Class: Dependabot::Bundler::Package::PackageDetailsFetcher

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
UpdateChecker::SharedBundlerHelpers
Defined in:
lib/dependabot/bundler/package/package_details_fetcher.rb

Constant Summary collapse

RELEASES_URL =
"%s/api/v1/versions/%s.json"
GEM_URL =
"%s/gems/%s.gem"
PACKAGE_TYPE =
"gem"
PACKAGE_LANGUAGE =
"ruby"
APPLICATION_JSON =
"application/json"
RUBYGEMS =
"rubygems"
GIT =
"git"
OTHER =
"other"

Constants included from UpdateChecker::SharedBundlerHelpers

UpdateChecker::SharedBundlerHelpers::GIT_REF_REGEX, UpdateChecker::SharedBundlerHelpers::GIT_REGEX, UpdateChecker::SharedBundlerHelpers::PATH_REGEX, UpdateChecker::SharedBundlerHelpers::REGISTRY_METADATA_ERROR_REGEX, UpdateChecker::SharedBundlerHelpers::RETRYABLE_ERRORS, UpdateChecker::SharedBundlerHelpers::RETRYABLE_PRIVATE_REGISTRY_ERRORS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UpdateChecker::SharedBundlerHelpers

#base_directory, #gemfile, #handle_bundler_errors, #in_a_native_bundler_context, #inaccessible_git_dependencies, #jfrog_source, #lockfile, #private_registry_credentials, #private_registry_source, #registry_metadata_error, #retryable_error?, #write_temporary_dependency_files

Constructor Details

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

Returns a new instance of PackageDetailsFetcher.



39
40
41
42
43
44
45
46
47
# File 'lib/dependabot/bundler/package/package_details_fetcher.rb', line 39

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

  @source_type = T.let(nil, T.nilable(String))
  @options = T.let({}, T::Hash[Symbol, T.untyped])
  @repo_contents_path = T.let(nil, T.nilable(String))
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



56
57
58
# File 'lib/dependabot/bundler/package/package_details_fetcher.rb', line 56

def credentials
  @credentials
end

#dependencyObject (readonly)

Returns the value of attribute dependency.



50
51
52
# File 'lib/dependabot/bundler/package/package_details_fetcher.rb', line 50

def dependency
  @dependency
end

#dependency_filesObject (readonly)

Returns the value of attribute dependency_files.



53
54
55
# File 'lib/dependabot/bundler/package/package_details_fetcher.rb', line 53

def dependency_files
  @dependency_files
end

#optionsObject (readonly)

Returns the value of attribute options.



59
60
61
# File 'lib/dependabot/bundler/package/package_details_fetcher.rb', line 59

def options
  @options
end

#repo_contents_pathObject (readonly)

Returns the value of attribute repo_contents_path.



62
63
64
# File 'lib/dependabot/bundler/package/package_details_fetcher.rb', line 62

def repo_contents_path
  @repo_contents_path
end

Instance Method Details

#fetchObject



65
66
67
68
69
70
71
72
# File 'lib/dependabot/bundler/package/package_details_fetcher.rb', line 65

def fetch
  case source_type
  when GIT, OTHER
    nil
  else
    rubygems_versions
  end
end