aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependency_module.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/dependency_module.rb')
-rw-r--r--activesupport/lib/active_support/dependency_module.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/dependency_module.rb b/activesupport/lib/active_support/dependency_module.rb
new file mode 100644
index 0000000000..6847c0f86a
--- /dev/null
+++ b/activesupport/lib/active_support/dependency_module.rb
@@ -0,0 +1,17 @@
+module ActiveSupport
+ module DependencyModule
+ def append_features(base)
+ return false if base < self
+ (@_dependencies ||= []).each { |dep| base.send(:include, dep) }
+ super
+ end
+
+ def depends_on(*mods)
+ mods.each do |mod|
+ next if self < mod
+ @_dependencies ||= []
+ @_dependencies << mod
+ end
+ end
+ end
+end