summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Irwin <conrad.irwin@gmail.com>2013-04-07 21:11:08 -0700
committerConrad Irwin <conrad.irwin@gmail.com>2013-04-07 21:11:08 -0700
commitb480fd5b1e6d84b7c1b22be44608185730bb5147 (patch)
treea59179ecf73aaf67e49b91ed94e7f5f09da634ba
parent898823f8269a03f4b5561d3c56b6a9f73ed2d396 (diff)
downloadpry-b480fd5b1e6d84b7c1b22be44608185730bb5147.tar.gz
Fix specs on rbx
-rw-r--r--lib/pry/wrapped_module.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/pry/wrapped_module.rb b/lib/pry/wrapped_module.rb
index 4694c133..e25ad893 100644
--- a/lib/pry/wrapped_module.rb
+++ b/lib/pry/wrapped_module.rb
@@ -340,27 +340,27 @@ class Pry
# (i.e we skip `__class_init__` because it's an odd rbx specific thing that causes tests to fail.)
# @return [Array<Pry::Method>]
def all_relevant_methods_for(mod)
- all_methods_for(mod).select(&:source_location).
+ methods = all_methods_for(mod).select(&:source_location).
reject{ |x| x.name == '__class_init__' || method_defined_by_forwardable_module?(x) }
- end
-
- # Return all methods (instance methods and class methods) for a
- # given module.
- # @return [Array<Pry::Method>]
- def all_methods_for(mod)
- methods = all_from_common(mod, :instance_method) + all_from_common(mod, :method)
return methods unless methods.empty?
safe_send(mod, :constants).map do |const_name|
if const = nested_module?(mod, const_name)
- all_methods_for(const)
+ all_relevant_methods_for(const)
else
[]
end
end.flatten
end
+ # Return all methods (instance methods and class methods) for a
+ # given module.
+ # @return [Array<Pry::Method>]
+ def all_methods_for(mod)
+ all_from_common(mod, :instance_method) + all_from_common(mod, :method)
+ end
+
# FIXME: a variant of this method is also found in Pry::Method
def all_from_common(mod, method_type)
%w(public protected private).map do |visibility|