Class: Dependabot::Hex::UpdateChecker

Inherits:
UpdateCheckers::Base
  • Object
show all
Defined in:
lib/dependabot/hex/update_checker.rb,
lib/dependabot/hex/update_checker/file_preparer.rb,
lib/dependabot/hex/update_checker/version_resolver.rb,
lib/dependabot/hex/update_checker/requirements_updater.rb

Defined Under Namespace

Classes: FilePreparer, RequirementsUpdater, VersionResolver

Instance Method Summary collapse

Instance Method Details

#latest_resolvable_versionObject



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

def latest_resolvable_version
  @latest_resolvable_version ||=
    if git_dependency?
      latest_resolvable_version_for_git_dependency
    else
      fetch_latest_resolvable_version(unlock_requirement: true)
    end
end

#latest_resolvable_version_with_no_unlockObject



36
37
38
39
40
41
42
43
# File 'lib/dependabot/hex/update_checker.rb', line 36

def latest_resolvable_version_with_no_unlock
  @latest_resolvable_version_with_no_unlock ||=
    if git_dependency?
      latest_resolvable_commit_with_unchanged_git_source
    else
      fetch_latest_resolvable_version(unlock_requirement: false)
    end
end

#latest_versionObject



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

def latest_version
  @latest_version ||=
    if git_dependency?
      latest_version_for_git_dependency
    else
      latest_release_from_hex_registry || latest_resolvable_version
    end
end

#updated_requirementsObject



45
46
47
48
49
50
51
# File 'lib/dependabot/hex/update_checker.rb', line 45

def updated_requirements
  RequirementsUpdater.new(
    requirements: dependency.requirements,
    updated_source: updated_source,
    latest_resolvable_version: latest_resolvable_version&.to_s
  ).updated_requirements
end