Created
May 17, 2011 06:48
-
-
Save webdevotion/976056 to your computer and use it in GitHub Desktop.
heroku compass config
This file contains 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
# This configuration file works with both the Compass command line tool and within Rails. | |
# Require any additional compass plugins here. | |
project_type = :rails | |
project_path = Compass::AppIntegration::Rails.root | |
# Set this to the root of your project when deployed: | |
http_path = "/" | |
environment = Compass::AppIntegration::Rails.env | |
if environment == 'production' | |
css_dir = "tmp/stylesheets" | |
sass_dir = "app/views/stylesheets" | |
else | |
css_dir = "public/stylesheets" | |
sass_dir = "app/views/stylesheets" | |
end |
This file contains 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
require 'compass' | |
require 'compass/app_integration/rails' | |
require 'fileutils' | |
Compass::AppIntegration::Rails.initialize! | |
environment = Compass::AppIntegration::Rails.env | |
if environment == 'production' | |
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets")) | |
Rails.configuration.middleware.delete('Sass::Plugin::Rack') | |
Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Sass::Plugin::Rack') | |
Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static', | |
:urls => ['/stylesheets'], | |
:root => "#{Rails.root}/tmp") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment