update namespace
This commit is contained in:
parent
a0df00b9e6
commit
cd12783e69
1 changed files with 35 additions and 33 deletions
|
@ -2,38 +2,40 @@
|
||||||
require "middleman-core"
|
require "middleman-core"
|
||||||
|
|
||||||
# Extension namespace
|
# Extension namespace
|
||||||
module MyExtension
|
module Middleman
|
||||||
class << self
|
module Deploy
|
||||||
|
class << self
|
||||||
|
|
||||||
# Called when user `activate`s your extension
|
# Called when user `activate`s your extension
|
||||||
def registered(app, options={})
|
def registered(app, options={})
|
||||||
# Setup extension-specific config
|
# Setup extension-specific config
|
||||||
app.set :config_variable, false
|
app.set :config_variable, false
|
||||||
|
|
||||||
# Include class methods
|
# Include class methods
|
||||||
# app.extend ClassMethods
|
# app.extend ClassMethods
|
||||||
|
|
||||||
# Include instance methods
|
# Include instance methods
|
||||||
# app.send :include, InstanceMethods
|
# app.send :include, InstanceMethods
|
||||||
|
|
||||||
app.after_configuration do
|
app.after_configuration do
|
||||||
# Do something
|
# Do something
|
||||||
|
|
||||||
# config_variable is now either the default or the user's
|
# config_variable is now either the default or the user's
|
||||||
# setting from config.rb
|
# setting from config.rb
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
alias :included :registered
|
||||||
end
|
end
|
||||||
alias :included :registered
|
|
||||||
|
# module ClassMethods
|
||||||
|
# def a_class_method
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
|
||||||
|
# module InstanceMethods
|
||||||
|
# def an_instance_method
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# module ClassMethods
|
|
||||||
# def a_class_method
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
# module InstanceMethods
|
|
||||||
# def an_instance_method
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue