diff options
author | Joshua Peek <josh@joshpeek.com> | 2012-10-15 10:20:50 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2012-10-15 10:20:50 -0500 |
commit | c800e27ad35ec46f32b5ac4428e5cf7141f95105 (patch) | |
tree | 0821e0afaba2a74dec6ea1397ee3cabfd3d10c59 /railties/lib/rails/engine.rb | |
parent | 7dba1599d9092a8362956a3fab23b2c60eedea63 (diff) | |
parent | 46dc6e7786222865309d15a9eaaaf55e3b7d9c1f (diff) | |
download | rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.tar.gz rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.tar.bz2 rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.zip |
Merge branch 'master' into asset-path-helper
Conflicts:
railties/test/application/configuration_test.rb
Diffstat (limited to 'railties/lib/rails/engine.rb')
-rw-r--r-- | railties/lib/rails/engine.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 7afb599910..2c2bb1c714 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -251,7 +251,7 @@ module Rails # # # config/routes.rb # MyApplication::Application.routes.draw do - # mount MyEngine::Engine => "/my_engine", :as => "my_engine" + # mount MyEngine::Engine => "/my_engine", as: "my_engine" # get "/foo" => "foo#index" # end # @@ -368,7 +368,7 @@ module Rails def isolate_namespace(mod) engine_name(generate_railtie_name(mod)) - self.routes.default_scope = { :module => ActiveSupport::Inflector.underscore(mod.name) } + self.routes.default_scope = { module: ActiveSupport::Inflector.underscore(mod.name) } self.isolated = true unless mod.respond_to?(:railtie_namespace) @@ -407,8 +407,8 @@ module Rails end end - delegate :middleware, :root, :paths, :to => :config - delegate :engine_name, :isolated?, :to => "self.class" + delegate :middleware, :root, :paths, to: :config + delegate :engine_name, :isolated?, to: "self.class" def initialize @_all_autoload_paths = nil @@ -536,7 +536,7 @@ module Rails end # Add configured load paths to ruby load paths and remove duplicates. - initializer :set_load_path, :before => :bootstrap_hook do + initializer :set_load_path, before: :bootstrap_hook do _all_load_paths.reverse_each do |path| $LOAD_PATH.unshift(path) if File.directory?(path) end @@ -548,7 +548,7 @@ module Rails # # This needs to be an initializer, since it needs to run once # per engine and get the engine as a block parameter - initializer :set_autoload_paths, :before => :bootstrap_hook do |app| + initializer :set_autoload_paths, before: :bootstrap_hook do |app| ActiveSupport::Dependencies.autoload_paths.unshift(*_all_autoload_paths) ActiveSupport::Dependencies.autoload_once_paths.unshift(*_all_autoload_once_paths) @@ -581,13 +581,13 @@ module Rails end end - initializer :load_environment_config, :before => :load_environment_hook, :group => :all do + initializer :load_environment_config, before: :load_environment_hook, group: :all do paths["config/environments"].existent.each do |environment| require environment end end - initializer :append_assets_path, :group => :all do |app| + initializer :append_assets_path, group: :all do |app| app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories) app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories) app.config.assets.paths.unshift(*paths["app/assets"].existent_directories) |