relaton-ietf 1.9.7 → 1.9.11

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: 38c6632f8b954cf88746dac6e0560294cf8c546063e774f1b717dec2a4f0a9d8
4
- data.tar.gz: dcf250a7d8c88a06ba9be27ba3d69bcbe3f5e50b3d41ee1616834011d6b2995c
3
+ metadata.gz: 158773d0da39dc2b3e8829cc5e8873820c3f58ff9589887af1d52e0d946a384d
4
+ data.tar.gz: eeac44410467846a7f79eee9291c088b261792b2c44c8ac759f4f00a85beac8f
5
5
  SHA512:
6
- metadata.gz: 55bb6cdf657772970caa7447097da8e38686aa7c0cc16a40e8f931963ecd26202ed1aed62a8c77269d8d0f49cf4e890002b8d4a2831235f566023dc3b13a06eb
7
- data.tar.gz: cfb86b6c8f4a52a19ff52ecb93d0ca9211159f8499a782f2aa3904ae089d0f1f6ae7c9f96e00f532c7502cc4a718d0ebb9b6784e2d9f3d9ebc2b180489fc0b0a
6
+ metadata.gz: f3ee4c3add2574937638ed5975a46f2fdc4d0dbd7013cd7fdf83741016715dafec8921210dff398310c402926b6ad6605458fd7c9a02d3c6ccbce4ed3dc56c84
7
+ data.tar.gz: 1ed33f92838279279361975a75b8d3f6bdd54a91959b1142c901686a5bcf6f5cdf7747a74effffe41f689fd05e2a0970463dbe71e108eeaeef0d8b1e38391e0a
data/README.adoc CHANGED
@@ -138,7 +138,7 @@ RelatonIetf::IetfBibliographicItem.from_hash hash
138
138
  There is a IETF datasets what can be converted into RelatonXML/BibXML/BibYAML formats:
139
139
 
140
140
  - `ietf-rfcsubseries` - https://www.rfc-editor.org/rfc-index.xml (`<bcp-entry>`, `<fyi-entry>`, `<std-entry>`)
141
- - `ietf-internet-drafts` - https://www.ietf.org/lib/dt/sprint/bibxml-ids.tgz
141
+ - `ietf-internet-drafts` - converts files from local directory `./bibxml-ids`. Use `rsync -avcizxL rsync.ietf.org::bibxml-ids ./bibxml-ids` command to fetch the files.
142
142
  - `ietf-rfc-entries` - https://www.rfc-editor.org/rfc-index.xml (`<rfc-entry>`)
143
143
 
144
144
  The method `RelatonIetf::DataFetcher.fetch(source, output: "data", format: "yaml")` converts all the documents from the dataset and save them to the `./data` folder in YAML format.
@@ -1,6 +1,6 @@
1
- require "rubygems"
2
- require "rubygems/package"
3
- require "zlib"
1
+ # require "rubygems"
2
+ # require "rubygems/package"
3
+ # require "zlib"
4
4
  require "relaton_ietf/rfc_index_entry"
5
5
  require "relaton_ietf/rfc_entry"
6
6
 
@@ -64,16 +64,19 @@ module RelatonIetf
64
64
  # Fetches ietf-internet-drafts documents
65
65
  #
66
66
  def fetch_ieft_internet_drafts # rubocop:disable Metrics/MethodLength
67
- gz = OpenURI.open_uri("https://www.ietf.org/lib/dt/sprint/bibxml-ids.tgz")
68
- z = Zlib::GzipReader.new(gz)
69
- io = StringIO.new(z.read)
70
- z.close
71
- Gem::Package::TarReader.new io do |tar|
72
- tar.each do |tarfile|
73
- next if tarfile.directory?
67
+ # gz = OpenURI.open_uri("https://www.ietf.org/lib/dt/sprint/bibxml-ids.tgz")
68
+ # z = Zlib::GzipReader.new(gz)
69
+ # io = StringIO.new(z.read)
70
+ # z.close
71
+ # Gem::Package::TarReader.new io do |tar|
72
+ # tar.each do |tarfile|
73
+ # next if tarfile.directory?
74
74
 
