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.
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!
class << self
def registered(app)
@ -93,11 +96,15 @@ module Middleman::Features
# Alternatively, you can pass in a Middleman feature module directly.
#
# activate MyFeatureModule
def activate(feature_name)
feature_name = feature_name.to_s if feature_name.class == Symbol
feature_name = Middleman::Features.const_get(feature_name.camelize) if feature_name.class == String if Middleman::Features.const_defined?(mod_name)
def activate(feature)
feature = feature.to_s if feature.is_a? Symbol
register feature_name
if feature.is_a? String
feature = feature.camelize
feature = Middleman::Features.const_get(feature)
end
register feature
end
# Deprecated API. Please use `activate` instead.