Skip to content
Browse files

Add use_sprockets flag

  • Loading branch information...
1 parent 7197eb7 commit 954d73df5312f4829c96a76f1929e45597e85680 @josh josh committed Mar 28, 2011
View
4 railties/lib/rails/application/configuration.rb
@@ -9,8 +9,7 @@ class Configuration < ::Rails::Engine::Configuration
: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 @@ def initialize(*)
@log_level = nil
@middleware = app_middleware
@generators = app_generators
- @compile_assets = []
end
def compiled_asset_path
View
4 railties/lib/rails/engine.rb
@@ -434,7 +434,7 @@ def env_config
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 @@ def assets
end
def build_asset_environment
+ return nil if !use_sprockets
+
require 'sprockets'
env = Sprockets::Environment.new(root.to_s)
View
5 railties/lib/rails/engine/configuration.rb
@@ -5,12 +5,15 @@ class Engine
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.

0 comments on commit 954d73d

Please sign in to comment.
Something went wrong with that request. Please try again.