Skip to content

Commit

Permalink
Add upstream JSON generator modules
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Feb 9, 2024
1 parent 664935c commit a7961a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/determine-test-runners.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def self.determine_test_runners

github_output = ENV.fetch("GITHUB_OUTPUT")
File.open(github_output, "a") do |f|
f.puts("runners=#{T.unsafe(runners).to_json}")
f.puts("runners=#{runners.to_json}")
f.puts("runners_present=#{runners.present?}")
end
end
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/requirements/macos_requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def display_s

def to_json(options)
comp = @comparator.to_s
return T.unsafe({ comp => @version.map(&:to_s) }).to_json(options) if @version.is_a?(Array)
return { comp => @version.map(&:to_s) }.to_json(options) if @version.is_a?(Array)

T.unsafe({ comp => [@version.to_s] }).to_json(options)
{ comp => [@version.to_s] }.to_json(options)
end
end
9 changes: 8 additions & 1 deletion Library/Homebrew/sorbet/rbi/upstream.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# This file contains temporary definitions for fixes that have
# been submitted upstream to https://github.com/sorbet/sorbet.

# https://github.com/sorbet/sorbet/pull/7682
class Array
include JSON::Ext::Generator::GeneratorMethods::Array
end
class Hash
include JSON::Ext::Generator::GeneratorMethods::Hash
end

# https://github.com/sorbet/sorbet/pull/7650
class Etc::Group < Struct
sig { returns(Integer) }
Expand All @@ -14,7 +22,6 @@ class Etc::Group < Struct
sig { returns(String) }
def passwd; end
end

# https://github.com/sorbet/sorbet/pull/7647
module IRB
sig { params(ap_path: T.nilable(String), argv: T::Array[String]).void }
Expand Down

0 comments on commit a7961a5

Please sign in to comment.