Merge pull request #10540 from cdalvaro/feature/brew_info_add_full_token_for_casks
Add full_token and tap entries to cask json output
This commit is contained in:
commit
78f54b060c
@ -169,6 +169,8 @@ module Cask
|
|||||||
def to_h
|
def to_h
|
||||||
{
|
{
|
||||||
"token" => token,
|
"token" => token,
|
||||||
|
"full_token" => full_name,
|
||||||
|
"tap" => tap&.name,
|
||||||
"name" => name,
|
"name" => name,
|
||||||
"desc" => desc,
|
"desc" => desc,
|
||||||
"homepage" => homepage,
|
"homepage" => homepage,
|
||||||
|
|||||||
@ -1766,6 +1766,7 @@ class Formula
|
|||||||
hsh = {
|
hsh = {
|
||||||
"name" => name,
|
"name" => name,
|
||||||
"full_name" => full_name,
|
"full_name" => full_name,
|
||||||
|
"tap" => tap&.name,
|
||||||
"oldname" => oldname,
|
"oldname" => oldname,
|
||||||
"aliases" => aliases.sort,
|
"aliases" => aliases.sort,
|
||||||
"versioned_formulae" => versioned_formulae.map(&:name),
|
"versioned_formulae" => versioned_formulae.map(&:name),
|
||||||
|
|||||||
@ -84,10 +84,10 @@ describe Cask::Cmd::List, :cask do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "lists json" do
|
describe "lists json" do
|
||||||
let(:casks) { ["local-caffeine", "local-transmission"] }
|
let(:casks) { ["local-caffeine", "local-transmission", "third-party/tap/third-party-cask"] }
|
||||||
let(:expected_output) {
|
let(:expected_output) {
|
||||||
<<~EOS
|
<<~EOS
|
||||||
[{"token":"local-caffeine","name":[],"desc":null,"homepage":"https://brew.sh/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/caffeine.zip","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94","artifacts":[["Caffeine.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"local-transmission","name":["Transmission"],"desc":"BitTorrent client","homepage":"https://transmissionbt.com/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg","appcast":null,"version":"2.61","installed":"2.61","outdated":false,"sha256":"e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68","artifacts":[["Transmission.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null}]
|
[{"token":"local-caffeine","full_token":"local-caffeine","tap":"homebrew/cask","name":[],"desc":null,"homepage":"https://brew.sh/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/caffeine.zip","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94","artifacts":[["Caffeine.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"local-transmission","full_token":"local-transmission","tap":"homebrew/cask","name":["Transmission"],"desc":"BitTorrent client","homepage":"https://transmissionbt.com/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg","appcast":null,"version":"2.61","installed":"2.61","outdated":false,"sha256":"e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68","artifacts":[["Transmission.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"third-party-cask","full_token":"third-party/tap/third-party-cask","tap":"third-party/tap","name":[],"desc":null,"homepage":"https://brew.sh/","url":"https://brew.sh/ThirdParty.dmg","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b","artifacts":[["ThirdParty.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null}]
|
||||||
EOS
|
EOS
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ describe Cask::Cmd::List, :cask do
|
|||||||
|
|
||||||
it "of given Casks" do
|
it "of given Casks" do
|
||||||
expect {
|
expect {
|
||||||
described_class.run("--json", "local-caffeine", "local-transmission")
|
described_class.run("--json", "local-caffeine", "local-transmission", "third-party/tap/third-party-cask")
|
||||||
}.to output(expected_output).to_stdout
|
}.to output(expected_output).to_stdout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -838,6 +838,7 @@ describe Formula do
|
|||||||
expect(h).to be_a(Hash)
|
expect(h).to be_a(Hash)
|
||||||
expect(h["name"]).to eq("foo")
|
expect(h["name"]).to eq("foo")
|
||||||
expect(h["full_name"]).to eq("foo")
|
expect(h["full_name"]).to eq("foo")
|
||||||
|
expect(h["tap"]).to eq("homebrew/core")
|
||||||
expect(h["versions"]["stable"]).to eq("1.0")
|
expect(h["versions"]["stable"]).to eq("1.0")
|
||||||
expect(h["versions"]["bottle"]).to be_truthy
|
expect(h["versions"]["bottle"]).to be_truthy
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user