Sha256: 27a5bc982ab51fdbb817d5815d159a2fb9b4fee91cbe5004276106141a2049b1
Contents?: true
Size: 648 Bytes
Versions: 1
Compression:
Stored size: 648 Bytes
Contents
module Aocli module Config module_function def add_config(key:, value:) config = load_config.merge({key => value}) File.write(Aocli::Values::CONFIG_FILE_PATH, config.to_yaml) end def value_for(key) load_config[key] end def load_config unless File.exist?(Aocli::Values::CONFIG_FILE_PATH) Aocli::FileUtils.touch_file(Aocli::Values::CONFIG_FILE_PATH) end YAML.load_file(Aocli::Values::CONFIG_FILE_PATH, fallback: {}) end def remove_config(key) config = load_config File.write(Aocli::Values::CONFIG_FILE_PATH, config.except(key).to_yaml) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aocli-1.5.0 | lib/aocli/config.rb |