From: Daniel Schierbeck Date: 2006-06-19T05:08:33+09:00 Subject: Re: Ruby in the sky with diamonds Gareth Clews wrote: > 1. Say I have 5 files which just contains arrays, hashes or a mixture > of both and I want to let somebody choose one of them [...] > then I want ruby/irb to output the hashes/arrays contained in the > files, like the cat or less commands with bash, how do I go about this?! Do you mean you're storing data in ruby arrays and hashes? You might want to take a look at YAML[1]. Are the file names static, and is there a fixed amount of files? > 3. An easier one methinks, how do I get irb to put what the contents of > a folder are and whether they are folders or files? (again kind of like > ls in bash) Well, I'm sure it's not too hard, but I don't understand why you want to. Are you using that information for something, or do you just want to browse the directories? Remember, IRB isn't a terminal. [1] http://ruby-doc.org/core/classes/YAML.html Cheers, Daniel