Class: Bottle::Filename
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
private
Returns the value of attribute name.
-
#rebuild ⇒ Object
readonly
private
Returns the value of attribute rebuild.
-
#tag ⇒ Object
readonly
private
Returns the value of attribute tag.
-
#version ⇒ Object
readonly
private
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
- #extname ⇒ String private
- #github_packages ⇒ Object
- #initialize(name, version, tag, rebuild) ⇒ void constructor private
- #json ⇒ String private
- #to_str ⇒ String private
- #url_encode ⇒ Object
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.
297 298 299 300 301 302 303 304 305 306 |
# File 'software_spec.rb', line 297 def initialize(name, version, tag, rebuild) @name = File.basename name 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 = tag.to_s @rebuild = rebuild end |
Instance Attribute Details
#name ⇒ Object (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.
Returns the value of attribute name.
289 290 291 |
# File 'software_spec.rb', line 289 def name @name end |
#rebuild ⇒ Object (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.
Returns the value of attribute rebuild.
289 290 291 |
# File 'software_spec.rb', line 289 def rebuild @rebuild end |
#tag ⇒ Object (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.
Returns the value of attribute tag.
289 290 291 |
# File 'software_spec.rb', line 289 def tag @tag end |
#version ⇒ Object (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.
Returns the value of attribute version.
289 290 291 |
# File 'software_spec.rb', line 289 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.
292 293 294 |
# File 'software_spec.rb', line 292 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.
330 331 332 333 |
# File 'software_spec.rb', line 330 def extname s = rebuild.positive? ? ".#{rebuild}" : "" ".#{tag}.bottle#{s}.tar.gz" end |
#github_packages ⇒ Object
325 326 327 |
# File 'software_spec.rb', line 325 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.
317 318 319 |
# File 'software_spec.rb', line 317 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.
309 310 311 |
# File 'software_spec.rb', line 309 def to_str "#{name}--#{version}#{extname}" end |
#url_encode ⇒ Object
321 322 323 |
# File 'software_spec.rb', line 321 def url_encode ERB::Util.url_encode("#{name}-#{version}#{extname}") end |