From 89666001dabb630fdbce56608aba4cf92c006cb0 Mon Sep 17 00:00:00 2001 From: Robert Gleeson Date: Sun, 23 Mar 2014 14:16:08 +0100 Subject: [PATCH] support deprecated method for HEAD support with pry-doc. closes #1152. related to #1136 but `? File.exists?` is still not showing me documentation. thanks to @yui-knk for finding the bug & providing a solution. --- Gemfile | 1 + lib/pry/method.rb | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5f7e69a0..73bfb029 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' gemspec gem 'rake', '~> 10.0' +gem 'pry-doc' # For Guard group :development do diff --git a/lib/pry/method.rb b/lib/pry/method.rb index 64530b16..5af44be3 100644 --- a/lib/pry/method.rb +++ b/lib/pry/method.rb @@ -148,14 +148,29 @@ class Pry end.flatten(1) end + # # Get all of the methods on an `Object` + # # @param [Object] obj - # @param [Boolean] include_super Whether to include methods from ancestors. + # + # @param [Boolean] include_super + # indicates whether or not to include methods from ancestors. + # # @return [Array[Pry::Method]] + # def all_from_obj(obj, include_super=true) all_from_class(singleton_class_of(obj), include_super) end + # + # @deprecated + # please use {#all_from_obj} instead. + # the `method_type` argument is ignored. + # + def all_from_common(obj, method_type = nil, include_super=true) + all_from_obj(obj, include_super) + end + # Get every `Class` and `Module`, in order, that will be checked when looking # for an instance method to call on this object. # @param [Object] obj