Handle the change from Haml::Util => Sass::Util and haml_warn => sass_warn.

This commit is contained in:
Chris Eppstein 2010-11-21 09:58:12 -08:00
parent ad7f2eb980
commit 9e033f7df5
4 changed files with 21 additions and 7 deletions

View File

@ -1,7 +1,7 @@
module Compass module Compass
end end
%w(dependencies sass_extensions core_ext version errors).each do |lib| %w(dependencies util sass_extensions core_ext version errors).each do |lib|
require "compass/#{lib}" require "compass/#{lib}"
end end

View File

@ -7,7 +7,7 @@ module Compass::Exec
else else
unless arguments.include?("-h") || arguments.include?("--help") unless arguments.include?("-h") || arguments.include?("--help")
Compass::Logger.new.red do Compass::Logger.new.red do
Haml::Util.haml_warn "WARNING: This interface is deprecated. Please use the new subcommand interface.\nSee `compass help` for more information.\n" Compass::Util.compass_warn "WARNING: This interface is deprecated. Please use the new subcommand interface.\nSee `compass help` for more information.\n"
end end
end end
SwitchUI SwitchUI

View File

@ -1,9 +1,5 @@
module Compass::SassExtensions::Functions::Colors module Compass::SassExtensions::Functions::Colors
if defined?(Sass::Util) include Compass::Util
include Sass::Util
else
include Haml::Util
end
# a genericized version of lighten/darken so that negative values can be used. # a genericized version of lighten/darken so that negative values can be used.
def adjust_lightness(color, amount) def adjust_lightness(color, amount)

18
lib/compass/util.rb Normal file
View File

@ -0,0 +1,18 @@
module Compass::Util
extend self
if defined?(Sass::Util)
WARN_METHOD = :sass_warn
include Sass::Util
extend Sass::Util
else
WARN_METHOD = :haml_warn
include Haml::Util
extend Haml::Util
end
def compass_warn(*args)
send(WARN_METHOD, *args)
end
end