2010-09-06 21:48:25 -04:00
|
|
|
module Middleman::Features
|
|
|
|
autoload :RelativeAssets, "middleman/features/relative_assets"
|
|
|
|
autoload :AssetHost, "middleman/features/asset_host"
|
|
|
|
autoload :CacheBuster, "middleman/features/cache_buster"
|
|
|
|
autoload :DefaultHelpers, "middleman/features/default_helpers"
|
|
|
|
autoload :AutomaticImageSizes, "middleman/features/automatic_image_sizes"
|
|
|
|
autoload :UglyHaml, "middleman/features/ugly_haml"
|
|
|
|
autoload :MinifyCss, "middleman/features/minify_css"
|
|
|
|
autoload :MinifyJavascript, "middleman/features/minify_javascript"
|
|
|
|
autoload :Slickmap, "middleman/features/slickmap"
|
2011-01-30 18:11:54 -05:00
|
|
|
autoload :SmushPngs, "middleman/features/smush_pngs"
|
2010-09-21 21:30:17 -04:00
|
|
|
autoload :CodeRay, "middleman/features/code_ray"
|
2011-01-18 18:01:17 -05:00
|
|
|
autoload :Lorem, "middleman/features/lorem"
|
2010-09-21 21:30:17 -04:00
|
|
|
# autoload :LiveReload, "middleman/features/live_reload"
|
2010-09-06 21:48:25 -04:00
|
|
|
|
|
|
|
class << self
|
|
|
|
def registered(app)
|
|
|
|
app.extend ClassMethods
|
2010-09-04 23:26:48 -04:00
|
|
|
end
|
2010-09-06 21:48:25 -04:00
|
|
|
alias :included :registered
|
|
|
|
end
|
|
|
|
|
|
|
|
module ClassMethods
|
|
|
|
def activate(feature_name)
|
|
|
|
mod_name = feature_name.to_s.camelize
|
|
|
|
if Middleman::Features.const_defined?(mod_name)
|
|
|
|
register Middleman::Features.const_get(mod_name)
|
|
|
|
end
|
2010-09-04 23:26:48 -04:00
|
|
|
end
|
2010-09-06 21:48:25 -04:00
|
|
|
|
|
|
|
def enable(feature_name)
|
|
|
|
$stderr.puts "Warning: Feature activation has been renamed from enable to activate"
|
|
|
|
activate(feature_name)
|
|
|
|
super(feature_name)
|
2010-09-04 23:26:48 -04:00
|
|
|
end
|
|
|
|
end
|
2011-01-18 18:01:17 -05:00
|
|
|
end
|