diff options
author | Austin Ziegler <austin@zieglers.ca> | 2019-01-27 00:15:29 -0500 |
---|---|---|
committer | Austin Ziegler <austin@zieglers.ca> | 2019-01-27 23:26:05 -0500 |
commit | 45ea1b30c7de0ad840f72afb82fd41eb2b9590db (patch) | |
tree | 22f879cbd21a183bac5c17f754c0aa598531d968 /bin | |
parent | 07ed577eba341f0ff0d7eebf4c1c2cc23083cba7 (diff) | |
download | diff-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-x | bin/htmldiff | 11 | ||||
-rwxr-xr-x | bin/ldiff | 5 |
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 @@ -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 |