summaryrefslogtreecommitdiff
path: root/bin/pry
diff options
context:
space:
mode:
authorJohn Mair <jrmair@gmail.com>2011-09-17 18:23:32 +1200
committerJohn Mair <jrmair@gmail.com>2011-09-17 18:23:32 +1200
commitd9f3c7852a1bb3b38a37d544affe14995580015a (patch)
tree67a12b7e771d27869f59cd5fb4b5b74ca3a28e60 /bin/pry
parenta44c57861e0380b8c410331e5f5ca42f39b1a1ee (diff)
downloadpry-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-xbin/pry11
1 files 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])