Skip to content

Commit

Permalink
Do not recommend to install pry-doc in some cases
Browse files Browse the repository at this point in the history
There is no sense to install "pry-doc" on Ruby platforms other than MRI,
since "pry-doc" is for MRI only. Although "pry-doc" works on non-MRI
platforms, it still shows C source code. Haha.
  • Loading branch information
kyrylo committed Jan 30, 2013
1 parent 966ef3d commit b928092
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/pry/method.rb
Expand Up @@ -481,12 +481,16 @@ def method_missing(method_name, *args, &block)
private

# @return [YARD::CodeObjects::MethodObject]
# @raise [CommandError] Raises when the method can't be found or `pry-doc` isn't installed.
# @raise [CommandError] when the method can't be found or `pry-doc` isn't installed.
def pry_doc_info
if Pry.config.has_pry_doc
Pry::MethodInfo.info_for(@method) or raise CommandError, "Cannot locate this method: #{name}. (source_location returns nil)"
else
raise CommandError, "Cannot locate this method: #{name}. Try `gem install pry-doc` to get access to Ruby Core documentation."
fail_msg = "Cannot locate this method: #{name}."
if mri_18? || mri_19?
fail_msg += ' Try `gem-install pry-doc` to get access to Ruby Core documentation.'
end
raise CommandError, fail_msg
end
end

Expand Down

0 comments on commit b928092

Please sign in to comment.