summaryrefslogtreecommitdiff
path: root/bin/htmldiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2019-01-27 00:15:29 -0500
committerAustin Ziegler <austin@zieglers.ca>2019-01-27 11:08:38 -0500
commitf07a49b67dcc1e2bad21d7c8f476af0df9e52151 (patch)
tree532caf445578eacb98ae84da344d2e879c8c3c6d /bin/htmldiff
parent07ed577eba341f0ff0d7eebf4c1c2cc23083cba7 (diff)
downloaddiff-lcs-rubocop.tar.gz
Applied Rubocop rules that I likerubocop
- Other linting configuration also applied. - Soft-deprecating versions older than 2.3.
Diffstat (limited to 'bin/htmldiff')
-rwxr-xr-xbin/htmldiff11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/htmldiff b/bin/htmldiff
index 1e4efe7..14114a7 100755
--- a/bin/htmldiff
+++ b/bin/htmldiff
@@ -1,4 +1,5 @@
-#!ruby -w
+#! /usr/bin/env ruby -w
+# frozen_string_literal: true
require 'diff/lcs'
require 'diff/lcs/htmldiff'
@@ -10,8 +11,8 @@ rescue LoadError
end
if ARGV.size < 2 or ARGV.size > 3
- $stderr.puts "usage: #{File.basename($0)} old new [output.html]"
- $stderr.puts " #{File.basename($0)} old new > output.html"
+ warn "usage: #{File.basename($0)} old new [output.html]"
+ warn " #{File.basename($0)} old new > output.html"
exit 127
end
@@ -23,10 +24,12 @@ options = { :title => "diff #{ARGV[0]} #{ARGV[1]}" }
htmldiff = Diff::LCS::HTMLDiff.new(left, right, options)
if ARGV[2]
- File.open(ARGV[2], "w") do |f|
+ File.open(ARGV[2], 'w') do |f|
htmldiff.options[:output] = f
htmldiff.run
end
else
htmldiff.run
end
+
+# vim: ft=ruby