Class: Bottle::Filename

Inherits:
Object
  • Object
show all
Defined in:
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.


261
262
263
264
265
266
# File 'Library/Homebrew/software_spec.rb', line 261

def initialize(name, version, tag, rebuild)
  @name = File.basename name
  @version = version
  @tag = tag.to_s
  @rebuild = rebuild
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


255
256
257
# File 'Library/Homebrew/software_spec.rb', line 255

def name
  @name
end

#rebuildObject (readonly)

Returns the value of attribute rebuild


255
256
257
# File 'Library/Homebrew/software_spec.rb', line 255

def rebuild
  @rebuild
end

#tagObject (readonly)

Returns the value of attribute tag


255
256
257
# File 'Library/Homebrew/software_spec.rb', line 255

def tag
  @tag
end

#versionObject (readonly)

Returns the value of attribute version


255
256
257
# File 'Library/Homebrew/software_spec.rb', line 255

def version
  @version
end

Class Method Details

.create(formula, tag, rebuild) ⇒ Object


257
258
259
# File 'Library/Homebrew/software_spec.rb', line 257

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

Instance Method Details

#bintrayObject


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

def bintray
  ERB::Util.url_encode("#{name}-#{version}#{extname}")
end

#extnameObject


281
282
283
284
# File 'Library/Homebrew/software_spec.rb', line 281

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

#jsonObject


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

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

#to_sObject Also known as: to_str


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

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