avm 0.82.0 → 0.83.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: ba7de7fb51ef4cb64b226e0f9797ceee1253fd91aec2db6dc97d51fa9ea1d9a0
4
- data.tar.gz: f6d75846fd246eba14ebb2b20dd0075c3c83d4177b4d017f806763bf1f9bf5df
3
+ metadata.gz: 604351198d39b18f5957ac599205ee2c3553b9158a830db6cd9473c337254762
4
+ data.tar.gz: 846e638a6fd9871a472da4a4dbef8614e40264e716e4bc1de6d5f99be1a26fc9
5
5
  SHA512:
6
- metadata.gz: 79c47096a1c10051bfa2c1371f8417a65375c386c81be0dc85998e95a3f11e4fba147760571a3f1e8506ab6e16dcfebcbb45307ab64bef6695c00c283cf2802f
7
- data.tar.gz: 9e92f65585c980504fc39eb098728c8be153a9cf70d7e0ba9656e0572cf6a9db593d20e829ba94bbbbc71480b6afeca16a6d0cb01069f6f7e378e9dd96f6ed74
6
+ metadata.gz: f0493cd888a5f886c00d04241fa4b887fd8b591d64cdbe8052c54a3098879c57968091e955854cf1b5de130106ca5a7dce3ce0b1f9d73487f637221ff71f7565
7
+ data.tar.gz: 3e9410b1deb34a3f5ad68eb766db1221b05b2701c5959bfb72ec08db2791fd9ab7820762ce1df955b2e1c6112a12b9ab4ad7339a350b34eaaa5984e2947fe3b5
@@ -0,0 +1,38 @@
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 Sub
9
+ class Remove
10
+ acts_as_instance_method
11
+
12
+ # !method initialize(sub)
13
+ # @param sub [Avm::Sources::Base::Sub]
14
+ common_constructor :sub
15
+ delegate :source, to: :sub
16
+
17
+ # @return [void]
18
+ def result
19
+ source.scm.commit_if_change(commit_message) { do_changes }
20
+ end
21
+
22
+ private
23
+
24
+ # @return [String]
25
+ def commit_message
26
+ sub.i18n_translate(:remove_commit_message, sub_path: sub.sub_path)
27
+ end
28
+
29
+ # @return [void]
30
+ def do_changes
31
+ ::FileUtils.rm_rf(sub.absolute_path)
32
+ source.on_sub_updated
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/sources/base/subs_paths'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Sources
8
+ class Base
9
+ class Sub
10
+ # !method initialize(source, sub_path)
11
+ # @param source [Avm::Sources::Base]
12
+ # @param sub_path [Pathname]
13
+ common_constructor :source, :sub_path do
14
+ self.sub_path = sub_path.to_pathname
15
+ end
16
+
17
+ # @return [Pathname]
18
+ def absolute_path
19
+ sub_path.expand_path(source.path)
20
+ end
21
+
22
+ require_sub __FILE__, require_mode: :kernel
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/sources/base/sub'
3
4
  require 'avm/sources/base/subs_paths'
4
5
  require 'eac_ruby_utils/core_ext'
5
6
 
@@ -17,6 +18,12 @@ module Avm
17
18
  subs.lazy.map { |sub| path.expand_path.child_of?(sub.path) ? sub : nil }.find(&:present?)
18
19
  end
19
20
 
21
+ # @param sub_path [Pathname]
22
+ # @return [Avm::Sources::Base::Sub]
23
+ def sub(sub_path)
24
+ ::Avm::Sources::Base::Sub.new(self, sub_path)
25
+ end
26
+
20
27
  # @return [Enumerable<Avm::Sources::Base>]
21
28
  def subs
22
29
  subs_paths_to_search
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.82.0'
4
+ VERSION = '0.83.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.82.0
4
+ version: 0.83.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-11-04 00:00:00.000000000 Z
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.38'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.38.1
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@ dependencies:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '0.38'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.38.1
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: eac_config
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -419,6 +425,8 @@ files:
419
425
  - lib/avm/sources/base/organizational.rb
420
426
  - lib/avm/sources/base/parent.rb
421
427
  - lib/avm/sources/base/stereotype.rb
428
+ - lib/avm/sources/base/sub.rb
429
+ - lib/avm/sources/base/sub/remove.rb
422
430
  - lib/avm/sources/base/subs.rb
423
431
  - lib/avm/sources/base/subs_paths.rb
424
432
  - lib/avm/sources/base/testing.rb