Implement assetpack for Sinatra

This commit is contained in:
Gregory Eremin
2013-07-12 17:40:26 +07:00
parent 9b1df758cf
commit ce91297ee0
17 changed files with 73 additions and 433 deletions
-21
View File
@@ -1,21 +0,0 @@
class CoffeeAssets < Sinatra::Base
set :views, File.expand_path('../../app/assets/javascripts', __FILE__)
get '/assets/:name.js' do
path = "#{settings.views}/#{params[:name]}.coffee"
return not_found unless File.exists?(path)
coffee params[:name].to_sym
end
end
class StylusAssets < Sinatra::Base
set :views, File.expand_path('../../app/assets/stylesheets', __FILE__)
get '/assets/:name.css' do
path = "#{settings.views}/#{params[:name]}.styl"
return not_found unless File.exists?(path)
stylus params[:name].to_sym
end
end