diff options
author | John Mair <jrmair@gmail.com> | 2011-09-17 18:23:32 +1200 |
---|---|---|
committer | John Mair <jrmair@gmail.com> | 2011-09-17 18:23:32 +1200 |
commit | d9f3c7852a1bb3b38a37d544affe14995580015a (patch) | |
tree | 67a12b7e771d27869f59cd5fb4b5b74ca3a28e60 /bin/pry | |
parent | a44c57861e0380b8c410331e5f5ca42f39b1a1ee (diff) | |
download | pry-d9f3c7852a1bb3b38a37d544affe14995580015a.tar.gz |
fixed tiny bug in bin/pry where no -e parameter still resulted in => nil output
Diffstat (limited to 'bin/pry')
-rwxr-xr-x | bin/pry | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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]) |