Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL: remove support for container_type #7429

Merged
merged 1 commit into from
Nov 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ class NakedExecutable < TestCask
url TestHelper.local_binary_url('naked_executable')
homepage 'http://example.com/naked-executable'

container_type :naked
container :type => :naked
end