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

Fix the less check (#712).

The exit status doesn't matter, it is always OK, but an exception is fired only when less is not available on the system.
This commit is contained in:
Vít Ondruch 2012-09-16 22:42:41 +02:00
parent ef350d3155
commit 41dbc0d4d9

3
lib/pry/pager.rb Normal file → Executable file
View file

@ -19,8 +19,7 @@ class Pry::Pager
def self.page(text, pager = nil)
case pager
when nil
`less` rescue nil
no_pager = !$?.success?
no_pager = !(`less` rescue nil)
is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
(is_jruby || no_pager) ? SimplePager.new(text).page : SystemPager.new(text).page
when :simple