remove support for `link` artifact
* `app`, `suite`, and `artifact no longer implemented as synonyms for `link` * backward-compatible code/comments removed * creates class `Cask::Artifact::Suite` * updates `brew cask info` to show specific artifact type * fixes stray "Generic artifact" messages
This commit is contained in:
parent
4d46f26447
commit
b837d6c552
|
@ -19,6 +19,7 @@ require 'cask/artifact/prefpane'
|
|||
require 'cask/artifact/qlplugin'
|
||||
require 'cask/artifact/widget'
|
||||
require 'cask/artifact/service'
|
||||
require 'cask/artifact/suite'
|
||||
require 'cask/artifact/caskroom_only'
|
||||
require 'cask/artifact/input_method'
|
||||
require 'cask/artifact/internet_plugin'
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
class Cask::Artifact::App < Cask::Artifact::Symlinked
|
||||
# todo remove this backward compatibility override
|
||||
def self.artifact_dsl_key
|
||||
:link
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
class Cask::Artifact::Artifact < Cask::Artifact::Symlinked
|
||||
def self.link_type_english_name
|
||||
def self.artifact_english_name
|
||||
'Generic artifact'
|
||||
end
|
||||
|
||||
# todo remove this backward compatibility override
|
||||
def self.artifact_dsl_key
|
||||
:link
|
||||
end
|
||||
|
||||
# todo remove this backward compatibility override
|
||||
def self.artifact_dirmethod
|
||||
@artifact_dirmethod ||= :appdir
|
||||
end
|
||||
|
||||
# todo remove this backward compatibility override
|
||||
def summary
|
||||
{}
|
||||
:appdir
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
class Cask::Artifact::Suite < Cask::Artifact::Symlinked
|
||||
def self.artifact_english_name
|
||||
'App Suite'
|
||||
end
|
||||
|
||||
def self.artifact_dirmethod
|
||||
:appdir
|
||||
end
|
||||
end
|
|
@ -13,7 +13,7 @@ class Cask::CLI::InternalStanza < Cask::CLI::InternalUseBase
|
|||
# Examples
|
||||
#
|
||||
# brew cask _stanza appcast --table
|
||||
# brew cask _stanza link --table alfred google-chrome adium voicemac logisim vagrant
|
||||
# brew cask _stanza app --table alfred google-chrome adium voicemac logisim vagrant
|
||||
# brew cask _stanza url --table alfred google-chrome adium voicemac logisim vagrant
|
||||
# brew cask _stanza version --table alfred google-chrome adium voicemac logisim vagrant
|
||||
# brew cask _stanza artifacts --table --inspect alfred google-chrome adium voicemac logisim vagrant
|
||||
|
@ -22,7 +22,9 @@ class Cask::CLI::InternalStanza < Cask::CLI::InternalUseBase
|
|||
|
||||
# todo: this should be retrievable from Cask::DSL
|
||||
ARTIFACTS = Set.new([
|
||||
:link,
|
||||
:app,
|
||||
:suite,
|
||||
:artifact,
|
||||
:prefpane,
|
||||
:qlplugin,
|
||||
:font,
|
||||
|
|
|
@ -214,9 +214,6 @@ module Cask::DSL
|
|||
# semantics.
|
||||
STANZA_ALIASES = {
|
||||
:pkg => :install, # todo remove
|
||||
:app => :link, # todo upgrade
|
||||
:suite => :link, # todo upgrade
|
||||
:artifact => :link, # todo upgrade
|
||||
:preflight => :before_install, # todo remove
|
||||
:postflight => :after_install, # todo remove
|
||||
:uninstall_preflight => :before_uninstall, # todo remove
|
||||
|
@ -225,7 +222,6 @@ module Cask::DSL
|
|||
|
||||
def self.ordinary_artifact_types
|
||||
@@ordinary_artifact_types ||= [
|
||||
:link, # todo remove
|
||||
:app,
|
||||
:suite,
|
||||
:artifact,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module Cask::Staged
|
||||
def info_plist
|
||||
"#{staged_path}/#{@cask.artifacts[:link].first.first}/Contents/Info.plist"
|
||||
"#{staged_path}/#{@cask.artifacts[:app].first.first}/Contents/Info.plist"
|
||||
end
|
||||
|
||||
def plist_exec(cmd)
|
||||
|
|
|
@ -10,7 +10,7 @@ describe Cask::CLI::Info do
|
|||
Not installed
|
||||
https://github.com/caskroom/homebrew-testcasks/blob/master/Casks/local-caffeine.rb
|
||||
==> Contents
|
||||
Caffeine.app (link)
|
||||
Caffeine.app (app)
|
||||
CLIOUTPUT
|
||||
end
|
||||
|
||||
|
@ -22,13 +22,13 @@ describe Cask::CLI::Info do
|
|||
Not installed
|
||||
https://github.com/caskroom/homebrew-testcasks/blob/master/Casks/local-caffeine.rb
|
||||
==> Contents
|
||||
Caffeine.app (link)
|
||||
Caffeine.app (app)
|
||||
local-transmission: 2.61
|
||||
http://example.com/local-transmission
|
||||
Not installed
|
||||
https://github.com/caskroom/homebrew-testcasks/blob/master/Casks/local-transmission.rb
|
||||
==> Contents
|
||||
Transmission.app (link)
|
||||
Transmission.app (app)
|
||||
CLIOUTPUT
|
||||
end
|
||||
|
||||
|
@ -54,7 +54,7 @@ describe Cask::CLI::Info do
|
|||
Not installed
|
||||
https://github.com/caskroom/homebrew-testcasks/blob/master/Casks/with-caveats.rb
|
||||
==> Contents
|
||||
Caffeine.app (link)
|
||||
Caffeine.app (app)
|
||||
==> Caveats
|
||||
Here are some things you might want to know.
|
||||
|
||||
|
@ -78,7 +78,7 @@ describe Cask::CLI::Info do
|
|||
Not installed
|
||||
https://github.com/caskroom/homebrew-testcasks/blob/master/Casks/with-conditional-caveats.rb
|
||||
==> Contents
|
||||
Caffeine.app (link)
|
||||
Caffeine.app (app)
|
||||
CLIOUTPUT
|
||||
end
|
||||
|
||||
|
|
|
@ -54,14 +54,14 @@ describe Cask::DSL do
|
|||
end
|
||||
|
||||
instance = CaskWithApps.new
|
||||
Array(instance.artifacts[:link]).sort.must_equal [['Bar.app'], ['Foo.app']]
|
||||
Array(instance.artifacts[:app]).sort.must_equal [['Bar.app'], ['Foo.app']]
|
||||
end
|
||||
|
||||
it "allow app stanzas to be empty" do
|
||||
CaskWithNoApps = Class.new(Cask)
|
||||
|
||||
instance = CaskWithNoApps.new
|
||||
Array(instance.artifacts[:link]).must_equal %w[]
|
||||
Array(instance.artifacts[:app]).must_equal %w[]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue