Class: Lapidarist::Outdated

Inherits:
Object
  • Object
show all
Defined in:
lib/lapidarist/outdated.rb

Instance Method Summary collapse

Constructor Details

#initializeOutdated



3
4
5
# File 'lib/lapidarist/outdated.rb', line 3

def initialize
  @bundle = BundleCommand.new
end

Instance Method Details

#runObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/lapidarist/outdated.rb', line 7

def run
  Lapidarist.logger.header('Detecting outdated gems')

  gems = outdated_gems.each_with_object([]) do |gem, results|
    reason = reason_to_skip(gem)
    if reason.nil?
      Lapidarist.logger.info(" + #{gem.log_s}")
      results.push Gem.from(gem, position: results.length)
    else
      Lapidarist.logger.info(" - (#{reason}) #{gem.log_s}")
      results.push Gem.from(gem, position: results.length, status: :skipped, reason: reason)
    end
  end

  Lapidarist.logger.debug(gems.map(&:name), :order)

  Gems.new(gems)
end