From 4cf54c24a3302304eb441a1de6b791a6c5c5dcca Mon Sep 17 00:00:00 2001 From: Aaron Spettl Date: Thu, 23 Aug 2018 18:38:13 +0200 Subject: [PATCH 1/2] Fix warnings regarding unused and shadowed variables --- lib/dns/zone.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/dns/zone.rb b/lib/dns/zone.rb index 8e6fcee..574adb2 100644 --- a/lib/dns/zone.rb +++ b/lib/dns/zone.rb @@ -35,7 +35,7 @@ def initialize # @api public def soa # return the first SOA we find in the records array. - rr = @records.find { |rr| rr.type == "SOA" } + rr = @records.find { |record| record.type == "SOA" } return rr if rr # otherwise create a new SOA rr = DNS::Zone::RR::SOA.new @@ -131,7 +131,6 @@ def self.extract_entries(string) # with a ";" (semicolon). entries = [] - mode = :line entry = '' parentheses_ref_count = 0 @@ -150,9 +149,6 @@ def self.extract_entries(string) quotes = entry.count('"') has_quotes = quotes > 0 - parentheses = entry.count('()') - has_parentheses = parentheses > 0 - if has_quotes character_strings = entry.scan(/("(?:[^"\\]+|\\.)*")/).join(' ') without = entry.gsub(/"((?:[^"\\]+|\\.)*)"/, '') From 07f62e19cb93c812790db9a4d5c42aeeebf40a6f Mon Sep 17 00:00:00 2001 From: Aaron Spettl Date: Thu, 23 Aug 2018 18:38:51 +0200 Subject: [PATCH 2/2] Fix minitest deprecation warning --- test/rr/record_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rr/record_test.rb b/test/rr/record_test.rb index 3be879b..be225dc 100644 --- a/test/rr/record_test.rb +++ b/test/rr/record_test.rb @@ -5,7 +5,7 @@ class RR_Record_Test < DNS::Zone::TestCase def test_rr_record_defaults rr = DNS::Zone::RR::Record.new assert_equal '@', rr.label, 'label is @, by default' - assert_equal nil, rr.ttl, 'ttl is nil, by default' + assert_nil rr.ttl, 'ttl is nil, by default' end def test_rr_record_with_label