summaryrefslogtreecommitdiff
path: root/bin/pry
diff options
context:
space:
mode:
authorJohn Mair <jrmair@gmail.com>2011-09-16 16:20:41 +1200
committerJohn Mair <jrmair@gmail.com>2011-09-16 16:28:10 +1200
commit674e2c3f5dcfbfb5989a71929b8918abbdeb0355 (patch)
treead4b1cad584890bd97a56afffdcc1456cad745e0 /bin/pry
parentb053ee1571b8d72193fe12874f9fb93aefe76911 (diff)
downloadpry-674e2c3f5dcfbfb5989a71929b8918abbdeb0355.tar.gz
pry -e now works using input_stack; should eliminate quirks and limitations in behavior
Diffstat (limited to 'bin/pry')
-rwxr-xr-xbin/pry7
1 files changed, 2 insertions, 5 deletions
diff --git a/bin/pry b/bin/pry
index 1b924069..08ba72c7 100755
--- a/bin/pry
+++ b/bin/pry
@@ -80,10 +80,7 @@ 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.
-if opts.exec?
- Pry.new(:input => StringIO.new(opts[:exec]), :print => proc {}).rep(context)
-end
+Pry.start(context, :input => StringIO.new(exec_string + "\n"), :input_stack => [Readline])
-# start the session
-context.pry