From 97106cdd1f0885aa5f9d53dd0ec95bcfe481ef8b Mon Sep 17 00:00:00 2001 From: Daniel Levy Date: Mon, 3 Dec 2018 13:29:44 -0800 Subject: [PATCH] Fix Warnings When Running Rake Test --- lib/twine/formatters/django.rb | 1 - lib/twine/formatters/jquery.rb | 2 +- lib/twine/plugin.rb | 2 +- lib/twine/runner.rb | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/twine/formatters/django.rb b/lib/twine/formatters/django.rb index e9775c8..87d16fe 100644 --- a/lib/twine/formatters/django.rb +++ b/lib/twine/formatters/django.rb @@ -18,7 +18,6 @@ module Twine key_regex = /msgid *"(.*)"$/ value_regex = /msgstr *"(.*)"$/m - last_comment = nil while line = io.gets comment_match = comment_regex.match(line) if comment_match diff --git a/lib/twine/formatters/jquery.rb b/lib/twine/formatters/jquery.rb index 34bcad5..2712782 100644 --- a/lib/twine/formatters/jquery.rb +++ b/lib/twine/formatters/jquery.rb @@ -41,7 +41,7 @@ module Twine def format_sections(twine_file, lang) sections = twine_file.sections.map { |section| format_section(section, lang) } - sections.delete_if &:empty? + sections.delete_if(&:empty?) sections.join(",\n\n") end diff --git a/lib/twine/plugin.rb b/lib/twine/plugin.rb index c696223..ab841f9 100644 --- a/lib/twine/plugin.rb +++ b/lib/twine/plugin.rb @@ -57,7 +57,7 @@ module Twine end def join_path *paths - File.expand_path File.join *paths + File.expand_path File.join(*paths) end end end diff --git a/lib/twine/runner.rb b/lib/twine/runner.rb index bfba1fa..ca84e7d 100644 --- a/lib/twine/runner.rb +++ b/lib/twine/runner.rb @@ -299,7 +299,7 @@ module Twine end def find_formatter(&block) - formatters = Formatters.formatters.select &block + formatters = Formatters.formatters.select(&block) if formatters.empty? return nil elsif formatters.size > 1