From: Tony Arcieri Date: 2010-05-26T09:42:29+09:00 Subject: Re: In-code data --000e0cd4b5b84baea10487748c2a Content-Type: text/plain; charset=ISO-8859-1 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 --000e0cd4b5b84baea10487748c2a--