Permalink
Browse files

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.
  • Loading branch information...
1 parent ef350d3 commit 41dbc0d4d944b7705405e8f7553b64e45aee377a @voxik voxik committed Sep 16, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/pry/pager.rb
View
3 lib/pry/pager.rb 100644 → 100755
@@ -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

0 comments on commit 41dbc0d

Please sign in to comment.