did this get missed somehow? fix activate, add live_reload to autoload

This commit is contained in:
Travis Tilley 2011-02-21 11:14:04 -05:00
parent 08a9f45164
commit 5c93bae53b

View file

@ -75,6 +75,9 @@ module Middleman::Features
# paragraphs, fake images, names and email addresses. # paragraphs, fake images, names and email addresses.
autoload :Lorem, "middleman/features/lorem" autoload :Lorem, "middleman/features/lorem"
# auto-reload browser after changes
autoload :LiveReload, "middleman/features/live_reload"
# The Feature API is itself a Feature. Mind blowing! # The Feature API is itself a Feature. Mind blowing!
class << self class << self
def registered(app) def registered(app)
@ -93,11 +96,15 @@ module Middleman::Features
# Alternatively, you can pass in a Middleman feature module directly. # Alternatively, you can pass in a Middleman feature module directly.
# #
# activate MyFeatureModule # activate MyFeatureModule
def activate(feature_name) def activate(feature)
feature_name = feature_name.to_s if feature_name.class == Symbol feature = feature.to_s if feature.is_a? Symbol
feature_name = Middleman::Features.const_get(feature_name.camelize) if feature_name.class == String if Middleman::Features.const_defined?(mod_name)
register feature_name if feature.is_a? String
feature = feature.camelize
feature = Middleman::Features.const_get(feature)
end
register feature
end end
# Deprecated API. Please use `activate` instead. # Deprecated API. Please use `activate` instead.