diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-12 13:27:24 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-13 01:19:22 +0100 |
commit | 9dd4c79d6148890f49949686e709cfb035755068 (patch) | |
tree | 803b195c8ed9436418f12a882c198c6364fcdd8f /railties/lib | |
parent | 4704af763f47362135b644302b8666e36a58fb34 (diff) | |
download | rails-9dd4c79d6148890f49949686e709cfb035755068.tar.gz rails-9dd4c79d6148890f49949686e709cfb035755068.tar.bz2 rails-9dd4c79d6148890f49949686e709cfb035755068.zip |
Allow to add subscribers through Railtie.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/plugin.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/railtie.rb | 4 |
3 files changed, 6 insertions, 0 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index 5f7e595d64..4ded2515fc 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -15,6 +15,7 @@ require 'rails/rack' require 'rails/paths' require 'rails/configuration' require 'rails/deprecation' +require 'rails/subscriber' require 'rails/ruby_version_check' # For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index 9cc6b9c35b..a057b8f701 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -53,6 +53,7 @@ module Rails ActionController::Base.view_paths.concat ["#{path}/app/views"] if File.directory?("#{path}/app/views") end + # TODO Isn't it supposed to be :after => "action_controller.initialize_routing" ? initializer :add_routing_file, :after => :initialize_routing do |app| routing_file = "#{path}/config/routes.rb" if File.exist?(routing_file) diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index ff28ade35d..43a0303c5b 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -25,6 +25,10 @@ module Rails Configuration.default end + def self.subscriber(subscriber) + Rails::Subscriber.add(plugin_name, subscriber) + end + def self.rake_tasks(&blk) @rake_tasks ||= [] @rake_tasks << blk if blk |