From 75eadd513e6ff4189f4017e6c3fae04b47da4b45 Mon Sep 17 00:00:00 2001 From: Matt Rideout Date: Tue, 7 Oct 2025 15:49:06 -0400 Subject: [PATCH 1/5] Allow modern versions of bundler --- dns-zone.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns-zone.gemspec b/dns-zone.gemspec index e9ac75b..f6d901c 100644 --- a/dns-zone.gemspec +++ b/dns-zone.gemspec @@ -24,7 +24,7 @@ spec = Gem::Specification.new do |s| # cross platform gem dependencies #s.add_dependency('gli') #s.add_dependency('paint') - s.add_development_dependency('bundler', '~> 1.0') + s.add_development_dependency('bundler', '>= 1.0') s.add_development_dependency('rake', '>= 9.0') s.add_development_dependency('minitest', '~> 5.0') s.add_development_dependency('simplecov', '~> 0.7.1') From 4aeb8109c022f202c54add77b2e2df1c26f8ee3f Mon Sep 17 00:00:00 2001 From: Matt Rideout Date: Tue, 7 Oct 2025 16:03:28 -0400 Subject: [PATCH 2/5] Fix frozen string literal warnings for Ruby 3.4 compatibility --- lib/dns/zone.rb | 10 +++++----- lib/dns/zone/rr.rb | 2 +- lib/dns/zone/rr/record.rb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/dns/zone.rb b/lib/dns/zone.rb index 8e6fcee..4c0a070 100644 --- a/lib/dns/zone.rb +++ b/lib/dns/zone.rb @@ -59,7 +59,7 @@ def dump content << rr.dump end - content.join("\n") << "\n" + content.join("\n") + "\n" end # Generates pretty output of the zone and its records. @@ -75,7 +75,7 @@ def dump_pretty last_type = rr.type end - content.join("\n") << "\n" + content.join("\n") + "\n" end # Load the provided zone file data into a new DNS::Zone object. @@ -132,7 +132,7 @@ def self.extract_entries(string) entries = [] mode = :line - entry = '' + entry = String.new parentheses_ref_count = 0 @@ -140,7 +140,7 @@ def self.extract_entries(string) # strip comments unless escaped # strip comments, unless its escaped. # skip semicolons within "quote segments" (TXT records) - line = line.gsub(/((? Date: Tue, 7 Oct 2025 16:08:51 -0400 Subject: [PATCH 3/5] Replace the deprecated 'assert_equal nil' pattern with assert_nil --- 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 From 88b0eb83964266e73c9d5213ed2895ac4a121cca Mon Sep 17 00:00:00 2001 From: Matt Rideout Date: Tue, 7 Oct 2025 16:28:40 -0400 Subject: [PATCH 4/5] Update minimum Ruby version to 2.4 and minimum simplecov version to 0.17 - Bump required_ruby_version from 2.0 to 2.4 - Update simplecov from ~> 0.7.1 to >= 0.17 (fixes Fixnum compatibility) - Update .travis.yml to test Ruby 2.4-3.4 - Remove obsolete Travis CI settings (sudo, rbx) SimpleCov 0.17+ requires Ruby 2.4+. --- .travis.yml | 16 +++++++++------- dns-zone.gemspec | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index ea70447..4f700d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,11 @@ -# configuration settings for http://travis-ci.org -sudo: false - language: ruby rvm: - - 2.2.4 - - 2.1.8 - - 2.0.0 - - rbx + - 2.4 + - 2.5 + - 2.6 + - 2.7 + - 3.0 + - 3.1 + - 3.2 + - 3.3 + - 3.4 diff --git a/dns-zone.gemspec b/dns-zone.gemspec index f6d901c..0ccc83c 100644 --- a/dns-zone.gemspec +++ b/dns-zone.gemspec @@ -19,7 +19,7 @@ spec = Gem::Specification.new do |s| #s.default_executable = 'dns-zone' # min ruby version - s.required_ruby_version = ::Gem::Requirement.new(">= 2.0") + s.required_ruby_version = ::Gem::Requirement.new(">= 2.4") # cross platform gem dependencies #s.add_dependency('gli') @@ -27,7 +27,7 @@ spec = Gem::Specification.new do |s| s.add_development_dependency('bundler', '>= 1.0') s.add_development_dependency('rake', '>= 9.0') s.add_development_dependency('minitest', '~> 5.0') - s.add_development_dependency('simplecov', '~> 0.7.1') + s.add_development_dependency('simplecov', '>= 0.17') s.add_development_dependency('yard', '~> 0.8') s.add_development_dependency('inch', '~> 0.6') s.add_development_dependency('guard-minitest', '~> 2.0') From 5607403737cf8d5f87415739fc582cc33ee2372a Mon Sep 17 00:00:00 2001 From: Matt Rideout Date: Tue, 7 Oct 2025 16:37:39 -0400 Subject: [PATCH 5/5] Update history doc to show recent changes --- HISTORY.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 0f3430d..77288ab 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,13 @@ ## HEAD +* Add Ruby 3.4 compatibility +* Fix frozen string literal warnings by avoiding in-place string mutations +* Update minimum Ruby version to 2.4 (from 2.0) +* Update SimpleCov dependency to >= 0.17 (from ~> 0.7.1) +* Update Bundler dependency to >= 1.0 (from ~> 1.0) to allow modern versions +* Update Travis CI config to test Ruby 2.4-3.4 +* Fix deprecated Minitest assertion (use assert_nil instead of assert_equal nil) + ## 0.3.1 (2015-12-23) * Fix edge case when zone file has multiple `ORIGIN` directives.