eac_tools 0.43.0 → 0.44.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: 65b0eefb0e0ef10a3abfd27894a02ee0d4c7de07af8aa4f26a20d4ac4fd6dcbd
4
- data.tar.gz: 6b07c4255b3d7ce70942927f6293d185ee7103bfd83fd6cc39fb0f69383293ac
3
+ metadata.gz: b4c29f133ac7e8ea838302984ba5d8c0a947e16cc615764dae97e2b9100bd40b
4
+ data.tar.gz: 49926d91a7fe7fc5b3135b6910b7a8bb211a9d21bab5072a9e2a87b2f759e60c
5
5
  SHA512:
6
- metadata.gz: d67d744fc384ea9a92c1b39aa98bfda3f53c72125a48cd76d00963c94b51fdf1bdceffb2f489da4b03475a26afcdc660c9cc6ee0cfc911d6312f66ef37a1a3e5
7
- data.tar.gz: ea8f9e685277a7e941ebe4e76593df2065505098e961d014ebe87f4d297e394e5b2f94d97574978d60e0cadf932e7a7b81add2e7b3cc89d92aff8d6967b6f67a
6
+ metadata.gz: d55a8b88951fc5b287d5f0897157129199b4d4229936e1ea31da011f66ae45a26d9a3966ae71afc595babe9da9312e5837a23c4c645702e4184bd6633d1effb3
7
+ data.tar.gz: b578bec6760cc52df6c9736ef4d4428f0af4460e056d3939553090b680ee7a8059ec608221867176dacacc33014c2f04434405154e4049ca9aad7125c327152b
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.43.0)
4
+ eac_tools (0.44.0)
5
5
  avm (~> 0.55)
6
- avm-eac_asciidoctor_base0 (~> 0.11)
6
+ avm-eac_asciidoctor_base0 (~> 0.12)
7
7
  avm-eac_generic_base0 (~> 0.8)
8
8
  avm-eac_latex_base0 (~> 0.3)
9
9
  avm-eac_php_base0 (~> 0.3)
@@ -33,7 +33,7 @@ PATH
33
33
  PATH
34
34
  remote: sub/avm-eac_asciidoctor_base0
35
35
  specs:
36
- avm-eac_asciidoctor_base0 (0.11.0)
36
+ avm-eac_asciidoctor_base0 (0.12.0)
37
37
  asciidoctor (~> 2.0, >= 2.0.18)
38
38
  avm-eac_webapp_base0 (~> 0.12, >= 0.12.2)
39
39
  eac_ruby_utils (~> 0.107)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.43.0'
4
+ VERSION = '0.44.0'
5
5
  end
@@ -0,0 +1,51 @@
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 ChildDocsMacroValue
11
+ enable_method_class
12
+ common_constructor :document
13
+
14
+ # @return [Array<String>]
15
+ def result
16
+ document.children.map { |child_doc| ChildDocLine.new(document, child_doc) }.sort
17
+ .map(&:result)
18
+ end
19
+
20
+ class ChildDocLine
21
+ common_constructor :document, :child
22
+ compare_by :title, :address
23
+
24
+ # @return [Pathname]
25
+ def address
26
+ child.body_target_path.relative_path_from(
27
+ document.body_target_path.dirname
28
+ )
29
+ end
30
+
31
+ # @return [String]
32
+ def link
33
+ "link:#{address}[#{title}]"
34
+ end
35
+
36
+ # @return [String]
37
+ def result
38
+ "* #{link}"
39
+ end
40
+
41
+ # @return [String]
42
+ def title
43
+ child.source_document.title
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -43,11 +43,8 @@ module Avm
43
43
  "#{author_name} <#{author_email}>"
44
44
  end
45
45
 
46
+ # @return [Array<String>]
46
47
  def result
47
- result_lines.join("\n")
48
- end
49
-
50
- def result_lines
51
48
  [stylesheet_line, title_line, author_line] + attributes_lines
52
49
  end
53
50
 
@@ -17,11 +17,12 @@ module Avm
17
17
 
18
18
  common_constructor :document, :line
19
19
 
20
+ # @return [Array<String>]
20
21
  def result
21
22
  if macro?
22
23
  macro_value
23
24
  else
24
- line
25
+ [line]
25
26
  end
26
27
  end
27
28
 
@@ -33,6 +34,7 @@ module Avm
33
34
  MACRO_PARSER
34
35
  end
35
36
 
37
+ # @return [Array<String>]
36
38
  def macro_value
37
39
  document.send("#{macro_name}_macro_value")
38
40
  end
@@ -36,7 +36,7 @@ module Avm
36
36
  end
37
37
 
38
38
  def perform_self
