avm-files 0.7.0 → 0.8.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: a1be6222438f1634817d7dd940ecdd13176a121b118b0d7c2b8b381bf7c0e0da
4
- data.tar.gz: eb94719a18444b4008a1774871a7154133a65a1e5839764340250e4f284b138a
3
+ metadata.gz: 035c50fa79547c82e98b29822c784064404994665967962f18bbfe41c93447bc
4
+ data.tar.gz: 8e7660d28d49c4703c93f4cdc1627a4aa0b752eeca01dd389e4f0807cd3402a5
5
5
  SHA512:
6
- metadata.gz: db17f17620d7924812c35bf65c01442eddad46569a37ed40bbece6f63671fc25ea3ee25faa9d6830a377dfce957d77319260f9b2f4558e0f0cad803590f18250
7
- data.tar.gz: e0bf2f93667968428c926aae9ddcd665b9e48f68d311e0f00985b0bb2bf0cae835a567dbef253b0c34332c9e3bf38bb70a10313ad311d4f2f8530df654c81677
6
+ metadata.gz: 4ef9a250fc5164ea8ae1f5f2b0eec5dada07f31a65cb370a0b4289d67b50daf1b91251672045e36d41cd056755de086c6edbaa2ed19bc308b518f016da6e5803
7
+ data.tar.gz: e3b2b6163dbba38bb220589d16041a28dc0a0ead6331fa2a18d2291cb799cdf4aaccc78e846d5cbed8380659cd537eaad76873528dba2f9acb2edb995b0eefcd
@@ -18,6 +18,13 @@ module Avm
18
18
  def write_on(target_dir)
19
19
  target_dir.join(target_path).write(content)
20
20
  end
21
+
22
+ protected
23
+
24
+ # @return [Enumerable<Symbol>]
25
+ def to_s_attributes
26
+ %i[target_path content]
27
+ end
21
28
  end
22
29
  end
23
30
  end
@@ -19,6 +19,11 @@ module Avm
19
19
 
20
20
  ::FileUtils.cp_r("#{source_path}/.", target_dir.to_path)
21
21
  end
22
+
23
+ # @return [Enumerable<Symbol>]
24
+ def to_s_attributes
25
+ [:source_path]
26
+ end
22
27
  end
23
28
  end
24
29
  end
@@ -6,7 +6,13 @@ module Avm
6
6
  module Files
7
7
  module Appendable
8
8
  class ResourceBase
9
+ acts_as_abstract :to_s_attributes
9
10
  common_constructor :appender
11
+
12
+ def to_s
13
+ v_to_s = to_s_attributes.map { |k| "#{k}: #{send(k)}" }.join(', ')
14
+ "#{self.class.name}[#{v_to_s}]"
15
+ end
10
16
  end
11
17
  end
12
18
  end
@@ -20,6 +20,11 @@ module Avm
20
20
  ::EacRubyUtils::Envs.local.command('tar', '-xf', '-', '-C', target_dir)
21
21
  ).execute!
22
22
  end
23
+
24
+ # @return [Enumerable<Symbol>]
25
+ def to_s_attributes
26
+ [:command]
27
+ end
23
28
  end
24
29
  end
25
30
  end
@@ -8,20 +8,31 @@ module Avm
8
8
  module Files
9
9
  module Appendable
10
10
  class TemplatizedDirectory < ::Avm::Files::Appendable::ResourceBase
11
- attr_reader :source_path
11
+ common_constructor :appender, :source_path, super_args: -> { [appender] }
12
12
 
13
- def initialize(appender, source_path)
14
- super(appender)
15
- @source_path = source_path
13
+ # @return [Object]
14
+ def applier
15
+ return source_path if source_path.respond_to?(:apply)
16
+
17
+ applier_from_path
18
+ end
19
+
20
+ # @return [EacTemplates::Variables::Directory]
21
+ def applier_from_path
22
+ raise "\"#{source_path}\" is not a directory" unless ::File.directory?(source_path)
23
+
24
+ ::EacTemplates::Variables::Directory.new(source_path)
16
25
  end
17
26
 
18
27
  def write_on(target_dir)
19
28
  raise 'Variables source not set' if appender.variables_source.blank?
20
29
 
21
- ::EacTemplates::Variables::Directory.new(source_path).apply(
22
- appender.variables_source,
23
- target_dir
24
- )
30
+ applier.apply(appender.variables_source, target_dir)
31
+ end
32
+
33
+ # @return [Enumerable<Symbol>]
34
+ def to_s_attributes
35
+ [:source_path]
25
36
  end
26
37
  end
27
38
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Files
5
- VERSION = '0.7.0'
5
+ VERSION = '0.8.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-files
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.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-02-13 00:00:00.000000000 Z
11
+ date: 2024-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -16,96 +16,90 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.84'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.84.2
19
+ version: '0.93'
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.84'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.84.2
26
+ version: '0.93'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: eac_cli
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '0.40'
33
+ version: '0.42'
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
38
  - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '0.40'
40
+ version: '0.42'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: eac_fs
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0.17'
47
+ version: '0.18'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '0.17'
54
+ version: '0.18'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: eac_ruby_utils
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
59
  - - "~>"
66
60
  - !ruby/object:Gem::Version
67
- version: '0.121'
61
+ version: '0.122'
68
62
  type: :runtime
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
66
  - - "~>"
73
67
  - !ruby/object:Gem::Version
74
- version: '0.121'
68
+ version: '0.122'
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: eac_templates
77
71
  requirement: !ruby/object:Gem::Requirement
78
72
  requirements:
79
73
  - - "~>"
80
74
  - !ruby/object:Gem::Version
81
- version: '0.5'
75
+ version: '0.7'
82
76
  - - ">="
83
77
  - !ruby/object:Gem::Version
84
- version: 0.5.1
78
+ version: 0.7.1
85
79
  type: :runtime
86
80
  prerelease: false
87
81
  version_requirements: !ruby/object:Gem::Requirement
88
82
  requirements:
89
83
  - - "~>"
90
84
  - !ruby/object:Gem::Version
91
- version: '0.5'
85
+ version: '0.7'
92
86
  - - ">="
93
87
  - !ruby/object:Gem::Version
94
- version: 0.5.1
88
+ version: 0.7.1
95
89
  - !ruby/object:Gem::Dependency
96
90
  name: eac_ruby_gem_support
97
91
  requirement: !ruby/object:Gem::Requirement
98
92
  requirements:
99
93
  - - "~>"
100
94
  - !ruby/object:Gem::Version
101
- version: '0.9'
95
+ version: '0.10'
102
96
  type: :development
103
97
  prerelease: false
104
98
  version_requirements: !ruby/object:Gem::Requirement
105
99
  requirements:
106
100
  - - "~>"
107
101
  - !ruby/object:Gem::Version
108
- version: '0.9'
102
+ version: '0.10'
109
103
  description:
110
104
  email:
111
105
  executables: []