aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/core_ext/module.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/module/inclusion.rb30
-rw-r--r--activesupport/test/core_ext/module_test.rb7
3 files changed, 0 insertions, 38 deletions
diff --git a/activesupport/lib/active_support/core_ext/module.rb b/activesupport/lib/active_support/core_ext/module.rb
index fbe89fe07c..b9c9614ca6 100644
--- a/activesupport/lib/active_support/core_ext/module.rb
+++ b/activesupport/lib/active_support/core_ext/module.rb
@@ -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'
diff --git a/activesupport/lib/active_support/core_ext/module/inclusion.rb b/activesupport/lib/active_support/core_ext/module/inclusion.rb
deleted file mode 100644
index 4f23841645..0000000000
--- a/activesupport/lib/active_support/core_ext/module/inclusion.rb
+++ /dev/null
@@ -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 \ No newline at end of file
diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb
index 87f056ea85..23016fd329 100644
--- a/activesupport/test/core_ext/module_test.rb
+++ b/activesupport/test/core_ext/module_test.rb
@@ -72,13 +72,6 @@ class ModuleTest < Test::Unit::TestCase
@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