class Middleman::Application
def self.cache
-
(Middleman::Util::Cache)
- The cache
Other tags:
- Private: -
def self.cache @_cache ||= ::Tilt::Cache.new end
def self.helpers(*extensions, &block)
-
(void)
-
def self.helpers(*extensions, &block) class_eval(&block) if block_given? include(*extensions) if extensions.any? end
def self.root
-
(String)
-
def self.root ENV['MM_ROOT'] || Dir.pwd end
def self.root_path
def self.root_path Pathname(root) end
def _hooks
https://github.com/apotonick/hooks/blob/master/lib/hooks/instance_hooks.rb#L10
Hooks clones _hooks from the class to the instance.
def _hooks self.class._hooks end
def build?
-
(Boolean)
- If we're in build mode
def build? config[:environment] == :build end
def development?
-
(Boolean)
- If we're in dev mode
def development? config[:environment] == :development end
def initialize(&block)
def initialize(&block) # Clear the static class cache cache.clear # Setup the default values from calls to set before initialization self.class.config.load_settings(self.class.superclass.config.all_settings) if Object.const_defined?(:Encoding) Encoding.default_internal = config[:encoding] Encoding.default_external = config[:encoding] end # Evaluate a passed block if given instance_exec(&block) if block_given? config[:source] = ENV['MM_SOURCE'] if ENV['MM_SOURCE'] super end
def logger
def logger ::Middleman::Logger.singleton end
def source_dir
-
(String)
-
def source_dir File.join(root, config[:source]) end
def to_s
messages, which can take a long time (minutes at full CPU)
where Ruby will call to_s/inspect while printing exception
Work around this bug: http://bugs.ruby-lang.org/issues/4521
def to_s "#<Middleman::Application:0x#{object_id}>" end