summaryrefslogtreecommitdiff
path: root/bin
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 23:26:05 -0500
commit45ea1b30c7de0ad840f72afb82fd41eb2b9590db (patch)
tree22f879cbd21a183bac5c17f754c0aa598531d968 /bin
parent07ed577eba341f0ff0d7eebf4c1c2cc23083cba7 (diff)
downloaddiff-lcs-45ea1b30c7de0ad840f72afb82fd41eb2b9590db.tar.gz
Applied Rubocop rules that I like
- Other linting configuration also applied. - Soft-deprecating versions older than 2.3.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/htmldiff11
-rwxr-xr-xbin/ldiff5
2 files changed, 11 insertions, 5 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
diff --git a/bin/ldiff b/bin/ldiff
index a9b876f..f4734f5 100755
--- a/bin/ldiff
+++ b/bin/ldiff
@@ -1,6 +1,9 @@
-#!ruby -w
+#! /usr/bin/env ruby -w
+# frozen_string_literal: true
require 'diff/lcs'
require 'diff/lcs/ldiff'
exit Diff::LCS::Ldiff.run(ARGV)
+
+# vim: ft=ruby