relaton-iana 1.14.1 → 1.14.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: b32501a7b2b388b0d50c63b33cfd73b070c0e505b123a99d5370be888958224e
4
- data.tar.gz: 4b82cbd93a58fe7450a53d09a2d991998c7e2496126c84e722070e5eb5658679
3
+ metadata.gz: e28db214fb7ee96d95437e096953b44088e3dcb0b0255a224773a2c3d0265ed2
4
+ data.tar.gz: 397b757c60191a373016f767ef76bd34000a77d4039ea85bd022376ca40fc3f1
5
5
  SHA512:
6
- metadata.gz: ac39b40b363f111b1fc2d6f44f7251e6ac8e7acbdd6e7c5fe19c1eb50a489630ac78450e953dfea1f2aebac4bb688a16fe8f3a2231ea164339d7cf5bcc3c6cf6
7
- data.tar.gz: 067114fa401cb20cf9f7abe59537723d30c597fd680d616fb22341b65596ad2cf31a526768f0ac8a1bc4955837b28ce4484d5c76f391fefdbfb6e5506270bfc9
6
+ metadata.gz: 82a9ba0764bae580b8938ef563e35b31da5a666e5accf9b99ff0f92ca9d1d2bb1c7f64515b545534efe1cb417cf68915507983be0fcbe34eb444380c3c5fe886
7
+ data.tar.gz: c28062035798f285063e3fff10b6a508998512f77e8ed7d63c4918980df97de8b7e0c5bb2a2a98c7a1142b6e047040ddff7984e6179f21fb6fbc70fb6628ad60
@@ -5,6 +5,7 @@ name: rake
5
5
  on:
6
6
  push:
7
7
  branches: [ master, main ]
8
+ tags: [ v* ]
8
9
  pull_request:
9
10
 
10
11
  jobs:
@@ -10,8 +10,9 @@ on:
10
10
  Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
11
11
  required: true
12
12
  default: 'skip'
13
- push:
14
- tags: [ v* ]
13
+ repository_dispatch:
14
+ types: [ do-release ]
15
+
15
16
 
16
17
  jobs:
17
18
  release:
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/.rubocop.yml CHANGED
@@ -7,6 +7,6 @@ require: rubocop-rails
7
7
  inherit_from:
8
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
9
  AllCops:
10
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 2.7
11
11
  Rails:
12
12
  Enabled: false
data/Gemfile CHANGED
@@ -10,3 +10,9 @@ gem "rake", "~> 13.0"
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
12
  gem "rubocop", "~> 1.7"
13
+ gem "rubocop-performance"
14
+ gem "rubocop-rails"
15
+ gem "ruby-jing"
16
+ gem "simplecov"
17
+ gem "vcr"
18
+ gem "webmock"
data/README.adoc CHANGED
@@ -111,7 +111,7 @@ Done in: 155 sec.
111
111
 
112
112
  This method uses GitHub search API to fetch the documents. The search API has a https://docs.github.com/en/rest/reference/search#rate-limit[rate limitaion] of 30 requests per minute for authenticated users and 10 requests per minute for unauthenticated users. Usually, the rate limit is not reached because the search API is used only for the file list fetching. But if you run the method multiple times in a short period, the rate limit may be reached. In this case, the method will wait until the rate limit is reset.
113
113
 
114
- You can use a personal access token to increase the rate limit. To do this, add your personal access token to the `GITHUB_TOKEN` environment variable.
114
+ You can use a personal access token (PTA) to increase the rate limit. To do this, add your PTA to the `GITHUB_TOKEN` environment variable.
115
115
 
116
116
  == Development
117
117
 
@@ -522,7 +522,6 @@
522
522
  <value>tip</value>
523
523
  <value>important</value>
524
524
  <value>caution</value>
525
- <value>statement</value>
526
525
  </choice>
527
526
  </define>
528
527
  <define name="figure">
data/grammars/biblio.rng CHANGED
@@ -216,6 +216,9 @@
216
216
  <optional>
217
217
  <ref name="fullname"/>
218
218
  </optional>
219
+ <zeroOrMore>
220
+ <ref name="credential"/>
221
+ </zeroOrMore>
219
222
  <zeroOrMore>
220
223
  <ref name="affiliation"/>
221
224
  </zeroOrMore>
@@ -232,6 +235,11 @@
232
235
  <ref name="FullNameType"/>
233
236
  </element>
234
237
  </define>
238
+ <define name="credential">
239
+ <element name="credential">
240
+ <text/>
241
+ </element>
242
+ </define>
235
243
  <define name="FullNameType">
236
244
  <choice>
237
245
  <group>
@@ -305,7 +313,9 @@
305
313
  <zeroOrMore>
306
314
  <ref name="affiliationdescription"/>
307
315
  </zeroOrMore>
308
- <ref name="organization"/>
316
+ <optional>
317
+ <ref name="organization"/>
318
+ </optional>
309
319
  </element>
310
320
  </define>
311
321
  <define name="affiliationname">
@@ -1316,7 +1326,7 @@
1316
1326
  <value>commentaryOf</value>
1317
1327
  <value>hasCommentary</value>
1318
1328
  <value>related</value>
1319
- <value>complements</value>
1329
+ <value>hasComplement</value>
1320
1330
  <value>complementOf</value>
1321
1331
  <value>obsoletes</value>
1322
1332
  <value>obsoletedBy</value>
@@ -34,60 +34,21 @@ module RelatonIana
34
34
  #
35
35
  # Parse documents
36
36
  #
37
- # @param [Integer] page page number
38
- #
39
- def fetch(page = 1) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
40
- params = {
41
- q: "repo:ietf-tools/iana-registries extension:xml",
42
- page: page, per_page: 100
43
- }
44
- if ENV["GITHUB_TOKEN"]
45
- headers = { "Authorization" => "token #{ENV['GITHUB_TOKEN']}" }
46
- end
47
- attempt = 0
48
- json = {}
49
- resp = nil
50
- until attempt > 3 || json["items"]
51
- if attempt.positive?
52
- t = resp.headers["x-ratelimit-reset"].to_i - Time.now.to_i
53
- if t.positive?
54
- t += 30
55
- warn "Rate limit is reached. Retrying in #{t} sec."
56
- sleep t
57
- end
58
- end
59
- attempt += 1
60
- resp = Faraday.get "https://api.github.com/search/code", params, headers
61
- json = JSON.parse resp.body
62
- end
63
- raise StandardError, json["message"] if json["message"]
64
-
65
- json["items"].each do |item|
66
- fetch_doc URI.join(SOURCE, item["path"]).to_s
37
+ def fetch
38
+ Dir["iana-registries/**/*.xml"].each do |file|
39
+ content = File.read file, encoding: "UTF-8"
40
+ parse(content) if content.include? "<registry"
41
+ rescue StandardError => e
42
+ warn "Error: #{e.message}. File: #{file}"
67
43
  end
68
- fetch(page + 1) if (json["total_count"] - (page * 100)).positive?
69
44
  end
70
45
 
71
- #
72
- # Fetch document
73
- #
74
- # @param [String] url url of document
75
- #
76
- def fetch_doc(url) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
77
- resp = Net::HTTP.get_response URI(url)
78
- if resp.code == "200"
79
- return unless resp.body.include? "<registry"
80
-
81
- xml = Nokogiri::XML(resp.body)
82
- registry = xml.at("/xmlns:registry")
83
- doc = Parser.parse registry
84
- save_doc doc
85
- registry.xpath("./xmlns:registry").each do |r|
86
- save_doc Parser.parse(r, doc)
87
- end
88
- end
89
- rescue StandardError => e
90
- warn "Error: #{e.message}. URL: #{url}"
46
+ def parse(content)
47
+ xml = Nokogiri::XML(content)
48
+ registry = xml.at("/xmlns:registry")
49
+ doc = Parser.parse registry
50
+ save_doc doc
51
+ registry.xpath("./xmlns:registry").each { |r| save_doc Parser.parse(r, doc) }
91
52
  end
