avm 0.101.0 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8159d75fec13eab1272dc522e956b2bf755dc473c05ac52aabe9d8e4dcc102a
4
- data.tar.gz: 56236e1be5fe03bd0d6b780ffa672ea01fdd6420db3c31b714a996e059e12ed4
3
+ metadata.gz: 99407bebdd63f7fd32b138edfbf95863e96981e71869347f131d0f2c9606e97c
4
+ data.tar.gz: d64bb5cc8c2ff3f71e59d780857b6b2caf6489de5d10d079db317c4e72177679
5
5
  SHA512:
6
- metadata.gz: 778a55da2129b6517e80deb203ed5c65e430957833f3f6f61e26b679670a073a6f09a5806105c9f952c74d377723803dd7b34639dce98d71a51c95dd02ec842d
7
- data.tar.gz: 0c92fcecb33b4def2ddf776369187edce9be7f25b70880274a4d813cb60d0b1fc3367ead17fe09c880359821e7a14576ab4dc54db026e17b7546df7d065b7d68
6
+ metadata.gz: 30374386114f387940c698961897a1e2e365331786b94b072afc8fe16d7b8ac729aed5be8213dc163d9449729b3bd11049b9f361c54414517d62bccf7051f4de
7
+ data.tar.gz: c94c7b7953feadc9b9c86968eb6db2e4d3aeae4183351309c33bf54ba0bf43907a57a0ee9498b5f16bb58861003663bc6b14ff93d920e9f8c24245896042a75c
@@ -7,7 +7,7 @@ module Avm
7
7
  class Context
8
8
  class InstanceDiscovery
9
9
  class SourceWrapper
10
- enable_simple_cache
10
+ enable_memoized
11
11
  enable_speaker
12
12
 
13
13
  common_constructor :owner, :logical_path, :parent_project
@@ -24,9 +24,10 @@ module Avm
24
24
  end
25
25
 
26
26
  # @return [Avm::Launcher::Instances::Base, nil]
27
- def self_project
27
+ memoize def self_project
28
28
  return nil unless logical_path.project?
29
29
 
30
+ infov logical_path, logical_path.real
30
31
  ::Avm::Launcher::Instances::Base.instanciate(logical_path,
31
32
  parent_project)
32
33
  end
@@ -49,10 +50,8 @@ module Avm
49
50
  []
50
51
  end
51
52
 
52
- protected
53
-
54
53
  # @return [Avm::Sources::Base]
55
- def warped_source_uncached
54
+ memoize def warped_source
56
55
  ::Avm::Registry.sources.detect(logical_path.warped)
57
56
  end
58
57
  end
@@ -4,32 +4,60 @@ module Avm
4
4
  module Sources
5
5
  class Base
6
6
  module Update
7
+ common_concern do
8
+ enable_speaker
9
+ end
10
+
7
11
  # To override in subclasses.
8
12
  def on_sub_updated
9
13
  # Do nothing
10
14
  end
11
15
 
16
+ # @return [void]
12
17
  def update
13
- update_self
18
+ update_self_before_subs
14
19
  update_subs
20
+ update_self_after_subs
15
21
  end
16
22
 
17
- def update_self
18
- scm.commit_if_change(-> { update_self_commit_message }) do
19
- update_self_content
20
- parent.if_present(&:on_sub_updated)
21
- end
23
+ # @param changes [Enumerable<Avm::Sources::Change>]
24
+ # @return [void]
25
+ def update_self(changes)
26
+ changes.each { |change| update_self_with_change(change) }
22
27
  end
23
28
 
24
- # Update source self content.
25
- #
26
- # To override in subclasses.
27
- def update_self_content
28
- # Do nothing
29
+ # @return [void]
30
+ def update_self_after_subs
31
+ infov __method__, self
32
+ update_self(update_self_changes_after_subs)
33
+ end
34
+
35
+ # @return [void]
36
+ def update_self_before_subs
37
+ infov __method__, self
38
+ update_self(update_self_changes_before_subs)
39
+ end
40
+
41
+ # Changes for update after subs' updating.
42
+ # @return [Enumerable<Avm::Sources::Change>]
43
+ def update_self_changes_after_subs
44
+ []
29
45
  end
30
46
 
31
- def update_self_commit_message
32
- i18n_translate(__method__)
47
+ # Changes for update before subs' updating.
48
+ # @return [Enumerable<Avm::Sources::Change>]
49
+ def update_self_changes_before_subs
50
+ []
51
+ end
52
+
53
+ # @param change [Avm::Sources::Change]
54
+ # @return [void]
55
+ def update_self_with_change(change)
56
+ infov 'Performing change', change
57
+ scm.commit_if_change(-> { change.commit_message }) do
58
+ change.perform
59
+ parent.if_present(&:on_sub_updated)
60
+ end
33
61
  end
34
62
  end
35
63
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Sources
5
+ class Change
6
+ acts_as_abstract
7
+ common_constructor :source
8
+
9
+ # Message for the commit.
10
+ # @return [String]
11
+ def commit_message
12
+ i18n_translate(__method__)
13
+ end
14
+
15
+ # Apply the changes to the source.
16
+ # @return [void]
17
+ def perform
18
+ raise_abstract_method __method__
19
+ end
20
+ end
21
+ end
22
+ 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.101.0'
4
+ VERSION = '0.102.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.101.0
4
+ version: 0.102.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: 2026-07-05 00:00:00.000000000 Z
11
+ date: 2026-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_cli
@@ -384,6 +384,7 @@ files:
384
384
  - lib/avm/sources/base/update_sub.rb
385
385
  - lib/avm/sources/base/update_subs.rb
386
386
  - lib/avm/sources/base/version_bump.rb
387
+ - lib/avm/sources/change.rb
387
388
  - lib/avm/sources/configuration.rb
388
389
  - lib/avm/sources/configuration/rubocop.rb
389
390
  - lib/avm/sources/issues/deliver.rb