Class: Renogen::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/renogen/config.rb

Overview

Stores configuratin values to be used by the libary

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



13
14
15
16
17
18
19
20
21
22
23
# 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

Instance Attribute Details

#changelog_pathObject

Returns the value of attribute changelog_path.



10
11
12
# File 'lib/renogen/config.rb', line 10

def changelog_path
  @changelog_path
end

#default_headingsObject

Returns the value of attribute default_headings.



10
11
12
# File 'lib/renogen/config.rb', line 10

def default_headings
  @default_headings
end

#input_sourceObject

Returns the value of attribute input_source.



10
11
12
# File 'lib/renogen/config.rb', line 10

def input_source
  @input_source
end

#output_formatObject

Returns the value of attribute output_format.



10
11
12
# File 'lib/renogen/config.rb', line 10

def output_format
  @output_format
end

#remove_duplicatesObject

Returns the value of attribute remove_duplicates.



10
11
12
# File 'lib/renogen/config.rb', line 10

def remove_duplicates
  @remove_duplicates
end

#single_line_formatObject

Returns the value of attribute single_line_format.



10
11
12
# File 'lib/renogen/config.rb', line 10

def single_line_format
  @single_line_format
end

#supported_keysObject

Returns the value of attribute supported_keys.



10
11
12
# File 'lib/renogen/config.rb', line 10

def supported_keys
  @supported_keys
end

#validationsObject

Returns the value of attribute validations.



10
11
12
# File 'lib/renogen/config.rb', line 10

def validations
  @validations
end

Class Method Details

.configure {|instance| ... } ⇒ Object

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

Yields:

  • (instance)


27
28
29
# File 'lib/renogen/config.rb', line 27

def self.configure
  yield instance
end