class Serif::Config

Public Class Methods

new(config_file) click to toggle source
# File lib/serif/config.rb, line 5
def initialize(config_file)
  @config_file = config_file
end

Public Instance Methods

admin_password() click to toggle source
# File lib/serif/config.rb, line 13
def admin_password
  yaml["admin"]["password"]
end
admin_username() click to toggle source
# File lib/serif/config.rb, line 9
def admin_username
  yaml["admin"]["username"]
end
archive_enabled?() click to toggle source
# File lib/serif/config.rb, line 25
def archive_enabled?
  a = yaml["archive"]

  if a
    a["enabled"]
  else
    false
  end
end
archive_url_format() click to toggle source
# File lib/serif/config.rb, line 35
def archive_url_format
  (yaml["archive"] || {})["url_format"] || "/archive/:year/:month"
end
image_upload_path() click to toggle source
# File lib/serif/config.rb, line 17
def image_upload_path
  yaml["image_upload_path"] || "/images/:timestamp_:name"
end

Private Instance Methods

yaml() click to toggle source
# File lib/serif/config.rb, line 41
def yaml
  @yaml ||= YAML.load_file(@config_file)
end