diff --git a/lib/compass.rb b/lib/compass.rb index 91d1af94..ebd83e8e 100644 --- a/lib/compass.rb +++ b/lib/compass.rb @@ -1,7 +1,7 @@ module Compass 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}" end diff --git a/lib/compass/exec/helpers.rb b/lib/compass/exec/helpers.rb index f1e8db1a..e0ba7e5e 100644 --- a/lib/compass/exec/helpers.rb +++ b/lib/compass/exec/helpers.rb @@ -7,7 +7,7 @@ module Compass::Exec else unless arguments.include?("-h") || arguments.include?("--help") 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 SwitchUI diff --git a/lib/compass/sass_extensions/functions/colors.rb b/lib/compass/sass_extensions/functions/colors.rb index 8f5f78ab..f7ba0173 100644 --- a/lib/compass/sass_extensions/functions/colors.rb +++ b/lib/compass/sass_extensions/functions/colors.rb @@ -1,9 +1,5 @@ module Compass::SassExtensions::Functions::Colors - if defined?(Sass::Util) - include Sass::Util - else - include Haml::Util - end + include Compass::Util # a genericized version of lighten/darken so that negative values can be used. def adjust_lightness(color, amount) diff --git a/lib/compass/util.rb b/lib/compass/util.rb new file mode 100644 index 00000000..516be5f9 --- /dev/null +++ b/lib/compass/util.rb @@ -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