From: Tony Arcieri Date: 2010-05-26T09:43:24+09:00 Subject: Re: In-code data --000e0cdf15569c95390487748f6f Content-Type: text/plain; charset=ISO-8859-1 Err, I guess DATA comes through as a File object, not a String, but you get the idea... On Tue, May 25, 2010 at 6:42 PM, Tony Arcieri wrote: > If you'd like to include some data inline with your code, you can do it > like this: > > puts DATA > > __END__ > Look at me, I'm some data! > > The DATA constant will be populated with whatever text remains after > __END__ > > > On Tue, May 25, 2010 at 4:26 PM, Jerome David Sallinger < > imran.nazir@yahoo.co.uk> wrote: > >> Hi, >> >> What is the best way/practice of storing data that is to be used and >> accessed within your code. For example if I downloded a language >> dictionay in txt format. Would it make more sense to read it from a text >> file and parse it into a hash table variable. Or could I have it >> contained within a secondary source file and simple use 'require' to >> load it. I work with a lot of specifications which often contain lots of >> tables with values, I would like to simply cut and paste the tables into >> my code. This would make the code easier to update between versions of >> specs especially where the data in the tables has changed. I know this >> sounds like a general question, but I am all ears to any ideas of new >> ways of working. >> >> TC >> -- >> Posted via http://www.ruby-forum.com/. >> >> > > > -- > Tony Arcieri > Medioh! A Kudelski Brand > -- Tony Arcieri Medioh! A Kudelski Brand --000e0cdf15569c95390487748f6f--