relaton-iana 1.14.2 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +2 -1
- data/Gemfile +1 -0
- data/grammars/biblio.rng +1 -1
- data/lib/relaton_iana/data_fetcher.rb +3 -2
- data/lib/relaton_iana/iana_bibliography.rb +10 -3
- data/lib/relaton_iana/processor.rb +7 -0
- data/lib/relaton_iana/version.rb +1 -1
- data/lib/relaton_iana.rb +1 -0
- data/relaton_iana.gemspec +3 -3
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6512698897df0914041e13906cca68fc122b181d3f4ec5f89016bbb8335a08e
|
4
|
+
data.tar.gz: 6a86c62db84860027c1127c7db46aa7a63cc3e86a5c79d1614b450ee15c7cd6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 389b62934467fa0296e801c4078e22184db48e403cd0540a3d3ede2163aaea6d6e7c82a31749706d9d3a52f35fef3943196483941db76cd2e838fc4f79e01dd3
|
7
|
+
data.tar.gz: e7134314b1dfe176b13ee5d0646a3823e7f194b22511b56b00b116a430f556c3b483f33db67f6cb7fc86c85a539dd7f2d0526d87a3c47fa1511806c766ffa4cc
|
@@ -7,7 +7,8 @@ on:
|
|
7
7
|
inputs:
|
8
8
|
next_version:
|
9
9
|
description: |
|
10
|
-
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
10
|
+
Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
|
11
|
+
Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
|
11
12
|
required: true
|
12
13
|
default: 'skip'
|
13
14
|
repository_dispatch:
|
data/Gemfile
CHANGED
data/grammars/biblio.rng
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
module RelatonIana
|
2
2
|
class DataFetcher
|
3
|
-
SOURCE = "https://raw.githubusercontent.com/ietf-ribose/iana-registries/main/".freeze
|
4
|
-
|
5
3
|
#
|
6
4
|
# Data fetcher initializer
|
7
5
|
#
|
@@ -13,6 +11,7 @@ module RelatonIana
|
|
13
11
|
@format = format
|
14
12
|
@ext = format.sub(/^bib/, "")
|
15
13
|
@files = []
|
14
|
+
@index = Relaton::Index.find_or_create :IANA, file: "index-v1.yaml"
|
16
15
|
end
|
17
16
|
|
18
17
|
#
|
@@ -41,6 +40,7 @@ module RelatonIana
|
|
41
40
|
rescue StandardError => e
|
42
41
|
warn "Error: #{e.message}. File: #{file}"
|
43
42
|
end
|
43
|
+
@index.save
|
44
44
|
end
|
45
45
|
|
46
46
|
def parse(content)
|
@@ -70,6 +70,7 @@ module RelatonIana
|
|
70
70
|
else
|
71
71
|
@files << file
|
72
72
|
end
|
73
|
+
@index.add_or_update bib.docnumber, file
|
73
74
|
File.write file, c, encoding: "UTF-8"
|
74
75
|
end
|
75
76
|
|
@@ -3,13 +3,20 @@
|
|
3
3
|
module RelatonIana
|
4
4
|
# Methods for search IANA standards.
|
5
5
|
module IanaBibliography
|
6
|
-
SOURCE = "https://raw.githubusercontent.com/relaton/relaton-data-iana/main/
|
6
|
+
SOURCE = "https://raw.githubusercontent.com/relaton/relaton-data-iana/main/"
|
7
|
+
INDEX_FILE = "index-v1.yaml"
|
7
8
|
|
8
9
|
# @param text [String]
|
9
10
|
# @return [RelatonIana::IanaBibliographicItem]
|
10
11
|
def search(text) # rubocop:disable Metrics/MethodLength
|
11
|
-
file = text.sub(/^IANA\s/, "").gsub(/[\s,:\/]/, "_").downcase
|
12
|
-
url = "#{SOURCE}#{file}.yaml"
|
12
|
+
# file = text.sub(/^IANA\s/, "").gsub(/[\s,:\/]/, "_").downcase
|
13
|
+
# url = "#{SOURCE}#{file}.yaml"
|
14
|
+
index = Relaton::Index.find_or_create :IANA, url: "#{SOURCE}index-v1.zip", file: INDEX_FILE
|
15
|
+
id = text.sub(/^IANA\s/, "")
|
16
|
+
row = index.search(id).min_by { |i| i[:id] }
|
17
|
+
return unless row
|
18
|
+
|
19
|
+
url = "#{SOURCE}#{row[:file]}"
|
13
20
|
resp = Net::HTTP.get_response URI(url)
|
14
21
|
return unless resp.code == "200"
|
15
22
|
|
@@ -50,5 +50,12 @@ module RelatonIana
|
|
50
50
|
def grammar_hash
|
51
51
|
@grammar_hash ||= ::RelatonIana.grammar_hash
|
52
52
|
end
|
53
|
+
|
54
|
+
#
|
55
|
+
# Remove index file
|
56
|
+
#
|
57
|
+
def remove_index_file
|
58
|
+
Relaton::Index.find_or_create(:IANA, url: true, file: IanaBibliography::INDEX_FILE).remove_file
|
59
|
+
end
|
53
60
|
end
|
54
61
|
end
|
data/lib/relaton_iana/version.rb
CHANGED
data/lib/relaton_iana.rb
CHANGED
data/relaton_iana.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.metadata["homepage_uri"] = spec.homepage
|
20
20
|
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
21
21
|
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
22
|
+
# spec.metadata["rubygems_mfa_required"] = "true"
|
22
23
|
|
23
24
|
# Specify which files should be added to the gem when it is released.
|
24
25
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -29,10 +30,9 @@ Gem::Specification.new do |spec|
|
|
29
30
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
31
|
spec.require_paths = ["lib"]
|
31
32
|
|
32
|
-
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
33
|
-
|
34
33
|
spec.add_dependency "faraday", "~> 2.7.0"
|
35
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
34
|
+
spec.add_dependency "relaton-bib", "~> 1.16.0"
|
35
|
+
spec.add_dependency "relaton-index", "~> 0.2.0"
|
36
36
|
|
37
37
|
# Uncomment to register a new dependency of your gem
|
38
38
|
# spec.add_dependency "example-gem", "~> 1.0"
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
19
|
+
version: 2.7.0
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: relaton-bib
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.16.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.16.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: relaton-
|
42
|
+
name: relaton-index
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.2.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.2.0
|
55
55
|
description: 'RelatonIana: Ruby XMLDOC impementation.'
|
56
56
|
email:
|
57
57
|
- open.source@ribose.com
|