avm-eac_ruby_base1 0.34.0 → 0.35.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: '0551452197578de7d88bf0dd64036f934868b554dd4109d51bacdb185ab62a0a'
4
- data.tar.gz: 4e012d782e992b4124597b66dafd4a01ac7d11d8838001ca4e226394cdc32cae
3
+ metadata.gz: 047b53c01e9863005516d56747f17c0b404f1045ad84c0b87608c0ad4256019d
4
+ data.tar.gz: 74bb4e7007c935f345242e36bd2d5c0aa438939322d59250cbbeaaf26b5bd804
5
5
  SHA512:
6
- metadata.gz: 13380e052781533f80d899beda569abb36f5fb18267be920374351e48ba83f41709584f839ea3b3ec8f44b469bf8b9899544114c012fe4a8b4dcd115112db49a
7
- data.tar.gz: 78be6a19cea6806ead0261d93e08cc1264f0b1dfd515c16c9ad0ee14e500c442b58731bc94c57c422801d3b6c8e3499a539a30c8f3bff8b3d9619a4deedab7bc
6
+ metadata.gz: 853d612a021dabb3920c9de969719cad348714a8fb11e3f542abb2cdbcbfe5f5d3caba34ebf572a9ca78c58765487d81d59621c5aca42b9d2d0da46188095c0a
7
+ data.tar.gz: 4dc164a18cb11760acaba38b13f9bea3d8515054fec6c76cf777ba8e6d77bd5799b75de1b29c30eef2099635ff8609394a73bcc100497061c02198e95fb41632
@@ -7,7 +7,13 @@ module Avm
7
7
  module Rubygems
8
8
  class Gemspec
9
9
  class Dependency
10
- common_constructor :gemspec, :gem_name
10
+ enable_listable
11
+ lists.add_string :type, '' => :common, '_development' => :development,
12
+ '_runtime' => :runtime
13
+
14
+ common_constructor :gemspec, :gem_name, :type do
15
+ self.type = self.class.lists.type.value_validate!(type)
16
+ end
11
17
 
12
18
  def version_specs=(version_specs)
13
19
  gemspec.add_or_replace_gem_line(gem_name, version_specs)
@@ -7,8 +7,10 @@ module Avm
7
7
  module Rubygems
8
8
  class Gemspec
9
9
  require_sub __FILE__, require_dependency: true
10
+ enable_simple_cache
10
11
 
11
- DEPENDENCY_LINE_PARSER = /s\.add_dependency\s*'(\S+)'/.to_parser { |m| m[1] }
12
+ DEPENDENCY_LINE_PARSER = /s\.add([a-zA-Z0-9_]*)_dependency\s*'(\S+)'/
13
+ .to_parser { |m| [m[2], m[1]] }
12
14
 
13
15
  class << self
14
16
  def from_file(path)
@@ -18,15 +20,15 @@ module Avm
18
20
 
19
21
  common_constructor :lines
20
22
 
23
+ # @param gem_name [String]
21
24
  # @return [Avm::EacRubyBase1::Bundler::Gemfile::Dependency]
22
25
  def dependency(gem_name)
23
- ::Avm::EacRubyBase1::Rubygems::Gemspec::Dependency.new(self, gem_name)
26
+ dependencies_hash.fetch(gem_name)
24
27
  end
25
28
 
26
29
  # @return [Array<Avm::EacRubyBase1::Bundler::Gemfile::Dependency>]
27
30
  def dependencies
28
- lines.lazy.map { |line| DEPENDENCY_LINE_PARSER.parse(line) }.compact_blank
29
- .map { |gem_name| dependency(gem_name) }.to_a
31
+ dependencies_hash.values
30
32
  end
31
33
 
32
34
  def write(path)
@@ -36,6 +38,21 @@ module Avm
36
38
  def to_text
37
39
  lines.map { |line| "#{line}\n" }.join
38
40
  end
41
+
42
+ protected
43
+
44
+ # @param gem_name [String]
45
+ # @param type [String] Avm::EacRubyBase1::Rubygems::Gemspec::Dependency::TYPE_*
46
+ # @return [Avm::EacRubyBase1::Bundler::Gemfile::Dependency]
47
+ def create_dependency(gem_name, type)
48
+ ::Avm::EacRubyBase1::Rubygems::Gemspec::Dependency.new(self, gem_name, type)
49
+ end
50
+
51
+ # @return [Hash<String, Avm::EacRubyBase1::Bundler::Gemfile::Dependency>]
52
+ def dependencies_hash_uncached
53
+ lines.lazy.map { |line| DEPENDENCY_LINE_PARSER.parse(line) }.compact_blank
54
+ .map { |dependency_args| create_dependency(*dependency_args) }.index_by(&:gem_name)
55
+ end
39
56
  end
40
57
  end
41
58
  end
@@ -10,14 +10,14 @@ module Avm
10
10
  enable_simple_cache
11
11
  common_constructor :name
12
12
 
13
- # @return [String]
13
+ # @return [Gem::Version, nil]
14
14
  def maximum_number
15
- numbers.max
15
+ numbers.max.if_present { |v| ::Gem::Version.new(v) }
16
16
  end
17
17
 
18
- # @return [Array<String>]
18
+ # @return [Array<Gem::Version>]
19
19
  def numbers
20
- versions.map { |v| v.fetch('number') }
20
+ versions.map { |v| ::Gem::Version.new(v.fetch('number')) }
21
21
  end
22
22
 
23
23
  protected
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.34.0'
5
+ VERSION = '0.35.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-eac_ruby_base1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.0
4
+ version: 0.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-29 00:00:00.000000000 Z
11
+ date: 2024-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.92'
19
+ version: '0.94'
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.92'
26
+ version: '0.94'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: avm-eac_generic_base0
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +58,20 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: 0.5.1
61
+ - !ruby/object:Gem::Dependency
62
+ name: eac_ruby_gem_support
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.10'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.10'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: eac_ruby_utils
63
77
  requirement: !ruby/object:Gem::Requirement