Skip to content

Instantly share code, notes, and snippets.

@flaneur2020
Created February 8, 2012 02:27
Show Gist options
  • Save flaneur2020/1764630 to your computer and use it in GitHub Desktop.
Save flaneur2020/1764630 to your computer and use it in GitHub Desktop.
less painful web prototyping with sinatra, slim, sass, and coffeescript
#!/usr/bin/env ruby
# A white board made the front-end prototyping easier with sass, compass, coffee, and slim.
# Inspired from http://johanharjono.com/archives/760
#
# fleuria<me.ssword@gmail.com> 2012
#
require 'rubygems'
require "bundler/setup"
Bundler.require(:default)
configure do
Compass.configuration do |config|
config.project_path = File.dirname(__FILE__)
config.sass_dir = 'sass'
end
end
set :public_folder, File.dirname(__FILE__) + '/public'
set :views, File.dirname(__FILE__) + '/views'
get '/css/:name.css' do
sass(:"sass/#{params[:name]}", Compass.sass_engine_options)
end
get "/js/:name.js" do
coffee :"coffee/#{params[:name]}"
end
get ':name.html' do
slim params[:name].to_sym
end
get '/' do
slim :index
end
source 'http://ruby.taobao.org'
gem 'sinatra'
gem 'sinatra-reloader'
gem 'slim'
gem 'sass'
gem 'coffee-script'
gem 'compass'
gem 'pry'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment