Class: Resource::BottleManifest Private

Inherits:
Resource
  • Object
show all
Defined in:
resource.rb

Overview

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.

A resource for a bottle manifest.

Defined Under Namespace

Classes: Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bottle) ⇒ 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.

Parameters:



380
381
382
383
384
# File 'resource.rb', line 380

def initialize(bottle)
  super("#{bottle.name}_bottle_manifest")
  @bottle = bottle
  @manifest_annotations = T.let(nil, T.nilable(T::Hash[String, T.untyped]))
end

Instance Attribute Details

#bottleBottle (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:



377
378
379
# File 'resource.rb', line 377

def bottle
  @bottle
end

Instance Method Details

#bottle_sizeInteger?

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:



405
406
407
# File 'resource.rb', line 405

def bottle_size
  manifest_annotations["sh.brew.bottle.size"]&.to_i
end

#download_queue_nameString

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:



418
# File 'resource.rb', line 418

def download_queue_name = "#{bottle.name} (#{bottle.resource.version})"

#download_queue_typeString

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:



415
# File 'resource.rb', line 415

def download_queue_type = "Bottle Manifest"

#installed_sizeInteger?

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:



410
411
412
# File 'resource.rb', line 410

def installed_size
  manifest_annotations["sh.brew.bottle.installed_size"]&.to_i
end

#tabHash{String => 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.

Returns:

Raises:



393
394
395
396
397
398
399
400
401
402
# File 'resource.rb', line 393

def tab
  tab = manifest_annotations["sh.brew.tab"]
  raise Error, "Couldn't find tab from manifest." if tab.blank?

  begin
    JSON.parse(tab)
  rescue JSON::ParserError
    raise Error, "Couldn't parse tab JSON."
  end
end

#verify_download_integrity(_filename) ⇒ 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.

Parameters:



387
388
389
390
# File 'resource.rb', line 387

def verify_download_integrity(_filename)
  # We don't have a checksum, but we can at least try parsing it.
  tab
end