Created
November 3, 2016 16:06
-
-
Save jeremyf/d3f83d65fc7e61b27e34b84560f85367 to your computer and use it in GitHub Desktop.
deep_merge_two_yaml_files.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'activesupport' | |
require 'active_support/core_ext/hash/deep_merge' | |
require 'psych' | |
first_hash = Psych.load_file(PATH_TO_FIRST_FILE) | |
second_hash = Psych.load_file(PATH_TO_SECOND_FILE) | |
File.write(PATH_TO_MERGED_FILE, Psych.dump(first_hash.deep_merge(second_hash))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment