Class: GemOutdatedChecker::GemList

Inherits:
Object
  • Object
show all
Extended by:
Config
Defined in:
lib/gem_outdated_checker.rb

Constant Summary

Constants included from Config

Config::CONFIG_KEYS

Instance Method Summary collapse

Methods included from Config

configure

Constructor Details

#initializeGemList

Returns a new instance of GemList.



11
12
13
14
# File 'lib/gem_outdated_checker.rb', line 11

def initialize
  @exclude_gems = configs[:exclude_gems] || []
  @bundle_path = configs[:bundle_path] || 'bundle'.freeze
end

Instance Method Details

#outdated_gemsObject



16
17
18
19
# File 'lib/gem_outdated_checker.rb', line 16

def outdated_gems
  bundle_outdated unless @execed
  @outdated_gems ||= @out.split("\n").grep(/\*/)
end

#update_pending_gemsObject



29
30
31
# File 'lib/gem_outdated_checker.rb', line 29

def update_pending_gems
  @update_pending_gems ||= outdated_gems - update_required_gems
end

#update_required_gemsObject



21
22
23
24
25
26
27
# File 'lib/gem_outdated_checker.rb', line 21

def update_required_gems
  return outdated_gems if @exclude_gems.empty?

  @update_required_gems ||= outdated_gems.reject do |gem_name|
    @exclude_gems.any?{ |pg| gem_name =~ /#{pg}/ }
  end
end