Class: Bottle::Filename

Inherits:
Object
  • Object
show all
Defined in:
brew/Library/Homebrew/software_spec.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version, tag, rebuild) ⇒ Filename

Returns a new instance of Filename



256
257
258
259
260
261
# File 'brew/Library/Homebrew/software_spec.rb', line 256

def initialize(name, version, tag, rebuild)
  @name = File.basename name
  @version = version
  @tag = tag.to_s.gsub(/_or_later$/, "")
  @rebuild = rebuild
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name



250
251
252
# File 'brew/Library/Homebrew/software_spec.rb', line 250

def name
  @name
end

#rebuildObject (readonly)

Returns the value of attribute rebuild



250
251
252
# File 'brew/Library/Homebrew/software_spec.rb', line 250

def rebuild
  @rebuild
end

#tagObject (readonly)

Returns the value of attribute tag



250
251
252
# File 'brew/Library/Homebrew/software_spec.rb', line 250

def tag
  @tag
end

#versionObject (readonly)

Returns the value of attribute version



250
251
252
# File 'brew/Library/Homebrew/software_spec.rb', line 250

def version
  @version
end

Class Method Details

.create(formula, tag, rebuild) ⇒ Object



252
253
254
# File 'brew/Library/Homebrew/software_spec.rb', line 252

def self.create(formula, tag, rebuild)
  new(formula.name, formula.pkg_version, tag, rebuild)
end

Instance Method Details

#bintrayObject



272
273
274
# File 'brew/Library/Homebrew/software_spec.rb', line 272

def bintray
  "#{name}-#{version}#{extname}"
end

#extnameObject



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

def extname
  s = rebuild.positive? ? ".#{rebuild}" : ""
  ".#{tag}.bottle#{s}.tar.gz"
end

#jsonObject



268
269
270
# File 'brew/Library/Homebrew/software_spec.rb', line 268

def json
  "#{name}--#{version}.#{tag}.bottle.json"
end

#to_sObject Also known as: to_str



263
264
265
# File 'brew/Library/Homebrew/software_spec.rb', line 263

def to_s
  "#{name}--#{version}#{extname}"
end