Class: InstalledGemFuture
- Inherits:
-
Object
- Object
- InstalledGemFuture
- Defined in:
- lib/installed_gem_future.rb
Instance Attribute Summary collapse
-
#gem ⇒ Object
readonly
Returns the value of attribute gem.
-
#installed_version ⇒ Object
readonly
Returns the value of attribute installed_version.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_future_version(version) ⇒ Object
- #count ⇒ Object
-
#initialize(gem) ⇒ InstalledGemFuture
constructor
A new instance of InstalledGemFuture.
- #inspect ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize(gem) ⇒ InstalledGemFuture
Returns a new instance of InstalledGemFuture.
5 6 7 8 9 10 |
# File 'lib/installed_gem_future.rb', line 5 def initialize(gem) @gem = gem @name = gem.name @installed_version = gem.version.to_s @futures = Array.new end |
Instance Attribute Details
#gem ⇒ Object (readonly)
Returns the value of attribute gem.
3 4 5 |
# File 'lib/installed_gem_future.rb', line 3 def gem @gem end |
#installed_version ⇒ Object (readonly)
Returns the value of attribute installed_version.
3 4 5 |
# File 'lib/installed_gem_future.rb', line 3 def installed_version @installed_version end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/installed_gem_future.rb', line 3 def name @name end |
Instance Method Details
#add_future_version(version) ⇒ Object
12 13 14 |
# File 'lib/installed_gem_future.rb', line 12 def add_future_version(version) @futures << version unless @futures.include? version end |
#count ⇒ Object
16 17 18 |
# File 'lib/installed_gem_future.rb', line 16 def count @futures.size end |
#inspect ⇒ Object
20 21 22 |
# File 'lib/installed_gem_future.rb', line 20 def inspect "#{@name} (#{@installed_version}): #{PP.pp(@futures, ' ')}" end |
#to_html ⇒ Object
24 25 26 |
# File 'lib/installed_gem_future.rb', line 24 def to_html "<tr><td class='gem'>#{@name}</td><td class='current-version'>#{@installed_version}</td><td class='versions-behind'>#{versions_behind}</td>#{futures_to_html}</tr>" end |