metanorma-cli 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/cli/collection.rb +17 -5
- data/lib/metanorma/cli/version.rb +1 -1
- 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: 254d35cba822c2ac5a62b076028ca38e87f0a246a6ba34bc17244c28b7fec68c
|
4
|
+
data.tar.gz: 9a2c5d89000c32ef1a575293c0010a9e34fc6eb0e220447bea540a0954d8a22a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 816f20bcf2da052e6e25006b9758ce953b81bf6ad881e9f9222aa05862cd2c70ac5e4f16cb76680fe8bd260c33f584cfbc0dab2618197a16dc034e99cdad0a7d
|
7
|
+
data.tar.gz: 85b6be4ea1c04c97895177659adf037683887446a5a5e08f92f9bfe6492e8f7be3610980767b97c5b790c86566a7fb6f512163e92fbeecbea10d5a19334afd4d
|
@@ -59,12 +59,24 @@ module Metanorma
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def extract_options_from_file
|
62
|
-
|
62
|
+
yaml_file = if /\.ya?ml$/.match?(@file.to_s)
|
63
|
+
YAML.safe_load(File.read(@file.to_s))
|
64
|
+
elsif /\.xml$/.match?(@file.to_s)
|
65
|
+
xml_extract_options_from_file
|
66
|
+
end
|
63
67
|
|
64
|
-
|
65
|
-
|
66
|
-
)
|
67
|
-
|
68
|
+
old = options.dup
|
69
|
+
@options = Cli.with_indifferent_access(
|
70
|
+
yaml_file.slice("coverpage", "format", "output_folder"),
|
71
|
+
)
|
72
|
+
@options.merge!(old)
|
73
|
+
end
|
74
|
+
|
75
|
+
def xml_extract_options_from_file
|
76
|
+
xml = Nokogiri::XML File.read(@file.to_s, encoding: "UTF-8") { |c| c.huge }
|
77
|
+
{ "coverpage" => xml.at("//xmlns:coverpage"),
|
78
|
+
"format" => xml.at("//xmlns:format"),
|
79
|
+
"output_folder" => xml.at("//xmlns:output_folder") }.compact
|
68
80
|
end
|
69
81
|
end
|
70
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debug
|