Redirect output (and errors) to less
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Denis Knauf 92d7e43e4c support for include IRB::Pager 10 years ago
lib support for include IRB::Pager 10 years ago
.gitignore ignore: gemspec, pkg 11 years ago
AUTHORS init 11 years ago
LICENSE init 11 years ago
README more documentation. README -> README.md for doc-generaters. 10 years ago
README.md pager -> irb-pager. Pager -> IRB::Pager 11 years ago
Rakefile pager -> irb-pager. Pager -> IRB::Pager 11 years ago
VERSION version 0.0.1 11 years ago

README.md

IRB::Pager vs. Pager

Because naming conflicts, i renamed Pager to IRB::Pager. There is no need for IRB; of course you can use IRB::Pager without irb.

I renamed these things:

  • gem: gem install pager #=> gem install irb-pager
  • lib: require 'pager' #=> require 'irb-pager'
  • module: Pager #=> IRB::Pager

Pager.pager will be IRB::Pager.pager now.

Usage

Very simple:

require 'irb-pager'
include IRB::Pager
pager { puts "Hello World!" }
pager { 1.upto(200) {|i|sleep 0.2; puts i} }

Exceptions will not be handled by pager:

pager { raise 'Oops' }

But if you want, pager can do:

pager( :rescuing => true) { raise 'Oops' }
$PAGER_RESCUE = true  # forces pager to handle exceptions everytime.
pager { raise 'Oops' }

You like more more than less? (I cannot understand, but it is your choice)

pager( :pager => 'more') { puts "Hello World!" }
$PAGER = 'more' # forces pager to use more
pager { puts "Hello World!" }

If you have set PAGER in your Processenvironment (/etc/profile or ~/.profile ...) this PAGER will be used.

PAGER=more
export PAGER