Class: Dependabot::Dep::UpdateChecker::VersionResolver

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

Constant Summary collapse

NOT_FOUND_REGEX =
/failed to list versions for (?<repo_url>.*?):\s+/.freeze
INDEX_OUT_OF_RANGE_REGEX =
/panic: runtime error: index out of range.*findValidVersion/m.freeze

Instance Method Summary collapse

Constructor Details

#initialize(dependency:, dependency_files:, credentials:) ⇒ VersionResolver

Returns a new instance of VersionResolver.



19
20
21
22
23
# File 'lib/dependabot/dep/update_checker/version_resolver.rb', line 19

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

Instance Method Details

#latest_resolvable_versionObject



25
26
27
28
29
30
31
# File 'lib/dependabot/dep/update_checker/version_resolver.rb', line 25

def latest_resolvable_version
  if defined?(@latest_resolvable_version)
    return @latest_resolvable_version
  end

  @latest_resolvable_version = fetch_latest_resolvable_version
end