1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/examples/example_output.rb

15 lines
374 B
Ruby
Raw Normal View History

direc = File.dirname(__FILE__)
require 'rubygems'
require "#{direc}/../lib/pry"
# Create a StringIO to contain the output data
str_output = StringIO.new
# Start a Pry session on the Fixnum 5 using str_output to store the
# output (not writing to $stdout)
Pry.start(5, :output => str_output)
# Display all the output accumulated during the session
puts str_output.string