Sha256: 22cd2e23f32fc866785f5e884ad6c31f8b0dc8148657554d2c2827e6dbe8fcb3
Contents?: true
Size: 502 Bytes
Versions: 3
Compression:
Stored size: 502 Bytes
Contents
# encoding: UTF-8 module Bunch class TreeMerge def initialize(left, right) @left, @right = left, right end def result @path = [] @output = @right.dup @left.accept(self) @output end def enter_tree(tree) @path << tree.name if tree.name end def leave_tree(tree) @path.pop if tree.name end def visit_file(file) file_path = [*@path, file.path].join("/") @output.write file_path, file.content end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
bunch-1.0.0pre3 | lib/bunch/tree_merge.rb |
bunch-1.0.0pre2 | lib/bunch/tree_merge.rb |
bunch-1.0.0pre1 | lib/bunch/tree_merge.rb |