75
- save_doc RelatonBib::BibXMLParser.parse(tarfile.read)
76
- end
75
+ # save_doc BibXMLParser.parse(tarfile.read)
76
+ # end
77
+ # end
78
+ Dir["bibxml-ids/*.xml"].each do |file|
79
+ save_doc BibXMLParser.parse(File.read(file, encoding: "UTF-8"))
77
80
  end
78
81
  end
79
82
 
@@ -51,7 +51,10 @@ module RelatonIetf
51
51
  # @return [Array<RelatonBib::DocumentIdettifier>] document identifiers
52
52
  #
53
53
  def parse_docid
54
- ids = [RelatonBib::DocumentIdentifier.new(id: pub_id, type: "IETF")]
54
+ ids = [
55
+ RelatonBib::DocumentIdentifier.new(id: pub_id, type: "IETF"),
56
+ RelatonBib::DocumentIdentifier.new(id: code, type: "IETF", scope: "anchor"),
57
+ ]
55
58
  doi = @doc.at("./xmlns:doi").text
56
59
  ids << RelatonBib::DocumentIdentifier.new(id: doi, type: "DOI")
57
60
  ids
@@ -73,7 +76,8 @@ module RelatonIetf
73
76
  # @return [String] PubID
74
77
  #
75
78
  def pub_id
76
- "IETF #{code.sub(/^(RFC)(\d+)/, '\1 \2')}"
79
+ /^RFC(?<num>\d+)$/ =~ code
80
+ "RFC #{num.sub(/^0+/, '')}"
77
81
  end
78
82
 
79
83
  #
@@ -19,7 +19,7 @@ module RelatonIetf
19
19
  #
20
20
  # @param [Nokogiri::XML::Element] doc document
21
21
  #
22
- # @return [RelatonIetf:RfcIndexEntry, nil]
22
+ # @return [RelatonIetf:IetfBibliographicItem, nil]
23
23
  #
24
24
  def self.parse(doc)
25
25
  doc_id = doc.at("./xmlns:doc-id")
@@ -55,12 +55,12 @@ module RelatonIetf
55
55
  def parse_docid
56
56
  [
57
57
  RelatonBib::DocumentIdentifier.new(type: "IETF", id: pub_id),
58
- RelatonBib::DocumentIdentifier.new(type: "rfc-anchor", id: anchor),
58
+ RelatonBib::DocumentIdentifier.new(type: "IETF", scope: "anchor", id: @doc_id),
59
59
  ]
60
60
  end
61
61
 
62
62
  def pub_id
63
- "IETF #{@name.upcase} #{@shortnum}"
63
+ "#{@name.upcase} #{@shortnum}"
64
64
  end
65
65
 
66
66
  def anchor
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.9.7".freeze
2
+ VERSION = "1.9.11".freeze
3
3
  end
data/relaton_ietf.gemspec CHANGED
@@ -38,6 +38,6 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency "vcr"
39
39
  spec.add_development_dependency "webmock"
40
40
 
41
- spec.add_dependency "relaton-bib", ">= 1.9.12"
42
- spec.add_dependency "zlib", "~> 1.1.0"
41
+ spec.add_dependency "relaton-bib", ">= 1.9.19"
42
+ # spec.add_dependency "zlib", "~> 1.1.0"
43
43
  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.9.7
4
+ version: 1.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-28 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -128,28 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 1.9.12
131
+ version: 1.9.19
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 1.9.12
139
- - !ruby/object:Gem::Dependency
140
- name: zlib
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 1.1.0
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 1.1.0
138
+ version: 1.9.19
153
139
  description: "RelatonIetf: retrieve IETF Standards for bibliographic use \nusing the
154
140
  BibliographicItem model.\n\nFormerly known as rfcbib.\n"
155
141
  email: