Module: Aerogel::Assets

Defined in:
lib/aerogel/core/assets.rb

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object

Registers and configures assets pipeline



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/aerogel/core/assets.rb', line 7

def self.registered( 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