Sha256: cdebe5051e6ad8fa98dbe21cde90be64e388425b3cde77f7da31ebb5b7a344d7

Contents?: true

Size: 1007 Bytes

Versions: 19

Compression:

Stored size: 1007 Bytes

Contents

$:.unshift File.expand_path('../../../lib', __FILE__)

require 'sinatra/base'
require 'sinatra/assetpack'

class App < Sinatra::Base
  set :root, File.dirname(__FILE__)
  register Sinatra::AssetPack

  assets do
    #js_compression :closure
    js_compression :uglify

    js :main, '/js/main.js', [
      '/js/vendor/*.js',
      '/js/app.js'
    ]

    css :main, [
      '/css/*.css'
    ]

    # The second parameter here is optional (see above).
    # It will default to '/css/#{name}.css'.
    css :more, '/css/more.css', [
      '/css/more/*.css'
    ]

    prebuild false

    # Can set this as an environment variable like "HOST" or "CDN_HOST"
    # This will add the domain name to the beginning of compiled assets
    # Useful if you need to serve production assets from a CDN
    asset_hosts [
      '//cdn-0.example.org',
      '//cdn-1.example.org',
      '//cdn-2.example.org',
      '//cdn-3.example.org'
    ]

  end

  get '/' do
    erb :index
  end
end

if __FILE__ == $0
  App.run!
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
sinatra-assetpack-0.3.5 examples/basic/app.rb
sinatra-assetpack-0.3.3 examples/basic/app.rb
sinatra-assetpack-0.3.2 examples/basic/app.rb
sinatra-assetpack-0.3.1 examples/basic/app.rb
sinatra-assetpack-0.3.0 examples/basic/app.rb
sinatra-assetpack-0.2.8 examples/basic/app.rb
sinatra-assetpack-0.2.7 examples/basic/app.rb
sinatra-assetpack-0.2.6 examples/basic/app.rb
sinatra-assetpack-0.2.5 examples/basic/app.rb
sinatra-assetpack-0.2.4 examples/basic/app.rb
sinatra-assetpack-0.2.3 examples/basic/app.rb
sinatra-assetpack-0.2.2 examples/basic/app.rb
sinatra-assetpack-0.2.1 examples/basic/app.rb
sinatra-assetpack-0.2.0 examples/basic/app.rb
sinatra-assetpack-0.1.7 examples/basic/app.rb
sundawg-sinatra-assetpack-fork-0.1.6 examples/basic/app.rb
sinatra-assetpack-0.1.6 examples/basic/app.rb
sinatra-assetpack-0.1.5 examples/basic/app.rb
sinatra-assetpack-0.1.4 examples/basic/app.rb