metanorma-core 0.2.5.pre.alpha.1 → 0.2.5
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 +4 -4
- data/lib/metanorma/core/version.rb +1 -1
- data/lib/metanorma/util/util.rb +10 -7
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed60afcd91e77723c04cf0d2e00865a035ee33c51e3a35fc7ff83ee12ed74624
|
|
4
|
+
data.tar.gz: 6a522123211ec73a787a366e85ec90e111008e105dcb66e7763f468d49a9fe45
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02f1b53d1566f3414d01b03eac4df7d4cb05f32c2c48aaae6caec8a9a39f1fea948725e4cc042b809591ee07130fafc94e80a07f6e05c2b7ccfcaa00056e1896
|
|
7
|
+
data.tar.gz: 6c1ee4778e2d42e8d92c3520ccc9b2810cc9ab2572c0fe77c7927947fa4a1ebe7d3ceea55d881b9c2ca6d740e9c466e472cfaaf4d1cbe04f7184f8ae8f1729ab
|
data/lib/metanorma/util/util.rb
CHANGED
|
@@ -5,15 +5,19 @@ module Metanorma
|
|
|
5
5
|
module Util
|
|
6
6
|
class << self
|
|
7
7
|
# Print +message+ to stdout if +type+ is in
|
|
8
|
-
# {Metanorma::Configuration#logs}; abort the process
|
|
9
|
-
# +type+ is +:fatal
|
|
8
|
+
# {Metanorma::Configuration#logs}; abort the process with the
|
|
9
|
+
# message on stderr if +type+ is +:fatal+.
|
|
10
|
+
#
|
|
11
|
+
# The +:fatal+ message is written to stderr unconditionally: a
|
|
12
|
+
# fatal abort that only surfaces when the right log category is
|
|
13
|
+
# configured reads as a silent death of the process
|
|
14
|
+
# (metanorma/iso-10303#756).
|
|
10
15
|
#
|
|
11
16
|
# @param message [String] the message to print.
|
|
12
17
|
# @param type [Symbol] severity, defaults to +:info+. Common
|
|
13
18
|
# values: +:info+, +:warning+, +:error+, +:fatal+. The
|
|
14
19
|
# configured +logs+ list determines which severities are
|
|
15
|
-
# printed; +:fatal+
|
|
16
|
-
# printing.
|
|
20
|
+
# printed; +:fatal+ aborts with the message on top of printing.
|
|
17
21
|
# @return [void]
|
|
18
22
|
def log(message, type = :info)
|
|
19
23
|
log_types = Metanorma.configuration.logs.map(&:to_s) || []
|
|
@@ -22,9 +26,8 @@ module Metanorma
|
|
|
22
26
|
puts(message)
|
|
23
27
|
end
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
end
|
|
29
|
+
# Kernel#abort prints the message to stderr and exits 1.
|
|
30
|
+
abort(message) if type == :fatal
|
|
28
31
|
end
|
|
29
32
|
|
|
30
33
|
# Sort key used to put output-format extensions in execution order.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.5
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciidoctor
|