Class: Rig::Command::Main
- Defined in:
- lib/rig/command.rb
Instance Method Summary collapse
Methods inherited from Abstract
#execute, #instance_list, #print_table
Instance Method Details
#merge_file(src, dest) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rig/command.rb', line 10 def merge_file(src, dest) old = YAML.load_file(dest) FileUtils.mv(dest, "#{dest}.bak.#{Time.now.to_i}") new = YAML.load_file(src) new.merge!(old) File.open(dest, "w") {|f| f.write(new.to_yaml)} end |