Class: Bottle
- Extended by:
- Forwardable
- Includes:
- Downloadable
- Defined in:
- software_spec.rb,
sorbet/rbi/dsl/bottle.rbi
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.
Attributes included from Downloadable
Instance Method Summary collapse
- #bottle_size ⇒ Integer? private
- #cached_download(*args, &block) ⇒ T.untyped private
- #clear_cache ⇒ void private
- #compatible_locations? ⇒ Boolean
- #downloader(*args, &block) ⇒ T.untyped private
- #fetch(verify_download_integrity: true, timeout: nil, quiet: false) ⇒ Pathname private
- #fetch_tab(timeout: nil, quiet: false) ⇒ Object
- #filename ⇒ Filename private
- #github_packages_manifest_resource ⇒ Resource::BottleManifest? private
-
#initialize(formula, spec, tag = nil) ⇒ Bottle
constructor
A new instance of Bottle.
- #installed_size ⇒ Integer? private
-
#skip_relocation? ⇒ Boolean
private
Does the bottle need to be relocated?.
- #stage ⇒ Object
- #tab_attributes ⇒ Object
- #url(*args, &block) ⇒ T.untyped private
- #verify_download_integrity(*args, &block) ⇒ T.untyped private
Methods included from Downloadable
#download_name, #download_strategy, #download_type, #downloaded?, #freeze, #initialize_dup, #version
Methods included from Context
current, current=, #debug?, #quiet?, #verbose?, #with_context
Constructor Details
#initialize(formula, spec, tag = nil) ⇒ Bottle
Returns a new instance of Bottle.
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'software_spec.rb', line 357 def initialize(formula, spec, tag = nil) super() @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.
352 353 354 |
# File 'software_spec.rb', line 352 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.
352 353 354 |
# File 'software_spec.rb', line 352 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.
352 353 354 |
# File 'software_spec.rb', line 352 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.
352 353 354 |
# File 'software_spec.rb', line 352 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.
352 353 354 |
# File 'software_spec.rb', line 352 def tag @tag end |
Instance Method Details
#bottle_size ⇒ Integer?
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.
440 441 442 443 444 445 |
# File 'software_spec.rb', line 440 def bottle_size resource = github_packages_manifest_resource return unless resource&.downloaded? resource.bottle_size end |
#cached_download(*args, &block) ⇒ T.untyped
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.
10 |
# File 'sorbet/rbi/dsl/bottle.rbi', line 10 def cached_download(*args, &block); end |
#clear_cache ⇒ 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.
This method returns an undefined value.
396 397 398 399 400 |
# File 'software_spec.rb', line 396 def clear_cache @resource.clear_cache github_packages_manifest_resource&.clear_cache @fetch_tab_retried = false end |
#compatible_locations? ⇒ Boolean
402 403 404 |
# File 'software_spec.rb', line 402 def compatible_locations? @spec.compatible_locations?(tag: @tag) end |
#downloader(*args, &block) ⇒ T.untyped
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.
13 |
# File 'sorbet/rbi/dsl/bottle.rbi', line 13 def downloader(*args, &block); end |
#fetch(verify_download_integrity: true, timeout: nil, quiet: false) ⇒ Pathname
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.
386 387 388 389 390 391 392 393 |
# File 'software_spec.rb', line 386 def fetch(verify_download_integrity: true, timeout: nil, quiet: false) resource.fetch(verify_download_integrity:, timeout:, quiet:) rescue DownloadError raise unless fallback_on_error fetch_tab retry end |
#fetch_tab(timeout: nil, quiet: false) ⇒ Object
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'software_spec.rb', line 413 def fetch_tab(timeout: nil, quiet: false) return unless (resource = github_packages_manifest_resource) begin resource.fetch(timeout:, quiet:) rescue DownloadError raise unless fallback_on_error retry rescue Resource::BottleManifest::Error raise if @fetch_tab_retried @fetch_tab_retried = true resource.clear_cache retry end 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.
456 457 458 |
# File 'software_spec.rb', line 456 def filename Filename.create(resource.owner, @tag, @spec.rebuild) end |
#github_packages_manifest_resource ⇒ Resource::BottleManifest?
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.
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
# File 'software_spec.rb', line 461 def github_packages_manifest_resource return if @resource.download_strategy != CurlGitHubPackagesDownloadStrategy @github_packages_manifest_resource ||= begin resource = Resource::BottleManifest.new(self) version_rebuild = GitHubPackages.version_rebuild(@resource.version, rebuild) resource.version(version_rebuild) image_name = GitHubPackages.image_formula_name(@name) image_tag = GitHubPackages.image_version_rebuild(version_rebuild) resource.url( "#{root_url}/#{image_name}/manifests/#{image_tag}", using: CurlGitHubPackagesDownloadStrategy, headers: ["Accept: application/vnd.oci.image.index.v1+json"], ) T.cast(resource.downloader, CurlGitHubPackagesDownloadStrategy).resolved_basename = "#{name}-#{version_rebuild}.bottle_manifest.json" resource end end |
#installed_size ⇒ Integer?
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.
448 449 450 451 452 453 |
# File 'software_spec.rb', line 448 def installed_size resource = github_packages_manifest_resource return unless resource&.downloaded? resource.installed_size 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?
407 408 409 |
# File 'software_spec.rb', line 407 def skip_relocation? @spec.skip_relocation?(tag: @tag) end |
#stage ⇒ Object
411 |
# File 'software_spec.rb', line 411 def stage = downloader.stage |
#tab_attributes ⇒ Object
431 432 433 434 435 436 437 |
# File 'software_spec.rb', line 431 def tab_attributes if (resource = github_packages_manifest_resource) && resource.downloaded? return resource.tab end {} end |
#url(*args, &block) ⇒ T.untyped
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.
16 |
# File 'sorbet/rbi/dsl/bottle.rbi', line 16 def url(*args, &block); end |
#verify_download_integrity(*args, &block) ⇒ T.untyped
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.
19 |
# File 'sorbet/rbi/dsl/bottle.rbi', line 19 def verify_download_integrity(*args, &block); end |