class Gemdiff::BundleInspector

Constants

BUNDLE_OUTDATED_PARSE_REGEX

Public Instance Methods

get(gem_name) click to toggle source
# File lib/gemdiff/bundle_inspector.rb, line 18
def get(gem_name)
  list.detect { |gem| gem.name == gem_name }
end
list() click to toggle source
# File lib/gemdiff/bundle_inspector.rb, line 7
def list
  @list ||=
    outdated
      .split("\n")
      .filter_map { |line| new_outdated_gem(line) }
end
outdated() click to toggle source
# File lib/gemdiff/bundle_inspector.rb, line 14
def outdated
  @outdated ||= bundle_outdated_strict
end

Private Instance Methods

bundle_outdated_strict() click to toggle source
# File lib/gemdiff/bundle_inspector.rb, line 24
def bundle_outdated_strict
  `bundle outdated --strict --parseable`
end
new_outdated_gem(line) click to toggle source
# File lib/gemdiff/bundle_inspector.rb, line 28
def new_outdated_gem(line)
  return unless (match = BUNDLE_OUTDATED_PARSE_REGEX.match(line))

  OutdatedGem.new(match[1], match[2], match[3])
end