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:
parent
ef350d3155
commit
41dbc0d4d9
1 changed files with 1 additions and 2 deletions
3
lib/pry/pager.rb
Normal file → Executable file
3
lib/pry/pager.rb
Normal file → Executable 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
|
||||
|
|
Loading…
Add table
Reference in a new issue