Class: Bottle::Filename Private
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Instance Attribute Summary collapse
- #name ⇒ String readonly private
- #rebuild ⇒ Integer readonly private
- #tag ⇒ String readonly private
- #version ⇒ PkgVersion readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #extname ⇒ String private
- #github_packages ⇒ String private
- #initialize(name, version, tag, rebuild) ⇒ void constructor private
- #json ⇒ String private
- #to_str ⇒ String private
- #url_encode ⇒ String private
Constructor Details
#initialize(name, version, tag, rebuild) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
23 24 25 26 27 28 29 30 31 32 |
# File 'bottle.rb', line 23 def initialize(name, version, tag, rebuild) @name = T.let(File.basename(name), String) raise ArgumentError, "Invalid bottle name" unless Utils.safe_filename?(@name) raise ArgumentError, "Invalid bottle version" unless Utils.safe_filename?(version.to_s) @version = version @tag = T.let(tag.to_unstandardized_sym.to_s, String) @rebuild = rebuild end |
Instance Attribute Details
#name ⇒ String (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
9 10 11 |
# File 'bottle.rb', line 9 def name @name end |
#rebuild ⇒ Integer (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
15 16 17 |
# File 'bottle.rb', line 15 def rebuild @rebuild end |
#tag ⇒ String (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
9 10 11 |
# File 'bottle.rb', line 9 def tag @tag end |
#version ⇒ PkgVersion (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
12 13 14 |
# File 'bottle.rb', line 12 def version @version end |
Class Method Details
.create(formula, tag, rebuild) ⇒ T.attached_class
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
18 19 20 |
# File 'bottle.rb', line 18 def self.create(formula, tag, rebuild) new(formula.name, formula.pkg_version, tag, rebuild) end |
Instance Method Details
#extname ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
58 59 60 61 |
# File 'bottle.rb', line 58 def extname s = rebuild.positive? ? ".#{rebuild}" : "" ".#{tag}.bottle#{s}.tar.gz" end |
#github_packages ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
53 54 55 |
# File 'bottle.rb', line 53 def github_packages "#{name}--#{version}#{extname}" end |
#json ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
43 44 45 |
# File 'bottle.rb', line 43 def json "#{name}--#{version}.#{tag}.bottle.json" end |
#to_str ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
35 36 37 |
# File 'bottle.rb', line 35 def to_str "#{name}--#{version}#{extname}" end |
#url_encode ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
48 49 50 |
# File 'bottle.rb', line 48 def url_encode ERB::Util.url_encode("#{name}-#{version}#{extname}") end |