Skip to content

Instantly share code, notes, and snippets.

@shuujii
Created April 30, 2012 12:49
Show Gist options
  • Select an option

  • Save shuujii/2558048 to your computer and use it in GitHub Desktop.

Select an option

Save shuujii/2558048 to your computer and use it in GitHub Desktop.
Scrollable output via less in Pry
module Kernel
def less(obj)
s = obj.kind_of?(String) ? obj :
defined?(AwesomePrint) ? obj.ai :
defined?(PrettyPrint) ? obj.pretty_inspect :
obj.inspect
Pry::Helpers::BaseHelpers.lesspipe(s, always: true, wrap: true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment