Convert self.artifacts to TYPES.
This commit is contained in:
parent
4a4a162223
commit
ac4969c331
@ -27,8 +27,7 @@ module Hbc
|
|||||||
module Artifact
|
module Artifact
|
||||||
# NOTE: order is important here, since we want to extract nested containers
|
# NOTE: order is important here, since we want to extract nested containers
|
||||||
# before we handle any other artifacts
|
# before we handle any other artifacts
|
||||||
def self.artifacts
|
TYPES = [
|
||||||
[
|
|
||||||
PreflightBlock,
|
PreflightBlock,
|
||||||
NestedContainer,
|
NestedContainer,
|
||||||
Installer,
|
Installer,
|
||||||
@ -53,13 +52,12 @@ module Hbc
|
|||||||
Uninstall,
|
Uninstall,
|
||||||
PostflightBlock,
|
PostflightBlock,
|
||||||
Zap,
|
Zap,
|
||||||
]
|
].freeze
|
||||||
end
|
|
||||||
|
|
||||||
def self.for_cask(cask, command: SystemCommand, force: false)
|
def self.for_cask(cask, command: SystemCommand, force: false)
|
||||||
odebug "Determining which artifacts are present in Cask #{cask}"
|
odebug "Determining which artifacts are present in Cask #{cask}"
|
||||||
|
|
||||||
artifacts
|
TYPES
|
||||||
.select { |klass| klass.me?(cask) }
|
.select { |klass| klass.me?(cask) }
|
||||||
.map { |klass| klass.new(cask, command: command, force: force) }
|
.map { |klass| klass.new(cask, command: command, force: force) }
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user