diff --git a/lib/compass/installers/base.rb b/lib/compass/installers/base.rb index 03bb9f5d..0a20c2e2 100644 --- a/lib/compass/installers/base.rb +++ b/lib/compass/installers/base.rb @@ -31,7 +31,7 @@ module Compass # Initializes the project to work with compass def init dirs = manifest.map do |entry| - File.dirname(send("install_location_for_#{entry.type}", entry.to)) + File.dirname(send("install_location_for_#{entry.type}", entry.to, entry.options)) end if manifest.has_stylesheet? @@ -90,9 +90,16 @@ module Compass def self.installer(type, &locator) locator ||= lambda{|to| to} loc_method = "install_location_for_#{type}".to_sym - define_method loc_method, locator + define_method("simple_#{loc_method}", locator) + define_method(loc_method) do |to, options| + if options[:like] && options[:like] != type + send("install_location_for_#{options[:like]}", to, options) + else + send("simple_#{loc_method}", to) + end + end define_method "install_#{type}" do |from, to, options| - copy templatize(from), targetize(send(loc_method, to)) + copy templatize(from), targetize(send(loc_method, to, options)) end end @@ -100,6 +107,10 @@ module Compass "#{sass_dir}/#{pattern_name_as_dir}#{to}" end + installer :css do |to| + "#{css_dir}/#{to}" + end + installer :image do |to| "#{images_dir}/#{to}" end