diff options
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/engine.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/engine/configuration.rb | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 6901748d04..c74bcbedf2 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -9,8 +9,7 @@ module Rails :filter_parameters, :helpers_paths, :logger, :preload_frameworks, :reload_plugins, :secret_token, :serve_static_assets, :session_options, - :time_zone, :whiny_nils, - :compile_assets + :time_zone, :whiny_nils attr_writer :log_level @@ -29,7 +28,6 @@ module Rails @log_level = nil @middleware = app_middleware @generators = app_generators - @compile_assets = [] end def compiled_asset_path diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 23177df11f..1c4e5dadc7 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -434,7 +434,7 @@ module Rails def routes @routes ||= ActionDispatch::Routing::RouteSet.new - @routes.add_route(assets, {}, {}, {}, nil, false) + @routes.add_route(assets, {}, {}, {}, nil, false) if config.use_sprockets @routes.append(&Proc.new) if block_given? @routes end @@ -458,6 +458,8 @@ module Rails end def build_asset_environment + return nil if !use_sprockets + require 'sprockets' env = Sprockets::Environment.new(root.to_s) diff --git a/railties/lib/rails/engine/configuration.rb b/railties/lib/rails/engine/configuration.rb index 4f458b0aee..1b4a712c75 100644 --- a/railties/lib/rails/engine/configuration.rb +++ b/railties/lib/rails/engine/configuration.rb @@ -5,12 +5,15 @@ module Rails class Configuration < ::Rails::Railtie::Configuration attr_reader :root attr_writer :middleware, :eager_load_paths, :autoload_once_paths, :autoload_paths - attr_accessor :plugins, :asset_path + attr_accessor :plugins, :asset_path, :use_sprockets, :compile_assets def initialize(root=nil) super() @root = root @generators = app_generators.dup + + @use_sprockets = false + @compile_assets = [] end # Returns the middleware stack for the engine. |