Class: Dependabot::Dep::UpdateChecker::LatestVersionFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/dep/update_checker/latest_version_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(dependency:, dependency_files:, credentials:, ignored_versions:) ⇒ LatestVersionFinder

Returns a new instance of LatestVersionFinder.



15
16
17
18
19
20
21
# File 'lib/dependabot/dep/update_checker/latest_version_finder.rb', line 15

def initialize(dependency:, dependency_files:, credentials:,
               ignored_versions:)
  @dependency       = dependency
  @dependency_files = dependency_files
  @credentials      = credentials
  @ignored_versions = ignored_versions
end

Instance Method Details

#latest_versionObject



23
24
25
26
27
28
# File 'lib/dependabot/dep/update_checker/latest_version_finder.rb', line 23

def latest_version
  @latest_version ||=
    if git_dependency? then latest_version_for_git_dependency
    else latest_release_tag_version
    end
end