Class: Hbc::Container::Naked

Inherits:
Base
  • Object
show all
Defined in:
Library/Homebrew/cask/lib/hbc/container/naked.rb

Direct Known Subclasses

Executable, Otf, Pkg, Ttf

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#extract_nested_container, #extract_nested_inside, #initialize, #verbose?

Constructor Details

This class inherits a constructor from Hbc::Container::Base

Class Method Details

.me?Boolean

Either inherit from this class and override with self.me?(criteria), or use this class directly as “container type: :naked”, in which case self.me? is not called.

Returns:

  • (Boolean)


9
10
11
# File 'Library/Homebrew/cask/lib/hbc/container/naked.rb', line 9

def self.me?(*)
  false
end

Instance Method Details

#extractObject



13
14
15
# File 'Library/Homebrew/cask/lib/hbc/container/naked.rb', line 13

def extract
  @command.run!("/usr/bin/ditto", args: ["--", @path, @cask.staged_path.join(target_file)])
end

#target_fileObject



17
18
19
20
# File 'Library/Homebrew/cask/lib/hbc/container/naked.rb', line 17

def target_file
  return @path.basename if @nested
  CGI.unescape(File.basename(@cask.url.path))
end