Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
Now allows any Compass option to be passed.
Browse files Browse the repository at this point in the history
This may break existing projects that rely on the default Rails config,
but using the default Compass settings seems more sensible.
  • Loading branch information
hawx committed Jun 6, 2013
1 parent e5c8844 commit 2b4baf6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/guard/sass.rb
Expand Up @@ -56,16 +56,16 @@ def initialize(watchers=[], options={})
if compass = options.delete(:compass)
require 'compass'
compass = {} unless compass.is_a?(Hash)

Compass.add_project_configuration

Compass.configuration.project_path ||= Dir.pwd
Compass.configuration.images_dir = compass[:images_dir] || "app/assets/images"
Compass.configuration.images_path = compass[:images_path] || File.join(Dir.pwd, "app/assets/images")
Compass.configuration.http_images_path = compass[:http_images_path] || "/assets"
Compass.configuration.http_images_dir = compass[:http_images_dir] || "/assets"

Compass.configuration.http_fonts_path = compass[:http_fonts_path] || "/assets"
Compass.configuration.http_fonts_dir = compass[:http_fonts_dir] || "/assets"

compass.each do |key, value|
Compass.configuration.send("#{key}=".to_sym, value)

if key.to_s.include?('dir') && !key.to_s.include?('http')
options[:load_paths] << value
end
end

Compass.configuration.asset_cache_buster = Proc.new {|*| {:query => Time.now.to_i} }
options[:load_paths] ||= []
Expand Down

0 comments on commit 2b4baf6

Please sign in to comment.