Class: Dependabot::GitMetadataFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/git_metadata_fetcher.rb

Constant Summary collapse

KNOWN_HOSTS =
/github\.com|bitbucket\.org|gitlab.com/.freeze

Instance Method Summary collapse

Constructor Details

#initialize(url:, credentials:) ⇒ GitMetadataFetcher

Returns a new instance of GitMetadataFetcher.



10
11
12
13
# File 'lib/dependabot/git_metadata_fetcher.rb', line 10

def initialize(url:, credentials:)
  @url = url
  @credentials = credentials
end

Instance Method Details

#tagsObject



19
20
21
22
23
# File 'lib/dependabot/git_metadata_fetcher.rb', line 19

def tags
  return [] unless upload_pack

  @tags ||= tags_for_upload_pack(upload_pack)
end

#upload_packObject



15
16
17
# File 'lib/dependabot/git_metadata_fetcher.rb', line 15

def upload_pack
  @upload_pack ||= fetch_upload_pack_for(url)
end