aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/engine/railties.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/engine/railties.rb')
-rw-r--r--railties/lib/rails/engine/railties.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/railties/lib/rails/engine/railties.rb b/railties/lib/rails/engine/railties.rb
new file mode 100644
index 0000000000..389a7602c6
--- /dev/null
+++ b/railties/lib/rails/engine/railties.rb
@@ -0,0 +1,23 @@
+module Rails
+ class Engine < Railtie
+ class Railties
+ # TODO Write tests for this behavior extracted from Application
+ def initialize(config)
+ @config = config
+ end
+
+ def all(&block)
+ @all ||= plugins
+ @all.each(&block) if block
+ @all
+ end
+
+ def plugins
+ @plugins ||= begin
+ plugin_names = (@config.plugins || [:all]).map { |p| p.to_sym }
+ Plugin.all(plugin_names, @config.paths.vendor.plugins)
+ end
+ end
+ end
+ end
+end