Class: Dogen::Configuration
- Inherits:
-
Object
- Object
- Dogen::Configuration
- Defined in:
- lib/dogen/configuration.rb
Defined Under Namespace
Classes: SetConfigError
Constant Summary collapse
- CONFIG_FILE_NAME =
'.dogenrc'
Instance Method Summary collapse
Instance Method Details
#clear ⇒ Object
21 22 23 |
# File 'lib/dogen/configuration.rb', line 21 def clear File.write(config_file, {}.to_yaml) end |
#get ⇒ Object
10 11 12 |
# File 'lib/dogen/configuration.rb', line 10 def get File.exist?(config_file) ? load_configuration : {} end |
#set(hash) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/dogen/configuration.rb', line 14 def set(hash) raise SetConfigError, 'argument is not kind of hash' unless hash.kind_of?(Hash) updated_config = get.merge(hash) save_configuration(updated_config) end |