92
53
 
93
54
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIana
4
- VERSION = "1.14.1"
4
+ VERSION = "1.14.2"
5
5
  end
data/lib/relaton_iana.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "faraday"
4
- require "jing"
5
4
  require "relaton_bib"
6
5
  require_relative "relaton_iana/version"
7
6
  require_relative "relaton_iana/iana_bibliographic_item"
data/relaton_iana.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "RelatonIana: Ruby XMLDOC impementation."
13
13
  spec.homepage = "https://github.com/relaton/relaton-iana"
14
14
  spec.license = "BSD-2-Clause"
15
- spec.required_ruby_version = ">= 2.5.0"
15
+ spec.required_ruby_version = ">= 2.7.0"
16
16
 
17
17
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'https://mygemserver.com'"
18
18
 
@@ -30,17 +30,9 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ["lib"]
31
31
 
32
32
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
33
- spec.add_development_dependency "rubocop"
34
- spec.add_development_dependency "rubocop-performance"
35
- spec.add_development_dependency "rubocop-rails"
36
- spec.add_development_dependency "ruby-jing"
37
- spec.add_development_dependency "simplecov"
38
- spec.add_development_dependency "vcr"
39
- spec.add_development_dependency "webmock"
40
-
41
- spec.add_dependency "faraday", "~> 1.0"
33
+
34
+ spec.add_dependency "faraday", "~> 2.7.0"
42
35
  spec.add_dependency "relaton-bib", "~> 1.14.0"
43
- spec.add_dependency "ruby-jing"
44
36
 
45
37
  # Uncomment to register a new dependency of your gem
46
38
  # spec.add_dependency "example-gem", "~> 1.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1
4
+ version: 1.14.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: 2022-12-05 00:00:00.000000000 Z
11
+ date: 2023-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -24,118 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.6'
27
- - !ruby/object:Gem::Dependency
28
- name: rubocop
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rubocop-performance
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop-rails
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: ruby-jing
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: simplecov
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
- - !ruby/object:Gem::Dependency
98
- name: vcr
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: webmock
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
27
  - !ruby/object:Gem::Dependency
126
28
  name: faraday
127
29
  requirement: !ruby/object:Gem::Requirement
128
30
  requirements:
129
31
  - - "~>"
130
32
  - !ruby/object:Gem::Version
131
- version: '1.0'
33
+ version: 2.7.0
132
34
  type: :runtime
133
35
  prerelease: false
134
36
  version_requirements: !ruby/object:Gem::Requirement
135
37
  requirements:
136
38
  - - "~>"
137
39
  - !ruby/object:Gem::Version
138
- version: '1.0'
40
+ version: 2.7.0
139
41
  - !ruby/object:Gem::Dependency
140
42
  name: relaton-bib
141
43
  requirement: !ruby/object:Gem::Requirement
@@ -150,20 +52,6 @@ dependencies:
150
52
  - - "~>"
151
53
  - !ruby/object:Gem::Version
152
54
  version: 1.14.0
153
- - !ruby/object:Gem::Dependency
154
- name: ruby-jing
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :runtime
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
55
  description: 'RelatonIana: Ruby XMLDOC impementation.'
168
56
  email:
169
57
  - open.source@ribose.com
@@ -211,14 +99,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
211
99
  requirements:
212
100
  - - ">="
213
101
  - !ruby/object:Gem::Version
214
- version: 2.5.0
102
+ version: 2.7.0
215
103
  required_rubygems_version: !ruby/object:Gem::Requirement
216
104
  requirements:
217
105
  - - ">="
218
106
  - !ruby/object:Gem::Version
219
107
  version: '0'
220
108
  requirements: []
221
- rubygems_version: 3.1.6
109
+ rubygems_version: 3.3.26
222
110
  signing_key:
223
111
  specification_version: 4
224
112
  summary: 'RelatonIana: Ruby XMLDOC impementation.'