Skip to content

Instantly share code, notes, and snippets.

@ancorgs
Created March 7, 2016 07: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 ancorgs/e74a92381d9af960ed69 to your computer and use it in GitHub Desktop.
Save ancorgs/e74a92381d9af960ed69 to your computer and use it in GitHub Desktop.
# This is a follow up on https://gist.github.com/ancorgs/c371a33177c6cf8d6d8e
# Yes Josef, instead of 2 lines, I would also prefer something like
# graph1 = BlaBlaFactory.load_yaml_file(input_file1)
# But that's not the point here
graph1 = Storage::Devicegraph.new
Yast::Storage::FakeDeviceFactory.load_yaml_file(graph1,input_file1)
graph2 = Storage::Devicegraph.new
Yast::Storage::FakeDeviceFactory.load_yaml_file(graph2,input_file2)
calculator = GraphUnionCalculator.new(graph1, graph2)
union = calculator.union
Yast::Storage::YamlWriter.write(union, output_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment