Sha256: d9761907c7f6978f5a2ec03403828029d5ec3b4c450b5e79d76140ef3d78095d
Contents?: true
Size: 1.02 KB
Versions: 19
Compression:
Stored size: 1.02 KB
Contents
require 'rubygems' require 'bundler' Bundler.require require 'rubygems' require 'faker' module AssetHelpers def asset_path(source) "/assets/" + settings.sprockets.find_asset(source).digest_path end end class App < Sinatra::Base set :root, File.expand_path('../', __FILE__) set :sprockets, Sprockets::Environment.new(root) set :precompile, [ /\w+\.(?!js|css).+/, /application.(css|js)$/ ] set :assets_prefix, 'assets' set :assets_path, File.join(root, 'public', assets_prefix) require "#{ root }/lib/sprockets/luca_template.rb" sprockets.register_engine '.luca', Sprockets::LucaTemplate configure do sprockets.append_path(File.join(root, 'assets', 'stylesheets')) sprockets.append_path(File.join(root, 'assets', 'javascripts')) sprockets.append_path(File.join(root, 'assets', 'images')) sprockets.context_class.instance_eval do include AssetHelpers end end helpers do include AssetHelpers end get "/" do erb :index end get "/jasmine" do erb :jasmine end end
Version data entries
19 entries across 19 versions & 1 rubygems