public
Last active

Non-Rails Rackup with Sprockets, Compass, Handlebars, Coffeescript, and Twitter Bootstrap

  • Download Gist
Gemfile
Ruby
1 2 3 4 5 6 7 8 9
source "https://rubygems.org"
 
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
gem 'handlebars_assets'
gem 'coffee-script'
application.css.sass
Sass
1 2
@import "compass"
@import "bootstrap"
application.js.coffee
CoffeeScript
1
#= require bootstrap
config.ru
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
require 'bundler'
Bundler.setup :default, (ENV['RACK_ENV'] || 'development')
 
require 'sprockets'
require 'compass'
require 'sprockets-sass'
require 'bootstrap-sass'
require 'handlebars_assets'
require 'coffee-script'
 
map '/assets' do
environment = Sprockets::Environment.new
environment.append_path 'assets/javascripts'
environment.append_path 'assets/stylesheets'
environment.append_path 'assets/templates' # for Handlebars templates
 
environment.append_path HandlebarsAssets.path
# Adds Twitter Bootstrap Javascripts
environment.append_path Compass::Frameworks['bootstrap'].templates_directory + '/../vendor/assets/javascripts'
run environment
end
 
run lambda{|env| [200, {}, ['Put your app here.']]}

Very useful!!! thanks for share.
Another good idea is to add coffeescript, right? :D

Can you add the app structure tree so that the above path makes much more sense?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.