-
-
Save grantmichaels/429077 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#\ -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