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

Version Path
luca-0.8.3 app.rb
luca-0.8.2 app.rb
luca-0.8.06 app.rb
luca-0.8 app.rb
luca-0.7.92 app.rb
luca-0.7.91 app.rb
luca-0.7.9 app.rb
luca-0.7.8 app.rb
luca-0.7.7 app.rb
luca-0.7.6 app.rb
luca-0.7.5 app.rb
luca-0.7.4 app.rb
luca-0.7.3 app.rb
luca-0.7.2 app.rb
luca-0.7.0 app.rb
luca-0.6.9 app.rb
luca-0.6.8 app.rb
luca-0.6.7 app.rb
luca-0.6.6 app.rb