2010-12-09 00:59:30 +00:00
|
|
|
require 'readline'
|
|
|
|
|
2010-12-13 12:33:05 +00:00
|
|
|
class Pry
|
2010-12-09 00:59:30 +00:00
|
|
|
class Input
|
|
|
|
def read(prompt)
|
|
|
|
Readline.readline(prompt, true)
|
|
|
|
end
|
|
|
|
end
|
2010-12-14 10:54:26 +00:00
|
|
|
|
|
|
|
class SourceInput
|
|
|
|
def initialize(file, line)
|
|
|
|
@f = File.open(file)
|
|
|
|
(line - 1).times { @f.readline }
|
|
|
|
end
|
|
|
|
|
|
|
|
def read(prompt)
|
|
|
|
@f.readline
|
|
|
|
end
|
|
|
|
end
|
2010-12-09 00:59:30 +00:00
|
|
|
end
|