module Middleman::CoreExtensions::Features::ClassMethods
def activate(feature)
Alternatively, you can pass in a Middleman feature module directly.
activate :lorem
feature module and includes it.
It takes a underscore-separated symbol, finds the appropriate
This method is available in the project's `config.rb`.
def activate(feature) feature = feature.to_s if feature.is_a? Symbol if feature.is_a? String feature = feature.camelize feature = Middleman::Features.const_get(feature) end register feature end
def after_feature_init(&block)
def after_feature_init(&block) @run_after_features ||= [] @run_after_features << block end
def enable(feature_name)
def enable(feature_name) $stderr.puts "Warning: Feature activation has been renamed from enable to activate" activate(feature_name) super(feature_name) end
def new
def new # Check for and evaluate local configuration local_config = File.join(self.root, "config.rb") if File.exists? local_config $stderr.puts "== Reading: Local config" if logging? class_eval File.read(local_config) set :app_file, File.expand_path(local_config) end # Add in defaults default_features.each do |ext| activate ext end @run_after_features.each { |block| class_eval(&block) } super end