# encoding: utf-8 require 'sinatra/base' 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