Skip to content

Instantly share code, notes, and snippets.

@bil-bas
Created August 8, 2011 11:19
Show Gist options
  • Save bil-bas/1131597 to your computer and use it in GitHub Desktop.
Save bil-bas/1131597 to your computer and use it in GitHub Desktop.
pry in Z&G
pry(#<Intro game=game("Zed and Ginger")>):3> cd particle_generator
pry(#<ParticleGenerator:0x2b2d8d8>):4> cd @active[1]
pry(#<Particle:0x2b2d2d8>):5> cd ..
NameError: undefined local variable or method `output' for Pry::Helpers::BaseHel
pers:Module
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pry-0.9.3-x86-mingw32/lib/pry/helpers/b
ase_helpers.rb:92:in `block in simple_pager'
pry(#<Intro game=game("Zed and Ginger")>):4> cat --ex
# a simple pager for systems without `less`. A la windows.
def simple_pager(text)
text_array = text.lines.to_a
text_array.each_slice(page_size) do |chunk|
=> output.puts chunk.join
break if chunk.size < page_size
if text_array.size > page_size
output.puts "\n<page break> --- Press enter to continue ( q<enter
> to break ) --- <page break>"
break if $stdin.gets.chomp == "q"
end
pry(#<Intro game=game("Zed and Ginger")>):4>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment