avm-eac_asciidoctor_base0 0.23.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/eac_asciidoctor_base0/documents_owner.rb +1 -1
- data/lib/avm/eac_asciidoctor_base0/instances/build/document/body_target.rb +10 -0
- data/lib/avm/eac_asciidoctor_base0/instances/build.rb +2 -1
- data/lib/avm/eac_asciidoctor_base0/logging/catcher.rb +47 -0
- data/lib/avm/eac_asciidoctor_base0/logging/error.rb +18 -0
- data/lib/avm/eac_asciidoctor_base0/logging.rb +11 -0
- data/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- metadata +45 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86a2fbf3a41bc705973e5d72606bb82f9e490c2dc1be92e69374c1daaaede203
|
4
|
+
data.tar.gz: bae73a31143d7ab4f3bcd3b792087780b72a613173828751341ed7e0280345a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b9de587064b412d52b4d081780f484edb1112544edcbd2c7fbce3c77098136e76246f328063b751bd41baefaaff03b7ea5767f9c9082351ec73aecdf484e594
|
7
|
+
data.tar.gz: 90eee15a5f8dfb0a8aeb93c947d3b29c0e6a6cce830ab5d4915126af4cc14c2a8358a98eaa314ee2c0ae42c19bb7e9b32859a76e3d6b99d7fd352ee0a6c85a43
|
@@ -13,7 +13,7 @@ module Avm
|
|
13
13
|
# @raise [KeyError]
|
14
14
|
def document(subpath)
|
15
15
|
documents.find { |d| d.subpath.to_pathname == subpath.to_pathname } ||
|
16
|
-
raise(::KeyError, "Document not found with
|
16
|
+
raise(::KeyError, "Document not found with subpath = \"#{subpath}\"")
|
17
17
|
end
|
18
18
|
|
19
19
|
# @return [Enumerable<Avm::EacAsciidoctorBase0::Sources::Document>]
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'asciidoctor'
|
4
4
|
require 'avm/eac_asciidoctor_base0/instances/macros'
|
5
|
+
require 'avm/eac_asciidoctor_base0/logging/catcher'
|
5
6
|
require 'eac_ruby_utils/core_ext'
|
6
7
|
|
7
8
|
module Avm
|
@@ -23,6 +24,15 @@ module Avm
|
|
23
24
|
|
24
25
|
# @return [Asciidoctor::Document]
|
25
26
|
def body_target_write
|
27
|
+
::Avm::EacAsciidoctorBase0::Logging::Catcher.on do
|
28
|
+
body_target_write_without_logging_catch
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
protected
|
33
|
+
|
34
|
+
# @return [Asciidoctor::Document]
|
35
|
+
def body_target_write_without_logging_catch
|
26
36
|
::Asciidoctor.convert(
|
27
37
|
pre_processed_body_source_content,
|
28
38
|
base_dir: convert_base_dir,
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_asciidoctor_base0/logging/error'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacAsciidoctorBase0
|
8
|
+
module Logging
|
9
|
+
class Catcher < ::SimpleDelegator
|
10
|
+
CATCH_LEVEL = ::Logger::ERROR
|
11
|
+
LOGGER_METHODS = %i[unknown fatal error warn info debug].freeze
|
12
|
+
|
13
|
+
class << self
|
14
|
+
# @param [String]
|
15
|
+
# @return [Integer]
|
16
|
+
def level_by_method(method_name)
|
17
|
+
::Logger.const_get(method_name.to_s.underscore.upcase)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @return [Hash<Symbol, Integer]
|
21
|
+
def methods_levels
|
22
|
+
LOGGER_METHODS.to_h { |method_name| [method_name, level_by_method(method_name)] }
|
23
|
+
end
|
24
|
+
|
25
|
+
def on
|
26
|
+
real_logger = ::Asciidoctor::LoggerManager.logger
|
27
|
+
begin
|
28
|
+
::Asciidoctor::LoggerManager.logger = new(real_logger)
|
29
|
+
yield
|
30
|
+
ensure
|
31
|
+
::Asciidoctor::LoggerManager.logger = real_logger
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
methods_levels.each do |method_name, level|
|
37
|
+
define_method method_name do |*args, &block|
|
38
|
+
__getobj__.send(method_name, *args, &block)
|
39
|
+
return unless level >= CATCH_LEVEL
|
40
|
+
|
41
|
+
raise ::Avm::EacAsciidoctorBase0::Logging::Error.new(level, *args, &block)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacAsciidoctorBase0
|
7
|
+
module Logging
|
8
|
+
class Error < ::RuntimeError
|
9
|
+
attr_reader :level
|
10
|
+
|
11
|
+
def initialize(level, *args)
|
12
|
+
@level = level
|
13
|
+
super(*args)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-eac_asciidoctor_base0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.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: 2024-
|
11
|
+
date: 2024-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '2.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 2.0.
|
22
|
+
version: 2.0.23
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,35 +29,69 @@ dependencies:
|
|
29
29
|
version: '2.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 2.0.
|
32
|
+
version: 2.0.23
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: avm-eac_webapp_base0
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.20'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.20.1
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.20'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.20.1
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: eac_fs
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0.18'
|
60
|
+
type: :runtime
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0.18'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: eac_ruby_gem_support
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0.10'
|
40
74
|
type: :runtime
|
41
75
|
prerelease: false
|
42
76
|
version_requirements: !ruby/object:Gem::Requirement
|
43
77
|
requirements:
|
44
78
|
- - "~>"
|
45
79
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
80
|
+
version: '0.10'
|
47
81
|
- !ruby/object:Gem::Dependency
|
48
82
|
name: eac_ruby_utils
|
49
83
|
requirement: !ruby/object:Gem::Requirement
|
50
84
|
requirements:
|
51
85
|
- - "~>"
|
52
86
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
87
|
+
version: '0.122'
|
54
88
|
type: :runtime
|
55
89
|
prerelease: false
|
56
90
|
version_requirements: !ruby/object:Gem::Requirement
|
57
91
|
requirements:
|
58
92
|
- - "~>"
|
59
93
|
- !ruby/object:Gem::Version
|
60
|
-
version: '0.
|
94
|
+
version: '0.122'
|
61
95
|
- !ruby/object:Gem::Dependency
|
62
96
|
name: os
|
63
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,6 +182,9 @@ files:
|
|
148
182
|
- lib/avm/eac_asciidoctor_base0/instances/macros/child_docs.rb
|
149
183
|
- lib/avm/eac_asciidoctor_base0/instances/macros/child_docs/document_builder.rb
|
150
184
|
- lib/avm/eac_asciidoctor_base0/instances/macros/default_body.rb
|
185
|
+
- lib/avm/eac_asciidoctor_base0/logging.rb
|
186
|
+
- lib/avm/eac_asciidoctor_base0/logging/catcher.rb
|
187
|
+
- lib/avm/eac_asciidoctor_base0/logging/error.rb
|
151
188
|
- lib/avm/eac_asciidoctor_base0/source_generators.rb
|
152
189
|
- lib/avm/eac_asciidoctor_base0/source_generators/base.rb
|
153
190
|
- lib/avm/eac_asciidoctor_base0/sources.rb
|