module Middleman::Configuration::Global

Access to a global configuration manager for the whole Middleman project, plus backwards compatibility mechanisms for older Middleman projects.

Public Class Methods

included(app) click to toggle source
# File lib/middleman-core/configuration.rb, line 6
def self.included(app)
  app.send :extend, ClassMethods
end

Public Instance Methods

config() click to toggle source
# File lib/middleman-core/configuration.rb, line 47
def config
  self.class.config
end
Also aliased as: settings
method_missing(method, *args) click to toggle source

Access global settings as methods, to preserve compatibility with old Middleman.

@deprecated Prefer accessing settings through “config”.

Calls superclass method
# File lib/middleman-core/configuration.rb, line 74
def method_missing(method, *args)
  if config.defines_setting? method
    config[method]
  else
    super
  end
end
respond_to?(method, include_private=false) click to toggle source

Needed so that method_missing makes sense

Calls superclass method
# File lib/middleman-core/configuration.rb, line 83
def respond_to?(method, include_private=false)
  super || config.defines_setting?(method)
end
set(key, value=nil, &block) click to toggle source

Set attributes (global variables)

@deprecated Prefer accessing settings through “config”.

@param [Symbol] key Name of the attribue @param value Attribute value @return [void]

# File lib/middleman-core/configuration.rb, line 65
def set(key, value=nil, &block)
  value = block if block_given?
  config[key] = value
end
settings()

Backwards compatibilty with old Sinatra template interface

@deprecated Prefer accessing settings through “config”.

@return [ConfigurationManager]

Alias for: config