Permalink
Browse files

removes Module#included_in_classes, which is no longer used

  • Loading branch information...
fxn committed Feb 7, 2010
1 parent b235af7 commit afd2e19be3b74effa3fdb9c4affd48f0aaede838
@@ -1,7 +1,6 @@
require 'active_support/core_ext/module/aliasing'
require 'active_support/core_ext/module/introspection'
-require 'active_support/core_ext/module/inclusion'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/module/attr_internal'
require 'active_support/core_ext/module/attr_accessor_with_default'
@@ -1,30 +0,0 @@
-class Module
- # Returns the classes in the current ObjectSpace where this module has been
- # mixed in according to Module#included_modules.
- #
- # module M
- # end
- #
- # module N
- # include M
- # end
- #
- # class C
- # include M
- # end
- #
- # class D < C
- # end
- #
- # p M.included_in_classes # => [C, D]
- #
- def included_in_classes
- classes = []
- ObjectSpace.each_object(Class) { |k| classes << k if k.included_modules.include?(self) }
-
- classes.reverse.inject([]) do |unique_classes, klass|
- unique_classes << klass unless unique_classes.collect { |k| k.to_s }.include?(klass.to_s)
- unique_classes
- end
- end
-end
@@ -72,13 +72,6 @@ def setup
@david = Someone.new("David", Somewhere.new("Paulina", "Chicago"))
end
- def test_included_in_classes
- assert One.included_in_classes.include?(Ab)
- assert One.included_in_classes.include?(Xy::Bc)
- assert One.included_in_classes.include?(Yz::Zy::Cd)
- assert !One.included_in_classes.include?(De)
- end
-
def test_delegation_to_methods
assert_equal "Paulina", @david.street
assert_equal "Chicago", @david.city

0 comments on commit afd2e19

Please sign in to comment.