1. More powar to you!
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    United Kingdom
    Rep Power

    Where's the readline? And... The documentation for it?

    Any ideas where there's good solid documentation on Ruby? I was reading up on the ins and outs on http://www.techotopia.com and wanted to know how to read from files... It showed me a few methods like File.open and File.new, I thought okay, I'll check out the Ruby API Documentation... And found http://ruby-doc.org/ so I thought, hey, this must be it...

    I thought I'd take a look at 1.9 standard library since that was the version of Ruby I was running, and looked up the File class. I was a little surprised when the documentation didn't actually list the method "readline". What have I missed exactly? I'm looking at the File class... Is the tutorial site wrong? Is there a better source for Ruby documentation?
    PHP Code:
    if($Tiredness TIREDNESS_MAX$CupOfTea++; 
    If you found what I've said helpful, I'm interested in reputation points!
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Woodland Hills, Los Angeles County, California, USA
    Rep Power
    The method you are looking for is called File.gets(). Odd that the ruby-doc site shows documentation for the ftools module, not the core File class. When you require 'ftools', it will add extra methods to the File class.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo