dependabot-cargo 0.288.0 → 0.289.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/cargo/file_parser.rb +44 -0
- data/lib/dependabot/cargo/language.rb +24 -0
- data/lib/dependabot/cargo/package_manager.rb +41 -0
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d229a4de3353bc97ff2751d53e4aa066be8b0c8f1d13ac37b36ffd3fe1bb1ff
|
4
|
+
data.tar.gz: a0981fe5014b151be3bd66ebbd09f4584afd080acc11b26e199fc36564f70c0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4a6ab78292f19fae8e511ce97a18f240725bccddf4f5f5616501c6145e5f7ca3aa6484b84938f51cc5bca6a22548b9ce53bd567072996da14af6a8a3174e142
|
7
|
+
data.tar.gz: 745af85db257f302caf74607481cb6c7fee296181d0bc67cb1d56370729fec6dbae8439128132685a331c233ea5d862bc4af9b461d7722a7494e53cf2cf3d911
|
@@ -11,6 +11,8 @@ require "dependabot/cargo/requirement"
|
|
11
11
|
require "dependabot/cargo/version"
|
12
12
|
require "dependabot/errors"
|
13
13
|
require "dependabot/cargo/registry_fetcher"
|
14
|
+
require "dependabot/cargo/language"
|
15
|
+
require "dependabot/cargo/package_manager"
|
14
16
|
|
15
17
|
# Relevant Cargo docs can be found at:
|
16
18
|
# - https://doc.rust-lang.org/cargo/reference/manifest.html
|
@@ -42,8 +44,50 @@ module Dependabot
|
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
47
|
+
sig { returns(Ecosystem) }
|
48
|
+
def ecosystem
|
49
|
+
@ecosystem ||= T.let(begin
|
50
|
+
Ecosystem.new(
|
51
|
+
name: ECOSYSTEM,
|
52
|
+
package_manager: package_manager,
|
53
|
+
language: language
|
54
|
+
)
|
55
|
+
end, T.nilable(Dependabot::Ecosystem))
|
56
|
+
end
|
57
|
+
|
45
58
|
private
|
46
59
|
|
60
|
+
sig { returns(Ecosystem::VersionManager) }
|
61
|
+
def package_manager
|
62
|
+
@package_manager ||= T.let(
|
63
|
+
PackageManager.new(T.must(cargo_version)),
|
64
|
+
T.nilable(Dependabot::Cargo::PackageManager)
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
68
|
+
sig { returns(T.nilable(Ecosystem::VersionManager)) }
|
69
|
+
def language
|
70
|
+
@language ||= T.let(begin
|
71
|
+
Language.new(T.must(rust_version))
|
72
|
+
end, T.nilable(Dependabot::Cargo::Language))
|
73
|
+
end
|
74
|
+
|
75
|
+
sig { returns(T.nilable(String)) }
|
76
|
+
def rust_version
|
77
|
+
@rust_version ||= T.let(begin
|
78
|
+
version = SharedHelpers.run_shell_command("rustc --version")
|
79
|
+
version.match(/rustc\s*(\d+\.\d+(.\d+)*)/)&.captures&.first
|
80
|
+
end, T.nilable(String))
|
81
|
+
end
|
82
|
+
|
83
|
+
sig { returns(T.nilable(String)) }
|
84
|
+
def cargo_version
|
85
|
+
@cargo_version ||= T.let(begin
|
86
|
+
version = SharedHelpers.run_shell_command("cargo --version")
|
87
|
+
version.match(/cargo\s*(\d+\.\d+(.\d+)*)/)&.captures&.first
|
88
|
+
end, T.nilable(String))
|
89
|
+
end
|
90
|
+
|
47
91
|
def check_rust_workspace_root
|
48
92
|
cargo_toml = dependency_files.find { |f| f.name == "Cargo.toml" }
|
49
93
|
workspace_root = parsed_file(cargo_toml).dig("package", "workspace")
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "sorbet-runtime"
|
5
|
+
require "dependabot/ecosystem"
|
6
|
+
require "dependabot/cargo/version"
|
7
|
+
|
8
|
+
module Dependabot
|
9
|
+
module Cargo
|
10
|
+
LANGUAGE = "rust"
|
11
|
+
|
12
|
+
class Language < Dependabot::Ecosystem::VersionManager
|
13
|
+
extend T::Sig
|
14
|
+
|
15
|
+
sig { params(raw_version: String).void }
|
16
|
+
def initialize(raw_version)
|
17
|
+
super(
|
18
|
+
LANGUAGE,
|
19
|
+
Version.new(raw_version)
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "sorbet-runtime"
|
5
|
+
require "dependabot/ecosystem"
|
6
|
+
require "dependabot/cargo/version"
|
7
|
+
|
8
|
+
module Dependabot
|
9
|
+
module Cargo
|
10
|
+
ECOSYSTEM = "rust"
|
11
|
+
PACKAGE_MANAGER = "cargo"
|
12
|
+
SUPPORTED_CARGO_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version])
|
13
|
+
|
14
|
+
# When a version is going to be unsupported, it will be added here
|
15
|
+
DEPRECATED_CARGO_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version])
|
16
|
+
|
17
|
+
class PackageManager < Dependabot::Ecosystem::VersionManager
|
18
|
+
extend T::Sig
|
19
|
+
|
20
|
+
sig { params(raw_version: String).void }
|
21
|
+
def initialize(raw_version)
|
22
|
+
super(
|
23
|
+
PACKAGE_MANAGER,
|
24
|
+
Version.new(raw_version),
|
25
|
+
DEPRECATED_CARGO_VERSIONS,
|
26
|
+
SUPPORTED_CARGO_VERSIONS
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
sig { returns(T::Boolean) }
|
31
|
+
def deprecated?
|
32
|
+
false
|
33
|
+
end
|
34
|
+
|
35
|
+
sig { returns(T::Boolean) }
|
36
|
+
def unsupported?
|
37
|
+
false
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
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.
|
4
|
+
version: 0.289.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-05 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.
|
19
|
+
version: 0.289.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.
|
26
|
+
version: 0.289.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: debug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,7 +249,9 @@ files:
|
|
249
249
|
- lib/dependabot/cargo/file_updater/lockfile_updater.rb
|
250
250
|
- lib/dependabot/cargo/file_updater/manifest_updater.rb
|
251
251
|
- lib/dependabot/cargo/helpers.rb
|
252
|
+
- lib/dependabot/cargo/language.rb
|
252
253
|
- lib/dependabot/cargo/metadata_finder.rb
|
254
|
+
- lib/dependabot/cargo/package_manager.rb
|
253
255
|
- lib/dependabot/cargo/registry_fetcher.rb
|
254
256
|
- lib/dependabot/cargo/requirement.rb
|
255
257
|
- lib/dependabot/cargo/update_checker.rb
|
@@ -263,7 +265,7 @@ licenses:
|
|
263
265
|
- MIT
|
264
266
|
metadata:
|
265
267
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
266
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
268
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.289.0
|
267
269
|
post_install_message:
|
268
270
|
rdoc_options: []
|
269
271
|
require_paths:
|