Skip to content

Commit 478f392

Browse files
author
Sam Goldstein
committed
Remove windows specific exec. Open2.capture3 should work on all
platforms.
1 parent ff2103d commit 478f392

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

lib/diffy/diff.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@ def diff
4949
[string1, string2]
5050
end
5151

52-
if WINDOWS
53-
# don't use open3 on windows
54-
cmd = sprintf '"%s" %s %s', diff_bin, diff_options.join(' '), @paths.map { |s| %("#{s}") }.join(' ')
55-
diff = `#{cmd}`
56-
else
57-
diff = Open3.popen3(diff_bin, *(diff_options + @paths)) { |i, o, e| o.read }
58-
end
52+
diff, stderr, process_status = Open3.capture3(diff_bin, *(diff_options + @paths))
5953
diff.force_encoding('ASCII-8BIT') if diff.respond_to?(:valid_encoding?) && !diff.valid_encoding?
6054
if diff =~ /\A\s*\Z/ && !options[:allow_empty_diff]
6155
diff = case options[:source]

0 commit comments

Comments
 (0)