Merge pull request #970 from DanielleSucher/fix-issue-956

Have show-doc suggest installing pry-doc in Ruby 2.0
This commit is contained in:
Robert 2013-09-06 06:31:53 -07:00
commit a67bf8b3b8
2 changed files with 9 additions and 5 deletions

View File

@ -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)

View File

@ -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