Skip to content

Commit

Permalink
Have show-doc suggest installing pry-doc in Ruby 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielleSucher committed Sep 6, 2013
1 parent d09cd5a commit 415eae9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/pry/helpers/base_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def mri_19?
RUBY_VERSION =~ /1.9/ && RbConfig::CONFIG['ruby_install_name'] == 'ruby'
end

def mri_20?
RUBY_VERSION =~ /2.0/ && RbConfig::CONFIG['ruby_install_name'] == 'ruby'
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)
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def pry_doc_info
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_18? || mri_19? || mri_20?
fail_msg += ' Try `gem-install pry-doc` to get access to Ruby Core documentation.'
end
raise CommandError, fail_msg
Expand Down

0 comments on commit 415eae9

Please sign in to comment.