39
- infov 'Building', source_document.root_path
39
+ infov 'Building', source_document.subpath
40
40
  ::Asciidoctor.convert(
41
41
  pre_processed_body_source_content,
42
42
  base_dir: convert_base_dir,
@@ -51,7 +51,8 @@ module Avm
51
51
  # @return [String]
52
52
  def pre_processed_body_source_content
53
53
  source_document.body_path.read.each_line
54
- .map { |line| pre_process_line(line.rstrip) + "\n" }.join
54
+ .flat_map { |line| pre_process_line(line.rstrip) }
55
+ .map { |line| "#{line.rstrip}\n" }.join
55
56
  end
56
57
 
57
58
  def tree_documents_count
@@ -13,14 +13,13 @@ module Avm
13
13
  enable_listable
14
14
  lists.add_symbol :option, :target_directory
15
15
  common_constructor :instance, :options, default: [{}] do
16
- instance.assert_argument(::Avm::EacAsciidoctorBase0::Instances::Base, 'instance')
17
16
  self.options = self.class.lists.option.hash_keys_validate!(options.symbolize_keys)
18
17
  end
19
18
 
20
19
  SOURCE_EXTNAMES = %w[.adoc .asc].freeze
21
20
 
22
21
  def perform
23
- infov 'Files to build', root_document.tree_documents_count
22
+ infov 'Documents to build', root_document.tree_documents_count
24
23
  target_directory.clear
25
24
  root_document.perform
26
25
  end
@@ -0,0 +1,45 @@
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 InstanceToBuild
11
+ AUTHOR_EMAIL = 'author@local.net'
12
+ AUTHOR_NAME = 'Local Author'
13
+ AUTHOR_NAME_INITIALS = 'L.A.'
14
+
15
+ common_constructor :source
16
+
17
+ # @return [Struct]
18
+ def application
19
+ ::Struct.new(:local_source).new(source)
20
+ end
21
+
22
+ # @return [String]
23
+ def author_email
24
+ AUTHOR_EMAIL
25
+ end
26
+
27
+ # @return [String]
28
+ def author_name
29
+ AUTHOR_NAME
30
+ end
31
+
32
+ # @return [String]
33
+ def author_name_initials
34
+ AUTHOR_NAME_INITIALS
35
+ end
36
+
37
+ # @return [String]
38
+ def web_url
39
+ "file://#{source.path.expand_path.join('build', 'index.html')}"
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -18,6 +18,11 @@ module Avm
18
18
  path.join(CONTENT_DIRECTORY_SUBPATH)
19
19
  end
20
20
 
21
+ # @return [Avm::EacAsciidoctorBase0::Sources::Base::InstanceToBuild]
22
+ def instance_to_build
23
+ ::Avm::EacAsciidoctorBase0::Sources::Base::InstanceToBuild.new(self)
24
+ end
25
+
21
26
  # @return [Avm::EacAsciidoctorBase0::Sources::Base::Document
22
27
  def root_document
23
28
  ::Avm::EacAsciidoctorBase0::Sources::Base::Document.new(self, nil, nil)
@@ -25,7 +25,7 @@ module Avm
25
25
 
26
26
  def build_uncached
27
27
  ::Avm::EacAsciidoctorBase0::Instances::Build.new(
28
- runner_context.call(:source).instance,
28
+ runner_context.call(:source).instance_to_build,
29
29
  target_directory: parsed.target_dir
30
30
  )
31
31
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacAsciidoctorBase0
5
- VERSION = '0.11.0'
5
+ VERSION = '0.12.0'
6
6
  end
7
7
  end
@@ -7,6 +7,9 @@ The Author <theauthor@example.net>
7
7
  :numbered:
8
8
  :website: https://www.example.net
9
9
 
10
+ == Child Documents
11
+
12
+
10
13
  == First Section
11
14
 
12
15
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sapien.
@@ -1,5 +1,9 @@
1
1
  //#header
2
2
 
3
+ == Child Documents
4
+
5
+ //#child_docs
6
+
3
7
  == First Section
4
8
 
5
9
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sapien.
@@ -1,5 +1,9 @@
1
1
  //#header
2
2
 
3
+ == Child Documents
4
+
5
+ //#child_docs
6
+
3
7
  == First Section
4
8
 
5
9
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sapien.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.11'
33
+ version: '0.12'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.11'
40
+ version: '0.12'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: avm-eac_generic_base0
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -307,6 +307,7 @@ files:
307
307
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/base.rb
308
308
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build.rb
309
309
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document.rb
310
+ - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/child_docs_macro_value.rb
310
311
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/header_macro_value.rb
311
312
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/build/document/pre_process_line.rb
312
313
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/deploy.rb
@@ -318,6 +319,7 @@ files:
318
319
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb
319
320
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/document.rb
320
321
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/document/title.rb
322
+ - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/instance_to_build.rb
321
323
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base/theme.rb
322
324
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners.rb
323
325
  - sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/build.rb