diff --git a/lib/compass/configuration/adapters.rb b/lib/compass/configuration/adapters.rb index bde7b16d..3ae9149b 100644 --- a/lib/compass/configuration/adapters.rb +++ b/lib/compass/configuration/adapters.rb @@ -22,6 +22,8 @@ module Compass plugin_opts[:cache] = cache unless cache.nil? plugin_opts[:cache_location] = cache_path unless cache_path.nil? plugin_opts.merge!(sass_options || {}) + plugin_opts[:load_paths] ||= [] + plugin_opts[:load_paths] << Compass::Sprites.new plugin_opts end @@ -57,6 +59,7 @@ module Compass load_paths << framework.stylesheets_directory if File.exists?(framework.stylesheets_directory) end load_paths += resolve_additional_import_paths + load_paths << Compass::Sprites.new load_paths end end diff --git a/lib/compass/sprites.rb b/lib/compass/sprites.rb index 1796f4a5..eed1468e 100644 --- a/lib/compass/sprites.rb +++ b/lib/compass/sprites.rb @@ -101,6 +101,16 @@ module Compass [self.class.name + ":" + File.dirname(File.expand_path(uri)), File.basename(uri)] end + + def mtime(uri, options) + Compass.quick_cache("mtime:#{uri}") do + self.path, self.name = Compass::Sprites.path_and_name(uri) + glob = File.join(Compass.configuration.images_path, uri) + Dir.glob(glob).inject(Time.at(0)) do |max_time, file| + (t = File.mtime(file)) > max_time ? t : max_time + end + end + end def to_s "" diff --git a/spec/sprites_spec.rb b/spec/sprites_spec.rb index 497495b8..4b86372a 100644 --- a/spec/sprites_spec.rb +++ b/spec/sprites_spec.rb @@ -33,7 +33,6 @@ describe Compass::Sprites do options[:line_comments] = false options[:style] = :expanded options[:syntax] = :scss - options[:load_paths] << Compass::Sprites.new css = Sass::Engine.new(scss, options).render # reformat to fit result of heredoc: " #{css.gsub('@charset "UTF-8";', '').gsub(/\n/, "\n ").strip}\n"