Browse Source

allow linkables to be set to none

sometimes it doesn't make sense for a cask to link anything out to the
Applications dir
phinze 12 years ago
parent
commit
021c6afb73
  1. 2
      Casks/adobe-air.rb
  2. 4
      lib/cask/dsl.rb
  3. 10
      test/cask/dsl_test.rb

2
Casks/adobe-air.rb

@ -6,4 +6,6 @@ class AdobeAir < Cask
#caveat 'You need to run {{install_path}}/AdobeAIRInstaller.app to actually install Adobe AIR'
sha1 '8fbd2dffc20442903d8b51e7362a3191f39752b4'
link :app, :none
end

4
lib/cask/dsl.rb

@ -34,8 +34,12 @@ module Cask::DSL
end
def link(type, *files)
if files == [:none]
linkables[type] = []
else
linkables[type] += files
end
end
attr_reader :sums

10
test/cask/dsl_test.rb

@ -59,4 +59,14 @@ describe Cask::DSL do
instance = CaskWithLinkables.new
Array(instance.linkables[:app]).must_equal %w[Foo.app Bar.app]
end
it "allow linkables to be set to empty" do
CaskWithNoLinkables = Class.new(Cask)
CaskWithNoLinkables.class_eval do
link :app, :none
end
instance = CaskWithNoLinkables.new
Array(instance.linkable_apps).must_equal %w[]
end
end

Loading…
Cancel
Save