diff options
author | Xavier Noria <fxn@hashref.com> | 2010-04-06 15:38:05 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-04-06 15:38:05 -0700 |
commit | 4c4fd1a60ff1c060e76e9ee540074756510f53ea (patch) | |
tree | 77da1c66c127e36c8b00825b676d9267a9ef4cd6 /railties/lib/rails/railtie.rb | |
parent | 03cb74b9461293b96ae0add8ff5efda132dabba0 (diff) | |
parent | af130575249571464ec984efa84fcea1267e8cf8 (diff) | |
download | rails-4c4fd1a60ff1c060e76e9ee540074756510f53ea.tar.gz rails-4c4fd1a60ff1c060e76e9ee540074756510f53ea.tar.bz2 rails-4c4fd1a60ff1c060e76e9ee540074756510f53ea.zip |
Merge commit 'rails/master'
Diffstat (limited to 'railties/lib/rails/railtie.rb')
-rw-r--r-- | railties/lib/rails/railtie.rb | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index 0d68abb323..6ac6be092e 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -39,7 +39,6 @@ module Rails # # lib/my_gem/railtie.rb # module MyGem # class Railtie < Rails::Railtie - # railtie_name :mygem # end # end # @@ -51,24 +50,8 @@ module Rails # # module MyGem # class Railtie < Rails::Railtie - # railtie_name :mygem # end # end - # - # * Make sure your Gem loads the railtie.rb file if Rails is loaded first, an easy - # way to check is by checking for the Rails constant which will exist if Rails - # has started: - # - # # lib/my_gem.rb - # module MyGem - # require 'lib/my_gem/railtie' if defined?(Rails) - # end - # - # * Or instead of doing the require automatically, you can ask your users to require - # it for you in their Gemfile: - # - # # #{USER_RAILS_ROOT}/Gemfile - # gem "my_gem", :require_as => ["my_gem", "my_gem/railtie"] # # == Initializers # @@ -82,13 +65,11 @@ module Rails # end # # If specified, the block can also receive the application object, in case you - # need to access some application specific configuration: + # need to access some application specific configuration, like middleware: # # class MyRailtie < Rails::Railtie # initializer "my_railtie.configure_rails_initialization" do |app| - # if app.config.cache_classes - # # some initialization behavior - # end + # app.middlewares.use MyRailtie::Middleware # end # end # @@ -104,9 +85,6 @@ module Rails # # Customize the ORM # config.generators.orm :my_railtie_orm # - # # Add a middleware - # config.middlewares.use MyRailtie::Middleware - # # # Add a to_prepare block which is executed once in production # # and before which request in development # config.to_prepare do @@ -160,7 +138,7 @@ module Rails # By registering it: # # class MyRailtie < Railtie - # subscriber MyRailtie::Subscriber.new + # subscriber :my_gem, MyRailtie::Subscriber.new # end # # Take a look in Rails::Subscriber docs for more information. |