of course I could have just used inspect, but I'm not sure how to make it print a newline for each item..

On 10/4/06, Bryan Donovan < [EMAIL PROTECTED]> wrote:
I doubt this is the right way, but I sometimes just make an array instead of read a file..

file = File.new('./dale_chall_n.txt')

arr = []
file.each_line do |line|
  arr << line.chop
end

txt = "my_arr = ["
arr.each do |a|
  txt << '"' + a + '"'
  txt <<  ',' + "\n" unless a == arr.last
end
txt << "]"
puts txt



On 10/4/06, Caleb Phillips < [EMAIL PROTECTED]> wrote:
So, I just released the first version of my first rubygem[1] (yay!). It
was amazingly painless, with one exception: accessing data files from
the installed library. I spent entirely too much time today reading
through the rubygems-dev-list; and they refer to this problem as the
'datadir' problem. It is also mentioned periodically on the ruby-lang
list. But, as far as I can tell, it hasn't been resolved. Of course, my
research isn't assisted by the fact that rubygems.org has been down for
a couple of days (without google's cache I would be helpless).

So, has anyone here come up against this problem? Is there a solution
that I am just not lucky enough to find documentation for? Is there a
way to use Rake magic or setup.rb magic from within the gem to stick the
shared data file somewhere accessible later?

If you are wondering, the data file read in by the simpleword? method on
the first call. It is just a list of (simple) words which have been
"normalized" and are newline separated. Maybe the best solution is to
not have such a data file at all and do something else - if you have
suggestions here, I am equally interested.

Any help is appreciated. Thanks,

[1] http://rubyforge.org/projects/style/

--
Caleb Phillips
_______________________________________________
PDXRuby mailing list
[email protected]
IRC: #pdx.rb on irc.freenode.net
http://lists.pdxruby.org/mailman/listinfo/pdxruby


_______________________________________________
PDXRuby mailing list
[email protected]
IRC: #pdx.rb on irc.freenode.net
http://lists.pdxruby.org/mailman/listinfo/pdxruby

Reply via email to