Class: Bottle::Filename

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



262
263
264
265
266
267
# File 'software_spec.rb', line 262

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.



256
257
258
# File 'software_spec.rb', line 256

def name
  @name
end

#rebuildObject (readonly)

Returns the value of attribute rebuild.



256
257
258
# File 'software_spec.rb', line 256

def rebuild
  @rebuild
end

#tagObject (readonly)

Returns the value of attribute tag.



256
257
258
# File 'software_spec.rb', line 256

def tag
  @tag
end

#versionObject (readonly)

Returns the value of attribute version.



256
257
258
# File 'software_spec.rb', line 256

def version
  @version
end

Class Method Details

.create(formula, tag, rebuild) ⇒ Object



258
259
260
# File 'software_spec.rb', line 258

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

Instance Method Details

#extnameString

Returns:



289
290
291
292
# File 'software_spec.rb', line 289

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

#github_packagesObject



284
285
286
# File 'software_spec.rb', line 284

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

#jsonString

Returns:



276
277
278
# File 'software_spec.rb', line 276

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

#to_sString Also known as: to_str

Returns:



270
271
272
# File 'software_spec.rb', line 270

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

#url_encodeObject



280
281
282
# File 'software_spec.rb', line 280

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