From 87c78735c7d20c7e3693029900f6136dd53fb036 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 18:32:47 +0000 Subject: [PATCH 1/6] build(deps-dev): bump json from 2.7.6 to 2.8.1 in /Library/Homebrew Bumps [json](https://github.com/ruby/json) from 2.7.6 to 2.8.1. - [Release notes](https://github.com/ruby/json/releases) - [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md) - [Commits](https://github.com/ruby/json/compare/v2.7.6...v2.8.1) --- updated-dependencies: - dependency-name: json dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Library/Homebrew/Gemfile.lock | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 77fa15111e72a..e419aa399545e 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -14,7 +14,7 @@ GEM bindata (~> 2) erubi (1.13.0) hana (1.3.7) - json (2.7.6) + json (2.8.1) json_schemer (2.3.0) bigdecimal hana (~> 1.3) @@ -146,7 +146,6 @@ GEM PLATFORMS aarch64-linux - arm-linux arm64-darwin x86_64-darwin x86_64-linux From a81b6a4b444794f3241db45ae1d9294cbba3973e Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:07:45 +0000 Subject: [PATCH 2/6] brew vendor-gems: commit updates. --- Library/Homebrew/Gemfile.lock | 1 + Library/Homebrew/vendor/bundle/bundler/setup.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index e419aa399545e..ab6ac2c08179a 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -146,6 +146,7 @@ GEM PLATFORMS aarch64-linux + arm-linux arm64-darwin x86_64-darwin x86_64-linux diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 865fea1837269..23627b6b1474b 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -47,8 +47,8 @@ def self.extension_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/elftools-1.3.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/erubi-1.13.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/hana-1.3.7/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/json-2.7.6") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.7.6/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/json-2.8.1") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.8.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/regexp_parser-2.9.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simpleidn-0.2.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json_schemer-2.3.0/lib") From c17ffb8c3bb23241b2f7e625bf8aafc8a3a9f5d4 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 7 Nov 2024 09:11:00 -0800 Subject: [PATCH 3/6] Try matching key type --- Library/Homebrew/cmd/outdated.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 17232e8dd4a24..9427fc0c5f424 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -62,13 +62,12 @@ def run end json = { - "formulae" => json_info(formulae), - "casks" => json_info(casks), + formulae: json_info(formulae), + casks: json_info(casks), } puts JSON.pretty_generate(json) outdated = formulae + casks - else outdated = if args.formula? outdated_formulae @@ -170,10 +169,7 @@ def json_version(version) "v1" => :v1, "v2" => :v2, } - - raise UsageError, "invalid JSON version: #{version}" unless version_hash.include?(version) - - version_hash[version] + version_hash.fetch(version) { raise UsageError, "invalid JSON version: #{version}" } end sig { returns(T::Array[Formula]) } From acb4eddaca739d84ea3b9e4b2186a7eaa99f1b13 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 7 Nov 2024 09:34:44 -0800 Subject: [PATCH 4/6] Allow multiple JSON outputs --- Library/Homebrew/test/cmd/outdated_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index c2af5d43b9aa2..94749286423c0 100644 --- a/Library/Homebrew/test/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cmd/outdated_spec.rb @@ -20,9 +20,12 @@ }], casks: [], }) + # json v2.8.1 is inconsistent it how it renders empty arrays, + # for now we allow multiple outputs: + alternate_json = expected_json.gsub("[]", "[\n\n]") expect { brew "outdated", "--json=v2" } - .to output("#{expected_json}\n").to_stdout + .to output(match(/\A(#{Regexp.escape(expected_json)}|#{Regexp.escape(alternate_json)})\n\z/)).to_stdout .and be_a_success end end From ebe1e504da00bac4ae4b2a25f2cc2049fbbdc2d9 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 7 Nov 2024 11:16:47 -0800 Subject: [PATCH 5/6] Change command output instead --- Library/Homebrew/cmd/outdated.rb | 4 +++- Library/Homebrew/test/cmd/outdated_spec.rb | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 9427fc0c5f424..2c7e7000d1622 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -65,7 +65,9 @@ def run formulae: json_info(formulae), casks: json_info(casks), } - puts JSON.pretty_generate(json) + # json v2.8.1 is inconsistent it how it renders empty arrays, + # so we use `[]` for consistency: + puts JSON.pretty_generate(json).gsub(/\[\n\n\s*\]/, "[]") outdated = formulae + casks else diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index 94749286423c0..c2af5d43b9aa2 100644 --- a/Library/Homebrew/test/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cmd/outdated_spec.rb @@ -20,12 +20,9 @@ }], casks: [], }) - # json v2.8.1 is inconsistent it how it renders empty arrays, - # for now we allow multiple outputs: - alternate_json = expected_json.gsub("[]", "[\n\n]") expect { brew "outdated", "--json=v2" } - .to output(match(/\A(#{Regexp.escape(expected_json)}|#{Regexp.escape(alternate_json)})\n\z/)).to_stdout + .to output("#{expected_json}\n").to_stdout .and be_a_success end end From ba3f4267262da31b3358621ac1cf12651c0516fa Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 7 Nov 2024 13:00:38 -0800 Subject: [PATCH 6/6] clean up fixture --- Library/Homebrew/test/support/fixtures/cask/everything.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Library/Homebrew/test/support/fixtures/cask/everything.json b/Library/Homebrew/test/support/fixtures/cask/everything.json index d290bd45d16ea..60c1abab72c16 100644 --- a/Library/Homebrew/test/support/fixtures/cask/everything.json +++ b/Library/Homebrew/test/support/fixtures/cask/everything.json @@ -1,9 +1,7 @@ { "token": "everything", "full_token": "everything", - "old_tokens": [ - - ], + "old_tokens": [], "tap": "homebrew/cask", "name": [ "Everything"