dependabot-hex 0.287.0 → 0.289.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: 1dcc9a57c29a3ce5b1f14590debf4e252bddacd38f6d8448f78e9fae197b0d59
4
- data.tar.gz: a38bd038d95e6550c28a4719542358bce869c6019e9b9691b0ca28bd3c175faa
3
+ metadata.gz: e1a6a8ea923d4b4c8c7453350fb4b8edc49f757a42d7080b62ba6add4252e447
4
+ data.tar.gz: c2898f3e954de3ebac1247beb9b08ebb16048e12edd610c46ff7e6f408cec6b9
5
5
  SHA512:
6
- metadata.gz: d7a3a05ef35cab8626bb4e2ea1f7b7bbf64474cf45bbbee43ce57b1fc19cb4c26ce3bd2187e84fb31519e5fb19385e367dcd591ea0ae5070faa0c6629e51dbac
7
- data.tar.gz: c2df7196e6e51087d1034a68c4bbf4f4882079a2e5007771802b63c74bca627d12de3e98c046411fd2708febf9992d4fec36d8790272da15e957353817fad819
6
+ metadata.gz: 972cb78cda36e1c64660e8963183372c20fe616a8ef00ce3630f17b7b665b6c9ecbd055d774b614422394a40faeccec3649adce7691caffb1b9c46a6cc204389
7
+ data.tar.gz: 552d415576209ace03422bd57e848a29d1503a73f86731d07f7ff9b49c5fee83631bcf68e1ceabca6fd22486f5d49f0a27ae195740a3dda76941e19abfed0c8a
@@ -7,12 +7,16 @@ require "dependabot/file_parsers"
7
7
  require "dependabot/file_parsers/base"
8
8
  require "dependabot/hex/file_updater/mixfile_sanitizer"
9
9
  require "dependabot/hex/native_helpers"
10
+ require "dependabot/hex/language"
11
+ require "dependabot/hex/package_manager"
12
+ require "dependabot/hex/requirement"
10
13
  require "dependabot/shared_helpers"
11
14
  require "dependabot/errors"
12
15
 
13
16
  # For docs, see https://hexdocs.pm/mix/Mix.Tasks.Deps.html
14
17
  module Dependabot
15
18
  module Hex
19
+ extend T::Sig
16
20
  class FileParser < Dependabot::FileParsers::Base
17
21
  extend T::Sig
18
22
  require "dependabot/file_parsers/base/dependency_set"
@@ -44,6 +48,17 @@ module Dependabot
44
48
  dependency_set.dependencies.sort_by(&:name)
45
49
  end
46
50
 
51
+ sig { returns(Ecosystem) }
52
+ def ecosystem
53
+ @ecosystem ||= T.let(begin
54
+ Ecosystem.new(
55
+ name: ECOSYSTEM,
56
+ package_manager: package_manager,
57
+ language: language
58
+ )
59
+ end, T.nilable(Dependabot::Ecosystem))
60
+ end
61
+
47
62
  private
48
63
 
49
64
  sig { returns(T::Array[T.any(T::Hash[String, String], T::Hash[String, T.untyped])]) }
@@ -137,6 +152,43 @@ module Dependabot
137
152
  def lockfile
138
153
  @lockfile ||= T.let(get_original_file("mix.lock"), T.nilable(Dependabot::DependencyFile))
139
154
  end
155
+
156
+ sig { returns(Ecosystem::VersionManager) }
157
+ def package_manager
158
+ @package_manager ||= T.let(
159
+ PackageManager.new(hex_version),
160
+ T.nilable(Dependabot::Hex::PackageManager)
161
+ )
162
+ end
163
+
164
+ sig { returns(T.nilable(Ecosystem::VersionManager)) }
165
+ def language
166
+ @language ||= T.let(
167
+ Language.new(elixir_version),
168
+ T.nilable(Dependabot::Hex::Language)
169
+ )
170
+ end
171
+
172
+ sig { returns(String) }
173
+ def hex_version
174
+ T.must(T.must(hex_info).fetch(:hex_version))
175
+ end
176
+
177
+ sig { returns(String) }
178
+ def elixir_version
179
+ T.must(T.must(hex_info).fetch(:elixir_version))
180
+ end
181
+
182
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
183
+ def hex_info
184
+ @hex_info ||= T.let(begin
185
+ version = SharedHelpers.run_shell_command("mix hex.info")
186
+ {
187
+ hex_version: version.match(/Hex: \s*(\d+\.\d+(.\d+)*)/)&.captures&.first,
188
+ elixir_version: version.match(/Elixir: \s*(\d+\.\d+(.\d+)*)/)&.captures&.first
189
+ }
190
+ end, T.nilable(T::Hash[Symbol, T.nilable(String)]))
191
+ end
140
192
  end
141
193
  end
142
194
  end
@@ -0,0 +1,21 @@
1
+ # typed: strong
2
+ # frozen_string_literal: true
3
+
4
+ require "sorbet-runtime"
5
+ require "dependabot/ecosystem"
6
+ require "dependabot/hex/version"
7
+
8
+ module Dependabot
9
+ module Hex
10
+ LANGUAGE = "elixir"
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(LANGUAGE, Version.new(raw_version))
18
+ end
19
+ end
20
+ end
21
+ 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/hex/version"
7
+
8
+ module Dependabot
9
+ module Hex
10
+ ECOSYSTEM = "hex"
11
+ PACKAGE_MANAGER = "hex"
12
+ SUPPORTED_HEX_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_HEX_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_HEX_VERSIONS,
26
+ SUPPORTED_HEX_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-hex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.287.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-19 00:00:00.000000000 Z
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.287.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.287.0
26
+ version: 0.289.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -259,8 +259,10 @@ files:
259
259
  - lib/dependabot/hex/file_updater/mixfile_requirement_updater.rb
260
260
  - lib/dependabot/hex/file_updater/mixfile_sanitizer.rb
261
261
  - lib/dependabot/hex/file_updater/mixfile_updater.rb
262
+ - lib/dependabot/hex/language.rb
262
263
  - lib/dependabot/hex/metadata_finder.rb
263
264
  - lib/dependabot/hex/native_helpers.rb
265
+ - lib/dependabot/hex/package_manager.rb
264
266
  - lib/dependabot/hex/requirement.rb
265
267
  - lib/dependabot/hex/update_checker.rb
266
268
  - lib/dependabot/hex/update_checker/file_preparer.rb
@@ -272,7 +274,7 @@ licenses:
272
274
  - MIT
273
275
  metadata:
274
276
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
275
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.287.0
277
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.289.0
276
278
  post_install_message:
277
279
  rdoc_options: []
278
280
  require_paths: