Module Pry::Helpers::BaseHelpers
In: lib/pry/helpers/base_helpers.rb

Methods

Public Instance methods

formatting

are we on Jruby platform?

Create scrollable output via less!

This command runs `less` in a subprocess, and gives you the IO to its STDIN pipe so that you can communicate with it.

Example:

  lesspipe do |less|
    50.times { less.puts "Hi mom!" }
  end

The default less parameters are:

  • Allow colour
  • Don‘t wrap lines longer than the screen
  • Quit immediately (without paging) if there‘s less than one screen of text.

You can change these options by passing a hash to `lesspipe`, like so:

  lesspipe(:wrap=>false) { |less| less.puts essay.to_s }

It accepts the following boolean options:

   :color  => Allow ANSI colour codes?
   :wrap   => Wrap long lines?
   :always => Always page, even if there's less than one page of text?

are we on rbx platform?

a simple pager for systems without `less`. A la windows.

Try to use `less` for paging, if it fails then use simple_pager. Also do not page if Pry.pager is falsey FIXME! Another JRuby hack

have fun on the Windows platform.

[Validate]