dependabot-nuget 0.119.2 → 0.120.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b17e71ca2621207000ce4ec937b94bcca2b5a43dfd5a7de0b852520494e62ab9
4
- data.tar.gz: a3855462ce00fd420f434016ad20d3174230a2984b98a472de76c8c69db8de5e
3
+ metadata.gz: 35138ea438bb8209fde7d4519b1e4530568735b860785c3ac69cee4c755cb762
4
+ data.tar.gz: 1e423974b465e3cd9b29ec90b89c898b75c15961a70b0dc59a0f1048ede0c0ac
5
5
  SHA512:
6
- metadata.gz: 0a9f6f198fbab2de59064b2ea9958751deaf51dcd11fd2e2e7df358e4710b33680a27943dbcb88794fba3708389ced422357e93586db1404a8d736378c519ce4
7
- data.tar.gz: 24c72168e99ed489678b568c37a483b7b136614c88a1028dfe779516542bdce0fb3e94fbe2dc0b68919226bc8f53d6c238697310c420bf56dc134e04afd772a4
6
+ metadata.gz: dca95fcac4b0a34b0917a4c4b7ddd2b45f2196945080fd92a4a80872eddf651bf95abcba5cae7ce28fc2b9b46b78cb90abd27bc2c62dc5c8cf43dc137957e4be
7
+ data.tar.gz: 17f9d6164fcd3851f54a310fad3777d77554fb9cb0e74a0807416aa8f0dc09af040d7792206ba68c6a96ca9a51330f42c7b98d50f27fc4253f38b15a1066630f
@@ -82,6 +82,7 @@ module Dependabot
82
82
  end.compact
83
83
  end
84
84
 
85
+ # rubocop:disable Metrics/PerceivedComplexity
85
86
  def sln_file_names
86
87
  sln_files = repo_contents.select { |f| f.name.end_with?(".sln") }
87
88
  src_dir = repo_contents.any? { |f| f.name == "src" && f.type == "dir" }
@@ -98,6 +99,7 @@ module Dependabot
98
99
 
99
100
  sln_files.map(&:name)
100
101
  end
102
+ # rubocop:enable Metrics/PerceivedComplexity
101
103
 
102
104
  def directory_build_files
103
105
  return @directory_build_files if @directory_build_files_checked
@@ -79,6 +79,7 @@ module Dependabot
79
79
  )
80
80
  end
81
81
 
82
+ # rubocop:disable Metrics/PerceivedComplexity
82
83
  def dependency_name(dependency_node, project_file)
83
84
  raw_name =
84
85
  dependency_node.attribute("Include")&.value&.strip ||
@@ -93,6 +94,7 @@ module Dependabot
93
94
 
94
95
  evaluated_value(raw_name, project_file)
95
96
  end
97
+ # rubocop:enable Metrics/PerceivedComplexity
96
98
 
97
99
  def dependency_requirement(dependency_node, project_file)
98
100
  raw_requirement = get_node_version_value(dependency_node)
@@ -127,6 +129,7 @@ module Dependabot
127
129
  named_captures.fetch("property")
128
130
  end
129
131
 
132
+ # rubocop:disable Metrics/PerceivedComplexity
130
133
  def get_node_version_value(node)
131
134
  attribute = "Version"
132
135
  value =
@@ -137,6 +140,7 @@ module Dependabot
137
140
 
138
141
  value == "" ? nil : value
139
142
  end
143
+ # rubocop:enable Metrics/PerceivedComplexity
140
144
 
141
145
  def evaluated_value(value, project_file)
142
146
  return value unless value.match?(PROPERTY_REGEX)
@@ -40,6 +40,7 @@ module Dependabot
40
40
 
41
41
  private
42
42
 
43
+ # rubocop:disable Metrics/PerceivedComplexity
43
44
  def fetch_declaration_strings
44
45
  deep_find_declarations(packages_config.content).select do |nd|
45
46
  node = Nokogiri::XML(nd)
@@ -55,6 +56,7 @@ module Dependabot
55
56
  node_requirement == declaring_requirement.fetch(:requirement)
56
57
  end
57
58
  end
59
+ # rubocop:enable Metrics/PerceivedComplexity
58
60
 
59
61
  def deep_find_declarations(string)
60
62
  string.scan(DECLARATION_REGEX).flat_map do |matching_node|
@@ -52,6 +52,7 @@ module Dependabot
52
52
  end
53
53
 
54
54
  # rubocop:disable Metrics/CyclomaticComplexity
55
+ # rubocop:disable Metrics/PerceivedComplexity
55
56
  def fetch_declaration_strings
