I am creating my first rbuy app - porting FPDF (PHP used to create PDF files) http://fpdf.org to ruby and was wondering where the font definition files should be installed. These files are text data files used to create new font definitions for PDFs and are not ruby code. Should they be a subdirectory of the fpdf module dir or some place completely outside the ruby libs area?
Thanks,
Dan
Dan:
I have actually ported Cpdf to PDF some time back. It's PDF::Writer.
You can see what I've done there on its RubyForge project.
-austin
···
On Fri, 14 Jan 2005 04:04:16 +0900, Dan Fitzpatrick <dan@eparklabs.com> wrote:
I am creating my first rbuy app - porting FPDF (PHP used to create PDF
files) http://fpdf.org to ruby and was wondering where the font
definition files should be installed. These files are text data files
used to create new font definitions for PDFs and are not ruby code.
Should they be a subdirectory of the fpdf module dir or some place
completely outside the ruby libs area?
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca
Is there a way to get Ruby to print the definition of a class or method,
like 'see' in Forth? I think it would be very useful to be able
(especially in irb) to see how a method in a running instance of Ruby is
defined. Is this possible?
Thanks in advance.
Pete
Not without some parsing of the text involved as it's being handled or
parsing the definition. The Ruby interpreter discards the text
definition of the method as soon as it's compiled.
-austin
···
On Fri, 14 Jan 2005 06:05:19 +0900, Pete Elmore <pete@petta-tech.com> wrote:
Is there a way to get Ruby to print the definition of a class or method,
like 'see' in Forth? I think it would be very useful to be able
(especially in irb) to see how a method in a running instance of Ruby is
defined. Is this possible?
Thanks in advance.
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca
Austin Ziegler wrote:
Not without some parsing of the text involved as it's being handled or
parsing the definition. The Ruby interpreter discards the text
definition of the method as soon as it's compiled.
So does Forth (sorry to be referring to such an obscure language, but
it's the only one I know of that has this useful feature).
For example, I define 'fnext' as below,
: fnext ( fib[n] fib[n+1] -- fib[n+1] fib[n+2] )
~ swap
~ over
~ +
;
Then I type 'see fnext' to see the definition:
see fnext
: fnext
~ swap over + ;
The formatting and the comment are gone, so it looks like it's just
converting from its own internal representation to something printable.
How are definitions represented internally? What files should I look at
to see this? Is a patch implementing such a feature likely to be
accepted? Does this seem useful to anyone besides me?
IMHO, this would be a great help for debugging ("puts doesn't work
because this module is re-defining it!") as well as learning about the
language and built-in features. Not to mention its effect on the size
of quines.
Pete