aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2010-02-15 21:44:30 +0700
committerJosé Valim <jose.valim@gmail.com>2010-02-16 22:36:15 +0100
commitf0523f72b46db14e2f50c8347a8708734c650f84 (patch)
treecf6562eb8f6c2e302a33840f36f04d838aadb569 /activesupport
parent7cff54f5d3ae2e364f0d147ceb86ea701b21389c (diff)
downloadrails-f0523f72b46db14e2f50c8347a8708734c650f84.tar.gz
rails-f0523f72b46db14e2f50c8347a8708734c650f84.tar.bz2
rails-f0523f72b46db14e2f50c8347a8708734c650f84.zip
Rename Rails::Subscriber to Rails::LogSubscriber
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/notifications.rb4
-rw-r--r--activesupport/lib/active_support/notifications/fanout.rb10
-rw-r--r--activesupport/test/notifications_test.rb6
3 files changed, 10 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb
index 3e96decb8c..06d57765bc 100644
--- a/activesupport/lib/active_support/notifications.rb
+++ b/activesupport/lib/active_support/notifications.rb
@@ -9,7 +9,7 @@ module ActiveSupport
# end
#
# You can consume those events and the information they provide by registering
- # a subscriber. For instance, let's store all instrumented events in an array:
+ # a log subscriber. For instance, let's store all instrumented events in an array:
#
# @events = []
#
@@ -35,7 +35,7 @@ module ActiveSupport
# end
#
# Notifications ships with a queue implementation that consumes and publish events
- # to subscribers in a thread. You can use any queue implementation you want.
+ # to log subscribers in a thread. You can use any queue implementation you want.
#
module Notifications
autoload :Instrumenter, 'active_support/notifications/instrumenter'
diff --git a/activesupport/lib/active_support/notifications/fanout.rb b/activesupport/lib/active_support/notifications/fanout.rb
index 0ec23da073..05de4946a5 100644
--- a/activesupport/lib/active_support/notifications/fanout.rb
+++ b/activesupport/lib/active_support/notifications/fanout.rb
@@ -1,10 +1,10 @@
module ActiveSupport
module Notifications
# This is a default queue implementation that ships with Notifications. It
- # just pushes events to all registered subscribers.
+ # just pushes events to all registered log subscribers.
class Fanout
def initialize
- @subscribers = []
+ @log_subscribers = []
end
def bind(pattern)
@@ -12,11 +12,11 @@ module ActiveSupport
end
def subscribe(pattern = nil, &block)
- @subscribers << Subscriber.new(pattern, &block)
+ @log_subscribers << LogSubscriber.new(pattern, &block)
end
def publish(*args)
- @subscribers.each { |s| s.publish(*args) }
+ @log_subscribers.each { |s| s.publish(*args) }
end
# This is a sync queue, so there is not waiting.
@@ -41,7 +41,7 @@ module ActiveSupport
end
end
- class Subscriber #:nodoc:
+ class LogSubscriber #:nodoc:
def initialize(pattern, &block)
@pattern = pattern
@block = block
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb
index 545811a376..779771553c 100644
--- a/activesupport/test/notifications_test.rb
+++ b/activesupport/test/notifications_test.rb
@@ -26,7 +26,7 @@ module Notifications
assert_equal [[:foo]], @events
end
- def test_subscriber_with_pattern
+ def test_log_subscriber_with_pattern
events = []
@notifier.subscribe('1') { |*args| events << args }
@@ -38,7 +38,7 @@ module Notifications
assert_equal [['1'], ['1.a']], events
end
- def test_subscriber_with_pattern_as_regexp
+ def test_log_subscriber_with_pattern_as_regexp
events = []
@notifier.subscribe(/\d/) { |*args| events << args }
@@ -50,7 +50,7 @@ module Notifications
assert_equal [['1'], ['a.1'], ['1.a']], events
end
- def test_multiple_subscribers
+ def test_multiple_log_subscribers
@another = []
@notifier.subscribe { |*args| @another << args }
@notifier.publish :foo