Class: Bottle::Filename
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rebuild ⇒ Object
readonly
Returns the value of attribute rebuild.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#extname ⇒ String
-
#github_packages ⇒ Object
-
#initialize(name, version, tag, rebuild) ⇒ Filename
constructor
A new instance of Filename.
-
#json ⇒ String
-
#to_s ⇒ String
(also: #to_str)
-
#url_encode ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
290 291 292 |
# File 'software_spec.rb', line 290 def name @name end |
#rebuild ⇒ Object (readonly)
Returns the value of attribute rebuild.
290 291 292 |
# File 'software_spec.rb', line 290 def rebuild @rebuild end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
290 291 292 |
# File 'software_spec.rb', line 290 def tag @tag end |
#version ⇒ Object (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
#extname ⇒ String
323 324 325 326 |
# File 'software_spec.rb', line 323 def extname s = rebuild.positive? ? ".#{rebuild}" : "" ".#{tag}.bottle#{s}.tar.gz" end |
#github_packages ⇒ Object
318 319 320 |
# File 'software_spec.rb', line 318 def github_packages "#{name}--#{version}#{extname}" end |
#json ⇒ String
310 311 312 |
# File 'software_spec.rb', line 310 def json "#{name}--#{version}.#{tag}.bottle.json" end |
#to_s ⇒ String Also known as: to_str
304 305 306 |
# File 'software_spec.rb', line 304 def to_s "#{name}--#{version}#{extname}" end |
#url_encode ⇒ Object
314 315 316 |
# File 'software_spec.rb', line 314 def url_encode ERB::Util.url_encode("#{name}-#{version}#{extname}") end |