Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 30 lines (25 sloc) 0.817 kB
1a9738f @banister refactored example initialization code (still need to update examples…
banister authored
1 require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
45f2f10 @banister almost ready for 0.4.0 release, created new example_input2.rb example…
banister authored
2
3 # Create a StringIO that contains the input data for all the Pry objects
4 cmds = <<-CMDS
5 cd 1
6 status
7 puts 'hello from 1!!'
8 cd 2
9 nesting
10 puts 'hello from 2!!'
11 _pry_.parent.input = Readline
12 back
42d1c12 @banister version 0.5.0pre4 Almost ready for release. Updated examples to match…
banister authored
13 exit-all
45f2f10 @banister almost ready for 0.4.0 release, created new example_input2.rb example…
banister authored
14 CMDS
18553b4 @banister Updated more docs and formatting.
banister authored
15
16 # create our StringIO object
45f2f10 @banister almost ready for 0.4.0 release, created new example_input2.rb example…
banister authored
17 str_input = StringIO.new(cmds)
18
18553b4 @banister Updated more docs and formatting.
banister authored
19 # set global input to str_input, this means that all pry sessions
20 # adopt this object as their input object.
45f2f10 @banister almost ready for 0.4.0 release, created new example_input2.rb example…
banister authored
21 Pry.input = str_input
22
23 # Start the session reading from str_input.
24 # Note that because `Pry.input` is set to `str_input` all nested pry
25 # sessions will read from `str_input` too. All pry sessions are there
26 # for non-interactive, except for `pry(1)` which starts off
27 # non-interactive but is set to be interactive by pry(2) (using
28 # _pry_.parent.input = Readline)
29 0.pry
Something went wrong with that request. Please try again.