lib/mayl/repl.rb in mayl-0.0.1 vs lib/mayl/repl.rb in mayl-0.1.0
- old
+ new
@@ -6,11 +6,11 @@
# Public: Initializes a new REPL from a given path.
#
# path - The path to get the locales from (defaults to 'config/locales').
def initialize(path)
- path ||= 'config/locales'
+ path ||= 'config/locales'
@env = Env.new(path)
@parser = Parser.new(@env)
end
# Public: Fires up the REPL that parses and executes given commands.
@@ -18,10 +18,10 @@
# Returns nothing.
def start
locales = @env.locales.map(&:name)
prompt = "> "
puts "Detected locales: #{locales.join(', ')}"
- while (print prompt; input = gets)
+ while (print prompt; input = $stdin.gets)
begin
value = @parser.parse(input.chomp).execute
@env.last_value = value
@env.commit
prompt = [@env.namespace, '> '].reject(&:empty?).join ' '
\ No newline at end of file