aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli
diff options
context:
space:
mode:
authorMarkus Reiter2017-10-04 17:08:35 +0200
committerMarkus Reiter2017-10-04 18:47:55 +0200
commit51a0de6368974eb3476369b819c3823feebebdce (patch)
tree9cd1dc66b7d489042e08577aa372c6afa828594f /Library/Homebrew/cask/lib/hbc/cli
parent2c7ef064e4ff0833ac94a4f18f5049ad17c30b7c (diff)
downloadbrew-51a0de6368974eb3476369b819c3823feebebdce.tar.bz2
Directly save artifacts in DSL.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/info.rb10
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/list.rb2
2 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/info.rb b/Library/Homebrew/cask/lib/hbc/cli/info.rb
index 2b4db9530..f12fe5564 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/info.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/info.rb
@@ -77,11 +77,11 @@ module Hbc
def self.artifact_info(cask)
ohai "Artifacts"
- DSL::ORDINARY_ARTIFACT_CLASSES.flat_map { |klass| klass.for_cask(cask) }
- .select { |artifact| artifact.respond_to?(:install_phase) }
- .each do |artifact|
- puts artifact.to_s
- end
+ cask.artifacts.each do |artifact|
+ next unless artifact.respond_to?(:install_phase)
+ next unless DSL::ORDINARY_ARTIFACT_CLASSES.include?(artifact.class)
+ puts artifact.to_s
+ end
end
end
end
diff --git a/Library/Homebrew/cask/lib/hbc/cli/list.rb b/Library/Homebrew/cask/lib/hbc/cli/list.rb
index 32415af8a..4b6a25d01 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/list.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/list.rb
@@ -30,7 +30,7 @@ module Hbc
end
def self.list_artifacts(cask)
- Artifact.for_cask(cask).group_by(&:class).each do |klass, artifacts|
+ cask.artifacts.group_by(&:class).each do |klass, artifacts|
next unless klass.respond_to?(:english_description)
ohai klass.english_description, artifacts.map(&:summarize_installed)
end