fix whitespace

This commit is contained in:
Thomas Reynolds 2014-06-09 14:02:46 -07:00
parent 29bf25ace6
commit ee1d89fe55
6 changed files with 18 additions and 36 deletions

View file

@ -1,6 +1,5 @@
PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__))) PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
ENV['TEST'] = 'true' ENV['TEST'] = 'true'
ENV["AUTOLOAD_COMPASS"] = "true"
require "middleman-core" require "middleman-core"
require "middleman-core/step_definitions" require "middleman-core/step_definitions"
require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-compass') require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-compass')

View file

@ -1,6 +1,6 @@
require "middleman-core" require "middleman-core"
Middleman::Extensions.register(:compass) do Middleman::Extensions.register :compass, auto_activate: :before_configuration do
require "middleman-compass/extension" require "middleman-compass/extension"
Middleman::CompassExtension Middleman::CompassExtension
end end

View file

@ -8,30 +8,31 @@ module Middleman
# Hooks to manually update the compass config after we're # Hooks to manually update the compass config after we're
# done with it # done with it
app.define_hook :compass_config end app.define_hook :compass_config
end
def after_configuration def after_configuration
::Compass.configuration do |compass_config| ::Compass.configuration do |compass|
compass_config.project_path = app.source_dir compass.project_path = app.source_dir
compass_config.environment = :development compass.environment = :development
compass_config.cache = false compass.cache = false
compass_config.sass_dir = app.config[:css_dir] compass.sass_dir = app.config[:css_dir]
compass_config.css_dir = app.config[:css_dir] compass.css_dir = app.config[:css_dir]
compass_config.javascripts_dir = app.config[:js_dir] compass.javascripts_dir = app.config[:js_dir]
compass_config.fonts_dir = app.config[:fonts_dir] compass.fonts_dir = app.config[:fonts_dir]
compass_config.images_dir = app.config[:images_dir] compass.images_dir = app.config[:images_dir]
compass_config.http_path = app.config[:http_prefix] compass.http_path = app.config[:http_prefix]
# Disable this initially, the cache_buster extension will # Disable this initially, the cache_buster extension will
# re-enable it if requested. # re-enable it if requested.
compass_config.asset_cache_buster { |_| nil } compass.asset_cache_buster { |_| nil }
# Disable this initially, the relative_assets extension will # Disable this initially, the relative_assets extension will
compass_config.relative_assets = false compass.relative_assets = false
# Default output style # Default output style
compass_config.output_style = :nested compass.output_style = :nested
end end
# Call hook # Call hook

View file

@ -1,6 +1,5 @@
ENV["TEST"] = "true" ENV["TEST"] = "true"
ENV["AUTOLOAD_SPROCKETS"] ||= "false" ENV["AUTOLOAD_SPROCKETS"] ||= "false"
ENV["AUTOLOAD_COMPASS"] ||= "false"
require 'simplecov' require 'simplecov'
SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..')) SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..'))

View file

@ -17,9 +17,6 @@ module Middleman
app.config.define_setting :autoload_sprockets, true, 'Automatically load sprockets at startup?' 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[: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.extend ClassMethods
app.delegate :configure, to: :"self.class" app.delegate :configure, to: :"self.class"
end end
@ -105,15 +102,6 @@ module Middleman
end end
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 # Evaluate a passed block if given
config_context.instance_exec(&block) if block_given? config_context.instance_exec(&block) if block_given?

View file

@ -1,16 +1,11 @@
# Asset Host module require 'middleman-core/middleware/inline_url_rewriter'
class Middleman::Extensions::AssetHost < ::Middleman::Extension class Middleman::Extensions::AssetHost < ::Middleman::Extension
option :host, nil, 'The asset host to use or a Proc to determine asset host' 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 :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 :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' 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 def after_configuration
app.use ::Middleman::Middleware::InlineURLRewriter, app.use ::Middleman::Middleware::InlineURLRewriter,
:id => :asset_host, :id => :asset_host,