Permalink
Browse files

almost ready for 0.4.0 release, created new example_input2.rb example…

… for advanced input usage
  • Loading branch information...
1 parent c8b05f5 commit 45f2f105f8a8ef4115f0e0c3fd32fd89e2d36f81 @banister banister committed Jan 21, 2011
Showing with 48 additions and 1 deletion.
  1. +10 −0 CHANGELOG
  2. +6 −0 README.markdown
  3. +1 −1 examples/example_image_edit.rb
  4. +31 −0 examples/example_input2.rb
View
@@ -1,3 +1,13 @@
+21/1/2010 version 0.4.0
+* added command API
+* added many new commands, i.e ls_methods and friends
+* modified other commands
+* now accepts greater customization, can modify: input, output, hooks,
+ prompt, print object
+* added tab completion (even completes commands)
+* added extensive tests
+* added examples
+* many more changes
9/12/2010 version 0.1.3
* Got rid of rubygems dependency, refactored some code.
8/12/2010 version 0.1.2
View
@@ -242,6 +242,12 @@ If you want to access a method of the same name, prefix the invocation by whites
current one with `obj` as the receiver of the new session. Very useful
when exploring large or complicated runtime state.
+Example Programs
+----------------
+
+Pry comes bundled with a few example programs to illustrate some
+features, see the `examples/` directory.
+
Customizing Pry
---------------
@@ -38,7 +38,7 @@ class WinClass < Gosu::Window
def initialize
super(WIDTH, HEIGHT, false)
- @img = TexPlay.create_image(self, 200, 200)
+ @img = TexPlay.create_image(self, 200, 200).clear :color => :black
@img.rect 0, 0, @img.width - 1, @img.height - 1
@binding = @img.__binding__
View
@@ -0,0 +1,31 @@
+direc = File.dirname(__FILE__)
+
+require 'rubygems'
+require "#{direc}/../lib/pry"
+
+# Create a StringIO that contains the input data for all the Pry objects
+cmds = <<-CMDS
+cd 1
+status
+puts 'hello from 1!!'
+cd 2
+nesting
+puts 'hello from 2!!'
+_pry_.parent.input = Readline
+back
+exit_all
+CMDS
+str_input = StringIO.new(cmds)
+
+# Start a Pry session on the Fixnum 5 using the input data in
+# str_input
+Pry.input = str_input
+
+# Start the session reading from str_input.
+# Note that because `Pry.input` is set to `str_input` all nested pry
+# sessions will read from `str_input` too. All pry sessions are there
+# for non-interactive, except for `pry(1)` which starts off
+# non-interactive but is set to be interactive by pry(2) (using
+# _pry_.parent.input = Readline)
+
+0.pry

0 comments on commit 45f2f10

Please sign in to comment.