Merge pull request #18664 from hyuraku/remove-Cask-Config-explicit_s

remove Cask::Config.explicit_s
This commit is contained in:
Bo Anderson 2024-10-30 17:19:31 +00:00 committed by GitHub
commit 27b9062530
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 21 deletions

View File

@ -188,23 +188,6 @@ module Cask
self.class.new(explicit: other.explicit.merge(explicit))
end
# Get explicit configuration as a string.
#
# @api internal
#
# TODO: This is only used by `homebrew/bundle`, so move it there.
sig { returns(String) }
def explicit_s
explicit.map do |key, value|
# inverse of #env - converts :languages config key back to --language flag
if key == :languages
key = "language"
value = T.cast(explicit.fetch(:languages, []), T::Array[String]).join(",")
end
"#{key}: \"#{value.to_s.sub(/^#{Dir.home}/, "~")}\""
end.join(", ")
end
sig { params(options: T.untyped).returns(String) }
def to_json(*options)
{

View File

@ -71,10 +71,6 @@ RSpec.describe Cask::Config, :cask do
it "returns array of preferred languages" do
expect(config.explicit[:languages]).to eq(["zh-TW", "en"])
end
it "returns string of explicit config keys and values" do
expect(config.explicit_s).to eq('appdir: "/explicit/path/to/apps", language: "zh-TW,en"')
end
end
context "when installing a cask and then adding a global default dir" do