Class: Bottle::Filename

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



296
297
298
299
300
301
# File 'software_spec.rb', line 296

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.



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

def name
  @name
end

#rebuildObject (readonly)

Returns the value of attribute rebuild.



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

def rebuild
  @rebuild
end

#tagObject (readonly)

Returns the value of attribute tag.



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

def tag
  @tag
end

#versionObject (readonly)

Returns the value of attribute version.



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

def version
  @version
end

Class Method Details

.create(formula, tag, rebuild) ⇒ Object



292
293
294
# File 'software_spec.rb', line 292

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

Instance Method Details

#extnameString

Returns:



323
324
325
326
# File 'software_spec.rb', line 323

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

#github_packagesObject



318
319
320
# File 'software_spec.rb', line 318

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

#jsonString

Returns:



310
311
312
# File 'software_spec.rb', line 310

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

#to_sString Also known as: to_str

Returns:



304
305
306
# File 'software_spec.rb', line 304

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

#url_encodeObject



314
315
316
# File 'software_spec.rb', line 314

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