eac_tools 0.60.1 → 0.60.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +32 -27
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +7 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_path_dockerfile +5 -0
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/source_generators/base.rb +2 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-eac_ubuntu_base0/Gemfile +3 -0
- data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +1 -1
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb +1 -1
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +1 -1
- data/sub/avm-files/avm-files.gemspec +5 -5
- data/sub/avm-files/lib/avm/files/appendable/templatized_directory.rb +2 -2
- data/sub/avm-files/lib/avm/files/version.rb +1 -1
- data/sub/eac_templates/Gemfile +8 -0
- data/sub/eac_templates/eac_templates.gemspec +19 -0
- data/sub/eac_templates/lib/eac_templates/core_ext.rb +4 -0
- data/sub/eac_templates/lib/eac_templates/interface_methods.rb +12 -0
- data/sub/eac_templates/lib/eac_templates/modules/ancestor/directory.rb +15 -0
- data/sub/eac_templates/lib/eac_templates/modules/ancestor/file.rb +15 -0
- data/sub/eac_templates/lib/eac_templates/modules/ancestor/fs_object.rb +32 -0
- data/sub/eac_templates/lib/eac_templates/modules/ancestor.rb +48 -0
- data/sub/eac_templates/lib/eac_templates/modules/base.rb +35 -0
- data/sub/eac_templates/lib/eac_templates/modules.rb +9 -0
- data/sub/eac_templates/lib/eac_templates/patches/module/erb_template.rb +9 -0
- data/sub/eac_templates/lib/eac_templates/patches/module/template.rb +9 -0
- data/sub/eac_templates/lib/eac_templates/patches/module.rb +4 -0
- data/sub/eac_templates/lib/eac_templates/patches/object/erb_template.rb +9 -0
- data/sub/eac_templates/lib/eac_templates/patches/object/template.rb +9 -0
- data/sub/eac_templates/lib/eac_templates/patches/object.rb +4 -0
- data/sub/eac_templates/lib/eac_templates/patches.rb +4 -0
- data/sub/eac_templates/lib/eac_templates/sources/directory.rb +24 -0
- data/sub/eac_templates/lib/eac_templates/sources/file.rb +24 -0
- data/sub/eac_templates/lib/eac_templates/sources/from_all_gems.rb +4 -0
- data/sub/eac_templates/lib/eac_templates/sources/from_gem.rb +37 -0
- data/sub/eac_templates/lib/eac_templates/sources/fs_object.rb +53 -0
- data/sub/eac_templates/lib/eac_templates/sources/internal_set.rb +22 -0
- data/sub/eac_templates/lib/eac_templates/sources/set.rb +54 -0
- data/sub/eac_templates/lib/eac_templates/sources/single.rb +29 -0
- data/sub/eac_templates/lib/eac_templates/sources.rb +9 -0
- data/sub/eac_templates/lib/eac_templates/variables/directory.rb +47 -0
- data/sub/eac_templates/lib/eac_templates/variables/file.rb +50 -0
- data/sub/eac_templates/lib/eac_templates/variables/fs_object.rb +65 -0
- data/sub/eac_templates/lib/eac_templates/variables/not_found_error.rb +7 -0
- data/sub/eac_templates/lib/eac_templates/variables/providers/base.rb +23 -0
- data/sub/eac_templates/lib/eac_templates/variables/providers/config_reader.rb +29 -0
- data/sub/eac_templates/lib/eac_templates/variables/providers/entries_reader.rb +25 -0
- data/sub/eac_templates/lib/eac_templates/variables/providers/generic.rb +25 -0
- data/sub/eac_templates/lib/eac_templates/variables/providers/hash.rb +29 -0
- data/sub/eac_templates/lib/eac_templates/variables/providers.rb +25 -0
- data/sub/eac_templates/lib/eac_templates/variables.rb +9 -0
- data/sub/eac_templates/lib/eac_templates/version.rb +5 -0
- data/sub/eac_templates/lib/eac_templates.rb +7 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec.rb +120 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/a_module/a/a_a +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/a_module/b +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/super_class/a/a_b +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path1/super_class/b +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/a/a_b +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/b +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/a_module/c +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/sub_class/b +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/super_class/a/a_b +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/module/template_spec_files/path2/super_class/b +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/object/template_spec.rb +26 -0
- data/sub/eac_templates/spec/lib/eac_templates/patches/object/template_spec_files/path/my_stub_with_template +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/sources/set_spec.rb +42 -0
- data/sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path1/subdir1/file1.template +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path1/subdir1/file2 +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/sources/set_spec_files/path2/subdir1/file3.template +1 -0
- data/sub/eac_templates/spec/lib/eac_templates/variables/file_spec.rb +35 -0
- data/sub/eac_templates/spec/lib/eac_templates/variables/file_spec_files/expected_content +2 -0
- data/sub/eac_templates/spec/lib/eac_templates/variables/file_spec_files/source.template +2 -0
- data/sub/eac_templates/spec/rubocop_spec.rb +3 -0
- data/sub/eac_templates/spec/spec_helper.rb +4 -0
- metadata +75 -7
- /data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/{Dockerfile_apache_setup → apache_host_dockerfile} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45d93cbf1d3d3ff2f5b76c8fffeae344c0025b822fcfd9fac2a2f4aabffd92cf
|
4
|
+
data.tar.gz: c1a141d90c59c987c7f2f08a1aed69561782042a04ff42cf238b5c78baa996dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 201e612bf01ed05f4c1e2f7478591cb6aecfbdc526af61931cc05aebaf916e4ed00592ffb7d66e86d90e48074d264f96d18b91d17f4cc49aad5db6450a9ec3a6
|
7
|
+
data.tar.gz: 1372d4f44f77b4ea330e6233509faee81f6ac75e0316f6e18517fbafebe270c475826272edc28b62663667cb13ac0edb4ad5c220290a9f5650974e31224174ea
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eac_tools (0.60.
|
5
|
-
avm (~> 0.67)
|
4
|
+
eac_tools (0.60.3)
|
5
|
+
avm (~> 0.67, >= 0.67.1)
|
6
6
|
avm-eac_asciidoctor_base0 (~> 0.18, >= 0.18.1)
|
7
7
|
avm-eac_generic_base0 (~> 0.12)
|
8
8
|
avm-eac_latex_base0 (~> 0.3, >= 0.3.1)
|
@@ -11,9 +11,9 @@ PATH
|
|
11
11
|
avm-eac_python_base0 (~> 0.2, >= 0.2.1)
|
12
12
|
avm-eac_rails_base0 (~> 0.10, >= 0.10.1)
|
13
13
|
avm-eac_rails_base1 (~> 0.8, >= 0.8.3)
|
14
|
-
avm-eac_redmine_base0 (~> 0.19, >= 0.19.
|
14
|
+
avm-eac_redmine_base0 (~> 0.19, >= 0.19.2)
|
15
15
|
avm-eac_redmine_plugin_base0 (~> 0.4)
|
16
|
-
avm-eac_ruby_base1 (~> 0.30, >= 0.30.
|
16
|
+
avm-eac_ruby_base1 (~> 0.30, >= 0.30.2)
|
17
17
|
avm-eac_webapp_base0 (~> 0.15)
|
18
18
|
avm-eac_wordpress_base0 (~> 0.3, >= 0.3.1)
|
19
19
|
avm-git (~> 0.13, >= 0.13.1)
|
@@ -97,7 +97,7 @@ PATH
|
|
97
97
|
PATH
|
98
98
|
remote: sub/avm-eac_redmine_base0
|
99
99
|
specs:
|
100
|
-
avm-eac_redmine_base0 (0.19.
|
100
|
+
avm-eac_redmine_base0 (0.19.2)
|
101
101
|
avm (~> 0.67)
|
102
102
|
avm-eac_generic_base0 (~> 0.12)
|
103
103
|
avm-eac_rails_base1 (~> 0.8, >= 0.8.3)
|
@@ -117,17 +117,17 @@ PATH
|
|
117
117
|
PATH
|
118
118
|
remote: sub/avm-eac_ruby_base1
|
119
119
|
specs:
|
120
|
-
avm-eac_ruby_base1 (0.30.
|
121
|
-
aranha-parsers (~> 0.17)
|
122
|
-
avm (~> 0.
|
120
|
+
avm-eac_ruby_base1 (0.30.2)
|
121
|
+
aranha-parsers (~> 0.17, >= 0.17.1)
|
122
|
+
avm (~> 0.67, >= 0.67.1)
|
123
123
|
avm-eac_generic_base0 (~> 0.12)
|
124
124
|
eac_ruby_utils (~> 0.112)
|
125
125
|
|
126
126
|
PATH
|
127
127
|
remote: sub/avm-eac_ubuntu_base0
|
128
128
|
specs:
|
129
|
-
avm-eac_ubuntu_base0 (0.4.
|
130
|
-
avm (~> 0.
|
129
|
+
avm-eac_ubuntu_base0 (0.4.2)
|
130
|
+
avm (~> 0.67, >= 0.67.1)
|
131
131
|
eac_ruby_utils (~> 0.112)
|
132
132
|
eac_templates (~> 0.3, >= 0.3.2)
|
133
133
|
|
@@ -153,12 +153,12 @@ PATH
|
|
153
153
|
PATH
|
154
154
|
remote: sub/avm-files
|
155
155
|
specs:
|
156
|
-
avm-files (0.6.
|
157
|
-
avm (~> 0.
|
158
|
-
eac_cli (~> 0.
|
159
|
-
eac_fs (~> 0.
|
160
|
-
eac_ruby_utils (~> 0.
|
161
|
-
eac_templates (~> 0.
|
156
|
+
avm-files (0.6.1)
|
157
|
+
avm (~> 0.67, >= 0.67.1)
|
158
|
+
eac_cli (~> 0.30, >= 0.30.1)
|
159
|
+
eac_fs (~> 0.16)
|
160
|
+
eac_ruby_utils (~> 0.112)
|
161
|
+
eac_templates (~> 0.4)
|
162
162
|
|
163
163
|
PATH
|
164
164
|
remote: sub/avm-git
|
@@ -191,7 +191,7 @@ PATH
|
|
191
191
|
PATH
|
192
192
|
remote: sub/avm
|
193
193
|
specs:
|
194
|
-
avm (0.67.
|
194
|
+
avm (0.67.1)
|
195
195
|
aranha-parsers (~> 0.17, >= 0.17.1)
|
196
196
|
eac_cli (~> 0.30, >= 0.30.1)
|
197
197
|
eac_config (~> 0.12)
|
@@ -199,7 +199,7 @@ PATH
|
|
199
199
|
eac_fs (~> 0.16)
|
200
200
|
eac_git (~> 0.14, >= 0.14.1)
|
201
201
|
eac_ruby_utils (~> 0.112)
|
202
|
-
eac_templates (~> 0.
|
202
|
+
eac_templates (~> 0.4)
|
203
203
|
filesize (~> 0.2)
|
204
204
|
htmlbeautifier (~> 1.4, >= 1.4.2)
|
205
205
|
minitar (~> 0.9)
|
@@ -260,6 +260,13 @@ PATH
|
|
260
260
|
filesize (~> 0.2)
|
261
261
|
net-ssh (~> 4.2)
|
262
262
|
|
263
|
+
PATH
|
264
|
+
remote: sub/eac_templates
|
265
|
+
specs:
|
266
|
+
eac_templates (0.4.0)
|
267
|
+
eac_config (~> 0.12)
|
268
|
+
eac_ruby_utils (~> 0.112)
|
269
|
+
|
263
270
|
GEM
|
264
271
|
remote: https://rubygems.org/
|
265
272
|
specs:
|
@@ -298,9 +305,6 @@ GEM
|
|
298
305
|
rubocop (~> 0.80.1)
|
299
306
|
rubocop-rails (~> 2.4.2)
|
300
307
|
rubocop-rspec (~> 1.38.1)
|
301
|
-
eac_templates (0.3.2)
|
302
|
-
eac_config (~> 0.11, >= 0.11.1)
|
303
|
-
eac_ruby_utils (~> 0.102, >= 0.102.1)
|
304
308
|
faraday (2.7.4)
|
305
309
|
faraday-net_http (>= 2.0, < 3.1)
|
306
310
|
ruby2_keywords (>= 0.0.4)
|
@@ -320,7 +324,7 @@ GEM
|
|
320
324
|
rchardet (~> 1.8)
|
321
325
|
hpricot (0.8.6)
|
322
326
|
htmlbeautifier (1.4.2)
|
323
|
-
i18n (1.
|
327
|
+
i18n (1.13.0)
|
324
328
|
concurrent-ruby (~> 1.0)
|
325
329
|
jaro_winkler (1.5.4)
|
326
330
|
minitar (0.9)
|
@@ -332,9 +336,9 @@ GEM
|
|
332
336
|
ofx-parser (1.1.0)
|
333
337
|
hpricot (>= 0.6)
|
334
338
|
os (1.1.4)
|
335
|
-
parallel (1.
|
339
|
+
parallel (1.23.0)
|
336
340
|
parseconfig (1.1.2)
|
337
|
-
parser (3.2.2.
|
341
|
+
parser (3.2.2.1)
|
338
342
|
ast (~> 2.4.1)
|
339
343
|
parslet (2.0.0)
|
340
344
|
public_suffix (5.0.1)
|
@@ -348,9 +352,9 @@ GEM
|
|
348
352
|
rspec-core (~> 3.12.0)
|
349
353
|
rspec-expectations (~> 3.12.0)
|
350
354
|
rspec-mocks (~> 3.12.0)
|
351
|
-
rspec-core (3.12.
|
355
|
+
rspec-core (3.12.2)
|
352
356
|
rspec-support (~> 3.12.0)
|
353
|
-
rspec-expectations (3.12.
|
357
|
+
rspec-expectations (3.12.3)
|
354
358
|
diff-lcs (>= 1.2.0, < 2.0)
|
355
359
|
rspec-support (~> 3.12.0)
|
356
360
|
rspec-mocks (3.12.5)
|
@@ -376,7 +380,7 @@ GEM
|
|
376
380
|
tzinfo (2.0.6)
|
377
381
|
concurrent-ruby (~> 1.0)
|
378
382
|
unicode-display_width (1.6.1)
|
379
|
-
zeitwerk (2.6.
|
383
|
+
zeitwerk (2.6.8)
|
380
384
|
zlib (2.1.1)
|
381
385
|
|
382
386
|
PLATFORMS
|
@@ -410,6 +414,7 @@ DEPENDENCIES
|
|
410
414
|
eac_ruby_base0!
|
411
415
|
eac_ruby_gem_support (~> 0.5.1)
|
412
416
|
eac_ruby_utils!
|
417
|
+
eac_templates!
|
413
418
|
eac_tools!
|
414
419
|
|
415
420
|
BUNDLED WITH
|
data/lib/eac_tools/version.rb
CHANGED
data/sub/avm/avm.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_dependency 'eac_fs', '~> 0.16'
|
20
20
|
s.add_dependency 'eac_git', '~> 0.14', '>= 0.14.1'
|
21
21
|
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
22
|
-
s.add_dependency 'eac_templates', '~> 0.
|
22
|
+
s.add_dependency 'eac_templates', '~> 0.4'
|
23
23
|
s.add_dependency 'filesize', '~> 0.2'
|
24
24
|
s.add_dependency 'htmlbeautifier', '~> 1.4', '>= 1.4.2'
|
25
25
|
s.add_dependency 'minitar', '~> 0.9'
|
data/sub/avm/lib/avm/version.rb
CHANGED
@@ -12,6 +12,8 @@ module Avm
|
|
12
12
|
class DockerImage < ::Avm::Instances::DockerImage
|
13
13
|
enable_simple_cache
|
14
14
|
|
15
|
+
APACHE_HOST_DOCKERFILE_SUBPATH = 'apache_host_dockerfile'
|
16
|
+
APACHE_PATH_DOCKERFILE_SUBPATH = 'apache_path_dockerfile'
|
15
17
|
INSTALLER_TARGET_TASK_WITH_WEB_PATH_BLANK = 'redmine_as_apache_base'
|
16
18
|
INSTALLER_TARGET_TASK_WITH_WEB_PATH_PRESENT = 'redmine_as_apache_path'
|
17
19
|
REDMINE_SOURCE_HOST_SUBPATH = 'redmine_source'
|
@@ -23,9 +25,12 @@ module Avm
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def apache_setup
|
26
|
-
|
28
|
+
template.child(apache_setup_dockerfile).apply(self)
|
29
|
+
end
|
27
30
|
|
28
|
-
|
31
|
+
# @return [String]
|
32
|
+
def apache_setup_dockerfile
|
33
|
+
web_path_present? ? APACHE_PATH_DOCKERFILE_SUBPATH : APACHE_HOST_DOCKERFILE_SUBPATH
|
29
34
|
end
|
30
35
|
|
31
36
|
def base_image
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,locale,template}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'aranha-parsers', '~> 0.17'
|
16
|
-
s.add_dependency 'avm', '~> 0.
|
15
|
+
s.add_dependency 'aranha-parsers', '~> 0.17', '>= 0.17.1'
|
16
|
+
s.add_dependency 'avm', '~> 0.67', '>= 0.67.1'
|
17
17
|
s.add_dependency 'avm-eac_generic_base0', '~> 0.12'
|
18
18
|
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
19
19
|
|
@@ -65,11 +65,11 @@ module Avm
|
|
65
65
|
protected
|
66
66
|
|
67
67
|
def apply_to_root_directory(template, subpath)
|
68
|
-
if template.is_a?(::EacTemplates::Directory)
|
68
|
+
if template.is_a?(::EacTemplates::Variables::Directory)
|
69
69
|
template.children.each do |child|
|
70
70
|
apply_to_root_directory(child, subpath.join(child.basename))
|
71
71
|
end
|
72
|
-
elsif template.is_a?(::EacTemplates::File)
|
72
|
+
elsif template.is_a?(::EacTemplates::Variables::File)
|
73
73
|
template.apply_to_file(template_variables, root_directory.join(subpath))
|
74
74
|
else
|
75
75
|
raise "Unknown template object: #{template}"
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,template}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.67', '>= 0.67.1'
|
16
16
|
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
17
17
|
s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
|
18
18
|
|
@@ -12,11 +12,11 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
16
|
-
s.add_dependency 'eac_cli', '~> 0.
|
17
|
-
s.add_dependency 'eac_fs', '~> 0.
|
18
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
19
|
-
s.add_dependency 'eac_templates', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.67', '>= 0.67.1'
|
16
|
+
s.add_dependency 'eac_cli', '~> 0.30', '>= 0.30.1'
|
17
|
+
s.add_dependency 'eac_fs', '~> 0.16'
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
19
|
+
s.add_dependency 'eac_templates', '~> 0.4'
|
20
20
|
|
21
21
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
22
22
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
4
|
require 'avm/files/appendable/resource_base'
|
5
|
-
require 'eac_templates/directory'
|
5
|
+
require 'eac_templates/variables/directory'
|
6
6
|
|
7
7
|
module Avm
|
8
8
|
module Files
|
@@ -18,7 +18,7 @@ module Avm
|
|
18
18
|
def write_on(target_dir)
|
19
19
|
raise 'Variables source not set' if appender.variables_source.blank?
|
20
20
|
|
21
|
-
::EacTemplates::Directory.new(source_path).apply(
|
21
|
+
::EacTemplates::Variables::Directory.new(source_path).apply(
|
22
22
|
appender.variables_source,
|
23
23
|
target_dir
|
24
24
|
)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
|
5
|
+
require 'eac_templates/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'eac_templates'
|
9
|
+
s.version = EacTemplates::VERSION
|
10
|
+
s.authors = ['Put here the authors']
|
11
|
+
s.summary = 'Put here de description.'
|
12
|
+
|
13
|
+
s.files = Dir['{lib}/**/*']
|
14
|
+
|
15
|
+
s.add_dependency 'eac_config', '~> 0.12'
|
16
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
17
|
+
|
18
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
19
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacTemplates
|
4
|
+
module InterfaceMethods
|
5
|
+
COMMON = %w[apply path].freeze
|
6
|
+
ONLY_DIRECTORY = %w[child children].freeze
|
7
|
+
DIRECTORY = COMMON + ONLY_DIRECTORY
|
8
|
+
ONLY_FILE = %w[apply_to_file content variables].freeze
|
9
|
+
FILE = COMMON + ONLY_FILE
|
10
|
+
ALL = COMMON + ONLY_DIRECTORY + ONLY_FILE
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_templates/interface_methods'
|
5
|
+
require 'eac_templates/modules/ancestor/fs_object'
|
6
|
+
|
7
|
+
module EacTemplates
|
8
|
+
module Modules
|
9
|
+
class Ancestor
|
10
|
+
class Directory < ::EacTemplates::Modules::Ancestor::FsObject
|
11
|
+
delegate(*::EacTemplates::InterfaceMethods::ONLY_DIRECTORY, to: :source_object)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_templates/interface_methods'
|
5
|
+
require 'eac_templates/modules/ancestor/fs_object'
|
6
|
+
|
7
|
+
module EacTemplates
|
8
|
+
module Modules
|
9
|
+
class Ancestor
|
10
|
+
class File < ::EacTemplates::Modules::Ancestor::FsObject
|
11
|
+
delegate(*::EacTemplates::InterfaceMethods::ONLY_FILE, to: :source_object)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_templates/interface_methods'
|
5
|
+
|
6
|
+
module EacTemplates
|
7
|
+
module Modules
|
8
|
+
class Ancestor
|
9
|
+
class FsObject
|
10
|
+
enable_simple_cache
|
11
|
+
common_constructor :base
|
12
|
+
delegate(*::EacTemplates::InterfaceMethods::COMMON, :found?, to: :source_object)
|
13
|
+
|
14
|
+
# @return [Symbol]
|
15
|
+
def object_type
|
16
|
+
self.class.name.demodulize.underscore.to_sym
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [Pathname, nil]
|
20
|
+
def path
|
21
|
+
source_object.found? ? source_object.send(:real_paths).first : nil
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def source_object_uncached
|
27
|
+
base.source_set.send(object_type, base.path_for_search)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_templates/interface_methods'
|
5
|
+
|
6
|
+
module EacTemplates
|
7
|
+
module Modules
|
8
|
+
class Ancestor
|
9
|
+
class << self
|
10
|
+
# @param a_module [Module]
|
11
|
+
# @return [Pathname]
|
12
|
+
def path_for_search(a_module)
|
13
|
+
a_module.name.underscore.to_pathname
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
common_constructor :base, :ancestor
|
18
|
+
delegate :subpath, :source_set, to: :base
|
19
|
+
delegate(*::EacTemplates::InterfaceMethods::ALL, to: :source_object)
|
20
|
+
|
21
|
+
# @return [EacTemplates::Modules::Directory]
|
22
|
+
def directory
|
23
|
+
::EacTemplates::Modules::Ancestor::Directory.new(self)
|
24
|
+
end
|
25
|
+
|
26
|
+
# @return [EacTemplates::Modules::File]
|
27
|
+
def file
|
28
|
+
@file ||= ::EacTemplates::Modules::Ancestor::File.new(self)
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [Pathname]
|
32
|
+
def path_for_search
|
33
|
+
r = self.class.path_for_search(ancestor)
|
34
|
+
subpath.if_present(r) { |v| r.join(v) }
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [EacTemplates::Modules::Ancestor::FsObject]
|
38
|
+
def source_object
|
39
|
+
return file if file.found?
|
40
|
+
return directory if directory.found?
|
41
|
+
|
42
|
+
raise "No template found: #{path_for_search}"
|
43
|
+
end
|
44
|
+
|
45
|
+
require_sub __FILE__
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_templates/interface_methods'
|
5
|
+
require 'eac_templates/modules/ancestor'
|
6
|
+
require 'eac_templates/sources/set'
|
7
|
+
|
8
|
+
module EacTemplates
|
9
|
+
module Modules
|
10
|
+
class Base
|
11
|
+
enable_listable
|
12
|
+
lists.add_symbol :option, :source_set, :subpath
|
13
|
+
common_constructor :the_module, :options, default: [{}] do
|
14
|
+
self.options = self.class.lists.option.hash_keys_validate!(options)
|
15
|
+
end
|
16
|
+
delegate(*::EacTemplates::InterfaceMethods::ALL, :path_for_search, :source_object,
|
17
|
+
to: :self_ancestor)
|
18
|
+
|
19
|
+
# @return [EacTemplates::Modules::Ancestor]
|
20
|
+
def self_ancestor
|
21
|
+
@self_ancestor ||= ::EacTemplates::Modules::Ancestor.new(self, the_module)
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [EacTemplates::SourceSet]
|
25
|
+
def source_set
|
26
|
+
options[OPTION_SOURCE_SET] || ::EacTemplates::Sources::Set.default
|
27
|
+
end
|
28
|
+
|
29
|
+
# @return [Pathname, nil]
|
30
|
+
def subpath
|
31
|
+
options[OPTION_SUBPATH].if_present(&:to_pathname)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_templates/sources/fs_object'
|
5
|
+
require 'eac_templates/variables/directory'
|
6
|
+
|
7
|
+
module EacTemplates
|
8
|
+
module Sources
|
9
|
+
class Directory < ::EacTemplates::Sources::FsObject
|
10
|
+
delegate :apply, :child, :children, :path, to: :applier
|
11
|
+
|
12
|
+
# @return [Class]
|
13
|
+
def applier_class
|
14
|
+
::EacTemplates::Variables::Directory
|
15
|
+
end
|
16
|
+
|
17
|
+
# @param path [Pathname]
|
18
|
+
# @return [Boolean]
|
19
|
+
def select_path?(path)
|
20
|
+
super && path.directory?
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|