module WorkMd::Config

Constants

DEFAULT_WORK_DIR
TRANSLATIONS

Public Class Methods

editor() click to toggle source
# File lib/work_md/config.rb, line 51
def self.editor
  ENV['EDITOR'] || ENV['VISUAL'] || yaml_file['editor'] || nil
end
title() click to toggle source
# File lib/work_md/config.rb, line 47
def self.title
  yaml_file['title'] || ''
end
translations() click to toggle source
# File lib/work_md/config.rb, line 59
def self.translations
  TRANSLATIONS[ENV['WORK_MD_LANG']] ||
    TRANSLATIONS[yaml_file['lang']] ||
    TRANSLATIONS['en']
end
work_dir() click to toggle source
# File lib/work_md/config.rb, line 55
def self.work_dir
  ENV['WORK_MD_DIR'] || DEFAULT_WORK_DIR
end
yaml_file() click to toggle source
# File lib/work_md/config.rb, line 65
def self.yaml_file
  YAML.load_file("#{DEFAULT_WORK_DIR}/config.yml")
rescue StandardError
  {}
end