Class: Bottle
Defined Under Namespace
Classes: Filename
Instance Attribute Summary collapse
-
#cellar ⇒ Object
readonly
private
Returns the value of attribute cellar.
-
#name ⇒ Object
readonly
private
Returns the value of attribute name.
-
#rebuild ⇒ Object
readonly
private
Returns the value of attribute rebuild.
-
#resource ⇒ Object
readonly
private
Returns the value of attribute resource.
-
#tag ⇒ Object
readonly
private
Returns the value of attribute tag.
Instance Method Summary collapse
- #clear_cache ⇒ Object
- #compatible_locations? ⇒ Boolean
- #fetch(verify_download_integrity: true) ⇒ Object
- #fetch_tab ⇒ Object
- #filename ⇒ Filename private
-
#initialize(formula, spec, tag = nil) ⇒ Bottle
constructor
A new instance of Bottle.
-
#skip_relocation? ⇒ Boolean
private
Does the bottle need to be relocated?.
- #stage ⇒ Object
- #tab_attributes ⇒ Object
Constructor Details
#initialize(formula, spec, tag = nil) ⇒ Bottle
Returns a new instance of Bottle.
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'software_spec.rb', line 343 def initialize(formula, spec, tag = nil) @name = formula.name @resource = Resource.new @resource.owner = formula @spec = spec tag_spec = spec.tag_specification_for(Utils::Bottles.tag(tag)) @tag = tag_spec.tag @cellar = tag_spec.cellar @rebuild = spec.rebuild @resource.version(formula.pkg_version.to_s) @resource.checksum = tag_spec.checksum @fetch_tab_retried = false root_url(spec.root_url, spec.root_url_specs) end |
Instance Attribute Details
#cellar ⇒ 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 cellar.
338 339 340 |
# File 'software_spec.rb', line 338 def cellar @cellar end |
#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.
338 339 340 |
# File 'software_spec.rb', line 338 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.
338 339 340 |
# File 'software_spec.rb', line 338 def rebuild @rebuild end |
#resource ⇒ 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 resource.
338 339 340 |
# File 'software_spec.rb', line 338 def resource @resource 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.
338 339 340 |
# File 'software_spec.rb', line 338 def tag @tag end |
Instance Method Details
#clear_cache ⇒ Object
372 373 374 375 376 |
# File 'software_spec.rb', line 372 def clear_cache @resource.clear_cache github_packages_manifest_resource&.clear_cache @fetch_tab_retried = false end |
#compatible_locations? ⇒ Boolean
378 379 380 |
# File 'software_spec.rb', line 378 def compatible_locations? @spec.compatible_locations?(tag: @tag) end |
#fetch(verify_download_integrity: true) ⇒ Object
363 364 365 366 367 368 369 370 |
# File 'software_spec.rb', line 363 def fetch(verify_download_integrity: true) @resource.fetch(verify_download_integrity:) rescue DownloadError raise unless fallback_on_error fetch_tab retry end |
#fetch_tab ⇒ Object
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'software_spec.rb', line 391 def fetch_tab return if github_packages_manifest_resource.blank? github_packages_manifest_resource.fetch rescue DownloadError raise unless fallback_on_error retry rescue ArgumentError raise if @fetch_tab_retried @fetch_tab_retried = true github_packages_manifest_resource.clear_cache retry end |
#filename ⇒ Filename
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.
414 415 416 |
# File 'software_spec.rb', line 414 def filename Filename.create(resource.owner, @tag, @spec.rebuild) end |
#skip_relocation? ⇒ Boolean
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.
Does the bottle need to be relocated?
383 384 385 |
# File 'software_spec.rb', line 383 def skip_relocation? @spec.skip_relocation?(tag: @tag) end |
#stage ⇒ Object
387 388 389 |
# File 'software_spec.rb', line 387 def stage resource.downloader.stage end |
#tab_attributes ⇒ Object
407 408 409 410 411 |
# File 'software_spec.rb', line 407 def tab_attributes return {} unless github_packages_manifest_resource&.downloaded? github_packages_manifest_resource.tab end |