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.
-
#pagination ⇒ Object
Returns the value of attribute pagination.
-
#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.
18 19 20 21 22 23 24 |
# File 'lib/dimples/config.rb', line 18 def initialize( = {}) = Config.defaults.merge() @source_paths = (File.(Dir.pwd), SOURCE_PATHS.dup) @build_paths = (File.([:build]), [:pathnames]) @pagination = [:pagination] 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 |
#pagination ⇒ Object
Returns the value of attribute pagination.
8 9 10 |
# File 'lib/dimples/config.rb', line 8 def pagination @pagination 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 |
# File 'lib/dimples/config.rb', line 10 def self.defaults { build: './site', pathnames: { posts: 'posts', categories: 'categories' }, pagination: { page_prefix: 'page_', per_page: 5 } } end |