Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

True type Dependabot::Bundler::MetadataFinder #9901

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bundler/lib/dependabot/bundler/metadata_finder.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true

require "excon"
Expand Down Expand Up @@ -87,7 +87,7 @@ def find_source_from_gemspec_download
end

source_url = github_urls.find do |url|
repo = Source.from_url(url).repo
repo = T.must(Source.from_url(url)).repo
repo.downcase.end_with?(dependency.name)
end
return unless source_url
Expand All @@ -102,7 +102,7 @@ def changelog_url_from_gemspec_download
rubygems_marshalled_gemspec_response.gsub("\x06;", "\n")
.scan(Dependabot::Source::SOURCE_REGEX) do
github_urls << (Regexp.last_match.to_s +
Regexp.last_match.post_match.split("\n").first)
T.must(T.must(Regexp.last_match).post_match.split("\n").first))
end

github_urls.find do |url|
Expand Down Expand Up @@ -204,7 +204,7 @@ def base_url
cred["type"] == "rubygems_server" && cred.replaces_base?
end
host = credential ? credential["host"] : "rubygems.org"
@base_url = "https://#{host}" + ("/" unless host.end_with?("/"))
@base_url = "https://#{host}#{host&.end_with?('/') ? '' : '/'}"
end

def registry_auth_headers
Expand Down
Loading