dependabot-common 0.115.2 → 0.116.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab043ac61d68f051ee37b932fd0c13abdab6570877a3daf992c92de594838877
4
- data.tar.gz: cab7b77dabfc106e699da58f2c4ddf304a76e60823a3172da2958bcac38f633c
3
+ metadata.gz: 100592e19e79ca976be5212fd173dae233cb216d37057632382120d7717edcf9
4
+ data.tar.gz: 605473cb4148339c77bd604ef8c2b1bff894a06f09811661f9ef8ae7446766f7
5
5
  SHA512:
6
- metadata.gz: 98cfd039b43f695b37c5466925271c39960b445f43349a9202348b8ee7a334653997cd3b47299fcc463a4bc7f3424e27f0057411cdb4775e94378f306d15025e
7
- data.tar.gz: f16086153e97711f3adba45dda4745229d2b712a4a4802053bc0a17daebcec23858dbf79ddfaa41723030c672f3f9410854ccd618e0c3296fe81b8ed1f7abd60
6
+ metadata.gz: 7d5e0befccd09c82e2fbce6b6fcbc80d4c6f92fa379ec88bf6e318c8d77f6098e88c75520711d4bab28b597f1552307d5ed452ccf8622f2057dd1f19fca10988
7
+ data.tar.gz: deb8403fb9af1c6ca9c2477a78e6145738f409699b3a97b2951642f53af33d0da0f7182303bae5cb22ff017d388bab8f51b973e3c45d709489441712f805785e
@@ -156,16 +156,26 @@ module Dependabot
156
156
  cred = credentials.select { |c| c["type"] == "git_source" }.
157
157
  find { |c| bare_uri.start_with?(c["host"]) }
158
158
 
159
+ scheme = scheme_for_uri(uri)
160
+
159
161
  if bare_uri.match?(%r{[^/]+:[^/]+@})
160
162
  # URI already has authentication details
161
- "https://#{bare_uri}"
163
+ "#{scheme}://#{bare_uri}"
162
164
  elsif cred&.fetch("username", nil) && cred&.fetch("password", nil)
163
165
  # URI doesn't have authentication details, but we have credentials
164
166
  auth_string = "#{cred.fetch('username')}:#{cred.fetch('password')}"
165
- "https://#{auth_string}@#{bare_uri}"
167
+ "#{scheme}://#{auth_string}@#{bare_uri}"
168
+ else
169
+ # No credentials, so just return the http(s) URI
170
+ "#{scheme}://#{bare_uri}"
171
+ end
172
+ end
173
+
174
+ def scheme_for_uri(uri)
175
+ if uri.match?(%r{^http://})
176
+ "http"
166
177
  else
167
- # No credentials, so just return the https URI
168
- "https://#{bare_uri}"
178
+ "https"
169
179
  end
170
180
  end
171
181
 
@@ -62,9 +62,12 @@ module Dependabot
62
62
  doc.walk do |node|
63
63
  if node.type == :link && node.url.match?(GITHUB_REF_REGEX)
64
64
  node.each do |subnode|
65
- last_match = subnode.string_content.match(GITHUB_REF_REGEX)
66
- next unless subnode.type == :text && last_match
65
+ unless subnode.type == :text &&
66
+ subnode.string_content.match?(GITHUB_REF_REGEX)
67
+ next
68
+ end
67
69
 
70
+ last_match = subnode.string_content.match(GITHUB_REF_REGEX)
68
71
  number = last_match.named_captures.fetch("number")
69
72
  repo = last_match.named_captures.fetch("repo")
70
73
  subnode.string_content = "#{repo}##{number}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.115.2"
4
+ VERSION = "0.116.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.115.2
4
+ version: 0.116.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-20 00:00:00.000000000 Z
11
+ date: 2020-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-codecommit
@@ -300,14 +300,14 @@ dependencies:
300
300
  requirements:
301
301
  - - "~>"
302
302
  - !ruby/object:Gem::Version
303
- version: 0.78.0
303
+ version: 0.79.0
304
304
  type: :development
305
305
  prerelease: false
306
306
  version_requirements: !ruby/object:Gem::Requirement
307
307
  requirements:
308
308
  - - "~>"
309
309
  - !ruby/object:Gem::Version
310
- version: 0.78.0
310
+ version: 0.79.0
311
311
  - !ruby/object:Gem::Dependency
312
312
  name: vcr
313
313
  requirement: !ruby/object:Gem::Requirement