Class: PolyglotCli::IO::Config
- Inherits:
-
Object
- Object
- PolyglotCli::IO::Config
- Extended by:
- Helper::Terminal
- Defined in:
- lib/polyglot_cli/io/config.rb
Constant Summary collapse
- CONFIG_FILE_PATH =
"#{Dir.pwd}/.polyglot.yml".freeze
Class Method Summary collapse
Methods included from Helper::Terminal
Class Method Details
.read ⇒ Object
14 15 16 17 |
# File 'lib/polyglot_cli/io/config.rb', line 14 def read prompt.say("Reading config from #{CONFIG_FILE_PATH}") YAML.load_file(CONFIG_FILE_PATH) end |
.write(data) ⇒ Object
9 10 11 12 |
# File 'lib/polyglot_cli/io/config.rb', line 9 def write(data) prompt.say("Writing config to #{CONFIG_FILE_PATH}") File.open(CONFIG_FILE_PATH, 'w') { |f| YAML.dump(data, f) } end |