eac_tools 0.58.0 → 0.60.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/breadcrumbs_macro_value.rb +59 -0
  5. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/child_docs_macro_value.rb +1 -3
  6. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb +7 -1
  7. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/media.rb +28 -0
  8. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document.rb +34 -11
  9. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/document/media.rb +30 -0
  10. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/document.rb +1 -0
  11. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  12. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build/document_spec.rb +58 -18
  13. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build/document_spec_files/pre_processed_root_body.adoc +7 -2
  14. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec.rb +11 -37
  15. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/_media/a_media_file +1 -0
  16. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/_media/a_media_file +1 -0
  17. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/body.adoc +11 -0
  18. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/title +1 -0
  19. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/body.adoc +11 -0
  20. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/_media/a_media_file +1 -0
  21. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/body.adoc +11 -0
  22. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/title +1 -0
  23. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/title +1 -0
  24. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/_media/a_media_file +1 -0
  25. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc1/_media/a_media_file +1 -0
  26. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc2/doc2_1/_media/a_media_file +1 -0
  27. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb +1 -6
  28. data/sub/avm-eac_asciidoctor_base0/spec/spec_helper/eac_asciidoctor_base0_stubs.rb +55 -0
  29. data/sub/avm-eac_asciidoctor_base0/spec/spec_helper.rb +3 -0
  30. metadata +24 -8
  31. /data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/{index.html → first.target/doc1/index.html} +0 -0
  32. /data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/{doc1.html → first.target/doc2/doc2_1/index.html} +0 -0
  33. /data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/{doc2.html → first.target/doc2/index.html} +0 -0
  34. /data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/{doc2/doc2_1.html → first.target/index.html} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff15266dd0fd06d6c50c3b3e2970122497b2de3fbfe81256f8f137b8f014b138
4
- data.tar.gz: e33174a9d250c9f677321323f6d5fc18eeb7e54b215cf1f9de606b8387efbaf6
3
+ metadata.gz: 327ae2eff08c0ad4c133241be2a63b4c7a0867317996c75f96254289510efc92
4
+ data.tar.gz: 7f683ac460509520c772af752277317ffbd6adfbc099757ad0f88cd104a85517
5
5
  SHA512:
6
- metadata.gz: 8b19995fc569e17ca90ce26cb98e46e6bf0da5dfe429e97897cbe738bbfedda45f1dac6a071cb9b09c112536b26c46ceb47c21200f471c52bc159e3e4ed5317e
7
- data.tar.gz: ba05f3546c0bba6967385775acfb6cc5d3991f2833e98e02cc0e9e9d9956739ad1b00b94759a97e58d245fd6c1030df4aee950efbc6d72f77009a0b0c2a934b1
6
+ metadata.gz: '08edc8c921395b4593f0ae47b0c36d1f67c1847d752d8e17fb258f82fa637854652e85b77ee69fd0a0664ca9f633d0ba2f3812bd188b750c1b55ddaeac60f732'
7
+ data.tar.gz: d6753df13da2becc01dccf9a71896f2aba4506e236f05b2c8026e8c0dc30a59f472da6dd4453a4b3506cdd778b76f1437e1cc3ac48f873622514b4613a6e0347
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.58.0)
4
+ eac_tools (0.60.0)
5
5
  avm (~> 0.66, >= 0.66.1)
6
- avm-eac_asciidoctor_base0 (~> 0.16)
6
+ avm-eac_asciidoctor_base0 (~> 0.18)
7
7
  avm-eac_generic_base0 (~> 0.12)
8
8
  avm-eac_latex_base0 (~> 0.3)
9
9
  avm-eac_php_base0 (~> 0.4, >= 0.4.1)
@@ -37,7 +37,7 @@ PATH
37
37
  PATH
38
38
  remote: sub/avm-eac_asciidoctor_base0
39
39
  specs:
40
- avm-eac_asciidoctor_base0 (0.16.0)
40
+ avm-eac_asciidoctor_base0 (0.18.0)
41
41
  asciidoctor (~> 2.0, >= 2.0.18)
42
42
  avm-eac_webapp_base0 (~> 0.14)
43
43
  eac_ruby_utils (~> 0.112)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.58.0'
4
+ VERSION = '0.60.0'
5
5
  end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacAsciidoctorBase0
