Put the Sprite importer on the default load paths coming from compass.

This commit is contained in:
Chris Eppstein 2010-11-29 14:35:37 -08:00
parent c55896b493
commit 8c7223575a
3 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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
""

View File

@ -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"