Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

IO::generic_readable#readline

readline(sep = $/, chomp: false) → string
readline(limit, chomp: false) → string
readline(sep, limit, chomp: false) → string

Reads a line as with IO#gets, but raises EOFError if already at end-of-file; see Line IO.