7
+ module Instances
8
+ class Build
9
+ class Document
10
+ class BreadcrumbsMacroValue
11
+ enable_method_class
12
+ common_constructor :document
13
+
14
+ NODE_SEPARATOR = ' » '
15
+ ROOT_DOCUMENT_TITLE = 'Home'
16
+
17
+ # @return [Array<String>]
18
+ def result
19
+ trail_nodes.join(NODE_SEPARATOR)
20
+ end
21
+
22
+ def trail_nodes
23
+ r = []
24
+ current = document
25
+ while current.present?
26
+ r.unshift(Node.new(document, current))
27
+ current = current.parent_document
28
+ end
29
+ r
30
+ end
31
+
32
+ class Node
33
+ common_constructor :current, :document
34
+
35
+ # @return [String]
36
+ def address
37
+ current.href_to_other_body(document)
38
+ end
39
+
40
+ # @return [String]
41
+ def title
42
+ if document.parent_document.present?
43
+ document.source_document.title
44
+ else
45
+ ROOT_DOCUMENT_TITLE
46
+ end
47
+ end
48
+
49
+ # @return [String]
50
+ def to_s
51
+ "link:#{address}[#{title}]"
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -23,9 +23,7 @@ module Avm
23
23
 
24
24
  # @return [Pathname]
25
25
  def address
26
- child.body_target_path.relative_path_from(
27
- document.body_target_path.dirname
28
- )
26
+ document.href_to_other_body(child)
29
27
  end
30
28
 
31
29
  # @return [String]
@@ -43,9 +43,15 @@ module Avm
43
43
  "#{author_name} <#{author_email}>"
44
44
  end
45
45
 
46
+ # @return [String]
47
+ def breadcrumbs_lines
48
+ ['[.normal]', document.breadcrumbs_macro_value]
49
+ end
50
+
46
51
  # @return [Array<String>]
47
52
  def result
48
- [stylesheet_line, title_line, author_line] + attributes_lines
53
+ [stylesheet_line, title_line, author_line] + attributes_lines + [''] +
54
+ breadcrumbs_lines
49
55
  end
50
56
 
51
57
  # @return [String]
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'asciidoctor'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacAsciidoctorBase0
8
+ module Instances
9
+ class Build
10
+ class Document
11
+ module Media
12
+ def copy_media_directory
13
+ source_document.copy_media_directory_to(media_target_path)
14
+ end
15
+
16
+ # @return [Pathname]
17
+ def media_target_path
18
+ build.target_directory.join(
19
+ parent_document.present? ? source_document.subpath : '',
20
+ ::Avm::EacAsciidoctorBase0::Sources::Base::Document::Media::MEDIA_DIRECTORY_BASENAME
21
+ )
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -8,21 +8,47 @@ module Avm
8
8
  module Instances
9
9
  class Build
10
10
  class Document
11
- require_sub __FILE__
11
+ require_sub __FILE__, include_modules: true
12
12
 
13
- ROOT_BODY_TARGET_BASENAME = 'index'
13
+ BODY_TARGET_BASENAME = 'index.html'
14
14
 
15
15
  enable_simple_cache
16
16
  enable_speaker
17
17
  common_constructor :build, :parent_document, :source_document
18
18
 
19
+ # @param other [Avm::EacAsciidoctorBase0::Instances::Build::Document]
20
+ # @return [String]
21
+ def href_to_other_body(other)
22
+ other.body_target_path.relative_path_from(body_target_path.dirname)
23
+ end
24
+
19
25
  # Absolute path to the output of Asciidoctor's source file.
20
26
  #
21
27
  # @return [Pathname]
22
28
  def body_target_path
23
- build.target_directory.join(
24
- parent_document.present? ? source_document.subpath : ROOT_BODY_TARGET_BASENAME
25
- ).basename_sub('.*') { |b| "#{b}.html" }
29
+ build.target_directory.join(source_document.subpath).join(BODY_TARGET_BASENAME)
30
+ end
31
+
32
+ # @return [Asciidoctor::Document]
33
+ def build_body
34
+ ::Asciidoctor.convert(
35
+ pre_processed_body_source_content,
36
+ base_dir: convert_base_dir,
37
+ to_file: body_target_path.to_path, safe: :unsafe, mkdirs: true
38
+ )
39
+ end
40
+
41
+ # @param basename [String]
42
+ # @return [Avm::EacAsciidoctorBase0::Instances::Build::Document, nil]
43
+ def child(basename)
44
+ basename = basename.to_s
45
+ children.find { |c| c.source_document.root_path.basename.to_path == basename }
46
+ end
47
+
48
+ # @param basename [String]
49
+ # @return [Avm::EacAsciidoctorBase0::Instances::Build::Document]
50
+ def child!(basename)
51
+ child(basename) || raise("Child not found with basename \"#{basename}\"")
26
52
  end
