mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
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:
commit
a67bf8b3b8
2 changed files with 9 additions and 5 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue