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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b8db31870f272c13e8704dfb09b08a7e56ea703478db5683d72fccb3c92981a
4
- data.tar.gz: 15fa2d2786a1c0d0f50054da7e7b0eb8a87a06b64cef492693938243534d9b75
3
+ metadata.gz: 4eec2ad64bffc0852186a6c9554f4afd5ed82af1c601859d9cb23074c9d8519a
4
+ data.tar.gz: cc584c653dcfba62a34c37c1b3a61036f250e2ed93b74fbf8ec0837c18b39d19
5
5
  SHA512:
6
- metadata.gz: 3ab548b6a6ffd205c9f549bea24e9620a13a8faa3dc9928b88368b085c2b7147add716e59c1efe8aa8137809a79c040ef305d6eb0529b9dfb131a419f24d76d3
7
- data.tar.gz: fbb82682d1f7917d10148404ffa046adaed0048bbb330c840cad22a9f0c08fc80cc9c508febedb5355fe51c34656e24d28af6bf587a6d6a8f7585caa3695b06a
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.map do |xml|
140
+ xml_files.flatten.reduce([]) do |mem, xml|
141
141
  doc = nokogiri_document(xml[:content])
142
- if (rfc = doc.at("//rfc"))
142
+ if (refs = doc.xpath("//rfc//reference")).any?
143
143
  require "relaton_ietf/scrapper"
144
- #ietf = RelatonIetf::Scrapper.bib_item rfc, "rfc"
145
- ietf = RelatonIetf::Scrapper.fetch_rfc rfc
146
- doc = nokogiri_document ietf.to_xml(bibdata: true)
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
 
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "1.0.1".freeze
3
+ VERSION = "1.0.2".freeze
4
4
  end
5
5
  end
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.1
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-04-30 00:00:00.000000000 Z
11
+ date: 2020-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug