Class: DependencyTimelineAudit::Gem
- Inherits:
-
Object
- Object
- DependencyTimelineAudit::Gem
- Defined in:
- lib/dependency-timeline-audit/gem.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#latest_version ⇒ Object
readonly
Returns the value of attribute latest_version.
-
#locked_version ⇒ Object
readonly
Returns the value of attribute locked_version.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(config:, name:, locked_version:) ⇒ Gem
constructor
A new instance of Gem.
- #print_info ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(config:, name:, locked_version:) ⇒ Gem
Returns a new instance of Gem.
5 6 7 8 9 10 |
# File 'lib/dependency-timeline-audit/gem.rb', line 5 def initialize(config:, name:, locked_version:) @config = config @name = name @locked_version = GemVersion.new(gem: self, name: locked_version) @latest_version = GemVersion.new(gem: self, name: api.latest_version) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/dependency-timeline-audit/gem.rb', line 3 def config @config end |
#latest_version ⇒ Object (readonly)
Returns the value of attribute latest_version.
3 4 5 |
# File 'lib/dependency-timeline-audit/gem.rb', line 3 def latest_version @latest_version end |
#locked_version ⇒ Object (readonly)
Returns the value of attribute locked_version.
3 4 5 |
# File 'lib/dependency-timeline-audit/gem.rb', line 3 def locked_version @locked_version end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/dependency-timeline-audit/gem.rb', line 3 def name @name end |
Instance Method Details
#print_info ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/dependency-timeline-audit/gem.rb', line 16 def print_info puts "Gem: #{TextFormat.bold}#{name}#{TextFormat.reset}" TextFormat.color = locked_version.color puts " - Locked to: #{locked_version.name} (Released: #{format_date(locked_version.released_at)})" TextFormat.color = latest_version.color puts " - Latest: #{latest_version.name} (Released: #{format_date(latest_version.released_at)})" TextFormat.reset! end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/dependency-timeline-audit/gem.rb', line 12 def to_s name.to_s end |