Class: DependencyTimelineAudit::Check
- Inherits:
-
Object
- Object
- DependencyTimelineAudit::Check
- Defined in:
- lib/dependency-timeline-audit/check.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(config:) ⇒ Check
constructor
A new instance of Check.
Constructor Details
#initialize(config:) ⇒ Check
Returns a new instance of Check.
7 8 9 |
# File 'lib/dependency-timeline-audit/check.rb', line 7 def initialize(config:) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/dependency-timeline-audit/check.rb', line 5 def config @config end |
Instance Method Details
#check ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/dependency-timeline-audit/check.rb', line 11 def check outdated_versions = [] locked_gems.each do |gem| outdated_versions.push(gem) if gem.locked_version.outdated? gem.print_info if config.verbose end print "\n" if config.verbose if outdated_versions.any? TextFormat.color = :red puts "Outdated gems detected!" puts " - #{outdated_versions.join(', ')}" exit(1) # Failure else puts "All gems are within the accepted threshold!" exit(0) # Success end end |