1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Do not recommend to install pry-doc in some cases

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.
This commit is contained in:
Kyrylo Silin 2013-01-30 10:32:10 +02:00
parent 966ef3d4b7
commit b928092abe

View file

@ -481,12 +481,16 @@ class Pry
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