Class: Serif::Config
- Inherits:
-
Object
- Object
- Serif::Config
- Defined in:
- lib/serif/config.rb
Instance Method Summary collapse
- #admin_password ⇒ Object
- #admin_username ⇒ Object
- #archive_enabled? ⇒ Boolean
- #archive_url_format ⇒ Object
- #image_upload_path ⇒ Object
-
#initialize(config_file) ⇒ Config
constructor
A new instance of Config.
- #permalink ⇒ Object
Constructor Details
#initialize(config_file) ⇒ Config
Returns a new instance of Config.
5 6 7 |
# File 'lib/serif/config.rb', line 5 def initialize(config_file) @config_file = config_file end |
Instance Method Details
#admin_password ⇒ Object
13 14 15 |
# File 'lib/serif/config.rb', line 13 def admin_password yaml["admin"]["password"] end |
#admin_username ⇒ Object
9 10 11 |
# File 'lib/serif/config.rb', line 9 def admin_username yaml["admin"]["username"] end |
#archive_enabled? ⇒ Boolean
25 26 27 28 29 30 31 32 33 |
# File 'lib/serif/config.rb', line 25 def archive_enabled? a = yaml["archive"] if a a["enabled"] else false end end |
#archive_url_format ⇒ Object
35 36 37 |
# File 'lib/serif/config.rb', line 35 def archive_url_format (yaml["archive"] || {})["url_format"] || "/archive/:year/:month" end |
#image_upload_path ⇒ Object
17 18 19 |
# File 'lib/serif/config.rb', line 17 def image_upload_path yaml["image_upload_path"] || "/images/:timestamp_:name" end |
#permalink ⇒ Object
21 22 23 |
# File 'lib/serif/config.rb', line 21 def permalink yaml["permalink"] || "/:title" end |