Rename Middleman::Base to Middleman::Application
This commit is contained in:
parent
2130e902c2
commit
d2d40079cc
11 changed files with 27 additions and 27 deletions
|
@ -11,4 +11,4 @@ module Middleman; end
|
|||
require "middleman-core/version"
|
||||
require "middleman-core/util"
|
||||
require "middleman-core/extensions"
|
||||
require "middleman-core/base"
|
||||
require "middleman-core/application"
|
|
@ -18,7 +18,7 @@ require "middleman-core/sitemap"
|
|||
|
||||
# Core Middleman Class
|
||||
module Middleman
|
||||
class Base
|
||||
class Application
|
||||
# Uses callbacks
|
||||
include Hooks
|
||||
|
||||
|
@ -49,7 +49,7 @@ module Middleman
|
|||
# Get the static instance
|
||||
#
|
||||
# @private
|
||||
# @return [Middleman::Base]
|
||||
# @return [Middleman::Application]
|
||||
def inst(&block)
|
||||
@inst ||= begin
|
||||
mm = new(&block)
|
||||
|
@ -61,7 +61,7 @@ module Middleman
|
|||
# Set the shared instance
|
||||
#
|
||||
# @private
|
||||
# @param [Middleman::Base] inst
|
||||
# @param [Middleman::Application] inst
|
||||
# @return [void]
|
||||
def inst=(inst)
|
||||
@inst = inst
|
||||
|
@ -427,7 +427,7 @@ module Middleman
|
|||
|
||||
# Backwards compatibilty with old Sinatra template interface
|
||||
#
|
||||
# @return [Middleman::Base]
|
||||
# @return [Middleman::Application]
|
||||
def settings
|
||||
self
|
||||
end
|
||||
|
@ -517,7 +517,7 @@ module Middleman
|
|||
end
|
||||
|
||||
class << self
|
||||
# Create a new Class which is based on Middleman::Base
|
||||
# Create a new Class which is based on Middleman::Application
|
||||
# Used to create a safe sandbox into which extensions and
|
||||
# configuration can be included later without impacting
|
||||
# other classes and instances.
|
||||
|
@ -526,7 +526,7 @@ module Middleman
|
|||
def server(&block)
|
||||
@@servercounter ||= 1
|
||||
@@servercounter += 1
|
||||
const_set("MiddlemanBase#{@@servercounter}", Class.new(Middleman::Base))
|
||||
const_set("MiddlemanApplication#{@@servercounter}", Class.new(Middleman::Application))
|
||||
end
|
||||
|
||||
# Creates a new Rack::Server
|
|
@ -57,9 +57,9 @@ module Middleman::Cli
|
|||
true
|
||||
end
|
||||
|
||||
# Middleman::Base singleton
|
||||
# Middleman::Application singleton
|
||||
#
|
||||
# @return [Middleman::Base]
|
||||
# @return [Middleman::Application]
|
||||
def shared_instance(verbose=false)
|
||||
@_shared_instance ||= ::Middleman.server.inst do
|
||||
set :environment, :build
|
||||
|
@ -67,9 +67,9 @@ module Middleman::Cli
|
|||
end
|
||||
end
|
||||
|
||||
# Middleman::Base class singleton
|
||||
# Middleman::Application class singleton
|
||||
#
|
||||
# @return [Middleman::Base]
|
||||
# @return [Middleman::Application]
|
||||
def shared_server
|
||||
@_shared_server ||= shared_instance.class
|
||||
end
|
||||
|
@ -86,7 +86,7 @@ module Middleman::Cli
|
|||
end
|
||||
end
|
||||
|
||||
# Set the root path to the Middleman::Base's root
|
||||
# Set the root path to the Middleman::Application's root
|
||||
def source_root
|
||||
shared_instance.root
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ module Middleman::CoreExtensions::Assets
|
|||
alias :included :registered
|
||||
end
|
||||
|
||||
# Methods to be mixed-in to Middleman::Base
|
||||
# Methods to be mixed-in to Middleman::Application
|
||||
module InstanceMethod
|
||||
|
||||
# Get the URL of an asset given a type/prefix
|
||||
|
|
|
@ -78,7 +78,7 @@ module Middleman::CoreExtensions::Data
|
|||
|
||||
# Setup data store
|
||||
#
|
||||
# @param [Middleman::Base] app The current instance of Middleman
|
||||
# @param [Middleman::Application] app The current instance of Middleman
|
||||
def initialize(app)
|
||||
@app = app
|
||||
@local_data = {}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
# activate MyExtension
|
||||
#
|
||||
# This will call the `registered` method in your extension and provide you
|
||||
# with the `app` parameter which is a Middleman::Base context. From here
|
||||
# with the `app` parameter which is a Middleman::Application context. From here
|
||||
# you can choose to respond to requests for certain paths or simply attach
|
||||
# Rack middleware to the stack.
|
||||
#
|
||||
|
|
|
@ -116,7 +116,7 @@ module Middleman::CoreExtensions::FrontMatter
|
|||
class FrontMatter
|
||||
|
||||
# Initialize frontmatter with current app
|
||||
# @param [Middleman::Base] app
|
||||
# @param [Middleman::Application] app
|
||||
def initialize(app)
|
||||
@app = app
|
||||
@source = File.expand_path(@app.source, @app.root)
|
||||
|
|
|
@ -5,7 +5,7 @@ module Middleman::Sitemap
|
|||
class Resource
|
||||
include Middleman::Sitemap::Extensions::Traversal
|
||||
|
||||
# @return [Middleman::Base]
|
||||
# @return [Middleman::Application]
|
||||
attr_reader :app
|
||||
|
||||
# @return [Middleman::Sitemap::Store]
|
||||
|
|
|
@ -12,11 +12,11 @@ module Middleman::Sitemap
|
|||
# extensions. All "path" parameters used in this class are source paths.
|
||||
class Store
|
||||
|
||||
# @return [Middleman::Base]
|
||||
# @return [Middleman::Application]
|
||||
attr_accessor :app
|
||||
|
||||
# Initialize with parent app
|
||||
# @param [Middleman::Base] app
|
||||
# @param [Middleman::Application] app
|
||||
def initialize(app)
|
||||
@app = app
|
||||
@resources = []
|
||||
|
|
|
@ -94,7 +94,7 @@ module Middleman
|
|||
end
|
||||
end
|
||||
|
||||
# Start an instance of Middleman::Base
|
||||
# Start an instance of Middleman::Application
|
||||
# @return [void]
|
||||
def bootup
|
||||
env = (@options[:environment] || "development").to_sym
|
||||
|
|
|
@ -51,17 +51,17 @@ module Middleman
|
|||
|
||||
# Setup renderers
|
||||
require "coffee_script"
|
||||
Base.register Middleman::Renderers::Haml
|
||||
Base.register Middleman::Renderers::Sass
|
||||
Base.register Middleman::Renderers::Markdown
|
||||
Base.register Middleman::Renderers::Liquid
|
||||
Base.register Middleman::Renderers::Slim
|
||||
Application.register Middleman::Renderers::Haml
|
||||
Application.register Middleman::Renderers::Sass
|
||||
Application.register Middleman::Renderers::Markdown
|
||||
Application.register Middleman::Renderers::Liquid
|
||||
Application.register Middleman::Renderers::Slim
|
||||
|
||||
# Compass framework
|
||||
Base.register Middleman::CoreExtensions::Compass
|
||||
Application.register Middleman::CoreExtensions::Compass
|
||||
|
||||
# Sprockets asset handling
|
||||
Base.register Middleman::CoreExtensions::Sprockets
|
||||
Application.register Middleman::CoreExtensions::Sprockets
|
||||
|
||||
# Register the optional extensions
|
||||
Extensions.register(:cache_buster) {
|
||||
|
|
Loading…
Reference in a new issue