Created
July 3, 2011 17:45
-
-
Save stefl/1062414 to your computer and use it in GitHub Desktop.
How to get Padrino, Compass and Heroku working without checking in the resulting css to the git repo
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
# Enables support for Compass, a stylesheet authoring framework based on SASS. | |
# See http://compass-style.org/ for more details. | |
# Store Compass/SASS files (by default) within 'app/stylesheets' | |
module CompassInitializer | |
def self.registered(app) | |
require 'sass/plugin/rack' | |
Compass.configuration do |config| | |
config.project_path = Padrino.root | |
config.sass_dir = "app/stylesheets" | |
config.project_type = :stand_alone | |
config.http_path = "/" | |
config.css_dir = "tmp/stylesheets" # we need to render to tmp | |
config.images_dir = "public/images" | |
config.javascripts_dir = "public/javascripts" | |
config.output_style = :compressed | |
end | |
Compass.configure_sass_plugin! | |
Compass.handle_configuration_change! | |
app.use Sass::Plugin::Rack | |
# then use Rack::Static to handle any requests for stylesheets and respond with the files rendered to tmp | |
require "fileutils" | |
FileUtils.mkdir_p(Padrino.root + "/tmp/stylesheets") | |
app.use Rack::Static, :root => "tmp/", :urls => ["/stylesheets"] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment