homebrew-cask-versions/lib/cask/artifact.rb
phinze c03ada18ec support for nested containers
- this allows us to support casks for things like "dmg in zip" "zip in
   tar", etc, etc
 - a nested container can be any format that homebrew-cask supports
 - the existing container support is now referred to as a Cask's
   "primary container"
 - use the `nested_container` artifact type to indicate the relative
   path to a nested container that you wanted extracted
 - multiple layers of nesting should work with multiple nested_container
   directives (though this is untested as yet)
 - add SpeedDownload as the first cask to use this feature; refs #602
2013-10-19 16:20:00 -05:00

27 lines
600 B
Ruby

module Cask::Artifact; end
require 'cask/artifact/base'
require 'cask/artifact/app'
require 'cask/artifact/nested_container'
require 'cask/artifact/pkg'
require 'cask/artifact/prefpane'
module Cask::Artifact
#
# NOTE: order is important here, since we want to extract nested containers
# before we handle any other artifacts
#
def self.artifacts
[
Cask::Artifact::NestedContainer,
Cask::Artifact::App,
Cask::Artifact::Pkg,
Cask::Artifact::Prefpane,
]
end
def self.for_cask(cask)
artifacts.select { |artifact| artifact.me?(cask) }
end
end