From d9f3c7852a1bb3b38a37d544affe14995580015a Mon Sep 17 00:00:00 2001 From: John Mair Date: Sat, 17 Sep 2011 18:23:32 +1200 Subject: [PATCH] fixed tiny bug in bin/pry where no -e parameter still resulted in => nil output --- bin/pry | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/pry b/bin/pry index 08ba72c7..cda0b63a 100755 --- a/bin/pry +++ b/bin/pry @@ -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])