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").
- GLOBAL_SCOPE =
Pathname.new("#{PROJECT_ROOT}/config").
- PATH =
[LOCAL_SCOPE, USER_SCOPE, GLOBAL_SCOPE]
- CONFIG_FILE =
"config.toml"
- TEMPLATES_DIRECTORY =
"templates"
- VERSION =
"0.10.0"
Class Method Summary collapse
-
.configuration ⇒ Config
Returns a hash of all active config, merging global, user, and local scoped config.
Class Method Details
.configuration ⇒ Config
Returns a hash of all active config, merging global, user, and local scoped config. Local overrides user, which overrides global config.
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 |