Extract compass support into extension, rewrite all features that rely on it to be pure Ruby
This commit is contained in:
parent
3879be0f23
commit
29bf25ace6
63 changed files with 766 additions and 363 deletions
|
@ -14,6 +14,12 @@ module Middleman
|
|||
app.define_hook :build_config
|
||||
app.define_hook :development_config
|
||||
|
||||
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
|
||||
|
@ -90,7 +96,7 @@ module Middleman
|
|||
activate ext_name
|
||||
end
|
||||
|
||||
if ENV['AUTOLOAD_SPROCKETS'] != 'false'
|
||||
if config[:autoload_sprockets]
|
||||
begin
|
||||
require 'middleman-sprockets'
|
||||
activate :sprockets
|
||||
|
@ -99,6 +105,15 @@ 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?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue