Class: SilentPackageManager::UpdateChecker

Inherits:
Dependabot::UpdateCheckers::Base
  • Object
show all
Defined in:
lib/dependabot/silent/update_checker.rb

Instance Method Summary collapse

Instance Method Details

#latest_resolvable_versionObject



46
47
48
# File 'lib/dependabot/silent/update_checker.rb', line 46

def latest_resolvable_version
  latest_version
end

#latest_versionObject



11
12
13
14
15
16
17
# File 'lib/dependabot/silent/update_checker.rb', line 11

def latest_version
  return next_git_version if git_dependency?

  versions = available_versions
  versions = filter_ignored_versions(versions)
  versions.max.to_s
end

#latest_version_resolvable_with_full_unlock?Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
25
# File 'lib/dependabot/silent/update_checker.rb', line 19

def latest_version_resolvable_with_full_unlock?
  # For ecosystems that have lockfiles, the updater allows an ecosystem to try progressively
  # more aggressive approaches to dependency unlocking. This method represents the most aggressive
  # approach that allows for updating all dependencies to try to get the target dependency to update.
  # We're going to let the specs handle testing that logic, returning false here.
  false
end

#lowest_resolvable_security_fix_versionObject



36
37
38
39
40
# File 'lib/dependabot/silent/update_checker.rb', line 36

def lowest_resolvable_security_fix_version
  raise "Dependency not vulnerable!" unless vulnerable?

  lowest_security_fix_version
end

#lowest_security_fix_versionObject



27
28
29
30
31
32
33
34
# File 'lib/dependabot/silent/update_checker.rb', line 27

def lowest_security_fix_version
  versions = available_versions
  versions = filter_lower_versions(versions)
  Dependabot::UpdateCheckers::VersionFilters.filter_vulnerable_versions(
    versions,
    security_advisories
  ).min.to_s
end

#up_to_date?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/dependabot/silent/update_checker.rb', line 42

def up_to_date?
  dependency.version == latest_version
end

#updated_requirementsObject



50
51
52
53
54
# File 'lib/dependabot/silent/update_checker.rb', line 50

def updated_requirements
  dependency.requirements.map do |req|
    req.merge(requirement: preferred_resolvable_version)
  end
end