metanorma-cli 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/.rubocop.yml +2 -7
- data/exe/metanorma +22 -4
- data/lib/metanorma-cli/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 869b7e9c0bfa656b994349015adf78547d09fba1661bc5405d775a92c27b1a5e
|
4
|
+
data.tar.gz: 24ed25e0c7e2554beb3bf3e701461c54530d2dce52fecc8ee995bd21718c2406
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2e375473c24bad5f0c1ecc72adca40918dec83069c05bb94520270cd7545b9a7fc046973ea05e9ff8a730d86037d1914f16f211c68f9e25619b817b4267948d
|
7
|
+
data.tar.gz: 3bd6cb886ed1a6e40d7749f5fc3bf5cf8f50001b28c6c9bf5de8a23b070e1551c6dbdfef98a9b02551168fe4cd9a8bca495ad557369add9e6db318771eacf4fa
|
data/.hound.yml
ADDED
data/.rubocop.yml
CHANGED
@@ -3,13 +3,8 @@
|
|
3
3
|
# All project-specific additions and overrides should be specified in this file.
|
4
4
|
|
5
5
|
inherit_from:
|
6
|
-
|
7
|
-
- ".rubocop.tb.yml"
|
8
|
-
# Overrides from Ribose
|
9
|
-
- ".rubocop.ribose.yml"
|
6
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
10
7
|
AllCops:
|
11
|
-
|
12
|
-
StyleGuideCopsOnly: false
|
13
|
-
TargetRubyVersion: 2.5
|
8
|
+
TargetRubyVersion: 2.3
|
14
9
|
Rails:
|
15
10
|
Enabled: true
|
data/exe/metanorma
CHANGED
@@ -148,6 +148,7 @@ unless options[:filename]
|
|
148
148
|
exit 0
|
149
149
|
end
|
150
150
|
|
151
|
+
filename = options[:filename]
|
151
152
|
options[:extension_keys] = nil if options[:extension_keys] == [:all]
|
152
153
|
|
153
154
|
case options[:format]
|
@@ -160,18 +161,32 @@ when :asciidoc
|
|
160
161
|
if processor.output_formats[e]
|
161
162
|
memo << e
|
162
163
|
else
|
163
|
-
warn "[metanorma] Error: #{e} format is not supported for this standard"
|
164
|
+
warn "[metanorma] Error: #{e} format is not supported for this standard."
|
164
165
|
end
|
165
166
|
memo
|
166
167
|
end
|
167
168
|
exit 0 if extensions.empty?
|
168
169
|
|
169
|
-
file = File.
|
170
|
-
|
170
|
+
file, isodoc = case extname = File.extname(filename)
|
171
|
+
when ".adoc"
|
172
|
+
puts "[metanorma] Processing: Asciidoctor input."
|
173
|
+
file = File.read(filename, encoding: "utf-8")
|
174
|
+
[file, processor.input_to_isodoc(file, filename)]
|
175
|
+
when ".xml"
|
176
|
+
puts "[metanorma] Processing: Metanorma XML input."
|
177
|
+
|
178
|
+
# TODO NN: this is a hack -- we should provide/bridge the
|
179
|
+
# document attributes in Metanorma XML
|
180
|
+
|
181
|
+
["", File.read(filename, encoding: "utf-8")]
|
182
|
+
else
|
183
|
+
warn "[metanorma] Error: file extension #{extname} is not supported."
|
184
|
+
exit 1
|
185
|
+
end
|
171
186
|
|
172
187
|
if options[:relaton]
|
173
188
|
xml = Nokogiri::XML(isodoc)
|
174
|
-
bibdata = xml.at("//xmlns:bibdata")
|
189
|
+
bibdata = xml.at("//bibdata") || xml.at("//xmlns:bibdata")
|
175
190
|
# require "byebug"; byebug
|
176
191
|
#docid = bibdata&.at("./xmlns:docidentifier")&.text || options[:filename]
|
177
192
|
#outname = docid.sub(/^\s+/, "").sub(/\s+$/, "").gsub(/\s+/, "-") + ".xml"
|
@@ -191,5 +206,8 @@ when :asciidoc
|
|
191
206
|
FileUtils.mv "#{outfilename}_images", outfilename
|
192
207
|
end
|
193
208
|
end
|
209
|
+
else
|
210
|
+
warn "[metanorma] Error: output format (#{options[:format]}) not supported."
|
211
|
+
exit 1
|
194
212
|
end
|
195
213
|
|
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.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -287,6 +287,7 @@ extra_rdoc_files:
|
|
287
287
|
- README.adoc
|
288
288
|
- LICENSE
|
289
289
|
files:
|
290
|
+
- ".hound.yml"
|
290
291
|
- ".rubocop.ribose.yml"
|
291
292
|
- ".rubocop.tb.yml"
|
292
293
|
- ".rubocop.yml"
|