eac_tools 0.60.2 → 0.61.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +34 -29
- 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_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/pre_process_line.rb +16 -4
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document.rb +23 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/base.rb +21 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/breadcrumbs.rb +55 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/child_docs/document_builder.rb +63 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/child_docs.rb +35 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/default_body.rb +21 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros.rb +13 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +5 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- 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 +79 -14
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/breadcrumbs_macro_value.rb +0 -59
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/child_docs_macro_value.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88b13d61ea11ac15cc3677a1cf5ec17f1381f8f87ab25074f8cf7be2804e0679
|
4
|
+
data.tar.gz: 4432b02f679cabc7aa8ac455599e2bdfa653a02c973a05f02315a7992b50665e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e4a6b279e9e1ee080a4fdf0f390187330bf84b36b022816cb807fa2274bf338c7c894587bd2938f9d71b72b45da42d2df6de2609ef9c783a42a4d063642685a
|
7
|
+
data.tar.gz: 2731fdeb08a1110cabba28cab3ccc98a60d8530e5d8a16c08a91459524952c98cccf7550cbcb6f21ccfcbdff8917c083d4911418ad91d6dc843e6e9f02fff58f
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eac_tools (0.
|
5
|
-
avm (~> 0.67)
|
6
|
-
avm-eac_asciidoctor_base0 (~> 0.
|
4
|
+
eac_tools (0.61.0)
|
5
|
+
avm (~> 0.67, >= 0.67.1)
|
6
|
+
avm-eac_asciidoctor_base0 (~> 0.19)
|
7
7
|
avm-eac_generic_base0 (~> 0.12)
|
8
8
|
avm-eac_latex_base0 (~> 0.3, >= 0.3.1)
|
9
9
|
avm-eac_php_base0 (~> 0.4, >= 0.4.2)
|
@@ -13,7 +13,7 @@ PATH
|
|
13
13
|
avm-eac_rails_base1 (~> 0.8, >= 0.8.3)
|
14
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)
|
@@ -34,7 +34,7 @@ PATH
|
|
34
34
|
PATH
|
35
35
|
remote: sub/avm-eac_asciidoctor_base0
|
36
36
|
specs:
|
37
|
-
avm-eac_asciidoctor_base0 (0.
|
37
|
+
avm-eac_asciidoctor_base0 (0.19.0)
|
38
38
|
asciidoctor (~> 2.0, >= 2.0.18)
|
39
39
|
avm-eac_webapp_base0 (~> 0.15)
|
40
40
|
eac_ruby_utils (~> 0.112)
|
@@ -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:
|
@@ -280,7 +287,7 @@ GEM
|
|
280
287
|
parslet (~> 2.0)
|
281
288
|
curb (0.9.11)
|
282
289
|
diff-lcs (1.5.0)
|
283
|
-
eac_envs-http (0.3.
|
290
|
+
eac_envs-http (0.3.1)
|
284
291
|
eac_fs (~> 0.16)
|
285
292
|
eac_ruby_utils (~> 0.112)
|
286
293
|
faraday (~> 2.7, >= 2.7.4)
|
@@ -288,8 +295,8 @@ GEM
|
|
288
295
|
faraday-gzip (~> 0.1)
|
289
296
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
290
297
|
faraday-retry (~> 2.1)
|
291
|
-
eac_rest (0.
|
292
|
-
eac_envs-http (~> 0.
|
298
|
+
eac_rest (0.8.0)
|
299
|
+
eac_envs-http (~> 0.3, >= 0.3.1)
|
293
300
|
eac_fs (~> 0.16)
|
294
301
|
eac_ruby_utils (~> 0.112)
|
295
302
|
eac_ruby_gem_support (0.5.1)
|
@@ -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)
|
@@ -334,7 +338,7 @@ GEM
|
|
334
338
|
os (1.1.4)
|
335
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
@@ -11,8 +11,10 @@ module Avm
|
|
11
11
|
enable_method_class
|
12
12
|
enable_simple_cache
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
ARGUMENT_SEPARATOR = ','
|
15
|
+
MACRO_PARSER = %r{\A\s*//\#(\S+)(?:\s+(.+))?\s*?\z}.to_parser do |m|
|
16
|
+
::Struct.new(:name, :arguments).new(m[1],
|
17
|
+
m[2].to_s.split(ARGUMENT_SEPARATOR).map(&:strip))
|
16
18
|
end
|
17
19
|
|
18
20
|
common_constructor :document, :line
|
@@ -30,18 +32,28 @@ module Avm
|
|
30
32
|
macro_name.present?
|
31
33
|
end
|
32
34
|
|
35
|
+
# @return [Array<String>, nil]
|
36
|
+
def macro_arguments
|
37
|
+
parsed_macro.if_present(&:arguments)
|
38
|
+
end
|
39
|
+
|
40
|
+
# @return [String, nil]
|
41
|
+
def macro_name
|
42
|
+
parsed_macro.if_present(&:name)
|
43
|
+
end
|
44
|
+
|
33
45
|
def macro_parser
|
34
46
|
MACRO_PARSER
|
35
47
|
end
|
36
48
|
|
37
49
|
# @return [Array<String>]
|
38
50
|
def macro_value
|
39
|
-
document.
|
51
|
+
document.macro_lines(macro_name, macro_arguments)
|
40
52
|
end
|
41
53
|
|
42
54
|
private
|
43
55
|
|
44
|
-
def
|
56
|
+
def parsed_macro_uncached
|
45
57
|
macro_parser.parse(line)
|
46
58
|
end
|
47
59
|
end
|
data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'asciidoctor'
|
4
|
+
require 'avm/eac_asciidoctor_base0/instances/macros'
|
4
5
|
require 'eac_ruby_utils/core_ext'
|
5
6
|
|
6
7
|
module Avm
|
@@ -22,6 +23,15 @@ module Avm
|
|
22
23
|
other.body_target_path.relative_path_from(body_target_path.dirname)
|
23
24
|
end
|
24
25
|
|
26
|
+
# @return [Enumerable<String>]
|
27
|
+
def body_source_lines
|
28
|
+
if source_document.body_path.file?
|
29
|
+
source_document.body_path.read.each_line
|
30
|
+
else
|
31
|
+
default_body_source_lines
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
25
35
|
# Absolute path to the output of Asciidoctor's source file.
|
26
36
|
#
|
27
37
|
# @return [Pathname]
|
@@ -56,6 +66,18 @@ module Avm
|
|
56
66
|
source_document.root_path
|
57
67
|
end
|
58
68
|
|
69
|
+
# @return [Enumerable<String>]
|
70
|
+
def default_body_source_lines
|
71
|
+
macro_lines(:default_body)
|
72
|
+
end
|
73
|
+
|
74
|
+
# @param name [String]
|
75
|
+
# @return [Array<String>]
|
76
|
+
def macro_lines(name, arguments = [])
|
77
|
+
::Avm::EacAsciidoctorBase0::Instances::Macros.const_get(name.to_s.camelize)
|
78
|
+
.new(self, arguments).result
|
79
|
+
end
|
80
|
+
|
59
81
|
def perform
|
60
82
|
perform_self
|
61
83
|
perform_children
|
@@ -74,7 +96,7 @@ module Avm
|
|
74
96
|
# @return [String]
|
75
97
|
def pre_processed_body_source_content
|
76
98
|
(
|
77
|
-
header_lines + [''] +
|
99
|
+
header_lines + [''] + body_source_lines
|
78
100
|
.flat_map { |line| pre_process_line(line.rstrip) }
|
79
101
|
).map { |line| "#{line.rstrip}\n" }.join
|
80
102
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacAsciidoctorBase0
|
7
|
+
module Instances
|
8
|
+
module Macros
|
9
|
+
class Base
|
10
|
+
enable_abstract_methods
|
11
|
+
common_constructor :document, :arguments, default: [[]]
|
12
|
+
|
13
|
+
# @return [Array<String>]
|
14
|
+
def result
|
15
|
+
raise_abstract_method __method__
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/breadcrumbs.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_asciidoctor_base0/instances/macros/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacAsciidoctorBase0
|
8
|
+
module Instances
|
9
|
+
module Macros
|
10
|
+
class Breadcrumbs < ::Avm::EacAsciidoctorBase0::Instances::Macros::Base
|
11
|
+
NODE_SEPARATOR = ' » '
|
12
|
+
ROOT_DOCUMENT_TITLE = 'Home'
|
13
|
+
|
14
|
+
# @return [Array<String>]
|
15
|
+
def result
|
16
|
+
trail_nodes.join(NODE_SEPARATOR)
|
17
|
+
end
|
18
|
+
|
19
|
+
def trail_nodes
|
20
|
+
r = []
|
21
|
+
current = document
|
22
|
+
while current.present?
|
23
|
+
r.unshift(Node.new(document, current))
|
24
|
+
current = current.parent_document
|
25
|
+
end
|
26
|
+
r
|
27
|
+
end
|
28
|
+
|
29
|
+
class Node
|
30
|
+
common_constructor :current, :document
|
31
|
+
|
32
|
+
# @return [String]
|
33
|
+
def address
|
34
|
+
current.href_to_other_body(document)
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [String]
|
38
|
+
def title
|
39
|
+
if document.parent_document.present?
|
40
|
+
document.source_document.title
|
41
|
+
else
|
42
|
+
ROOT_DOCUMENT_TITLE
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# @return [String]
|
47
|
+
def to_s
|
48
|
+
"link:#{address}[#{title}]"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_asciidoctor_base0/instances/macros/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacAsciidoctorBase0
|
8
|
+
module Instances
|
9
|
+
module Macros
|
10
|
+
class ChildDocs < ::Avm::EacAsciidoctorBase0::Instances::Macros::Base
|
11
|
+
class DocumentBuilder
|
12
|
+
common_constructor :child_docs, :document, :depth, default: [0]
|
13
|
+
compare_by :title, :address
|
14
|
+
|
15
|
+
# @return [Pathname]
|
16
|
+
def address
|
17
|
+
root_document.href_to_other_body(document)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @return [Array] Document's children mapped to document builders.
|
21
|
+
def children
|
22
|
+
document.children.map { |c| self.class.new(child_docs, c, depth + 1) }.sort
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [Boolean]
|
26
|
+
def lines_for_children?
|
27
|
+
child_docs.maximum_depth.negative? || child_docs.maximum_depth <= depth
|
28
|
+
end
|
29
|
+
|
30
|
+
# @return [String]
|
31
|
+
def link
|
32
|
+
"link:#{address}[#{title}]"
|
33
|
+
end
|
34
|
+
|
35
|
+
# @return [Array<String>]
|
36
|
+
def result
|
37
|
+
children.flat_map do |child|
|
38
|
+
r = [child.self_line]
|
39
|
+
r += child.result if lines_for_children?
|
40
|
+
r
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# @return [Avm::EacAsciidoctorBase0::Instances::Build::Document]
|
45
|
+
def root_document
|
46
|
+
child_docs.document
|
47
|
+
end
|
48
|
+
|
49
|
+
# @return [String]
|
50
|
+
def self_line
|
51
|
+
"#{'*' * depth} #{link}"
|
52
|
+
end
|
53
|
+
|
54
|
+
# @return [String]
|
55
|
+
def title
|
56
|
+
document.source_document.title
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/child_docs.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_asciidoctor_base0/instances/macros/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacAsciidoctorBase0
|
8
|
+
module Instances
|
9
|
+
module Macros
|
10
|
+
class ChildDocs < ::Avm::EacAsciidoctorBase0::Instances::Macros::Base
|
11
|
+
DEFAULT_MAXIMUM_DEPTH = -1
|
12
|
+
|
13
|
+
# @return [Array<String>]
|
14
|
+
def result
|
15
|
+
document_builder_class.new(self, document).result
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [Integer]
|
19
|
+
def maximum_depth
|
20
|
+
arguments[0].if_present(DEFAULT_MAXIMUM_DEPTH, &:to_i)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
# @return [Class]
|
26
|
+
def document_builder_class
|
27
|
+
::Avm::EacAsciidoctorBase0::Instances::Macros::ChildDocs::DocumentBuilder
|
28
|
+
end
|
29
|
+
|
30
|
+
require_sub __FILE__
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/macros/default_body.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_asciidoctor_base0/instances/macros/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacAsciidoctorBase0
|
8
|
+
module Instances
|
9
|
+
module Macros
|
10
|
+
class DefaultBody < ::Avm::EacAsciidoctorBase0::Instances::Macros::Base
|
11
|
+
RESULT_LINES = ['== Índice', '', '//#child_docs'].freeze
|
12
|
+
|
13
|
+
# @return [Array<String>]
|
14
|
+
def result
|
15
|
+
RESULT_LINES
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -8,9 +8,13 @@ module Avm
|
|
8
8
|
module EacAsciidoctorBase0
|
9
9
|
module Sources
|
10
10
|
class Base < ::Avm::EacWebappBase0::Sources::Base
|
11
|
+
require_sub __FILE__
|
12
|
+
|
11
13
|
CONTENT_DIRECTORY_SUBPATH = ::Pathname.new('content')
|
12
14
|
CONTENT_DOCUMENT_BASENAME = ::Pathname.new('body.adoc')
|
13
|
-
MAIN_FILE_SUBPATH = CONTENT_DIRECTORY_SUBPATH.join(
|
15
|
+
MAIN_FILE_SUBPATH = CONTENT_DIRECTORY_SUBPATH.join(
|
16
|
+
::Avm::EacAsciidoctorBase0::Sources::Base::Document::TITLE_BASENAME
|
17
|
+
)
|
14
18
|
|
15
19
|
require_sub __FILE__, include_modules: true
|
16
20
|
|
@@ -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
|
)
|