27
53
 
28
54
  # @return [Pathname]
@@ -37,11 +63,8 @@ module Avm
37
63
 
38
64
  def perform_self
39
65
  infov 'Building', source_document.subpath
40
- ::Asciidoctor.convert(
41
- pre_processed_body_source_content,
42
- base_dir: convert_base_dir,
43
- to_file: body_target_path.to_path, safe: :unsafe, mkdirs: true
44
- )
66
+ build_body
67
+ copy_media_directory
45
68
  end
46
69
 
47
70
  def perform_children
@@ -52,7 +75,7 @@ module Avm
52
75
  def pre_processed_body_source_content
53
76
  (
54
77
  header_lines + [''] + source_document.body_path.read.each_line
55
- .flat_map { |line| pre_process_line(line.rstrip) }
78
+ .flat_map { |line| pre_process_line(line.rstrip) }
56
79
  ).map { |line| "#{line.rstrip}\n" }.join
57
80
  end
58
81
 
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'asciidoctor'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacAsciidoctorBase0
8
+ module Sources
9
+ class Base
10
+ class Document
11
+ module Media
12
+ MEDIA_DIRECTORY_BASENAME = '_media'
13
+
14
+ def copy_media_directory_to(target_directory_path)
15
+ return unless media_directory.directory?
16
+
17
+ target_directory_path.parent.mkpath
18
+ ::FileUtils.copy_entry(media_directory, target_directory_path)
19
+ end
20
+
21
+ # @return [Pathname]
22
+ def media_directory
23
+ root_path.join(MEDIA_DIRECTORY_BASENAME)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -38,6 +38,7 @@ module Avm
38
38
 
39
39
  def children_uncached
40
40
  root_path.children.select(&:directory?)
41
+ .reject { |path| path.basename.to_path == MEDIA_DIRECTORY_BASENAME }
41
42
  .map { |path| self.class.new(source, self, path.basename) }
42
43
  end
43
44
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacAsciidoctorBase0
5
- VERSION = '0.16.0'
5
+ VERSION = '0.18.0'
6
6
  end
7
7
  end
@@ -1,32 +1,72 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_asciidoctor_base0/sources/base'
4
3
  require 'avm/eac_asciidoctor_base0/instances/build'
5
4
 
6
- ::RSpec.describe ::Avm::EacAsciidoctorBase0::Instances::Build::Document do
7
- let(:application) { ::Avm::Applications::Base.new('myapp') }
8
- let(:application_instance) do
9
- ::Avm::EacAsciidoctorBase0::Instances::Base
10
- .new(application, 'stub')
11
- end
12
- let(:build) { ::Avm::EacAsciidoctorBase0::Instances::Build.new(application_instance) }
5
+ ::RSpec.describe ::Avm::EacAsciidoctorBase0::Instances::Build::Document do # rubocop:disable Metrics/BlockLength
6
+ let(:app_director) { eac_asciidoctor_base0_stubs }
7
+ let(:build) { ::Avm::EacAsciidoctorBase0::Instances::Build.new(app_director.instance) }
13
8
  let(:fixtures_dir) { __dir__.to_pathname.join('document_spec_files') }
14
- let(:instance) { build.root_document }
15
- let(:source) { avm_source('EacAsciidoctorBase0', target_basename: application.id) }
9
+ let(:instance) { build_doc_child(build.root_document, :c1, :c1_1, :c1_1_1) }
16
10
  let(:target_file) { fixtures_dir.join('pre_processed_root_body.adoc') }
11
+ let(:source) { app_director.source }
12
+ let(:doc_template) do
13
+ r = temp_dir
14
+ ::FileUtils.copy_entry(source.root_document.root_path, r)
15
+ r
16
+ end
17
17
 
18
18
  before do
19
- application.entry('stereotype').write('EacAsciidoctorBase0')
20
- ::EacConfig::Node.context.current.entry("#{application.id}_dev.install.path")
21
- .value = source.path.to_path
22
- application_instance.entry('install.path').write(source.path.to_path)
23
- application_instance.entry('install.name').write('The Author')
24
- application_instance.entry('install.name_initials').write('T.A.')
25
- application_instance.entry('install.email').write('theauthor@example.net')
26
- application_instance.entry('web.url').write('https://www.example.net')
19
+ copy_template_hash(
20
+ source.root_document,
21
+ c1: {
22
+ c1_1: {
23
+ c1_1_1: {
24
+ c1_1_1_1: {},
25
+ c1_1_1_2: {}
26
+ },
27
+ c1_1_2: {
28
+ c1_1_2_1: {},
29
+ c1_1_2_2: {}
30
+ }
31
+ }
32
+ },
33
+ c2: {
34
+ c2_1: {}
35
+ }
36
+ )
27
37
  end
28
38
 
29
39
  it do
30
40
  expect(instance.pre_processed_body_source_content).to eq(target_file.read)
31
41
  end
42
+
43
+ # @return [Avm::EacAsciidoctorBase0::Sources::Base::Document]
44
+ def copy_template_doc(parent, basename)
45
+ parent.assert_argument(::Avm::EacAsciidoctorBase0::Sources::Base::Document, 'parent')
46
+
47
+ root_target = parent.root_path.join(basename.to_s)
48
+ ::FileUtils.copy_entry(doc_template, root_target)
49
+ root_target.join('title').write(root_target.basename.to_path)
50
+ ::Avm::EacAsciidoctorBase0::Sources::Base::Document.new(parent.source, parent,
51
+ root_target.basename)
52
+ end
53
+
54
+ # @return [Array<Avm::EacAsciidoctorBase0::Sources::Base::Document>]
55
+ def copy_template_hash(parent, hash)
56
+ parent.assert_argument(::Avm::EacAsciidoctorBase0::Sources::Base::Document, 'parent')
57
+ hash.assert_argument(::Hash, 'hash')
58
+
59
+ hash.map do |k, v|
60
+ r = copy_template_doc(parent, k)
61
+ copy_template_hash(r, v)
62
+ r
63
+ end
64
+ end
65
+
66
+ # @return [Avm::EacAsciidoctorBase0::Instances::Build::Document]
67
+ def build_doc_child(build_doc, *path)
68
+ basename = path.shift.to_s
69
+ r = build_doc.child!(basename)
70
+ path.any? ? build_doc_child(r, *path) : r
71
+ end
32
72
  end
@@ -1,5 +1,5 @@
1
- :stylesheet: ../theme/main.css
2
- = EacAsciidoctorBase0 Generated Source
1
+ :stylesheet: ../../../../theme/main.css
2
+ = c1_1_1
3
3
  The Author <theauthor@example.net>
4
4
  :Author Initials: T.A.
5
5
  :toc: left
@@ -7,8 +7,13 @@ The Author <theauthor@example.net>
7
7
  :numbered:
8
8
  :website: https://www.example.net
9
9
 
10
+ [.normal]
11
+ link:../../../index.html[Home] » link:../../index.html[c1] » link:../index.html[c1_1] » link:index.html[c1_1_1]
12
+
10
13
  == Child Documents
11
14
 
15
+ * link:c1_1_1_1/index.html[c1_1_1_1]
16
+ * link:c1_1_1_2/index.html[c1_1_1_2]
12
17
 
13
18
  == First Section
14
19
 
@@ -1,48 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_asciidoctor_base0/sources/base'
4
3
  require 'avm/eac_asciidoctor_base0/instances/build'
5
4
  require 'eac_fs/comparator'
6
5
 
7
- ::RSpec.describe ::Avm::EacAsciidoctorBase0::Instances::Build do # rubocop:disable Metrics/BlockLength
8
- let(:application) { ::Avm::Applications::Base.new('myapp') }
9
- let(:application_instance) do
10
- ::Avm::EacAsciidoctorBase0::Instances::Base
11
- .new(application, 'stub')
12
- end
13
- let(:fixtures_dir) { __dir__.to_pathname.join('build_spec_files') }
6
+ ::RSpec.describe ::Avm::EacAsciidoctorBase0::Instances::Build do
7
+ let(:app_director) { eac_asciidoctor_base0_stubs }
14
8
  let(:fs_comparator) { ::EacFs::Comparator.new.truncate_file('*.html') }
