dependabot-cargo 0.94.7 → 0.94.8

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: 29fd7cece76acc3c05ff92790e5469c78d8fe7ef2b93f55bacb6dc99ed620cca
4
- data.tar.gz: 57768d258414cd60505f5358cf00369d5834f0616e98d9126a872a56ffc16e93
3
+ metadata.gz: 2cee607bf20f532f1385061a48f3deffe5a229a94afbf70fe6729c2507295a1d
4
+ data.tar.gz: c9ece501b8ef817f7a9595e572e26a43a4af5970690015be742c423a7575162a
5
5
  SHA512:
6
- metadata.gz: f2c730106ebf3c650a6a3c11bd86a93cb926b1925723ba6ac1fcc97fd9d67e30eeed2cef6a35f13b24daab691c5236be3718b5107f6cefbd91d09950624df811
7
- data.tar.gz: 47c0661088136eee87d8bc009131c99df25f1d3e89147748a58a7eb892d6d0d763b0ae97ac418ca478f9f0529b3b760ed31d23c056adc3a1c14aeb5aa590acfa
6
+ metadata.gz: 8372539630a93279e8aa9f02499345d26e1f4631db7a72539728ac9f6f8eb022681ae8de6483727ef247676d5d4362b23b2834827325a4715f3ac4e1d9b65836
7
+ data.tar.gz: e7105d8834fdc29f279cfbecfaba5f68b8ac8b1f33ce73e0812a4dc723e76b54af1e87de46a1c2efa4c0cb83229bf719b81e4e533d93f8501adab45bf8ad6da9
@@ -60,17 +60,22 @@ module Dependabot
60
60
  raise Dependabot::DependencyFileNotResolvable, error.message
61
61
  end
62
62
 
63
+ # rubocop:disable Metrics/PerceivedComplexity
63
64
  def dependency_spec
64
65
  spec = dependency.name
65
66
 
66
- if git_dependency?
67
+ if git_dependency? && git_source_url && git_previous_version
68
+ spec = "#{git_source_url}##{git_previous_version}"
69
+ elsif git_dependency?
67
70
  spec += ":#{git_previous_version}" if git_previous_version
68
71
  elsif dependency.previous_version
69
72
  spec += ":#{dependency.previous_version}"
73
+ spec = "https://github.com/rust-lang/crates.io-index#" + spec
70
74
  end
71
75
 
72
76
  spec
73
77
  end
78
+ # rubocop:enable Metrics/PerceivedComplexity
74
79
 
75
80
  def git_previous_version
76
81
  TomlRB.parse(lockfile.content).
@@ -80,6 +85,12 @@ module Dependabot
80
85
  fetch("version")
81
86
  end
82
87
 
88
+ def git_source_url
89
+ dependency.previous_requirements.
90
+ find { |r| r.dig(:source, :type) == "git" }&.
91
+ dig(:source, :url)
92
+ end
93
+
83
94
  def desired_lockfile_content
84
95
  return dependency.version if git_dependency?
85
96
 
@@ -78,17 +78,22 @@ module Dependabot
78
78
  end
79
79
  end
80
80
 
81
+ # rubocop:disable Metrics/PerceivedComplexity
81
82
  def dependency_spec
82
83
  spec = dependency.name
83
84
 
84
- if git_dependency?
85
+ if git_dependency? && git_source_url && git_dependency_version
86
+ spec = "#{git_source_url}##{git_dependency_version}"
87
+ elsif git_dependency?
85
88
  spec += ":#{git_dependency_version}" if git_dependency_version
86
89
  elsif dependency.version
87
90
  spec += ":#{dependency.version}"
91
+ spec = "https://github.com/rust-lang/crates.io-index#" + spec
88
92
  end
89
93
 
90
94
  spec
91
95
  end
96
+ # rubocop:enable Metrics/PerceivedComplexity
92
97
 
93
98
  def run_cargo_command(command)
94
99
  start = Time.now
@@ -216,6 +221,12 @@ module Dependabot
216
221
  fetch("version")
217
222
  end
218
223
 
224
+ def git_source_url
225
+ dependency.requirements.
226
+ find { |r| r.dig(:source, :type) == "git" }&.
227
+ dig(:source, :url)
228
+ end
229
+
219
230
  def dummy_app_content
220
231
  %{fn main() {\nprintln!("Hello, world!");\n}}
221
232
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-cargo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.94.7
4
+ version: 0.94.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-03 00:00:00.000000000 Z
11
+ date: 2019-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.94.7
19
+ version: 0.94.8
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.94.7
26
+ version: 0.94.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement