# from Caleb Phillips
# on Thursday 05 October 2006 12:01 pm:
>> I'll keep an eye on rubygems and when they proclaim a solution to
>> the "datadir problem", I will use that. Until then, I will use this
>> neat __END__ hack.
Is there a good description of "the datadir problem" anywhere? As far
as I can tell, it only involves "rubygems won't write /usr/share/blah/
files for you."
Maybe I'm too ignorant of the issue, but what's wrong with turning your
file's name into a directory name (s/\.rb//) and looking for
"#{dir}/mydata.txt" ? It's only a little different than require on
a .rb that contains only your data. This does assume that this data
doesn't change during runtime, etc. (but that data goes in /etc/foo/ or
~/.foo/ anyway)
>Anyway, I guess I am back to the drawing board. Any more ideas?
Open __FILE__ and read your own __END__ section?
--Eric
--
"Time flies like an arrow, but fruit flies like a banana."
--Groucho Marx
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------
_______________________________________________
PDXRuby mailing list
[email protected]
IRC: #pdx.rb on irc.freenode.net
http://lists.pdxruby.org/mailman/listinfo/pdxruby