Cleanup Compass extension

This commit is contained in:
Thomas Reynolds 2012-04-26 15:53:45 -07:00
parent d6f75afb3d
commit 072880d79c

View file

@ -1,18 +1,24 @@
# Forward the settings on config.rb and the result of registered extensions
# to Compass
module Middleman::CoreExtensions::Compass
module Middleman
module CoreExtensions
# Forward the settings on config.rb and the result of registered
# extensions to Compass
module Compass
# Extension registered
class << self
# Once registered
def registered(app)
# Require the library
require "compass"
# Where to look for fonts
app.set :fonts_dir, "fonts"
# Hooks to manually update the compass config after we're
# done with it
app.define_hook :compass_config
app.define_hook :after_compass_config
app.after_configuration do
::Compass.configuration do |config|
@ -26,17 +32,15 @@ module Middleman::CoreExtensions::Compass
config.images_dir = images_dir
config.http_path = http_prefix
# Correctly support HTTP paths with generated sprites
# if config.respond_to? :http_generated_images_path
# config.http_generated_images_path = if app.respond_to? :http_generated_images_path
# app.http_generated_images_path
# else
# File.join(app.http_prefix || "/", app.images_dir)
# end
# end
# Disable this initially, the cache_buster extension will
# re-enable it if requested.
config.asset_cache_buster :none
# Disable this initially, the relative_assets extension will
# re-enable it if requested.
config.relative_assets = false
# Default output style
config.output_style = :nested
if respond_to?(:asset_host) && asset_host.is_a?(Proc)
@ -44,17 +48,14 @@ module Middleman::CoreExtensions::Compass
end
end
# if build?
# ::Compass.configuration do |config|
# config.environment = :production
# config.project_path = File.join(root, build_dir)
# end
# end
# Call hook
run_hook :compass_config, ::Compass.configuration
run_hook :after_compass_config
end
end
alias :included :registered
end
end
end
end