Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
5d38cd72
Unverified
Commit
5d38cd72
authored
4 years ago
by
Sean Molenaar
Browse files
Options
Downloads
Patches
Plain Diff
cask/list: fix artifact list
parent
535e7dc8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/cask/cmd/list.rb
+12
-4
12 additions, 4 deletions
Library/Homebrew/cask/cmd/list.rb
Library/Homebrew/test/cask/cmd/list_spec.rb
+2
-2
2 additions, 2 deletions
Library/Homebrew/test/cask/cmd/list_spec.rb
with
14 additions
and
6 deletions
Library/Homebrew/cask/cmd/list.rb
+
12
−
4
View file @
5d38cd72
# frozen_string_literal: true
require
"cask/artifact/relocated"
module
Cask
class
Cmd
class
List
<
AbstractCommand
...
...
@@ -48,17 +50,23 @@ module Cask
elsif
versions
puts
output
.
map
(
&
method
(
:format_versioned
))
elsif
!
output
.
empty?
&&
casks
.
any?
puts
output
.
map
(
&
method
(
:list_artifacts
))
output
.
map
(
&
method
(
:list_artifacts
))
elsif
!
output
.
empty?
puts
Formatter
.
columns
(
output
.
map
(
&
:to_s
))
end
end
def
self
.
list_artifacts
(
cask
)
cask
.
artifacts
.
group_by
(
&
:class
).
each
do
|
klass
,
artifacts
|
next
unless
klass
.
respond_to?
(
:english_description
)
cask
.
artifacts
.
group_by
(
&
:class
).
sort_by
{
|
klass
,
_
|
klass
.
english_name
}.
each
do
|
klass
,
artifacts
|
next
if
[
Artifact
::
Uninstall
,
Artifact
::
Zap
].
include?
klass
ohai
klass
.
english_name
artifacts
.
each
do
|
artifact
|
puts
artifact
.
summarize_installed
if
artifact
.
respond_to?
(
:summarize_installed
)
next
if
artifact
.
respond_to?
(
:summarize_installed
)
return
"==>
#{
klass
.
english_description
}
"
,
artifacts
.
map
(
&
:summarize_installed
)
puts
artifact
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/cask/cmd/list_spec.rb
+
2
−
2
View file @
5d38cd72
...
...
@@ -126,9 +126,9 @@ describe Cask::Cmd::List, :cask do
expect
{
described_class
.
run
(
"local-transmission"
,
"local-caffeine"
)
}.
to
output
(
<<~
EOS
).
to_stdout
==> App
s
==> App
#{
transmission
.
config
.
appdir
.
join
(
"Transmission.app"
)
}
(
#{
transmission
.
config
.
appdir
.
join
(
"Transmission.app"
).
abv
}
)
==> App
s
==> App
Missing App:
#{
caffeine
.
config
.
appdir
.
join
(
"Caffeine.app"
)
}
EOS
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment