diff options
author | Prem Sichanugrist <s@sikachu.com> | 2010-02-15 21:44:30 +0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-16 22:36:15 +0100 |
commit | f0523f72b46db14e2f50c8347a8708734c650f84 (patch) | |
tree | cf6562eb8f6c2e302a33840f36f04d838aadb569 /actionpack | |
parent | 7cff54f5d3ae2e364f0d147ceb86ea701b21389c (diff) | |
download | rails-f0523f72b46db14e2f50c8347a8708734c650f84.tar.gz rails-f0523f72b46db14e2f50c8347a8708734c650f84.tar.bz2 rails-f0523f72b46db14e2f50c8347a8708734c650f84.zip |
Rename Rails::Subscriber to Rails::LogSubscriber
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/railtie.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/railties/log_subscriber.rb (renamed from actionpack/lib/action_controller/railties/subscriber.rb) | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/railtie.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_view/railties/log_subscriber.rb (renamed from actionpack/lib/action_view/railties/subscriber.rb) | 2 | ||||
-rw-r--r-- | actionpack/test/activerecord/controller_runtime_test.rb | 16 | ||||
-rw-r--r-- | actionpack/test/controller/log_subscriber_test.rb (renamed from actionpack/test/controller/subscriber_test.rb) | 18 | ||||
-rw-r--r-- | actionpack/test/template/log_subscriber_test.rb (renamed from actionpack/test/template/subscriber_test.rb) | 12 |
7 files changed, 29 insertions, 29 deletions
diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb index 55a5c22ac0..015a8212c4 100644 --- a/actionpack/lib/action_controller/railtie.rb +++ b/actionpack/lib/action_controller/railtie.rb @@ -6,8 +6,8 @@ module ActionController class Railtie < Rails::Railtie railtie_name :action_controller - require "action_controller/railties/subscriber" - subscriber ActionController::Railties::Subscriber.new + require "action_controller/railties/log_subscriber" + log_subscriber ActionController::Railties::LogSubscriber.new initializer "action_controller.logger" do ActionController::Base.logger ||= Rails.logger diff --git a/actionpack/lib/action_controller/railties/subscriber.rb b/actionpack/lib/action_controller/railties/log_subscriber.rb index 4499e82292..df9ffa1717 100644 --- a/actionpack/lib/action_controller/railties/subscriber.rb +++ b/actionpack/lib/action_controller/railties/log_subscriber.rb @@ -1,6 +1,6 @@ module ActionController module Railties - class Subscriber < Rails::Subscriber + class LogSubscriber < Rails::LogSubscriber INTERNAL_PARAMS = %w(controller action format _method only_path) def start_processing(event) diff --git a/actionpack/lib/action_view/railtie.rb b/actionpack/lib/action_view/railtie.rb index d9e2557d89..03f18ac172 100644 --- a/actionpack/lib/action_view/railtie.rb +++ b/actionpack/lib/action_view/railtie.rb @@ -5,8 +5,8 @@ module ActionView class Railtie < Rails::Railtie railtie_name :action_view - require "action_view/railties/subscriber" - subscriber ActionView::Railties::Subscriber.new + require "action_view/railties/log_subscriber" + log_subscriber ActionView::Railties::LogSubscriber.new initializer "action_view.cache_asset_timestamps" do |app| unless app.config.cache_classes diff --git a/actionpack/lib/action_view/railties/subscriber.rb b/actionpack/lib/action_view/railties/log_subscriber.rb index 803f19379c..9487a10706 100644 --- a/actionpack/lib/action_view/railties/subscriber.rb +++ b/actionpack/lib/action_view/railties/log_subscriber.rb @@ -1,6 +1,6 @@ module ActionView module Railties - class Subscriber < Rails::Subscriber + class LogSubscriber < Rails::LogSubscriber def render_template(event) message = "Rendered #{from_rails_root(event.payload[:identifier])}" message << " within #{from_rails_root(event.payload[:layout])}" if event.payload[:layout] diff --git a/actionpack/test/activerecord/controller_runtime_test.rb b/actionpack/test/activerecord/controller_runtime_test.rb index ed8e324938..4d2a7b9b5a 100644 --- a/actionpack/test/activerecord/controller_runtime_test.rb +++ b/actionpack/test/activerecord/controller_runtime_test.rb @@ -1,30 +1,30 @@ require 'active_record_unit' require 'active_record/railties/controller_runtime' require 'fixtures/project' -require 'rails/subscriber/test_helper' -require 'action_controller/railties/subscriber' +require 'rails/log_subscriber/test_helper' +require 'action_controller/railties/log_subscriber' ActionController::Base.send :include, ActiveRecord::Railties::ControllerRuntime -class ControllerRuntimeSubscriberTest < ActionController::TestCase - class SubscriberController < ActionController::Base +class ControllerRuntimeLogSubscriberTest < ActionController::TestCase + class LogSubscriberController < ActionController::Base def show render :inline => "<%= Project.all %>" end end - include Rails::Subscriber::TestHelper - tests SubscriberController + include Rails::LogSubscriber::TestHelper + tests LogSubscriberController def setup @old_logger = ActionController::Base.logger - Rails::Subscriber.add(:action_controller, ActionController::Railties::Subscriber.new) + Rails::LogSubscriber.add(:action_controller, ActionController::Railties::LogSubscriber.new) super end def teardown super - Rails::Subscriber.subscribers.clear + Rails::LogSubscriber.log_subscribers.clear ActionController::Base.logger = @old_logger end diff --git a/actionpack/test/controller/subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index d7c1166f14..182f343b2f 100644 --- a/actionpack/test/controller/subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -1,9 +1,9 @@ require "abstract_unit" -require "rails/subscriber/test_helper" -require "action_controller/railties/subscriber" +require "rails/log_subscriber/test_helper" +require "action_controller/railties/log_subscriber" module Another - class SubscribersController < ActionController::Base + class LogSubscribersController < ActionController::Base def show render :nothing => true end @@ -35,9 +35,9 @@ module Another end end -class ACSubscriberTest < ActionController::TestCase - tests Another::SubscribersController - include Rails::Subscriber::TestHelper +class ACLogSubscriberTest < ActionController::TestCase + tests Another::LogSubscribersController + include Rails::LogSubscriber::TestHelper def setup @old_logger = ActionController::Base.logger @@ -46,13 +46,13 @@ class ACSubscriberTest < ActionController::TestCase ActionController::Base.page_cache_directory = @cache_path ActionController::Base.cache_store = :file_store, @cache_path - Rails::Subscriber.add(:action_controller, ActionController::Railties::Subscriber.new) + Rails::LogSubscriber.add(:action_controller, ActionController::Railties::LogSubscriber.new) super end def teardown super - Rails::Subscriber.subscribers.clear + Rails::LogSubscriber.log_subscribers.clear FileUtils.rm_rf(@cache_path) ActionController::Base.logger = @old_logger end @@ -65,7 +65,7 @@ class ACSubscriberTest < ActionController::TestCase get :show wait assert_equal 2, logs.size - assert_equal "Processing by Another::SubscribersController#show as HTML", logs.first + assert_equal "Processing by Another::LogSubscribersController#show as HTML", logs.first end def test_process_action diff --git a/actionpack/test/template/subscriber_test.rb b/actionpack/test/template/log_subscriber_test.rb index 8bacab7088..2eb2484cf5 100644 --- a/actionpack/test/template/subscriber_test.rb +++ b/actionpack/test/template/log_subscriber_test.rb @@ -1,22 +1,22 @@ require "abstract_unit" -require "rails/subscriber/test_helper" -require "action_view/railties/subscriber" +require "rails/log_subscriber/test_helper" +require "action_view/railties/log_subscriber" require "controller/fake_models" -class AVSubscriberTest < ActiveSupport::TestCase - include Rails::Subscriber::TestHelper +class AVLogSubscriberTest < ActiveSupport::TestCase + include Rails::LogSubscriber::TestHelper def setup @old_logger = ActionController::Base.logger @view = ActionView::Base.new(ActionController::Base.view_paths, {}) Rails.stubs(:root).returns(File.expand_path(FIXTURE_LOAD_PATH)) - Rails::Subscriber.add(:action_view, ActionView::Railties::Subscriber.new) + Rails::LogSubscriber.add(:action_view, ActionView::Railties::LogSubscriber.new) super end def teardown super - Rails::Subscriber.subscribers.clear + Rails::LogSubscriber.log_subscribers.clear ActionController::Base.logger = @old_logger end |