relaton-ietf 1.12.0 → 1.12.3

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: ee8439e302cb63b932839983b8beb248eeb760bf9ec797ad4b3ae6b66a6c5650
4
- data.tar.gz: 7f34f291e1af77dbdcedf4c3895b87568f7bab8ec037cc83ff53590bfe29b9e9
3
+ metadata.gz: d11fb2dfa0df019e33ac1b60faf21a8823473d965fdc67815bb788fd2898471c
4
+ data.tar.gz: 4c3446caa2b71be202528aae5ab9b0c1c79f0b85ca422930986347bd51312265
5
5
  SHA512:
6
- metadata.gz: 1c026795d5a04d9ca8ba1fbc6ebff3acc86010703ee596eeb052b0dc4cf1aff20046dafbe7acecf9160713641119b7a7604bc6ded4b5de23415d974992d2b8d7
7
- data.tar.gz: c51489f7fbb18b9834c16231995b1409996b20c3e1922f38b90de7a7ae7928b139042cb7049ad8567b58f845b722ed63a343d7238bbe4fd0a088bc5b39653478
6
+ metadata.gz: 78caccd01344b810325d661c921aec1b908cbe363b39aa48534b84f3f0726231c90cc70adf82585ed3fa42c466ab2b8b409d54e73c0d02bbea58064969449169
7
+ data.tar.gz: 1484d8c01e99a419faef0c50be081a62b4ea1ed630dda2a5f115c23ae3a56488813ab7cadd3beeefbdbf6eeff95e2b97bf67788e497319d883381757b9996077
@@ -33,7 +33,7 @@ module RelatonIetf
33
33
  def self.fetch(source, output: "data", format: "yaml")
34
34
  t1 = Time.now
35
35
  puts "Started at: #{t1}"
36
- FileUtils.mkdir_p output unless Dir.exist? output
36
+ FileUtils.mkdir_p output # unless Dir.exist? output
37
37
  new(source, output, format).fetch
38
38
  t2 = Time.now
39
39
  puts "Stopped at: #{t2}"
@@ -72,8 +72,8 @@ module RelatonIetf
72
72
  end
73
73
  bib = BibXMLParser.parse(File.read(path, encoding: "UTF-8"))
74
74
  if ver
75
- version = RelatonBib::BibliographicItem::Version.new nil, [ver]
76
- bib.instance_variable_set :@version, version
75
+ version = RelatonBib::BibliographicItem::Version.new nil, ver
76
+ bib.instance_variable_set :@version, [version]
77
77
  end
78
78
  save_doc bib
79
79
  end
@@ -14,7 +14,7 @@ module RelatonIetf
14
14
  def editorialgroup_hash_to_bib(ret)
15
15
  return unless ret[:editorialgroup]
16
16
 
17
- technical_committee = array(ret[:editorialgroup]).map do |wg|
17
+ technical_committee = RelatonBib.array(ret[:editorialgroup]).map do |wg|
18
18
  Committee.new RelatonBib::WorkGroup.new(**wg)
19
19
  end
20
20
  ret[:editorialgroup] = RelatonBib::EditorialGroup.new technical_committee
@@ -21,7 +21,8 @@ module RelatonIetf
21
21
  warn "[relaton-ietf] (\"#{code}\") fetching..."
22
22
  result = search code
23
23
  if result
24
- warn "[relaton-ietf] (\"#{code}\") found #{result.docidentifier.first.id}"
24
+ docid = result.docidentifier.detect(&:primary) || result.docidentifier.first
25
+ warn "[relaton-ietf] (\"#{code}\") found #{docid.id}"
25
26
  else
26
27
  warn "[relaton-ietf] (\"#{code}\") not found"
27
28
  end
@@ -5,18 +5,17 @@ module RelatonIetf
5
5
  module Scrapper
6
6
  extend Scrapper
7
7
 
8
- IDS = "https://raw.githubusercontent.com/ietf-ribose/relaton-data-ids/main/data/"
9
- RFC = "https://raw.githubusercontent.com/ietf-ribose/relaton-data-rfcs/main/data/"
10
- RSS = "https://raw.githubusercontent.com/ietf-ribose/relaton-data-rfcsubseries/main/data/"
8
+ IDS = "https://raw.githubusercontent.com/relaton/relaton-data-ids/main/data/"
9
+ RFC = "https://raw.githubusercontent.com/relaton/relaton-data-rfcs/main/data/"
10
+ RSS = "https://raw.githubusercontent.com/relaton/relaton-data-rfcsubseries/main/data/"
11
11
 
12
12
  # @param text [String]
13
- # @param is_relation [TrueClass, FalseClass]
14
13
  # @return [RelatonIetf::IetfBibliographicItem]
15
- def scrape_page(text, is_relation: false)
14
+ def scrape_page(text)
16
15
  # Remove initial "IETF " string if specified
17
16
  ref = text.gsub(/^IETF /, "")
18
17
  ref.sub!(/(?<=^(?:RFC|BCP|FYI|STD))\s(\d+)/) { $1.rjust 4, "0" }
19
- rfc_item ref, is_relation
18
+ rfc_item ref
20
19
  rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
21
20
  Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
22
21
  Net::ProtocolError, SocketError
@@ -26,9 +25,8 @@ module RelatonIetf
26
25
  private
27
26
 
28
27
  # @param ref [String]
29
- # @param is_relation [Boolen, nil]
30
28
  # @return [RelatonIetf::IetfBibliographicItem]
31
- def rfc_item(ref, is_relation)
29
+ def rfc_item(ref) # rubocop:disable Metrics/MethodLength
32
30
  ghurl = case ref
33
31
  when /^RFC/ then RFC
34
32
  when /^(?:BCP|FYI|STD)/ then RSS
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.12.0".freeze
2
+ VERSION = "1.12.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-25 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml