Sha256: d467d2ce74951e6396662aedcfc65495b47688e4f9467ff566f77eff547c243f

Contents?: true

Size: 1.1 KB

Versions: 153

Compression:

Stored size: 1.1 KB

Contents

module Sprockets
  class Bootstrap
    def initialize(app)
      @app = app
    end

    # TODO: Get rid of config.assets.enabled
    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 { Sprockets::Compressors.registered_js_compressor(config.assets.js_compressor || :uglifier) }
        end

        unless config.assets.css_compressor == false
          app.assets.css_compressor = LazyCompressor.new { Sprockets::Compressors.registered_css_compressor(config.assets.css_compressor) }
        end
      end

      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
  end
end

Version data entries

153 entries across 114 versions & 18 rubygems

Version Path
actionpack-3.2.22.5 lib/sprockets/bootstrap.rb
actionpack-3.2.22.4 lib/sprockets/bootstrap.rb
actionpack-3.2.22.3 lib/sprockets/bootstrap.rb
actionpack-3.2.22.2 lib/sprockets/bootstrap.rb
actionpack-3.2.22.1 lib/sprockets/bootstrap.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/sprockets/bootstrap.rb
actionpack-3.2.22 lib/sprockets/bootstrap.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.12/lib/sprockets/bootstrap.rb
actionpack-3.2.21 lib/sprockets/bootstrap.rb
actionpack-3.2.20 lib/sprockets/bootstrap.rb
actionpack-3.2.19 lib/sprockets/bootstrap.rb
actionpack-3.2.18 lib/sprockets/bootstrap.rb
actionpack-3.2.17 lib/sprockets/bootstrap.rb
actionpack-3.2.16 lib/sprockets/bootstrap.rb
actionpack-3.2.15 lib/sprockets/bootstrap.rb
actionpack-3.2.15.rc3 lib/sprockets/bootstrap.rb
actionpack-3.2.15.rc2 lib/sprockets/bootstrap.rb
actionpack-3.2.15.rc1 lib/sprockets/bootstrap.rb
actionpack-3.2.14 lib/sprockets/bootstrap.rb
actionpack-3.2.14.rc2 lib/sprockets/bootstrap.rb