Skip to content

Instantly share code, notes, and snippets.

@rafapolo
Last active October 19, 2023 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafapolo/c6aeec0b2928260f41200357198c79d6 to your computer and use it in GitHub Desktop.
Save rafapolo/c6aeec0b2928260f41200357198c79d6 to your computer and use it in GitHub Desktop.
theoretical merge in between YAMLs to avoid redundant data
require 'yaml'
# Load the base YAML file
base_data = YAML.load(File.read('config.yml'))
# Load the new data from a separate YAML file
version7_data = YAML.load(File.read('new_data.yml'))
# Merge the original data with the new data, overwriting the specified keys
actual_data = base_data.merge(version7_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment