Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (41 sloc) 1.25 KB
#\ -p 4000
gem 'activesupport'
gem 'serve'
require 'serve'
require 'serve/rack'
require 'sass/plugin/rack'
require 'compass'
# The project root directory
root = ::File.dirname(__FILE__)
# Set the haml options
# http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#options
class Haml::Engine
alias old_initialize initialize
def initialize(lines, options)
options.update(:format => :html5)
old_initialize(lines, options)
end
end
# Compass
Compass.add_project_configuration(root + '/config.rb')
Compass.configure_sass_plugin!
# Rack Middleware
use Rack::ShowStatus # Nice looking 404s and other messages
use Rack::ShowExceptions # Nice looking errors
# Because Heroku doesn't allow you to write to the file system,
# if you're not using Heroku in production this condition won't be needed
if ENV['RACK_ENV'] != "production"
use Sass::Plugin::Rack # Compile Sass on the fly
end
# Rack Application
if ENV['SERVER_SOFTWARE'] =~ /passenger/i
# Passendger 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
Something went wrong with that request. Please try again.