Class: BrewCaskTools::Casks::Versions
- Inherits:
-
Object
- Object
- BrewCaskTools::Casks::Versions
- Defined in:
- lib/bct/cask/versions.rb
Overview
Operations on a collection of Cask versions
Instance Attribute Summary collapse
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Instance Method Summary collapse
- #candidate ⇒ Object
- #current ⇒ Object
-
#initialize(dir, candidate) ⇒ Versions
constructor
A new instance of Versions.
- #installed ⇒ Object
- #latest? ⇒ Boolean
- #metadata ⇒ Object
- #old_installed ⇒ Object
- #old_metadata ⇒ Object
- #rm_old ⇒ Object
Constructor Details
Instance Attribute Details
#local ⇒ Object (readonly)
Returns the value of attribute local.
7 8 9 |
# File 'lib/bct/cask/versions.rb', line 7 def local @local end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
7 8 9 |
# File 'lib/bct/cask/versions.rb', line 7 def @meta end |
Instance Method Details
#candidate ⇒ Object
23 24 25 |
# File 'lib/bct/cask/versions.rb', line 23 def candidate Version.parse_version(@candidate) end |
#current ⇒ Object
27 28 29 |
# File 'lib/bct/cask/versions.rb', line 27 def current installed.last end |
#installed ⇒ Object
15 16 17 |
# File 'lib/bct/cask/versions.rb', line 15 def installed @local.versions end |
#latest? ⇒ Boolean
31 32 33 |
# File 'lib/bct/cask/versions.rb', line 31 def latest? current.to_s == 'latest' end |
#metadata ⇒ Object
19 20 21 |
# File 'lib/bct/cask/versions.rb', line 19 def @meta.versions end |
#old_installed ⇒ Object
35 36 37 |
# File 'lib/bct/cask/versions.rb', line 35 def old_installed @local.old end |
#old_metadata ⇒ Object
39 40 41 |
# File 'lib/bct/cask/versions.rb', line 39 def @meta.old end |
#rm_old ⇒ Object
43 44 45 46 |
# File 'lib/bct/cask/versions.rb', line 43 def rm_old @local.rm_old @meta.rm_old end |