Sha256: 92a8c5001331307dd3ab77832e6d51289862a4b0b79a5c6dcc988a0392c5b13c

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8

require 'rack/classy_assets'
require 'sinatra/sprockets-helpers'

module Sinatra
  module ClassyAssets
    def self.registered(app)
      app.use Rack::ClassyAssets
      app.register ::Sinatra::Sprockets::Helpers
      app.configure_sprockets_helpers do |config|
        manifest_file = ::File.join(::ClassyAssets::Configuration.public_path, ::ClassyAssets::Configuration.asset_prefix, 'manifset.json')

        config.asset_host   = ::ClassyAssets::Configuration.asset_host
        config.debug        = ::ClassyAssets::Configuration.debug_mode
        config.digest       = ::ClassyAssets::Configuration.asset_digest
        config.environment  = ::ClassyAssets::Configuration.sprockets
        config.manifest     = ::Sprockets::Manifest.new(::ClassyAssets::Configuration.sprockets, manifest_file) if ::File.exists? manifest_file
        config.prefix       = ::ClassyAssets::Configuration.asset_prefix
        config.public_path  = ::ClassyAssets::Configuration.public_path
      end 
    end
  end
  register ClassyAssets
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
classy_assets-0.1.4 lib/sinatra/classy_assets.rb
classy_assets-0.1.3 lib/sinatra/classy_assets.rb