Class: Dependabot::Hex::UpdateChecker::LatestVersionFinder

Inherits:
Package::PackageLatestVersionFinder
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/hex/update_checker/latest_version_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependency:, dependency_files:, credentials:, ignored_versions:, security_advisories:, raise_on_ignored:, options: {}, cooldown_options: nil) ⇒ LatestVersionFinder



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/dependabot/hex/update_checker/latest_version_finder.rb', line 36

def initialize(
  dependency:,
  dependency_files:,
  credentials:,
  ignored_versions:,
  security_advisories:,
  raise_on_ignored:,
  options: {},
  cooldown_options: nil
)
  @dependency          = dependency
  @dependency_files    = dependency_files
  @credentials         = credentials
  @ignored_versions    = ignored_versions
  @security_advisories = security_advisories
  @raise_on_ignored    = raise_on_ignored
  @options             = options
  @cooldown_options = cooldown_options
  super
end

Instance Attribute Details

#cooldown_optionsObject (readonly)

Returns the value of attribute cooldown_options.



64
65
66
# File 'lib/dependabot/hex/update_checker/latest_version_finder.rb', line 64

def cooldown_options
  @cooldown_options
end

#credentialsObject (readonly)

Returns the value of attribute credentials.



61
62
63
# File 'lib/dependabot/hex/update_checker/latest_version_finder.rb', line 61

def credentials
  @credentials
end

#dependencyObject (readonly)

Returns the value of attribute dependency.



58
59
60
# File 'lib/dependabot/hex/update_checker/latest_version_finder.rb', line 58

def dependency
  @dependency
end

#ignored_versionsObject (readonly)

Returns the value of attribute ignored_versions.



67
68
69
# File 'lib/dependabot/hex/update_checker/latest_version_finder.rb', line 67

def ignored_versions
  @ignored_versions
end

#security_advisoriesObject (readonly)

Returns the value of attribute security_advisories.



70
71
72
# File 'lib/dependabot/hex/update_checker/latest_version_finder.rb', line 70

def security_advisories
  @security_advisories
end

Instance Method Details

#package_detailsObject



73
# File 'lib/dependabot/hex/update_checker/latest_version_finder.rb', line 73

def package_details; end

#release_versionObject



76
77
78
79
80
81
82
83
84
# File 'lib/dependabot/hex/update_checker/latest_version_finder.rb', line 76

def release_version
  releases = package_releases

  releases = filter_prerelease_versions(T.must(releases))
  releases = filter_ignored_versions(releases)
  releases = filter_by_cooldown(releases)

  releases.max_by(&:version)&.version
end