15
- let(:instance) { described_class.new(application_instance) }
16
- let(:source) { avm_source('EacAsciidoctorBase0', target_basename: application.id) }
17
- let(:target_dir) { fixtures_dir }
18
- let(:main_document) do
19
- source.path.join(::Avm::EacAsciidoctorBase0::Sources::Base::MAIN_FILE_SUBPATH)
20
- end
9
+ let(:instance) { described_class.new(app_director.instance) }
21
10
 
22
- before do
23
- application.entry('stereotype').write('EacAsciidoctorBase0')
24
- ::EacConfig::Node.context.current.entry("#{application.id}_dev.install.path")
25
- .value = source.path.to_path
26
- application_instance.entry('install.name').write('The Author')
27
- application_instance.entry('install.name_initials').write('T.A.')
28
- application_instance.entry('install.email').write('theauthor@example.net')
29
- application_instance.entry('web.url').write('https://www.example.net')
30
- %w[doc1 doc2 doc2/doc2_1].each do |subpath|
31
- target_dir = source.content_directory.join(subpath)
32
- target_dir.mkpath
33
- ::FileUtils.cp(
34
- main_document,
35
- target_dir.join(::Avm::EacAsciidoctorBase0::Sources::Base::CONTENT_DOCUMENT_BASENAME)
36
- )
37
- ::FileUtils.cp(
38
- source.root_document.title_path,
39
- target_dir.join(::Avm::EacAsciidoctorBase0::Sources::Base::Document::TITLE_BASENAME)
40
- )
11
+ include_examples 'source_target_fixtures', __FILE__ do
12
+ def source_data(source_file)
13
+ ::FileUtils.copy_entry(source_file, app_director.source.path)
14
+ instance.perform
15
+ fs_comparator.build(instance.target_directory)
41
16
  end
42
- instance.perform
43
- end
44
17
 
45
- it do
46
- expect(fs_comparator.build(instance.target_directory)).to eq(fs_comparator.build(target_dir))
18
+ def target_data(target_file)
19
+ fs_comparator.build(target_file.to_pathname)
20
+ end
47
21
  end
48
22
  end
@@ -0,0 +1,11 @@
1
+ == Child Documents
2
+
3
+ //#child_docs
4
+
5
+ == First Section
6
+
7
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sapien.
8
+
9
+ == Second Section
10
+
11
+ Nam faucibus quis dui at laoreet. Pellentesque ut sapien est.
@@ -0,0 +1,11 @@
1
+ == Child Documents
2
+
3
+ //#child_docs
4
+
5
+ == First Section
6
+
7
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sapien.
8
+
9
+ == Second Section
10
+
11
+ Nam faucibus quis dui at laoreet. Pellentesque ut sapien est.
@@ -0,0 +1,11 @@
1
+ == Child Documents
2
+
3
+ //#child_docs
4
+
5
+ == First Section
6
+
7
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sapien.
8
+
9
+ == Second Section
10
+
11
+ Nam faucibus quis dui at laoreet. Pellentesque ut sapien est.
@@ -7,12 +7,7 @@ require 'avm/eac_asciidoctor_base0/sources/base'
7
7
  include_examples 'in_avm_registry', 'sources'
8
8
 
9
9
  describe '#instance' do
10
- let(:application) { ::Avm::Applications::Base.new('myapp') }
11
- let(:source) { avm_source('EacAsciidoctorBase0', target_basename: application.id) }
12
-
13
- before do
14
- application.local_source_path_entry.value = source.path
15
- end
10
+ let(:source) { eac_asciidoctor_base0_stubs.source }
16
11
 
17
12
  it do
