diff --git a/lib/pry/helpers/base_helpers.rb b/lib/pry/helpers/base_helpers.rb index 307910b1..4756df6f 100644 --- a/lib/pry/helpers/base_helpers.rb +++ b/lib/pry/helpers/base_helpers.rb @@ -88,22 +88,26 @@ class Pry end def jruby_19? - RbConfig::CONFIG['ruby_install_name'] == 'jruby' && - RbConfig::CONFIG['ruby_version'] == '1.9' + jruby? && RbConfig::CONFIG['ruby_version'] == '1.9' end def rbx? RbConfig::CONFIG['ruby_install_name'] == 'rbx' end + def mri? + RbConfig::CONFIG['ruby_install_name'] == 'ruby' + end + def mri_18? - RUBY_VERSION =~ /1.8/ && RbConfig::CONFIG['ruby_install_name'] == 'ruby' + mri? && RUBY_VERSION =~ /1.8/ end def mri_19? - RUBY_VERSION =~ /1.9/ && RbConfig::CONFIG['ruby_install_name'] == 'ruby' + mri? && RUBY_VERSION =~ /1.9/ end + # Try to use `less` for paging, if it fails then use # simple_pager. Also do not page if Pry.pager is falsey def stagger_output(text, out = nil) diff --git a/lib/pry/method.rb b/lib/pry/method.rb index 5a94ea1e..a96fe9ed 100644 --- a/lib/pry/method.rb +++ b/lib/pry/method.rb @@ -473,7 +473,7 @@ class Pry Pry::MethodInfo.info_for(@method) or raise CommandError, "Cannot locate this method: #{name}. (source_location returns nil)" else fail_msg = "Cannot locate this method: #{name}." - if mri_18? || mri_19? + if mri? fail_msg += ' Try `gem-install pry-doc` to get access to Ruby Core documentation.' end raise CommandError, fail_msg