Class: Bottle

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
Library/Homebrew/software_spec.rb

Defined Under Namespace

Classes: Filename

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(formula, spec) ⇒ Bottle

Returns a new instance of Bottle



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'Library/Homebrew/software_spec.rb', line 282

def initialize(formula, spec)
  @name = formula.name
  @resource = Resource.new
  @resource.owner = formula
  @spec = spec

  checksum, tag = spec.checksum_for(Utils::Bottles.tag)

  filename = Filename.create(formula, tag, spec.rebuild)
  @resource.url(build_url(spec.root_url, filename))
  @resource.download_strategy = CurlBottleDownloadStrategy
  @resource.version = formula.pkg_version
  @resource.checksum = checksum
  @prefix = spec.prefix
  @cellar = spec.cellar
  @rebuild = spec.rebuild
end

Instance Attribute Details

#cellarObject (readonly)

Returns the value of attribute cellar



277
278
279
# File 'Library/Homebrew/software_spec.rb', line 277

def cellar
  @cellar
end

#nameObject (readonly)

Returns the value of attribute name



277
278
279
# File 'Library/Homebrew/software_spec.rb', line 277

def name
  @name
end

#prefixObject (readonly)

Returns the value of attribute prefix



277
278
279
# File 'Library/Homebrew/software_spec.rb', line 277

def prefix
  @prefix
end

#rebuildObject (readonly)

Returns the value of attribute rebuild



277
278
279
# File 'Library/Homebrew/software_spec.rb', line 277

def rebuild
  @rebuild
end

#resourceObject (readonly)

Returns the value of attribute resource



277
278
279
# File 'Library/Homebrew/software_spec.rb', line 277

def resource
  @resource
end

Instance Method Details

#compatible_cellar?Boolean

Returns:

  • (Boolean)


300
301
302
# File 'Library/Homebrew/software_spec.rb', line 300

def compatible_cellar?
  @spec.compatible_cellar?
end

#skip_relocation?Boolean

Does the bottle need to be relocated?

Returns:

  • (Boolean)


305
306
307
# File 'Library/Homebrew/software_spec.rb', line 305

def skip_relocation?
  @spec.skip_relocation?
end

#stageObject



309
310
311
# File 'Library/Homebrew/software_spec.rb', line 309

def stage
  resource.downloader.stage
end