From f07a49b67dcc1e2bad21d7c8f476af0df9e52151 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Sun, 27 Jan 2019 00:15:29 -0500 Subject: Applied Rubocop rules that I like - Other linting configuration also applied. - Soft-deprecating versions older than 2.3. --- bin/htmldiff | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'bin/htmldiff') 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 -- cgit v1.2.1