Module: Mint

Defined in:
lib/mint.rb,
lib/mint/style.rb,
lib/mint/config.rb,
lib/mint/layout.rb,
lib/mint/css_dsl.rb,
lib/mint/helpers.rb,
lib/mint/version.rb,
lib/mint/document.rb,
lib/mint/template.rb,
lib/mint/workspace.rb,
lib/mint/css_parser.rb,
lib/mint/exceptions.rb,
lib/mint/document_tree.rb,
lib/mint/commandline/run.rb,
lib/mint/commandline/parse.rb,
lib/mint/commandline/publish.rb,
lib/mint/renderers/css_renderer.rb,
lib/mint/renderers/erb_renderer.rb,
lib/mint/renderers/markdown_renderer.rb

Defined Under Namespace

Modules: CSS, Commandline, Helpers, Layout, Renderers, Style, Template Classes: Config, CssParser, Document, DocumentTree, DocumentTreeNode, LayoutNotFoundException, StyleNotFoundException, Workspace

Constant Summary collapse

PROJECT_ROOT =
(Pathname.new(__FILE__).realpath.dirname + "..").to_s
LOCAL_SCOPE =
Pathname.new(".mint")
USER_SCOPE =
Pathname.new("~/.config/mint").expand_path
GLOBAL_SCOPE =
Pathname.new("#{PROJECT_ROOT}/config").expand_path
PATH =
[LOCAL_SCOPE, USER_SCOPE, GLOBAL_SCOPE]
CONFIG_FILE =
"config.toml"
TEMPLATES_DIRECTORY =
"templates"
VERSION =
"0.10.0"

Class Method Summary collapse

Class Method Details

.configurationConfig

Returns a hash of all active config, merging global, user, and local scoped config. Local overrides user, which overrides global config.

Returns:

  • (Config)

    a structured set of configuration options



36
37
38
39
40
41
42
43
# File 'lib/mint.rb', line 36

def self.configuration
  Mint::PATH.
    reverse.
    map {|p| p + Mint::CONFIG_FILE }.
    select(&:exist?).
    map {|p| Config.load_file p }.
    reduce(Config.defaults) {|agg, cfg| agg.merge cfg }
end