fix whitespace
This commit is contained in:
parent
29bf25ace6
commit
ee1d89fe55
|
@ -1,6 +1,5 @@
|
|||
PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
|
||||
ENV['TEST'] = 'true'
|
||||
ENV["AUTOLOAD_COMPASS"] = "true"
|
||||
require "middleman-core"
|
||||
require "middleman-core/step_definitions"
|
||||
require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-compass')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require "middleman-core"
|
||||
|
||||
Middleman::Extensions.register(:compass) do
|
||||
Middleman::Extensions.register :compass, auto_activate: :before_configuration do
|
||||
require "middleman-compass/extension"
|
||||
Middleman::CompassExtension
|
||||
end
|
||||
|
|
|
@ -8,30 +8,31 @@ module Middleman
|
|||
|
||||
# Hooks to manually update the compass config after we're
|
||||
# done with it
|
||||
app.define_hook :compass_config end
|
||||
app.define_hook :compass_config
|
||||
end
|
||||
|
||||
def after_configuration
|
||||
::Compass.configuration do |compass_config|
|
||||
compass_config.project_path = app.source_dir
|
||||
compass_config.environment = :development
|
||||
compass_config.cache = false
|
||||
compass_config.sass_dir = app.config[:css_dir]
|
||||
compass_config.css_dir = app.config[:css_dir]
|
||||
compass_config.javascripts_dir = app.config[:js_dir]
|
||||
compass_config.fonts_dir = app.config[:fonts_dir]
|
||||
compass_config.images_dir = app.config[:images_dir]
|
||||
compass_config.http_path = app.config[:http_prefix]
|
||||
::Compass.configuration do |compass|
|
||||
compass.project_path = app.source_dir
|
||||
compass.environment = :development
|
||||
compass.cache = false
|
||||
compass.sass_dir = app.config[:css_dir]
|
||||
compass.css_dir = app.config[:css_dir]
|
||||
compass.javascripts_dir = app.config[:js_dir]
|
||||
compass.fonts_dir = app.config[:fonts_dir]
|
||||
compass.images_dir = app.config[:images_dir]
|
||||
compass.http_path = app.config[:http_prefix]
|
||||
|
||||
# Disable this initially, the cache_buster extension will
|
||||
# re-enable it if requested.
|
||||
compass_config.asset_cache_buster { |_| nil }
|
||||
compass.asset_cache_buster { |_| nil }
|
||||
|
||||
# Disable this initially, the relative_assets extension will
|
||||
|
||||
compass_config.relative_assets = false
|
||||
compass.relative_assets = false
|
||||
|
||||
# Default output style
|
||||
compass_config.output_style = :nested
|
||||
compass.output_style = :nested
|
||||
end
|
||||
|
||||
# Call hook
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
ENV["TEST"] = "true"
|
||||
ENV["AUTOLOAD_SPROCKETS"] ||= "false"
|
||||
ENV["AUTOLOAD_COMPASS"] ||= "false"
|
||||
|
||||
require 'simplecov'
|
||||
SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..'))
|
||||
|
|
|
@ -17,9 +17,6 @@ module Middleman
|
|||
app.config.define_setting :autoload_sprockets, true, 'Automatically load sprockets at startup?'
|
||||
app.config[:autoload_sprockets] = (ENV['AUTOLOAD_SPROCKETS'] == 'true') if ENV['AUTOLOAD_SPROCKETS']
|
||||
|
||||
app.config.define_setting :autoload_compass, true, 'Automatically load compass at startup?'
|
||||
app.config[:autoload_compass] = (ENV['AUTOLOAD_COMPASS'] == 'true') if ENV['AUTOLOAD_COMPASS']
|
||||
|
||||
app.extend ClassMethods
|
||||
app.delegate :configure, to: :"self.class"
|
||||
end
|
||||
|
@ -105,15 +102,6 @@ module Middleman
|
|||
end
|
||||
end
|
||||
|
||||
if config[:autoload_compass]
|
||||
begin
|
||||
require 'middleman-compass'
|
||||
activate :compass
|
||||
rescue LoadError
|
||||
# Compass is not available, don't complain about it
|
||||
end
|
||||
end
|
||||
|
||||
# Evaluate a passed block if given
|
||||
config_context.instance_exec(&block) if block_given?
|
||||
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
# Asset Host module
|
||||
require 'middleman-core/middleware/inline_url_rewriter'
|
||||
|
||||
class Middleman::Extensions::AssetHost < ::Middleman::Extension
|
||||
option :host, nil, 'The asset host to use or a Proc to determine asset host'
|
||||
option :exts, %w(.css .png .jpg .jpeg .svg .svgz .js .gif), 'List of extensions that get cache busters strings appended to them.'
|
||||
option :sources, %w(.htm .html .php .css .js), 'List of extensions that are searched for bustable assets.'
|
||||
option :ignore, [], 'Regexes of filenames to skip adding query strings to'
|
||||
|
||||
def initialize(app, options_hash={}, &block)
|
||||
super
|
||||
|
||||
require 'middleman-core/middleware/inline_url_rewriter'
|
||||
end
|
||||
|
||||
def after_configuration
|
||||
app.use ::Middleman::Middleware::InlineURLRewriter,
|
||||
:id => :asset_host,
|
||||
|
|
Loading…
Reference in a new issue