avm-eac_asciidoctor_base0 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3a5da1c3697e1e33e663e83f4b6a72a0bc91f2970144259e7a05f6ee745f9df6
4
+ data.tar.gz: 4279b1fca900b650f5afcb71e5154ed9a09978e3c86fe393010101ee3d0abec5
5
+ SHA512:
6
+ metadata.gz: 6ab892d696634f53de5891a06633c418e91c2c1462f9e0d490ac5db3eb2c435620a839d4784b845bef4a06b374a9bd89bae63cf850e114f17dd9f9bee72c3202
7
+ data.tar.gz: 6148e7d7a0b737d1e961ccad3895b196edb013deb1970a56493c06c0be24f1e285ece1f66e35969e38108fafaa446f55cd673a52423b3597573c7be9967cab8f
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacAsciidoctorBase0
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacAsciidoctorBase0
7
+ module Sources
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacAsciidoctorBase0
7
+ module Sources
8
+ class Base
9
+ common_constructor :root do
10
+ self.root = root.to_pathname
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_utils/fs/clearable_directory'
5
+
6
+ module Avm
7
+ module EacAsciidoctorBase0
8
+ module Sources
9
+ class Build
10
+ require_sub __FILE__
11
+ enable_console_speaker
12
+ enable_simple_cache
13
+ enable_listable
14
+ lists.add_symbol :option, :target_directory
15
+ common_constructor :project, :options, default: [{}] do
16
+ self.options = self.class.lists.option.hash_keys_validate!(options.symbolize_keys)
17
+ end
18
+
19
+ SOURCE_EXTNAMES = %w[.adoc .asc].freeze
20
+
21
+ def run
22
+ infov 'Files to build', source_files.count
23
+ target_directory.clear
24
+ source_files.each(&:run)
25
+ end
26
+
27
+ def default_target_directory
28
+ project.root.join('build')
29
+ end
30
+
31
+ def target_directory
32
+ ::EacRubyUtils::Fs::ClearableDirectory.new(
33
+ options[OPTION_TARGET_DIRECTORY] || default_target_directory
34
+ )
35
+ end
36
+
37
+ def source_files_uncached
38
+ r = []
39
+ project.root.children.each do |child|
40
+ next unless SOURCE_EXTNAMES.include?(child.extname)
41
+
42
+ r << ::Avm::EacAsciidoctorBase0::Sources::Build::File.new(self, child.basename)
43
+ end
44
+ r
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'asciidoctor'
4
+
5
+ module Avm
6
+ module EacAsciidoctorBase0
7
+ module Sources
8
+ class Build
9
+ class File
10
+ enable_console_speaker
11
+ common_constructor :build, :subpath
12
+
13
+ def run
14
+ infov 'Building', subpath
15
+ ::Asciidoctor.convert_file source_path.to_path,
16
+ to_file: target_path.to_path, safe: :unsafe, mkdirs: true
17
+ end
18
+
19
+ def source_path
20
+ build.project.root.join(subpath)
21
+ end
22
+
23
+ def target_path
24
+ build.target_directory.join(subpath).basename_sub('.*') { |b| "#{b}.html" }
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module EacAsciidoctorBase0
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: avm-eac_asciidoctor_base0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Put here the authors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-05-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: eac_ruby_utils
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.63'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.63'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rouge
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.26'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.26'
41
+ - !ruby/object:Gem::Dependency
42
+ name: eac_ruby_gem_support
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.2'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.2'
55
+ description:
56
+ email:
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - lib/avm/eac_asciidoctor_base0.rb
62
+ - lib/avm/eac_asciidoctor_base0/sources.rb
63
+ - lib/avm/eac_asciidoctor_base0/sources/base.rb
64
+ - lib/avm/eac_asciidoctor_base0/sources/build.rb
65
+ - lib/avm/eac_asciidoctor_base0/sources/build/file.rb
66
+ - lib/avm/eac_asciidoctor_base0/version.rb
67
+ homepage:
68
+ licenses: []
69
+ metadata: {}
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubygems_version: 3.0.9
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: Put here de description.
89
+ test_files: []