From f9e74f373d9248847b3b5ecba05c8a90e535e13c Mon Sep 17 00:00:00 2001 From: Eric Amorde Date: Mon, 6 Jul 2026 13:13:27 -0700 Subject: [PATCH 1/3] Update fixtures for newer JSON format --- Gemfile.lock | 33 ++++++++++++----------- spec/fixtures/CannonPodder14.podspec.json | 4 +-- spec/fixtures/CannonPodder15.podspec.json | 4 +-- spec/fixtures/CannonPodder16.podspec.json | 4 +-- spec/fixtures/CannonPodder17.podspec.json | 4 +-- spec/fixtures/CannonPodder18.podspec.json | 4 +-- spec/specification/json_spec.rb | 6 ++++- 7 files changed, 27 insertions(+), 32 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 422a75e6b..49f4e1563 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (7.2.2) + activesupport (7.2.3.1) base64 benchmark (>= 0.3) bigdecimal @@ -24,7 +24,7 @@ GEM drb i18n (>= 1.6, < 2) logger (>= 1.4.2) - minitest (>= 5.1) + minitest (>= 5.1, < 6) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) addressable (2.9.0) @@ -36,25 +36,26 @@ GEM awesome_print (1.9.2) bacon (1.2.0) base64 (0.1.2) - benchmark (0.3.0) - bigdecimal (3.1.8) + benchmark (0.5.0) + bigdecimal (4.1.2) coderay (1.1.3) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) + concurrent-ruby (1.3.7) + connection_pool (3.0.2) crack (1.0.1) bigdecimal rexml - drb (2.2.1) - ethon (0.16.0) + drb (2.2.3) + ethon (0.18.0) ffi (>= 1.15.0) - ffi (1.17.0) + logger + ffi (1.17.4) fuzzy_match (2.0.4) hashdiff (1.2.1) httpclient (2.9.0) mutex_m - i18n (1.14.6) + i18n (1.15.2) concurrent-ruby (~> 1.0) - json (2.7.5) + json (2.20.0) kicker (3.0.0) listen (~> 1.3.0) notify (~> 0.5.2) @@ -63,10 +64,10 @@ GEM rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) rb-kqueue (>= 0.2) - logger (1.6.1) + logger (1.7.0) metaclass (0.0.4) method_source (1.0.0) - minitest (5.25.1) + minitest (5.27.0) mocha (1.4.0) metaclass (~> 0.0.1) mocha-on-bacon (0.2.3) @@ -114,10 +115,10 @@ GEM rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.13.0) - securerandom (0.3.1) + securerandom (0.4.1) strscan (3.1.8) - typhoeus (1.4.1) - ethon (>= 0.9.0) + typhoeus (1.6.0) + ethon (>= 0.18.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) diff --git a/spec/fixtures/CannonPodder14.podspec.json b/spec/fixtures/CannonPodder14.podspec.json index 609385c83..2a47cdb05 100644 --- a/spec/fixtures/CannonPodder14.podspec.json +++ b/spec/fixtures/CannonPodder14.podspec.json @@ -35,9 +35,7 @@ ] }, "dependencies": { - "OCMock": [ - - ] + "OCMock": [] } } ] diff --git a/spec/fixtures/CannonPodder15.podspec.json b/spec/fixtures/CannonPodder15.podspec.json index 609385c83..2a47cdb05 100644 --- a/spec/fixtures/CannonPodder15.podspec.json +++ b/spec/fixtures/CannonPodder15.podspec.json @@ -35,9 +35,7 @@ ] }, "dependencies": { - "OCMock": [ - - ] + "OCMock": [] } } ] diff --git a/spec/fixtures/CannonPodder16.podspec.json b/spec/fixtures/CannonPodder16.podspec.json index 609385c83..2a47cdb05 100644 --- a/spec/fixtures/CannonPodder16.podspec.json +++ b/spec/fixtures/CannonPodder16.podspec.json @@ -35,9 +35,7 @@ ] }, "dependencies": { - "OCMock": [ - - ] + "OCMock": [] } } ] diff --git a/spec/fixtures/CannonPodder17.podspec.json b/spec/fixtures/CannonPodder17.podspec.json index 609385c83..2a47cdb05 100644 --- a/spec/fixtures/CannonPodder17.podspec.json +++ b/spec/fixtures/CannonPodder17.podspec.json @@ -35,9 +35,7 @@ ] }, "dependencies": { - "OCMock": [ - - ] + "OCMock": [] } } ] diff --git a/spec/fixtures/CannonPodder18.podspec.json b/spec/fixtures/CannonPodder18.podspec.json index 609385c83..2a47cdb05 100644 --- a/spec/fixtures/CannonPodder18.podspec.json +++ b/spec/fixtures/CannonPodder18.podspec.json @@ -35,9 +35,7 @@ ] }, "dependencies": { - "OCMock": [ - - ] + "OCMock": [] } } ] diff --git a/spec/specification/json_spec.rb b/spec/specification/json_spec.rb index 9951fc9c6..c75173b42 100644 --- a/spec/specification/json_spec.rb +++ b/spec/specification/json_spec.rb @@ -112,11 +112,15 @@ module Pod end it 'maintains correct order of keys across versions' do + # json < 2.8.0 renders empty arrays and objects across multiple + # lines, newer versions render them compactly as [] / {}, so + # normalize empty collections before comparing. + normalize = ->(s) { s.gsub(/\[\s+\]/, '[]').gsub(/\{\s+\}/, '{}') } %w(14 15 16 17 18).each do |version| json = File.read(File.expand_path("../../fixtures/CannonPodder#{version}.podspec.json", __FILE__)) loaded_spec = Specification.from_json(json) new_json = loaded_spec.to_pretty_json - new_json.should.equal json + normalize.call(new_json).should.equal normalize.call(json) end end end From 6649f9f840bd52b08d87bd94f9f5fd69ea2e5f6d Mon Sep 17 00:00:00 2001 From: Eric Amorde Date: Mon, 6 Jul 2026 13:18:42 -0700 Subject: [PATCH 2/3] Fix a crash when run against certain activesupport versions --- CHANGELOG.md | 4 +++- lib/cocoapods-core.rb | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb0cfbb79..6dea858f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ ##### Bug Fixes -* None. +* Fix a crash when running with certain activesupport versions. + [Eric Amorde](https://github.com/amorde) + [#781](https://github.com/CocoaPods/Core/pull/781) ## 1.16.2 (2024-10-31) diff --git a/lib/cocoapods-core.rb b/lib/cocoapods-core.rb index 2b9d8edfd..b255bf8da 100644 --- a/lib/cocoapods-core.rb +++ b/lib/cocoapods-core.rb @@ -14,6 +14,8 @@ class Informative < PlainInformative; end require 'pathname' require 'cocoapods-core/vendor' + # Fix for crash when importing certain activesupport versions + require 'logger' require 'active_support' require 'active_support/core_ext' From 229685025f90470670d2ec15933959e9b4a30847 Mon Sep 17 00:00:00 2001 From: Eric Amorde Date: Mon, 6 Jul 2026 13:22:12 -0700 Subject: [PATCH 3/3] Add log for current Ruby version to Rake task --- Rakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rakefile b/Rakefile index 73687a9ed..202e30de8 100644 --- a/Rakefile +++ b/Rakefile @@ -50,6 +50,8 @@ begin end task :all do + puts "\033[0;32mUsing #{`ruby --version`}\033[0m" + title 'Running Unit Tests' sh "bundle exec bacon #{specs('**')}"