lib/kosmos.rb in kosmos-0.0.3 vs lib/kosmos.rb in kosmos-0.0.4
- old
+ new
@@ -37,11 +37,12 @@
private
def write_config(opts)
FileUtils.touch(config_path)
- File.open(config_path, "r+") do |file|
- file.write JSON.pretty_generate(read_config.merge(opts))
+ config_to_write = JSON.pretty_generate(read_config.merge(opts))
+ File.open(config_path, "w") do |file|
+ file.write config_to_write
end
end
def read_config
FileUtils.touch(config_path)