Permalink
Browse files

Rename plugin_name to railtie_name and engine_name.

  • Loading branch information...
1 parent b926087 commit e548f96b1d5cb6529dd6fbc6544f03a3a840b48c @josevalim josevalim committed Jan 24, 2010
@@ -3,7 +3,7 @@
module ActionMailer
class Railtie < Rails::Railtie
- plugin_name :action_mailer
+ railtie_name :action_mailer
require "action_mailer/railties/subscriber"
subscriber ActionMailer::Railties::Subscriber.new
@@ -3,7 +3,7 @@
module ActionController
class Railtie < Rails::Railtie
- plugin_name :action_controller
+ railtie_name :action_controller
require "action_controller/railties/subscriber"
subscriber ActionController::Railties::Subscriber.new
@@ -3,7 +3,7 @@
module ActionDispatch
class Railtie < Rails::Railtie
- plugin_name :action_dispatch
+ railtie_name :action_dispatch
# Initialize route files to an array
config.action_dispatch.route_paths = []
@@ -3,7 +3,7 @@
module ActionView
class Railtie < Rails::Railtie
- plugin_name :action_view
+ railtie_name :action_view
require "action_view/railties/subscriber"
subscriber ActionView::Railties::Subscriber.new
@@ -8,7 +8,7 @@
module ActiveRecord
class Railtie < Rails::Railtie
- plugin_name :active_record
+ railtie_name :active_record
rake_tasks do
load "active_record/railties/databases.rake"
@@ -3,7 +3,7 @@
module ActiveResource
class Railtie < Rails::Railtie
- plugin_name :active_resource
+ railtie_name :active_resource
require "active_resource/railties/subscriber"
subscriber ActiveResource::Railties::Subscriber.new
@@ -3,7 +3,7 @@
module I18n
class Railtie < Rails::Railtie
- plugin_name :i18n
+ railtie_name :i18n
# Initialize I18n load paths to an array
config.i18n.load_path = []
@@ -34,7 +34,7 @@ class Railtie < Rails::Railtie
module ActiveSupport
class Railtie < Rails::Railtie
- plugin_name :active_support
+ railtie_name :active_support
# Loads support for "whiny nil" (noisy warnings when methods are invoked
# on +nil+ values) if Configuration#whiny_nils is true.
@@ -71,7 +71,7 @@ def config_key_regexp
end
def config_keys
- (Railtie.plugin_names + Engine.plugin_names).map { |n| n.to_s }.uniq
+ (Railtie.railtie_names + Engine.engine_names).map { |n| n.to_s }.uniq
end
def options
@@ -9,6 +9,9 @@ class Engine < Railtie
class << self
attr_accessor :called_from
+ alias :engine_name :railtie_name
+ alias :engine_names :railtie_names
+
def inherited(base)
unless abstract_railtie?(base)
base.called_from = begin
@@ -22,25 +22,18 @@ def inherited(base)
end
end
- # TODO This should be called railtie_name and engine_name
- def plugin_name(plugin_name = nil)
- @plugin_name ||= name.demodulize.underscore
- @plugin_name = plugin_name if plugin_name
- @plugin_name
+ def railtie_name(railtie_name = nil)
+ @railtie_name ||= name.demodulize.underscore
+ @railtie_name = railtie_name if railtie_name
+ @railtie_name
end
- # TODO Deprecate me
- def plugins
- subclasses
- end
-
- # TODO Deprecate me
- def plugin_names
- plugins.map { |p| p.plugin_name }
+ def railtie_names
+ subclasses.map { |p| p.railtie_name }
end
def subscriber(subscriber)
- Rails::Subscriber.add(plugin_name, subscriber)
+ Rails::Subscriber.add(railtie_name, subscriber)
end
def rake_tasks(&blk)

0 comments on commit e548f96

Please sign in to comment.