Skip to content

Commit

Permalink
Merge pull request #7429 from rolandwalker/remove_container_type
Browse files Browse the repository at this point in the history
DSL: remove support for `container_type`
  • Loading branch information
rolandwalker committed Nov 19, 2014
2 parents 1f24c7e + e31264d commit c15fdad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
16 changes: 1 addition & 15 deletions lib/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def depends_on; self.class.depends_on; end

def conflicts_with; self.class.conflicts_with; end

def container_type; self.class.container_type; end

def container; self.class.container; end

def tags; self.class.tags; end
Expand Down Expand Up @@ -91,14 +89,6 @@ def gpg(*args)
end
end

# todo: remove this backwards compatibility element after 0.50.0
def container_type(type=nil)
if @container_type and !type.nil?
raise CaskInvalidError.new(self.title, "'container_type' stanza may only appear once")
end
@container_type ||= type
end

def container(*args)
if @container and !args.empty?
# todo: remove this constraint, and instead merge multiple container stanzas
Expand All @@ -109,12 +99,8 @@ def container(*args)
rescue StandardError => e
raise CaskInvalidError.new(self.title, e)
end
# todo: remove this backwards compatibility section after removing container_type
if @container.type
@container_type ||= @container.type
end
# todo: remove this backwards compatibility section after removing nested_container
if @container.nested
if @container and @container.nested
artifacts[:nested_container] << @container.nested
end
@container
Expand Down
4 changes: 2 additions & 2 deletions lib/cask/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def download
def extract_primary_container
odebug "Extracting primary container"
FileUtils.mkdir_p @cask.staged_path
container = if @cask.container_type
Cask::Container.from_type(@cask.container_type)
container = if @cask.container and @cask.container.type
Cask::Container.from_type(@cask.container.type)
else
Cask::Container.for_path(@downloaded_path, @command)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cask/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def dumpcask
:caveats,
:depends_on,
:conflicts_with,
:container_type,
:container,
:gpg,
].each do |method|
odebug "Cask instance method '#{method}':", self.send(method).to_yaml
Expand Down
2 changes: 1 addition & 1 deletion test/support/Casks/naked-executable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
url TestHelper.local_binary_url('naked_executable')
homepage 'http://example.com/naked-executable'

container_type :naked
container :type => :naked
end

0 comments on commit c15fdad

Please sign in to comment.