Class: Dimples::Config
- Inherits:
-
Object
- Object
- Dimples::Config
- Defined in:
- lib/dimples/config.rb
Overview
Configuration settings for a site.
Constant Summary collapse
- SOURCE_PATHS =
{ pages: 'pages', posts: 'posts', layouts: 'layouts', static: 'static' }.freeze
Instance Attribute Summary collapse
-
#build_paths ⇒ Object
Returns the value of attribute build_paths.
-
#generation ⇒ Object
Returns the value of attribute generation.
-
#pagination ⇒ Object
Returns the value of attribute pagination.
-
#site ⇒ Object
Returns the value of attribute site.
-
#source_paths ⇒ Object
Returns the value of attribute source_paths.
Class Method Summary collapse
Instance Method Summary collapse
- #expand_paths(root, paths) ⇒ Object
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
21 22 23 24 25 26 27 28 29 |
# File 'lib/dimples/config.rb', line 21 def initialize( = {}) = Config.defaults.merge() @source_paths = (File.([:source]), SOURCE_PATHS.dup) @build_paths = (File.([:build]), [:pathnames]) @site = [:site] @pagination = [:pagination] @generation = [:generation] end |
Instance Attribute Details
#build_paths ⇒ Object
Returns the value of attribute build_paths.
8 9 10 |
# File 'lib/dimples/config.rb', line 8 def build_paths @build_paths end |
#generation ⇒ Object
Returns the value of attribute generation.
8 9 10 |
# File 'lib/dimples/config.rb', line 8 def generation @generation end |
#pagination ⇒ Object
Returns the value of attribute pagination.
8 9 10 |
# File 'lib/dimples/config.rb', line 8 def pagination @pagination end |
#site ⇒ Object
Returns the value of attribute site.
8 9 10 |
# File 'lib/dimples/config.rb', line 8 def site @site end |
#source_paths ⇒ Object
Returns the value of attribute source_paths.
8 9 10 |
# File 'lib/dimples/config.rb', line 8 def source_paths @source_paths end |
Class Method Details
.defaults ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/dimples/config.rb', line 10 def self.defaults { source: Dir.pwd, build: './site', pathnames: { posts: 'posts', categories: 'categories' }, site: { name: nil, domain: nil }, pagination: { page_prefix: 'page_', per_page: 5 }, generation: { api: false, main_feed: true, category_feeds: false } } end |