avm 0.61.0 → 0.63.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: fbd9a676670802e3c3904a555bc7255ab8637a1b474131e6f39190192d47d64d
4
- data.tar.gz: 8f743999b2b25fe740cd813356e9104d9b29dcf03968c7a300afb31385babe83
3
+ metadata.gz: f5236fb00d6c8bc96cde8ed4fc6be6b50523b42d8a51f51a45b6fcaa14259080
4
+ data.tar.gz: 0d49606d43adaeef94fd86f335abc4953d4088c3831181bab8fa698889676568
5
5
  SHA512:
6
- metadata.gz: 1a96c7da39855abf2991b203b697ff69e61d4bdb4b322bebccf06066df2e59ab843d3bc5ecefc2e3a3011d7c514ec1854635d98e8d116089a55075bd7d07e166
7
- data.tar.gz: a066bec86aed66c6f2d8bd6f849534551c684340bc61fa67da7a94dd4fdcffc4ffc43b33cb237f184f20a418232587f762bea578f743095fd2eeb2155527c83e
6
+ metadata.gz: c62f8d4af9bf08011fc5ea9cdc78aea565f88f9778112e14896425468ac946109ac2a0cd3e5d439581405190bf32f9c303b4bae29ae9c7810508c10c0437b6d3
7
+ data.tar.gz: e42783ac12657162f41f0e1d5fb37a132c0cd1974b4b48d2008742738b73d96cf5368fa68deb5939a774c4df8ec120ae82867fcf1998a091770ff8c9d8d6f975
@@ -14,7 +14,7 @@ module Avm
14
14
  end
15
15
 
16
16
  def class_name
17
- file_format.file_resource_name(path)
17
+ file_format.file_resource_name(relative_path)
18
18
  end
19
19
 
20
20
  def commit_message
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Sources
7
+ module AutoCommit
8
+ class ForFile
9
+ common_constructor :source, :path, :rules
10
+
11
+ delegate :run, to: :scm_auto_commit
12
+
13
+ # @return [Pathname]
14
+ def path_for_auto_commit
15
+ path.relative_path_from(source_for_auto_commit.path)
16
+ end
17
+
18
+ # @return [Avm::Scms::AutoCommit::ForFile]
19
+ def scm_auto_commit
20
+ ::Avm::Scms::AutoCommit::ForFile.new(source_for_auto_commit.scm, path_for_auto_commit,
21
+ rules)
22
+ end
23
+
24
+ # @return [Avm::Sources::Base]
25
+ def source_for_auto_commit
26
+ source.sub_for_path(path) || source
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Sources
7
+ module AutoCommit
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -12,6 +12,11 @@ module Avm
12
12
  SUBS_EXCLUDE_PATHS_DEFAULT = [].freeze
13
13
  SUBS_INCLUDE_PATHS_DEFAULT = ['sub/*'].freeze
14
14
 
15
+ # @return [Avm::Sources::Base, nil]
16
+ def sub_for_path(path)
17
+ subs.lazy.map { |sub| path.expand_path.child_of?(sub.path) ? sub : nil }.find(&:present?)
18
+ end
19
+
15
20
  # @return [Enumerable<Avm::Sources::Base>]
16
21
  def subs
17
22
  subs_paths_to_search
@@ -33,10 +33,6 @@ module Avm
33
33
  def update_self_commit_message
34
34
  i18n_translate(__method__)
35
35
  end
36
-
37
- def update_subs
38
- subs.each { |sub| update_sub(sub) }
39
- end
40
36
  end
41
37
  end
42
38
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Sources
7
+ class Base
8
+ class UpdateSubs
9
+ enable_method_class
10
+
11
+ common_constructor :source
12
+
13
+ def result
14
+ source.subs.each { |sub| source.update_sub(sub) }
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Sources
5
+ class UpdateError < ::RuntimeError
6
+ end
7
+ end
8
+ end
data/lib/avm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.61.0'
4
+ VERSION = '0.63.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.61.0
4
+ version: 0.63.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2023-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.14'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.14.4
19
+ version: '0.16'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.14'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.14.4
26
+ version: '0.16'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: eac_cli
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -37,6 +31,9 @@ dependencies:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
33
  version: '0.30'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.30.1
40
37
  type: :runtime
41
38
  prerelease: false
42
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,6 +41,9 @@ dependencies:
44
41
  - - "~>"
45
42
  - !ruby/object:Gem::Version
46
43
  version: '0.30'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.30.1
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: eac_config
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.5'
67
+ version: '0.6'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '0.5'
74
+ version: '0.6'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: eac_fs
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -106,20 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '0.110'
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: 0.110.1
109
+ version: '0.112'
113
110
  type: :runtime
114
111
  prerelease: false
115
112
  version_requirements: !ruby/object:Gem::Requirement
116
113
  requirements:
117
114
  - - "~>"
118
115
  - !ruby/object:Gem::Version
119
- version: '0.110'
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- version: 0.110.1
116
+ version: '0.112'
123
117
  - !ruby/object:Gem::Dependency
124
118
  name: eac_templates
125
119
  requirement: !ruby/object:Gem::Requirement
@@ -406,6 +400,8 @@ files:
406
400
  - lib/avm/source_generators/option_list.rb
407
401
  - lib/avm/source_generators/runner.rb
408
402
  - lib/avm/sources.rb
403
+ - lib/avm/sources/auto_commit.rb
404
+ - lib/avm/sources/auto_commit/for_file.rb
409
405
  - lib/avm/sources/base.rb
410
406
  - lib/avm/sources/base/application.rb
411
407
  - lib/avm/sources/base/configuration.rb
@@ -419,6 +415,7 @@ files:
419
415
  - lib/avm/sources/base/testing.rb
420
416
  - lib/avm/sources/base/update.rb
421
417
  - lib/avm/sources/base/update_sub.rb
418
+ - lib/avm/sources/base/update_subs.rb
422
419
  - lib/avm/sources/base/version_bump.rb
423
420
  - lib/avm/sources/configuration.rb
424
421
  - lib/avm/sources/configuration/rubocop.rb
@@ -428,6 +425,7 @@ files:
428
425
  - lib/avm/sources/tests/performer.rb
429
426
  - lib/avm/sources/tests/result.rb
430
427
  - lib/avm/sources/tests/single.rb
428
+ - lib/avm/sources/update_error.rb
431
429
  - lib/avm/sync.rb
432
430
  - lib/avm/version.rb
433
431
  - lib/avm/version_number.rb