fixed tiny bug in bin/pry where no -e parameter still resulted in => nil output

This commit is contained in:
John Mair 2011-09-17 18:23:32 +12:00
parent a44c57861e
commit d9f3c7852a
1 changed files with 8 additions and 3 deletions

11
bin/pry
View File

@ -80,7 +80,12 @@ Pry.cli = true
# create the actual context
context = Pry.binding_for(eval(opts[:context]))
exec_string = opts[:exec] || ""
# run code passed with `-e`, if there is any.
Pry.start(context, :input => StringIO.new(exec_string + "\n"), :input_stack => [Readline])
if opts[:exec]
exec_string = opts[:exec] + "\n"
else
exec_string = ""
end
# Start the session (running any code passed with -e, if there is any)
Pry.start(context, :input => StringIO.new(exec_string), :input_stack => [Readline])