avm-eac_ruby_base1 0.34.1 → 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: ba1b2ccbba6af68c7a620b57f52799eab587b01c612b4a469bbd755e0506652b
4
- data.tar.gz: dc698a77abe634b26197ceb28241a15988d99c45bcd2d130c3b3a60ed2e2507d
3
+ metadata.gz: 047b53c01e9863005516d56747f17c0b404f1045ad84c0b87608c0ad4256019d
4
+ data.tar.gz: 74bb4e7007c935f345242e36bd2d5c0aa438939322d59250cbbeaaf26b5bd804
5
5
  SHA512:
6
- metadata.gz: 6203de727473926431355e4e945198b91a3566163649ed1fda516a0f8be0f273aab3de661cc7bc782cdafa457d2bae10e801fa60f99924a2327870f7244cd80b
7
- data.tar.gz: 5fdf7b83ea6cb8c8113cb84357d3c8a571f539aed4bc6d9cbfb2a1f0114d368a8e01cc7fb4d87192b1c147a9a9dc2e9a6bb22b15d2a393c4b177d8a7d512ba78
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.34.1'
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.1
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-06-07 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