lib/synvert/cli.rb in synvert-0.18.0 vs lib/synvert/cli.rb in synvert-0.18.1

- old
+ new

@@ -245,11 +245,11 @@ puts "===== #{snippet_name} done =====" elsif json_output? group, name = snippet_name.split('/') rewriter = Core::Rewriter.call group, name output = { - affected_files: rewriter.affected_files.union(rewriter.sub_snippets.sum([], &:affected_files)).to_a, + affected_files: rewriter.affected_files.union(rewriter.sub_snippets.sum(Set.new, &:affected_files)).to_a, warnings: rewriter.warnings.union(rewriter.sub_snippets.sum([], &:warnings)), todo: rewriter.todo } puts JSON.generate(output) end @@ -257,20 +257,20 @@ # execute snippet def execute_snippet input = STDIN.read if plain_output? - puts "===== execute started =====" + puts '===== execute started =====' rewriter = eval(input) rewriter.warnings.each do |warning| puts '[Warn] ' + warning.message end puts rewriter.todo if rewriter.todo - puts "===== execute done =====" + puts '===== execute done =====' elsif json_output? rewriter = eval(input) output = { - affected_files: rewriter.affected_files.union(rewriter.sub_snippets.sum([], &:affected_files)).to_a, + affected_files: rewriter.affected_files.union(rewriter.sub_snippets.sum(Set.new, &:affected_files)).to_a, warnings: rewriter.warnings.union(rewriter.sub_snippets.sum([], &:warnings)), todo: rewriter.todo } puts JSON.generate(output) end