Class: Sprockets::Bootstrap
- Inherits:
-
Object
- Object
- Sprockets::Bootstrap
- Defined in:
- lib/sprockets/bootstrap.rb
Instance Method Summary collapse
-
#initialize(app) ⇒ Bootstrap
constructor
A new instance of Bootstrap.
-
#run ⇒ Object
TODO: Get rid of config.assets.enabled.
Constructor Details
#initialize(app) ⇒ Bootstrap
Returns a new instance of Bootstrap.
3 4 5 |
# File 'lib/sprockets/bootstrap.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#run ⇒ Object
TODO: Get rid of config.assets.enabled
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sprockets/bootstrap.rb', line 8 def run app, config = @app, @app.config return unless app.assets config.assets.paths.each { |path| app.assets.append_path(path) } if config.assets.compress # temporarily hardcode default JS compressor to uglify. Soon, it will work # the same as SCSS, where a default plugin sets the default. unless config.assets.js_compressor == false app.assets.js_compressor = LazyCompressor.new { (config.assets.js_compressor || :uglifier) } end unless config.assets.css_compressor == false app.assets.css_compressor = LazyCompressor.new { (config.assets.css_compressor) } end end ## I can't figure out how to do this properly in Rails 3.0, so you ## need to add the mount explicitly in your routes.rb (see README) # # if config.assets.compile # app.routes.prepend do # mount app.assets => config.assets.prefix # end # end if config.assets.digest app.assets = app.assets.index end end |