dependabot-common 0.106.16 → 0.106.17

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: 144baf835971a7e5f18ba4b93f83d3a03626a2173c52825f9b39ae6a59f0fa33
4
- data.tar.gz: 62a946ed6499692203709bce5cfc20e5a5e77da8e34bc492b8912f759ddede00
3
+ metadata.gz: 8724a667c9672dc25b113f0d95fccecac74263acaa19ef1b059de3589e128b80
4
+ data.tar.gz: 82ef1fb2496cb8eb1f2032969c3a2f98ae948d5f5f7bd536899ff0237370e6e8
5
5
  SHA512:
6
- metadata.gz: f0ada47028ee4319c1eaeaf6267784064f28b7261639026a836f68780370f470e9d3b8c90d2d1e023be57663a6fa8257d93481bd89c8081fc1aa50a7e5ed770d
7
- data.tar.gz: 5ac228997f11270d23041e58af21d976e7961e33e2a3d3cb3fb961bdc043cdb313bc20e0e13a5a0bf6757e3e9b59e9285121ed94d456ff631413ececba8849a3
6
+ metadata.gz: 9ca073a5222a2bed55307ee6ec5d5a204323edbcf60d55e1d5d3ddf7d8d063378386d2f8529d29643947bb3bf1b39be2ed63c80c6d0ac7913ed0b73f16b6399e
7
+ data.tar.gz: 55586523f8ab17fa2b604c5b20079c125a24f8a72adc7f786c01f15ae7ce483eb52cb8542ea81671bf1f227494e52187d8e7d9a0f380830527d08b5f62c2730f
@@ -201,10 +201,16 @@ module Dependabot
201
201
  gitlab_client.
202
202
  repo_tree(repo, path: path, ref_name: commit, per_page: 100).
203
203
  map do |file|
204
+ type = case file.type
205
+ when "blob" then "file"
206
+ when "tree" then "dir"
207
+ else file.fetch("type")
208
+ end
209
+
204
210
  OpenStruct.new(
205
211
  name: file.name,
206
212
  path: file.path,
207
- type: file.type == "blob" ? "file" : file.type,
213
+ type: type,
208
214
  size: 0 # GitLab doesn't return file size
209
215
  )
210
216
  end
@@ -265,9 +265,14 @@ module Dependabot
265
265
  def fetch_bitbucket_file_list
266
266
  branch = default_bitbucket_branch
267
267
  bitbucket_client.fetch_repo_contents(source.repo).map do |file|
268
+ type = case file.fetch("type")
269
+ when "commit_file" then "file"
270
+ when "commit_directory" then "dir"
271
+ else file.fetch("type")
272
+ end
268
273
  OpenStruct.new(
269
274
  name: file.fetch("path").split("/").last,
270
- type: file.fetch("type") == "commit_file" ? "file" : file["type"],
275
+ type: type,
271
276
  size: file.fetch("size", 100),
272
277
  html_url: "#{source.url}/src/#{branch}/#{file['path']}",
273
278
  download_url: "#{source.url}/raw/#{branch}/#{file['path']}"
@@ -281,9 +286,14 @@ module Dependabot
281
286
 
282
287
  def fetch_gitlab_file_list
283
288
  gitlab_client.repo_tree(source.repo).map do |file|
289
+ type = case file.type
290
+ when "blob" then "file"
291
+ when "tree" then "dir"
292
+ else file.fetch("type")
293
+ end
284
294
  OpenStruct.new(
285
295
  name: file.name,
286
- type: file.type == "blob" ? "file" : file.type,
296
+ type: type,
287
297
  size: 100, # GitLab doesn't return file size
288
298
  html_url: "#{source.url}/blob/master/#{file.path}",
289
299
  download_url: "#{source.url}/raw/master/#{file.path}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.106.16"
4
+ VERSION = "0.106.17"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.106.16
4
+ version: 0.106.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot