Class: Poper2::ConfigFile
- Inherits:
-
Object
- Object
- Poper2::ConfigFile
- Defined in:
- lib/poper2/config_file.rb
Constant Summary collapse
- EMPTY =
{ 'disallow_single_word' => { 'enabled' => true }, 'character_limit' => { 'enabled' => true, 'number' => 72 }, 'summary_character_limit' => { 'enabled' => true, 'number' => 50 }, 'disallow_generic' => { 'enabled' => true, 'words' => %w[fix fixed fixes oops todo fixme commit changes hm hmm hmmm test tests quickfix] }, 'enforce_capitalized' => { 'enabled' => true } }.freeze
Instance Method Summary collapse
-
#initialize(path = '.poper.yml') ⇒ ConfigFile
constructor
A new instance of ConfigFile.
- #to_h ⇒ Object
Constructor Details
#initialize(path = '.poper.yml') ⇒ ConfigFile
Returns a new instance of ConfigFile.
25 26 27 |
# File 'lib/poper2/config_file.rb', line 25 def initialize(path = '.poper.yml') @path = path end |
Instance Method Details
#to_h ⇒ Object
29 30 31 32 |
# File 'lib/poper2/config_file.rb', line 29 def to_h hash = File.exist?(@path) ? YAML.load_file(@path) : {} deep_merge(hash) end |