56
57
  deep_find_declarations(declaring_file.content).select do |nd|
57
58
  node = Nokogiri::XML(nd)
@@ -68,8 +69,10 @@ module Dependabot
68
69
  node_requirement == declaring_requirement.fetch(:requirement)
69
70
  end
70
71
  end
72
+ # rubocop:enable Metrics/PerceivedComplexity
71
73
  # rubocop:enable Metrics/CyclomaticComplexity
72
74
 
75
+ # rubocop:disable Metrics/PerceivedComplexity
73
76
  def get_node_version_value(node)
74
77
  attribute = "Version"
75
78
  node.attribute(attribute)&.value&.strip ||
@@ -77,6 +80,7 @@ module Dependabot
77
80
  node.attribute(attribute.downcase)&.value&.strip ||
78
81
  node.at_xpath("./#{attribute.downcase}")&.content&.strip
79
82
  end
83
+ # rubocop:enable Metrics/PerceivedComplexity
80
84
 
81
85
  def deep_find_declarations(string)
82
86
  string.scan(DECLARATION_REGEX).flat_map do |matching_node|
@@ -32,7 +32,8 @@ module Dependabot
32
32
 
33
33
  def source_from_anywhere_in_nuspec(nuspec)
34
34
  github_urls = []
35
- nuspec.to_s.scan(Source::SOURCE_REGEX) do
35
+ nuspec.to_s.force_encoding(Encoding::UTF_8).
36
+ scan(Source::SOURCE_REGEX) do
36
37
  github_urls << Regexp.last_match.to_s
37
38
  end
38
39
 
@@ -86,6 +87,7 @@ module Dependabot
86
87
  source.fetch("source_url")
87
88
  end
88
89
 
90
+ # rubocop:disable Metrics/PerceivedComplexity
89
91
  def auth_header
90
92
  source = dependency.requirements.
91
93
  find { |r| r&.fetch(:source) }&.fetch(:source)
@@ -108,6 +110,7 @@ module Dependabot
108
110
  { "Authorization" => "Bearer #{token}" }
109
111
  end
110
112
  end
113
+ # rubocop:enable Metrics/PerceivedComplexity
111
114
  end
112
115
  end
113
116
  end
@@ -93,10 +93,12 @@ module Dependabot
93
93
 
94
94
  def build_v2_url(response, repo_details)
95
95
  doc = Nokogiri::XML(response.body)
96
+
96
97
  doc.remove_namespaces!
97
98
  base_url = doc.at_xpath("service")&.attributes&.
98
99
  fetch("base", nil)&.value
99
- return unless base_url
100
+
101
+ base_url ||= repo_details.fetch(:url)
100
102
 
101
103
  {
102
104
  repository_url: base_url,
@@ -148,6 +150,8 @@ module Dependabot
148
150
  end
149
151
 
150
152
  # rubocop:disable Metrics/CyclomaticComplexity
153
+ # rubocop:disable Metrics/PerceivedComplexity
154
+ # rubocop:disable Metrics/AbcSize
151
155
  def repos_from_config_file(config_file)
152
156
  doc = Nokogiri::XML(config_file.content)
153
157
  doc.remove_namespaces!
@@ -179,6 +183,8 @@ module Dependabot
179
183
 
180
184
  sources
181
185
  end
186
+ # rubocop:enable Metrics/AbcSize
187
+ # rubocop:enable Metrics/PerceivedComplexity
182
188
  # rubocop:enable Metrics/CyclomaticComplexity
183
189
 
184
190
  def default_repository_details
@@ -193,6 +199,7 @@ module Dependabot
193
199
  }
194
200
  end
195
201
 
202
+ # rubocop:disable Metrics/PerceivedComplexity
196
203
  def add_config_file_credentials(sources:, doc:)
197
204
  sources.each do |source_details|
198
205
  key = source_details.fetch(:key)
@@ -225,6 +232,7 @@ module Dependabot
225
232
 
226
233
  sources
227
234
  end
235
+ # rubocop:enable Metrics/PerceivedComplexity
228
236
 
229
237
  def remove_wrapping_zero_width_chars(string)
230
238
  string.force_encoding("UTF-8").encode.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-nuget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.119.2
4
+ version: 0.120.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-02 00:00:00.000000000 Z
11
+ date: 2020-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.119.2
19
+ version: 0.120.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.119.2
26
+ version: 0.120.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.88.0
103
+ version: 0.91.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.88.0
110
+ version: 0.91.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: vcr
113
113
  requirement: !ruby/object:Gem::Requirement