From ec0aa868f4dcdbf83a82b22c27e04a6d8f557581 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Tue, 8 Nov 2011 15:05:06 -0800 Subject: [PATCH] compass hooks --- lib/middleman/core_extensions/compass.rb | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/middleman/core_extensions/compass.rb b/lib/middleman/core_extensions/compass.rb index c10e360b..d8dc6358 100644 --- a/lib/middleman/core_extensions/compass.rb +++ b/lib/middleman/core_extensions/compass.rb @@ -3,6 +3,7 @@ module Middleman::CoreExtensions::Compass def registered(app) # Where to look for fonts app.set :fonts_dir, "fonts" + app.define_hook :after_compass_config app.extend ClassMethods @@ -83,10 +84,7 @@ module Middleman::CoreExtensions::Compass end end - app.execute_after_compass_init! - app.execute_after_compass_config! - - # app.set :sass, ::Compass.configuration.to_sass_engine_options + run_hook :after_compass_config, ::Compass.configuration end end alias :included :registered @@ -95,23 +93,11 @@ module Middleman::CoreExtensions::Compass module ClassMethods # Add a block/proc to be run after features have been setup def compass_config(&block) - @run_after_compass ||= [] - @run_after_compass << block - end - - def execute_after_compass_init! - @run_after_compass ||= [] - @run_after_compass.each { |block| block.call(::Compass.configuration) } + after_compass_config(&block) end def after_compass_config(&block) - @run_after_compass_config ||= [] - @run_after_compass_config << block - end - - def execute_after_compass_config! - @run_after_compass_config ||= [] - @run_after_compass_config.each { |block| block.call() } + after_compass_config(&block) end end end \ No newline at end of file