class Renogen::Config

Stores configuratin values to be used by the libary

Attributes

changelog_path[RW]
default_headings[RW]
input_source[RW]
output_format[RW]
remove_duplicates[RW]
single_line_format[RW]
supported_keys[RW]
validations[RW]

Public Class Methods

configure() { |instance| ... } click to toggle source

Renogen configuration extension a block can be provided to programatily setup configuration values

# File lib/renogen/config.rb, line 27
def self.configure
  yield instance
end
new() click to toggle source
# File lib/renogen/config.rb, line 13
def initialize
  config_file = load_yaml_config
  self.single_line_format = config_file['single_line_format'] || 'summary (see link)'
  self.supported_keys = config_file['supported_keys'] || %w(identifier link summary)
  self.input_source = config_file['input_source'] || 'yaml'
  self.output_format = config_file['output_format'] || 'markdown'
  self.changelog_path = config_file['changelog_path'] || './change_log'
  self.default_headings = config_file['default_headings'] || %w(Summary Detailed Tasks)
  self.validations = config_file['allowed_values']
  self.remove_duplicates = config_file['remove_duplicates'] || false
end

Private Instance Methods

load_yaml_config(config_file_path = '.renogen') click to toggle source
# File lib/renogen/config.rb, line 33
def load_yaml_config(config_file_path = '.renogen')
  YAML.load_file(config_file_path)
rescue StandardError
  {}
end