relaton-ietf 1.7.0 → 1.7.5

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: 3c5a2dadfc8c3979deda72b4c158dc706b0d6039651aa1620cd8382b0a558f07
4
- data.tar.gz: bdd60090e9305272cccbf60b5bfbf6e1fa8cbc94872c8b540e0689380b2fb42e
3
+ metadata.gz: 7026502f569da127c8de60c69942d7c30959b942edf9b60e26145672f5f3e362
4
+ data.tar.gz: f8873f10d5cdf54fba4c5a097988eccfdc5607dfcc754b739bcc8380c70719e0
5
5
  SHA512:
6
- metadata.gz: 48a0e3a5a35e91ad9294280e065d04a15ca34a84fc9fbb8ac8f60774ceb500542d203d6215b725cfd2c5d86527e55539d19c581e53d0a54e82ea41c5021dd77b
7
- data.tar.gz: 072e6fed985fd082f374ee5764f95c6c0fa7eacbd3d5edec5e1b7d06aebd67c75ce4f1c671d295e8abd2008e41367f020b47103a2e673a5296058f3f20e0e6b4
6
+ metadata.gz: 93e3c02df7e66931b857c8578cc80ed91f02ddb72fb2779413611789f0768bcff3a76fd8e1d11b625390ae14f0a115584ccba7d4afc31144e76168ca0aa929b7
7
+ data.tar.gz: 6c827a3ea89d38f28e6ec5b0b2c3bbe490ec1ea88f400821d14ff21c548dfda0527ba741b743505fe06dfa2661821caf428689cbc474535a77b5f6baac38b33f
@@ -0,0 +1,46 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
21
+ experimental: [ false ]
22
+ include:
23
+ - ruby: '3.0'
24
+ os: 'ubuntu-latest'
25
+ experimental: true
26
+ - ruby: '3.0'
27
+ os: 'windows-latest'
28
+ experimental: true
29
+ - ruby: '3.0'
30
+ os: 'macos-latest'
31
+ experimental: true
32
+ steps:
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
36
+
37
+ # https://github.com/ruby-debug/debase/issues/89#issuecomment-686827382
38
+ - if: matrix.os == 'macos-latest' && matrix.ruby == '2.5'
39
+ run: echo BUNDLE_BUILD__DEBASE="--with-cflags=\"-Wno-error=implicit-function-declaration\"" >> $GITHUB_ENV
40
+
41
+ - uses: ruby/setup-ruby@v1
42
+ with:
43
+ ruby-version: ${{ matrix.ruby }}
44
+ bundler-cache: true
45
+
46
+ - run: bundle exec rake
data/README.adoc CHANGED
@@ -33,19 +33,30 @@ Or install it yourself as:
33
33
 
34
34
  == Usage
35
35
 
36
- === Search document
36
+ === Fetching documents
37
37
 
38
38
  [source,ruby]
39
39
  ----
40
40
  require 'relaton_ietf'
41
41
 
42
- item = RelatonIetf::IetfBibliography.search 'RFC 8341'
42
+ # Fetch RFC document
43
+ item = RelatonIetf::IetfBibliography.get 'IETF RFC 8341'
44
+ [relaton-ietf] ("IETF RFC 8341") fetching...
45
+ [relaton-ietf] ("IETF RFC 8341") found RFC 8341
43
46
  => #<RelatonIetf::IetfBibliographicItem:0x007fd1875e7f58
44
47
  ...
45
48
 
49
+ # Fetch Internet-Draft document
50
+ RelatonIetf::IetfBibliography.get 'IETF I-D.abarth-cake-02'
51
+ [relaton-ietf] ("IETF I-D.abarth-cake-02") fetching...
52
+ [relaton-ietf] ("IETF I-D.abarth-cake-02") found I-D.abarth-cake
53
+ => #<RelatonIetf::IetfBibliographicItem:0x00007fa7c81688f8
54
+ ...
55
+
46
56
  # Return nil if document doesn't exist.
47
- RelatonIetf::IetfBibliography.search '1111'
48
- RelatonBib::RequestError: 1111: not recognised for RFC
57
+ RelatonIetf::IetfBibliography.get 'IETF 1111'
58
+ [relaton-ietf] ("IETF 1111") fetching...
59
+ [relaton-ietf] ("IETF 1111") not found
49
60
  => nil
50
61
  ----
51
62
 
@@ -102,11 +113,7 @@ hash = YAML.load_file 'spec/examples/ietf_bib_item.yml'
102
113
  => {"id"=>"RFC 8341",
103
114
  ...
104
115
 
105
- bib_hash = RelatonIetf::HashConverter.hash_to_bib hash
106
- => {:id=>"RFC 8341",
107
- ...
108
-
109
- RelatonIetf::IetfBibliographicItem.new bib_hash
116
+ RelatonIetf::IetfBibliographicItem.from_hash hash
110
117
  => #<RelatonIetf::IetfBibliographicItem:0x007f9a929dde40
111
118
  ...
112
119
  ----
data/lib/relaton_ietf.rb CHANGED
@@ -6,11 +6,6 @@ require "relaton_ietf/ietf_bibliographic_item"
6
6
  require "relaton_ietf/xml_parser"
7
7
  require "relaton_ietf/hash_converter"
8
8
 
9
- # if defined? Relaton
10
- # require_relative "relaton_ietf/processor"
11
- # Relaton::Registry.instance.register(RelatonIetf::Processor)
12
- # end
13
-
14
9
  require "relaton/provider_ietf"
15
10
 
16
11
  module RelatonIetf
@@ -22,4 +17,4 @@ module RelatonIetf
22
17
  grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
23
18
  Digest::MD5.hexdigest grammars
24
19
  end
25
- end
20
+ end
@@ -1,23 +1,14 @@
1
1
  module RelatonIetf
2
2
  class HashConverter < RelatonBib::HashConverter
3
3
  class << self
4
- # @override RelatonBib::HashConverter.hash_to_bib
5
- # @param args [Hash]
6
- # @param nested [TrueClass, FalseClass]
7
- # @return [Hash]
8
- # def hash_to_bib(args, nested = false)
9
- # ret = super
10
- # return if ret.nil?
11
-
12
- # doctype_hash_to_bib(ret)
13
- # ret
14
- # end
15
-
16
- # private
17
-
18
- # def doctype_hash_to_bib(ret)
19
- # ret
20
- # end
4
+ #
5
+ # Ovverides superclass's method
6
+ #
7
+ # @param item [Hash]
8
+ # @retirn [RelatonIetf::IetfBibliographicItem]
9
+ def bib_item(item)
10
+ IetfBibliographicItem.new(**item)
11
+ end
21
12
  end
22
13
  end
23
14
  end
@@ -17,6 +17,13 @@ module RelatonIetf
17
17
  super
18
18
  end
19
19
 
20
+ # @param hash [Hash]
21
+ # @return [RelatonIetf::IetfBibliographicItem]
22
+ def self.from_hash(hash)
23
+ item_hash = ::RelatonIetf::HashConverter.hash_to_bib(hash)
24
+ new **item_hash
25
+ end
26
+
20
27
  # @param opts [Hash]
21
28
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
22
29
  # @option opts [Boolean] :bibdata
@@ -20,7 +20,11 @@ module RelatonIetf
20
20
  def get(code, _year = nil, _opts = {})
21
21
  warn "[relaton-ietf] (\"#{code}\") fetching..."
22
22
  result = search code
23
- warn "[relaton-ietf] (\"#{code}\") found #{result.docidentifier.first.id}"
23
+ if result
24
+ warn "[relaton-ietf] (\"#{code}\") found #{result.docidentifier.first.id}"
25
+ else
26
+ warn "[relaton-ietf] (\"#{code}\") not found"
27
+ end
24
28
  result
25
29
  end
26
30
  end
@@ -27,8 +27,7 @@ module RelatonIetf
27
27
  # @param hash [Hash]
28
28
  # @return [RelatonIetf::IetfBibliographicItem]
29
29
  def hash_to_bib(hash)
30
- item_hash = ::RelatonIetf::HashConverter.hash_to_bib(hash)
31
- ::RelatonIetf::IetfBibliographicItem.new item_hash
30
+ ::RelatonIetf::IetfBibliographicItem.from_hash hash
32
31
  end
33
32
 
34
33
  # Returns hash of XML grammar
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "net/http"
4
- require "nokogiri"
5
4
  require "relaton_bib"
6
5
  require "relaton_ietf/ietf_bibliographic_item"
7
6
 
@@ -10,44 +9,31 @@ module RelatonIetf
10
9
 
11
10
  # Scrapper module
12
11
  module Scrapper
13
- RFC_URI_PATTERN = "https://xml2rfc.tools.ietf.org/public/rfc/bibxml"
14
- # ID_URI_PATTERN = "https://xml2rfc.tools.ietf.org/public/rfc/bibxml-ids/reference.CODE"
12
+ GH_URL = "https://raw.githubusercontent.com/relaton/relaton-data-ietf/master/data/reference."
15
13
  BCP_URI_PATTERN = "https://www.rfc-editor.org/info/CODE"
16
14
 
17
15
  class << self
18
- # rubocop:disable Metrics/MethodLength
19
-
20
16
  # @param text [String]
21
17
  # @param is_relation [TrueClass, FalseClass]
22
18
  # @return [RelatonIetf::IetfBibliographicItem]
23
- def scrape_page(text, is_relation = false)
19
+ def scrape_page(text, is_relation: false)
24
20
  # Remove initial "IETF " string if specified
25
21
  ref = text.gsub(/^IETF /, "")
26
-
27
- case ref
28
- when /^RFC/ then rfc_item [""], ref, is_relation
29
- when /^I-D/ then rfc_item ["3"], ref, is_relation
30
- when /^W3C/ then rfc_item ["4", "2"], ref, is_relation
31
- when /^(ANSI|CCITT|FIPS|IANA|ISO|ITU|NIST|OASIS|PKCS)/
32
- rfc_item ["2"], ref, is_relation
33
- when /^(3GPP|SDO-3GPP)/ then rfc_item ["5"], ref, is_relation
34
- when /^IEEE/ then rfc_item ["6", "2"], ref, is_relation
35
- when /^BCP/ then bcp_item BCP_URI_PATTERN.dup, ref
36
- else
37
- raise RelatonBib::RequestError, "#{ref}: not recognised for RFC"
38
- end
22
+ /^(?:RFC|BCP|FYI|STD)\s(?<num>\d+)/ =~ ref
23
+ ref.sub! /(?<=^(?:RFC|BCP|FYI|STD)\s)(\d+)/, num.rjust(4, "0") if num
24
+ rfc_item ref, is_relation
39
25
  rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
40
26
  Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
41
27
  Net::ProtocolError, SocketError
42
- raise RelatonBib::RequestError, "No document found for #{ref} reference."
28
+ raise RelatonBib::RequestError, "No document found for #{ref} reference"
43
29
  end
44
30
 
45
- # @param reference [String]
31
+ # @param reference [Nokogiri::XML::Element, nil]
46
32
  # @param is_relation [TrueClass, FalseClass]
47
33
  # @param url [String, NilClass]
48
34
  # @param ver [String, NilClass] Internet Draft version
49
35
  # @return [RelatonIetf::IetfBibliographicItem]
50
- def fetch_rfc(reference, is_relation = false, url = nil, ver = nil)
36
+ def fetch_rfc(reference, is_relation: false, url: nil, ver: nil) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
51
37
  return unless reference
52
38
 
53
39
  ietf_item(
@@ -59,8 +45,10 @@ module RelatonIetf
59
45
  language: [language(reference)],
60
46
  link: link(reference, url, ver),
61
47
  title: titles(reference),
48
+ formattedref: formattedref(reference),
62
49
  abstract: abstracts(reference),
63
50
  contributor: contributors(reference),
51
+ relation: relations(reference),
64
52
  date: dates(reference),
65
53
  series: series(reference),
66
54
  place: ["Fremont, CA"],
@@ -68,14 +56,13 @@ module RelatonIetf
68
56
  doctype: doctype(reference[:anchor]),
69
57
  )
70
58
  end
71
- # rubocop:enable Metrics/MethodLength
72
59
 
73
60
  private
74
61
 
75
62
  # @param anchor [String]
76
63
  # @return [String]
77
64
  def doctype(anchor)
78
- anchor =~ /I-D/ ? "internet-draft" : "rfc"
65
+ anchor&.include?("I-D") ? "internet-draft" : "rfc"
79
66
  end
80
67
 
81
68
  # @param reference [Nokogiri::XML::Element]
@@ -86,7 +73,7 @@ module RelatonIetf
86
73
  l = []
87
74
  l << { type: "xml", content: url } if url
88
75
  l << { type: "src", content: reference[:target] } if reference[:target]
89
- if reference[:anchor] =~ /^I-D/
76
+ if /^I-D/.match? reference[:anchor]
90
77
  reference.xpath("format").each do |f|
91
78
  c = ver ? f[:target].sub(/(?<=-)\d{2}(?=\.)/, ver) : f[:target]
92
79
  l << { type: f[:type], content: c }
@@ -103,81 +90,70 @@ module RelatonIetf
103
90
  RelatonIetf::IetfBibliographicItem.new **attrs
104
91
  end
105
92
 
106
- # @param uri_nums [Array<String>]
107
93
  # @param ref [String]
94
+ # @param is_relation [Boolen, nil]
108
95
  # @return [RelatonIetf::IetfBibliographicItem]
109
- def rfc_item(uri_nums, ref, is_relation)
110
- uri = nil
111
- error = nil
112
- uri_nums.each do |n|
113
- /(?<=-)(?<ver>\d{2})$/ =~ ref
114
- if n == "3"
115
- ref.sub! /-\d{2}/, "" if ver
116
- ref.sub! /(?<=I-D\.)draft-/, ""
117
- end
118
-
119
- uri = "#{RFC_URI_PATTERN}#{n}/reference.#{ref.sub(/\s|\u00a0/, ".")}.xml"
120
- begin
121
- doc = Nokogiri::XML get_page(uri)
122
- resp = fetch_rfc doc.at("//reference"), is_relation, uri, ver
123
- return resp if resp
124
- rescue RelatonBib::RequestError => e
125
- error = e
126
- end
96
+ def rfc_item(ref, is_relation)
97
+ /(?<=-)(?<ver>\d{2})$/ =~ ref
98
+ if /^I-D/.match? ref
99
+ ref.sub! /-\d{2}/, "" if ver
100
+ ref.sub! /(?<=I-D\.)draft-/, ""
127
101
  end
128
- raise error
129
- end
130
102
 
131
- # @param uri_template [String]
132
- # @param reference [String]
133
- # @return [RelatonIetf::IetfBibliographicItem]
134
- def bcp_item(uri_template, reference)
135
- uri = uri_template.sub "CODE", reference.sub(" ", "").downcase
136
- doc = Nokogiri::HTML get_page(uri)
137
- ietf_item(
138
- id: reference,
139
- title: [content: ""],
140
- docid: [RelatonBib::DocumentIdentifier.new(type: "IETF", id: reference)],
141
- language: ["en"],
142
- link: [{ type: "src", content: uri }],
143
- relation: fetch_relations(doc),
144
- doctype: "rfc",
145
- )
103
+ uri = "#{GH_URL}#{ref.sub(/\s|\u00a0/, '.')}.xml"
104
+ doc = Nokogiri::XML get_page(uri)
105
+ r = doc.at("/referencegroup", "/reference")
106
+ fetch_rfc r, is_relation: is_relation, url: uri, ver: ver
146
107
  end
147
108
 
148
- def fetch_relations(doc)
149
- doc.xpath("//table/tr/td/a[contains(., 'RFC')]").map do |r|
150
- RelatonBib::DocumentRelation.new(
151
- type: "merges",
152
- bibitem: scrape_page(r.text, true),
153
- )
109
+ # @param reference [Nokogiri::XML::Element]
110
+ # @return [Hash]
111
+ def relations(reference)
112
+ reference.xpath("reference").map do |ref|
113
+ { type: "includes", bibitem: fetch_rfc(ref, is_relation: true) }
154
114
  end
155
115
  end
156
116
 
117
+ # @param uri [String]
118
+ # @return [String] HTTP response body
157
119
  def get_page(uri)
158
120
  res = Net::HTTP.get_response(URI(uri))
159
- if res.code != "200"
160
- raise RelatonBib::RequestError, "No document found at #{uri}"
161
- end
121
+ return unless res.code == "200"
122
+
123
+ # raise RelatonBib::RequestError, "No document found at #{uri}"
124
+ # end
162
125
 
163
126
  res.body
164
127
  end
165
128
 
166
- # def make_uri(uri_template, reference)
167
- # uri_template.gsub("CODE", reference)
168
- # end
169
-
129
+ # @param reference [Nokogiri::XML::Element]
170
130
  # @return [String]
171
131
  def language(reference)
172
132
  reference[:lang] || "en"
173
133
  end
174
134
 
135
+ # @param reference [Nokogiri::XML::Element]
175
136
  # @return [Array<Hash>]
176
137
  def titles(reference)
177
- title = reference.at("./front/title")
178
- [{ content: title.text, language: language(reference), script: "Latn" }]
138
+ reference.xpath("./front/title").map do |title|
139
+ { content: title.text, language: language(reference), script: "Latn" }
140
+ end
179
141
  end
180
142
 
143
+ # @param reference [Nokogiri::XML::Element]
144
+ # @return [RelatonBib::FormattedRef, nil]
145
+ def formattedref(reference)
146
+ return if reference.at "./fornt/title"
147
+
148
+ cont = (reference[:anchor] || reference[:docName] || reference[:number])
149
+ if cont
150
+ RelatonBib::FormattedRef.new(
151
+ content: cont, language: language(reference), script: "Latn",
152
+ )
153
+ end
154
+ end
155
+
156
+ # @param reference [Nokogiri::XML::Element]
181
157
  # @return [Array<RelatonBib::FormattedString>]
182
158
  def abstracts(ref)
183
159
  ref.xpath("./front/abstract").map do |a|
@@ -188,15 +164,17 @@ module RelatonIetf
188
164
  end
189
165
  end
190
166
 
167
+ # @param reference [Nokogiri::XML::Element]
191
168
  # @return [Array<Hash>]
192
169
  def contributors(reference)
193
170
  persons(reference) + organizations(reference)
194
171
  end
195
172
 
173
+ # @param reference [Nokogiri::XML::Element]
196
174
  # @return [Array<Hash{Symbol=>RelatonBib::Person,Symbol=>Array<String>}>]
197
175
  def persons(reference)
198
- reference.xpath("./front/author[@surname]|./front/author[@fullname]").
199
- map do |author|
176
+ reference.xpath("./front/author[@surname]|./front/author[@fullname]")
177
+ .map do |author|
200
178
  entity = RelatonBib::Person.new(
201
179
  name: full_name(author, reference),
202
180
  affiliation: [affiliation(author)],
@@ -206,7 +184,9 @@ module RelatonIetf
206
184
  end
207
185
  end
208
186
 
209
- # @return [Array<Hash{Symbol=>RelatonBib::Organization,Symbol=>Array<String>}>]
187
+ # @param reference [Nokogiri::XML::Element]
188
+ # @return [Array<Hash{Symbol=>RelatonBib::Organization,
189
+ # Symbol=>Array<String>}>]
210
190
  def organizations(reference)
211
191
  publisher = { entity: new_org, role: [type: "publisher"] }
212
192
  orgs = reference.xpath("./seriesinfo").reduce([publisher]) do |mem, si|
@@ -221,8 +201,8 @@ module RelatonIetf
221
201
  end
222
202
  end
223
203
 
224
- # @param author [Nokogiri::XML::Document]
225
- # @param ref [Nokogiri::XML::Document]
204
+ # @param author [Nokogiri::XML::Element]
205
+ # @param ref [Nokogiri::XML::Element]
226
206
  # @return [RelatonBib::FullName]
227
207
  def full_name(author, ref)
228
208
  lang = language ref
@@ -242,7 +222,7 @@ module RelatonIetf
242
222
  RelatonBib::LocalizedString.new(content, lang)
243
223
  end
244
224
 
245
- # @param postal [Nokogiri::XML::Document]
225
+ # @param postal [Nokogiri::XML::Element]
246
226
  # @return [Array<RelatonBib::Address, RelatonBib::Phone>]
247
227
  def contacts(addr)
248
228
  contacts = []
@@ -256,9 +236,9 @@ module RelatonIetf
256
236
  contacts
257
237
  end
258
238
 
259
- # @param postal [Nokogiri::XML::Document]
239
+ # @param postal [Nokogiri::XML::Element]
260
240
  # @rerurn [RelatonBib::Address]
261
- def address(postal)
241
+ def address(postal) # rubocop:disable Metrics/CyclomaticComplexity
262
242
  RelatonBib::Address.new(
263
243
  street: [(postal.at("./postalLine") || postal.at("./street"))&.text],
264
244
  city: postal.at("./city")&.text,
@@ -276,7 +256,7 @@ module RelatonIetf
276
256
  contacts << RelatonBib::Contact.new(type: type, value: value.text)
277
257
  end
278
258
 
279
- # @param author [Nokogiri::XML::Document]
259
+ # @param author [Nokogiri::XML::Element]
280
260
  # @return [RelatonBib::Affiliation]
281
261
  def affiliation(author)
282
262
  organization = author.at("./organization")
@@ -303,7 +283,7 @@ module RelatonIetf
303
283
 
304
284
  def month(mon)
305
285
  return 1 if !mon || mon.empty?
306
- return mon if /^\d+$/ =~ mon
286
+ return mon if /^\d+$/.match? mon
307
287
 
308
288
  Date::MONTHNAMES.index(mon)
309
289
  end
@@ -311,6 +291,7 @@ module RelatonIetf
311
291
  #
312
292
  # Extract date from reference.
313
293
  #
294
+ # @param reference [Nokogiri::XML::Element]
314
295
  # @return [Array<RelatonBib::BibliographicDate>] published data.
315
296
  #
316
297
  def dates(reference)
@@ -322,8 +303,6 @@ module RelatonIetf
322
303
  [RelatonBib::BibliographicDate.new(type: "published", on: date)]
323
304
  end
324
305
 
325
- # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
326
-
327
306
  #
328
307
  # Extract document identifiers from reference
329
308
  #
@@ -332,7 +311,7 @@ module RelatonIetf
332
311
  #
333
312
  # @return [Array<RelatonBib::DocumentIdentifier>]
334
313
  #
335
- def docids(reference, ver)
314
+ def docids(reference, ver) # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/AbcSize
336
315
  id = (reference[:anchor] || reference[:docName] || reference[:number])
337
316
  ret = []
338
317
  if id
@@ -351,11 +330,10 @@ module RelatonIetf
351
330
  RelatonBib::DocumentIdentifier.new(id: id, type: si[:name])
352
331
  end.compact
353
332
  end
354
- # enable Metrics/MethodLength, Metrics/AbcSize
355
333
 
356
334
  #
357
335
  # Extract series form reference
358
- # @param reference [Nokogiri::XML::Document]
336
+ # @param reference [Nokogiri::XML::Element]
359
337
  #
360
338
  # @return [Array<RelatonBib::Series>]
361
339
  #
@@ -375,7 +353,7 @@ module RelatonIetf
375
353
 
376
354
  #
377
355
  # extract status
378
- # @param reference [Nokogiri::XML::Document]
356
+ # @param reference [Nokogiri::XML::Element]
379
357
  #
380
358
  # @return [RelatonBib::DocumentStatus]
381
359
  #
@@ -383,9 +361,7 @@ module RelatonIetf
383
361
  st = reference.at("./seriesinfo[@status]")
384
362
  return unless st
385
363
 
386
- RelatonBib::DocumentStatus.new(
387
- stage: st[:status],
388
- )
364
+ RelatonBib::DocumentStatus.new(stage: st[:status])
389
365
  end
390
366
  end
391
367
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.7.0".freeze
2
+ VERSION = "1.7.5".freeze
3
3
  end
@@ -9,7 +9,7 @@ module RelatonIetf
9
9
  # @param item_hash [Hash]
10
10
  # @return [RelatonIetf::IetfBibliographicItem]
11
11
  def bib_item(item_hash)
12
- IetfBibliographicItem.new item_hash
12
+ IetfBibliographicItem.new **item_hash
13
13
  end
14
14
  end
15
15
  end
data/relaton_ietf.gemspec CHANGED
@@ -29,12 +29,12 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
31
31
 
32
- spec.add_development_dependency "debase"
32
+ # spec.add_development_dependency "debase"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
34
34
  spec.add_development_dependency "pry-byebug"
35
- spec.add_development_dependency "rake", "~> 10.0"
35
+ spec.add_development_dependency "rake", "~> 13.0"
36
36
  spec.add_development_dependency "rspec", "~> 3.0"
37
- spec.add_development_dependency "ruby-debug-ide"
37
+ # spec.add_development_dependency "ruby-debug-ide"
38
38
  spec.add_development_dependency "ruby-jing"
39
39
  spec.add_development_dependency "simplecov"
40
40
  spec.add_development_dependency "vcr"
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.5
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-27 00:00:00.000000000 Z
11
+ date: 2021-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: debase
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: equivalent-xml
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +44,14 @@ dependencies:
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '10.0'
47
+ version: '13.0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '10.0'
54
+ version: '13.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rspec
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +66,6 @@ dependencies:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
68
  version: '3.0'
83
- - !ruby/object:Gem::Dependency
84
- name: ruby-debug-ide
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
69
  - !ruby/object:Gem::Dependency
98
70
  name: ruby-jing
99
71
  requirement: !ruby/object:Gem::Requirement
@@ -172,9 +144,7 @@ executables: []
172
144
  extensions: []
173
145
  extra_rdoc_files: []
174
146
  files:
175
- - ".github/workflows/macos.yml"
176
- - ".github/workflows/ubuntu.yml"
177
- - ".github/workflows/windows.yml"
147
+ - ".github/workflows/rake.yml"
178
148
  - ".gitignore"
179
149
  - ".hound.yml"
180
150
  - ".rspec"
@@ -220,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
190
  - !ruby/object:Gem::Version
221
191
  version: '0'
222
192
  requirements: []
223
- rubygems_version: 3.0.6
193
+ rubygems_version: 3.2.3
224
194
  signing_key:
225
195
  specification_version: 4
226
196
  summary: 'RelatonIetf: retrieve IETF Standards for bibliographic use using the BibliographicItem
@@ -1,34 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: macos
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- branches: [ '**' ]
10
-
11
- jobs:
12
- test-macos:
13
- name: Test on Ruby ${{ matrix.ruby }} macOS
14
- runs-on: macos-latest
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- ruby: [ '2.6', '2.5', '2.4' ]
19
- steps:
20
- - uses: actions/checkout@master
21
- - name: Use Ruby
22
- uses: actions/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- architecture: 'x64'
26
- - name: Update gems
27
- run: |
28
- sudo gem install bundler --force
29
- ruby -v | grep 2.5 && bundle config set build.debase --with-cflags="-Wno-error=implicit-function-declaration"
30
- ruby -v | grep 2.5 && bundle config set build.ruby-debug-ide --with-cflags="-Wno-error=implicit-function-declaration"
31
- bundle install --jobs 4 --retry 3
32
- - name: Run specs
33
- run: |
34
- bundle exec rake
@@ -1,33 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: ubuntu
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- branches: [ '**' ]
10
-
11
- jobs:
12
- test-linux:
13
- name: Test on Ruby ${{ matrix.ruby }} Ubuntu
14
- runs-on: ubuntu-latest
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- ruby: [ '2.6', '2.5', '2.4' ]
19
- steps:
20
- - uses: actions/checkout@master
21
- - name: Use Ruby
22
- uses: actions/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- architecture: 'x64'
26
- - name: Update gems
27
- run: |
28
- gem install bundler
29
- bundle install --jobs 4 --retry 3
30
- - name: Run specs
31
- run: |
32
- unset JAVA_TOOL_OPTIONS
33
- bundle exec rake
@@ -1,35 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: windows
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- branches: [ '**' ]
10
-
11
- jobs:
12
- test-windows:
13
- name: Test on Ruby ${{ matrix.ruby }} Windows
14
- runs-on: windows-latest
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- ruby: [ '2.6', '2.5', '2.4' ]
19
- steps:
20
- - uses: actions/checkout@master
21
- - name: Use Ruby
22
- uses: actions/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- architecture: 'x64'
26
- - name: Update gems
27
- shell: pwsh
28
- run: |
29
- gem install bundler
30
- bundle config --local path vendor/bundle
31
- bundle update
32
- bundle install --jobs 4 --retry 3
33
- - name: Run specs
34
- run: |
35
- bundle exec rake