Method: Ronin::DB::ConfigFile.edit
- Defined in:
- lib/ronin/db/config_file.rb
.edit(path = PATH) {|yaml| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Opens the configuration file and edits it's contents.
127 128 129 130 131 132 133 134 135 |
# File 'lib/ronin/db/config_file.rb', line 127 def self.edit(path=PATH,&block) unless File.file?(path) # create the parent directory for YAML::Store FileUtils.mkdir_p(File.dirname(path)) end store = YAML::Store.new(path) store.transaction(&block) end |