18
13
  expect(source.instance).to be_a(::Avm::EacAsciidoctorBase0::Instances::Base)
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_config/node'
4
+ require 'avm/applications/base'
5
+ require 'avm/instances/base'
6
+ require 'eac_ruby_utils/core_ext'
7
+
8
+ module EacAsciidoctorBase0Stubs
9
+ class Director
10
+ DEFAULT_APPLICATION_ID = 'myapp'
11
+ INSTANCE_ENTRY_KEYS = {
12
+ 'install.name' => 'The Author',
13
+ 'install.name_initials' => 'T.A.',
14
+ 'install.email' => 'theauthor@example.net',
15
+ 'web.url' => 'https://www.example.net'
16
+ }.freeze
17
+
18
+ enable_simple_cache
19
+ common_constructor :rspec_example, :application_id, default: [DEFAULT_APPLICATION_ID] do
20
+ source
21
+ application
22
+ instance
23
+ end
24
+
25
+ private
26
+
27
+ # @return [Avm::Applications::Base]
28
+ def application_uncached
29
+ r = ::Avm::Applications::Base.new(application_id)
30
+ r.entry('stereotype').write('EacAsciidoctorBase0')
31
+ r.local_source_path_entry.value = source.path.to_path
32
+ r
33
+ end
34
+
35
+ # @return [Avm::EacAsciidoctorBase0::Instances::Base]
36
+ def instance_uncached
37
+ r = ::Avm::EacAsciidoctorBase0::Instances::Base.new(application, 'stub')
38
+ INSTANCE_ENTRY_KEYS.each { |k, v| r.entry(k).write(v) }
39
+ r
40
+ end
41
+
42
+ # @return [Avm::EacAsciidoctorBase0::Sources::Base]
43
+ def source_uncached
44
+ rspec_example.avm_source('EacAsciidoctorBase0', target_basename: application_id)
45
+ end
46
+ end
47
+
48
+ def eac_asciidoctor_base0_stubs(id = nil)
49
+ args = [self]
50
+ args << id if id.present?
51
+ ::EacAsciidoctorBase0Stubs::Director.new(*args)
52
+ end
53
+ end
54
+
55
+ ::EacRubyUtils::Rspec.default_setup.rspec_config.include(::EacAsciidoctorBase0Stubs)
@@ -3,3 +3,6 @@
3
3
  require 'eac_ruby_utils/rspec/default_setup'
4
4
  ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
5
5
  .stub_avm_contexts
6
+
7
+ require 'eac_ruby_utils/require_sub'
8
+ ::EacRubyUtils.require_sub __FILE__
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.58.0
4
+ version: 0.60.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: 2023-04-05 00:00:00.000000000 Z
11
+ date: 2023-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.16'
39
+ version: '0.18'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.16'
46
+ version: '0.18'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: avm-eac_generic_base0
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -375,8 +375,10 @@ files:
375
375
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/base.rb
376
376
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build.rb
377
377
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document.rb
378
+ - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/breadcrumbs_macro_value.rb
378
379
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/child_docs_macro_value.rb
379
380
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb
381
+ - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/media.rb
380
382
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/pre_process_line.rb
381
383
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/deploy.rb
382
384
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/source_generators.rb
@@ -384,6 +386,7 @@ files:
384
386
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb
385
387
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb
386
388
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/document.rb
389
+ - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/document/media.rb
387
390
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/document/title.rb
388
391
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/instance_to_build.rb
389
392
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/theme.rb
@@ -394,10 +397,22 @@ files:
394
397
  - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build/document_spec.rb
395
398
  - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build/document_spec_files/pre_processed_root_body.adoc
396
399
  - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec.rb
397
- - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/doc1.html
398
- - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/doc2.html
399
- - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/doc2/doc2_1.html
400
- - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/index.html
400
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/_media/a_media_file
401
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/_media/a_media_file
402
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/body.adoc
403
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc1/title
404
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/body.adoc
405
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/_media/a_media_file
406
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/body.adoc
407
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/doc2_1/title
408
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.source/content/doc2/title
409
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/_media/a_media_file
410
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc1/_media/a_media_file
411
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc1/index.html
412
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc2/doc2_1/_media/a_media_file
413
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc2/doc2_1/index.html
414
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/doc2/index.html
415
+ - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/instances/build_spec_files/first.target/index.html
401
416
  - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/source_generators/base_spec.rb
402
417
  - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/source_generators/base_spec_files/no_options/content/body.adoc
403
418
  - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/source_generators/base_spec_files/no_options/content/title
@@ -405,6 +420,7 @@ files:
405
420
  - sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb
406
421
  - sub/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb
407
422
  - sub/avm-eac_asciidoctor_base0/spec/spec_helper.rb
423
+ - sub/avm-eac_asciidoctor_base0/spec/spec_helper/eac_asciidoctor_base0_stubs.rb
408
424
  - sub/avm-eac_asciidoctor_base0/template/avm/eac_asciidoctor_base0/source_generators/base/content/body.adoc
409
425
  - sub/avm-eac_asciidoctor_base0/template/avm/eac_asciidoctor_base0/source_generators/base/content/title
410
426
  - sub/avm-eac_asciidoctor_base0/template/avm/eac_asciidoctor_base0/source_generators/base/theme/main.css