Skip to content

Instantly share code, notes, and snippets.

@zh
Created March 14, 2012 05:06
Show Gist options
  • Save zh/2034223 to your computer and use it in GitHub Desktop.
Save zh/2034223 to your computer and use it in GitHub Desktop.
Sprockets without Rails
ROOT
assets/
javascripts/
application.js
biz.js.coffee
bar.js.coffee
stylesheets/
application.css
baz.css.scss
foo.css.scss
config.ru
## stuffs
Assets = Sprockets::Environment.new(File.dirname(__FILE__))
Assets.paths << "assets/javascripts"
Assets.paths << "assets/stylesheets"
Routes = Rack::Mount::RouteSet.new do |set|
set.add_route Assets, :path_info => %r{^/assets}
end
run Routes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment