Class: Dependabot::Composer::UpdateChecker::VersionResolver

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

Defined Under Namespace

Classes: MissingExtensions

Constant Summary collapse

MISSING_EXPLICIT_PLATFORM_REQ_REGEX =
%r{
  (?<=PHP\sextension\s)ext\-[^\s\/]+\s.*?\s(?=is|but)|
  (?<=requires\s)php(?:\-[^\s\/]+)?\s.*?\s(?=but)
}x.freeze
MISSING_IMPLICIT_PLATFORM_REQ_REGEX =
%r{
  (?<!with|for|by)\sext\-[^\s\/]+\s.*?\s(?=->)|
  (?<=requires\s)php(?:\-[^\s\/]+)?\s.*?\s(?=->)
}x.freeze
VERSION_REGEX =
/[0-9]+(?:\.[A-Za-z0-9\-_]+)*/.freeze
SOURCE_TIMED_OUT_REGEX =
/The "(?<url>[^"]+packages\.json)".*timed out/.freeze

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of VersionResolver.


40
41
42
43
44
45
46
47
48
# File 'lib/dependabot/composer/update_checker/version_resolver.rb', line 40

def initialize(credentials:, dependency:, dependency_files:,
               requirements_to_unlock:, latest_allowable_version:)
  @credentials                  = credentials
  @dependency                   = dependency
  @dependency_files             = dependency_files
  @requirements_to_unlock       = requirements_to_unlock
  @latest_allowable_version     = latest_allowable_version
  @composer_platform_extensions = initial_platform
end

Instance Method Details

#latest_resolvable_versionObject


50
51
52
# File 'lib/dependabot/composer/update_checker/version_resolver.rb', line 50

def latest_resolvable_version
  @latest_resolvable_version ||= fetch_latest_resolvable_version
end