Module: Aerogel::Assets
- Defined in:
- lib/aerogel/core/assets.rb
Class Method Summary collapse
-
.registered(app) ⇒ Object
Registers and configures assets pipeline.
-
.reset!(app) ⇒ Object
Resets assets pipeline.
-
.setup_assets_pipeline(app) ⇒ Object
Configures assets pipeline.
-
.setup_reloader(app) ⇒ Object
Configures reloader for assets.
Class Method Details
.registered(app) ⇒ Object
Registers and configures assets pipeline
9 10 11 12 |
# File 'lib/aerogel/core/assets.rb', line 9 def self.registered( app ) setup_reloader(app) if Aerogel.config.aerogel.reloader? setup_assets_pipeline app end |
.reset!(app) ⇒ Object
Resets assets pipeline
25 26 27 |
# File 'lib/aerogel/core/assets.rb', line 25 def self.reset!(app) # TODO how to remove middleware? anyone? end |
.setup_assets_pipeline(app) ⇒ Object
Configures assets pipeline.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/aerogel/core/assets.rb', line 31 def self.setup_assets_pipeline( app ) # Include these files when precompiling assets app.set :assets_precompile, %w(application.js controllers/*.js application.css controllers/*.css) + %w(*.png *.jpg *.gif *.svg *.eot *.ttf *.woff) # Logical paths to your assets (in reverse order) app.set :assets_prefix, [ Aerogel.get_resource_paths( :assets ) ].flatten.reverse # Use another host for serving assets # set :assets_host, '<id>.cloudfront.net' # Serve assets using this protocol # set :assets_protocol, :http # CSS minification app.set :assets_css_compressor, :yui # JavaScript minification app.set :assets_js_compressor, :uglifier app.register Sinatra::AssetPipeline end |