Skip to content

Instantly share code, notes, and snippets.

@grantmichaels
Forked from jlong/compass.config
Created June 7, 2010 19:38
Show Gist options
  • Save grantmichaels/429077 to your computer and use it in GitHub Desktop.
Save grantmichaels/429077 to your computer and use it in GitHub Desktop.
http_path = "/" # Root of project when deployed
css_dir = "public/stylesheets"
sass_dir = "public/stylesheets/sass"
images_dir = "images"
javascripts_dir = "javascripts"
relative_assets = true
#\ -p 4000
gem 'activesupport', '2.3.5' # version required by Serve
gem 'serve', '>= 0.11.3'
require 'serve'
require 'serve/rack'
require 'sass/plugin/rack'
require 'compass'
# The project root directory
root = File.dirname(__FILE__)
# Compass
Compass.add_project_configuration(root + '/compass.config')
Compass.configure_sass_plugin!
# Middleware
use Rack::ShowStatus # Nice looking 404s and other messages
use Rack::ShowExceptions # Nice looking errors
use Sass::Plugin::Rack # Compile Sass on the fly
# Rack Application
if ENV['SERVER_SOFTWARE'] =~ /passenger/i
# Passenger only needs the adapter
run Serve::RackAdapter.new(root + '/views')
else
# We use Rack::Cascade and Rack::Directory on other platforms to
# handle static assets
run Rack::Cascade.new([
Serve::RackAdapter.new(root + '/views'),
Rack::Directory.new(root + '/public')
])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment