relaton-cli 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/README.adoc +2 -1
- data/lib/relaton/cli/relaton_file.rb +10 -6
- data/lib/relaton/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: 4eec2ad64bffc0852186a6c9554f4afd5ed82af1c601859d9cb23074c9d8519a
|
4
|
+
data.tar.gz: cc584c653dcfba62a34c37c1b3a61036f250e2ed93b74fbf8ec0837c18b39d19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac2cf3134f6b27ecdb5f17d895b2b25d61b568b7fc041aa0ac90cb3012612a54f7009ae87e1874b975094603c3ad8fb312cb68de7d0e950192bbddba5bc75c96
|
7
|
+
data.tar.gz: dda1a006e2987834f670173c2c5cfb8c78f5673308b68a8644f4e6acfc212b74e1724aedc56310de83d86977f18657ab42d16d776b39922d33015c66e58535a8
|
data/docs/README.adoc
CHANGED
@@ -43,12 +43,13 @@ suports an additional `-x` or `--extension` options to use different extension.
|
|
43
43
|
|
44
44
|
[source,console]
|
45
45
|
----
|
46
|
-
$ relaton fetch CODE -t TYPE -y YEAR
|
46
|
+
$ relaton fetch CODE -t TYPE -f FORMAT -y YEAR
|
47
47
|
----
|
48
48
|
|
49
49
|
Fetch the Relaton XML entry corresponding to the document identifier `CODE`.
|
50
50
|
|
51
51
|
* `YEAR` is optional, and specifies the year of publication of the standard.
|
52
|
+
* `FORMAT` is optional, and specifies the output format; the recognised values for `FORMAT` are `xml` (default), `bibtex`.
|
52
53
|
* `TYPE` specifies the standards class library to be used, that the identifier is part of; the recognised
|
53
54
|
values for `TYPE` are `isobib`, `ietfbib`, `iecbib`, `gbbib`.
|
54
55
|
|
@@ -137,15 +137,19 @@ module Relaton
|
|
137
137
|
def concatenate_files
|
138
138
|
xml_files = [convert_rxl_to_xml, convert_yamls_to_xml, convert_xml_to_xml]
|
139
139
|
|
140
|
-
xml_files.flatten.
|
140
|
+
xml_files.flatten.reduce([]) do |mem, xml|
|
141
141
|
doc = nokogiri_document(xml[:content])
|
142
|
-
if (
|
142
|
+
if (refs = doc.xpath("//rfc//reference")).any?
|
143
143
|
require "relaton_ietf/scrapper"
|
144
|
-
|
145
|
-
|
146
|
-
|
144
|
+
mem + refs.map do |rfc|
|
145
|
+
ietf = RelatonIetf::Scrapper.fetch_rfc rfc
|
146
|
+
d = nokogiri_document ietf.to_xml(bibdata: true)
|
147
|
+
bibdata_instance(d, xml[:file])
|
148
|
+
end
|
149
|
+
elsif doc&.root&.name == "bibdata"
|
150
|
+
mem << bibdata_instance(doc, xml[:file])
|
151
|
+
else mem
|
147
152
|
end
|
148
|
-
bibdata_instance(doc, xml[:file]) if doc&.root&.name == "bibdata"
|
149
153
|
end.compact
|
150
154
|
end
|
151
155
|
|
data/lib/relaton/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.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: 2020-
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|