relaton-iana 1.18.0 → 1.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +5 -12
- data/grammars/basicdoc.rng +3 -0
- data/lib/relaton_iana/data_fetcher.rb +2 -2
- data/lib/relaton_iana/iana_bibliography.rb +3 -3
- data/lib/relaton_iana/parser.rb +2 -2
- data/lib/relaton_iana/util.rb +1 -4
- data/lib/relaton_iana/version.rb +1 -1
- data/lib/relaton_iana.rb +0 -1
- data/relaton_iana.gemspec +1 -1
- metadata +5 -6
- data/lib/relaton_iana/config.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5aa300478bf7a3dc6a7d313e2bbc128ef159c86f3146ea68bda643cde1a743a
|
4
|
+
data.tar.gz: 354bd3075650d6ed3910aa60e4e61d053c4214cdcf3d31897a321d92cbbe3b7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed74e427ff0fdffe0d7c116176c54865c062920be86b3f91521323071088dddd7cfcab8479e193886dbf216784927b8e29599ac577ea9b5c2b55757e64d9f56d
|
7
|
+
data.tar.gz: 4eb4910fe94bf48a0ae24c86455064e91bf6e1ed7f532b943d7442f33f0a72a8b4ca3ce23a18a4dc001464b7bba592b7f8669577ce607e0de8b07e404b5028e4
|
data/README.adoc
CHANGED
@@ -23,24 +23,13 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
== Usage
|
25
25
|
|
26
|
-
===
|
27
|
-
|
28
|
-
Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `RelatonIana.configure` block.
|
26
|
+
=== Search for a standard using keywords
|
29
27
|
|
30
28
|
[source,ruby]
|
31
29
|
----
|
32
30
|
require 'relaton_iana'
|
33
31
|
=> true
|
34
32
|
|
35
|
-
RelatonIana.configure do |config|
|
36
|
-
config.logger.level = Logger::DEBUG
|
37
|
-
end
|
38
|
-
----
|
39
|
-
|
40
|
-
=== Search for a standard using keywords
|
41
|
-
|
42
|
-
[source,ruby]
|
43
|
-
----
|
44
33
|
item = RelatonIana::IanaBibliography.get "IANA service-names-port-numbers"
|
45
34
|
[relaton-iana] (IANA service-names-port-numbers) Fetching from Relaton repository ...
|
46
35
|
[relaton-iana] (IANA service-names-port-numbers) Found: `IANA service-names-port-numbers`
|
@@ -124,6 +113,10 @@ This method uses GitHub search API to fetch the documents. The search API has a
|
|
124
113
|
|
125
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.
|
126
115
|
|
116
|
+
=== Logging
|
117
|
+
|
118
|
+
RelatonIana uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
|
119
|
+
|
127
120
|
== Development
|
128
121
|
|
129
122
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/grammars/basicdoc.rng
CHANGED
@@ -38,7 +38,7 @@ module RelatonIana
|
|
38
38
|
content = File.read file, encoding: "UTF-8"
|
39
39
|
parse(content) if content.include? "<registry"
|
40
40
|
rescue StandardError => e
|
41
|
-
|
41
|
+
Util.error "Error: #{e.message}. File: #{file}"
|
42
42
|
end
|
43
43
|
@index.save
|
44
44
|
end
|
@@ -66,7 +66,7 @@ module RelatonIana
|
|
66
66
|
end
|
67
67
|
file = file_name(bib)
|
68
68
|
if @files.include? file
|
69
|
-
warn "File #{file} already exists. Document: #{bib.docnumber}"
|
69
|
+
Util.warn "File #{file} already exists. Document: #{bib.docnumber}"
|
70
70
|
else
|
71
71
|
@files << file
|
72
72
|
end
|
@@ -34,14 +34,14 @@ module RelatonIana
|
|
34
34
|
# @param opts [Hash] options
|
35
35
|
# @return [RelatonIana::IanaBibliographicItem]
|
36
36
|
def get(ref, _year = nil, _opts = {})
|
37
|
-
Util.
|
37
|
+
Util.info "Fetching from Relaton repository ...", key: ref
|
38
38
|
result = search(ref)
|
39
39
|
unless result
|
40
|
-
Util.
|
40
|
+
Util.info "Not found.", key: ref
|
41
41
|
return
|
42
42
|
end
|
43
43
|
|
44
|
-
Util.
|
44
|
+
Util.info "Found: `#{result.docidentifier[0].id}`", key: ref
|
45
45
|
result
|
46
46
|
end
|
47
47
|
|
data/lib/relaton_iana/parser.rb
CHANGED
@@ -61,8 +61,8 @@ module RelatonIana
|
|
61
61
|
def parse_link
|
62
62
|
if @rootdoc then @rootdoc.link
|
63
63
|
else
|
64
|
-
uri = URI.join
|
65
|
-
[RelatonBib::TypedUri.new(type: "
|
64
|
+
uri = URI.join "https://www.iana.org/assignments/", @xml[:id]
|
65
|
+
[RelatonBib::TypedUri.new(type: "self", content: uri.to_s)]
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
data/lib/relaton_iana/util.rb
CHANGED
data/lib/relaton_iana/version.rb
CHANGED
data/lib/relaton_iana.rb
CHANGED
@@ -4,7 +4,6 @@ require "faraday"
|
|
4
4
|
require "relaton/index"
|
5
5
|
require "relaton_bib"
|
6
6
|
require_relative "relaton_iana/version"
|
7
|
-
require_relative "relaton_iana/config"
|
8
7
|
require_relative "relaton_iana/util"
|
9
8
|
require_relative "relaton_iana/iana_bibliographic_item"
|
10
9
|
require_relative "relaton_iana/xml_parser"
|
data/relaton_iana.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
33
|
spec.add_dependency "faraday", "~> 2.7.0"
|
34
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
34
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
35
35
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
36
36
|
|
37
37
|
# Uncomment to register a new dependency of your gem
|
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.
|
4
|
+
version: 1.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01
|
11
|
+
date: 2024-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.19.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: 1.
|
40
|
+
version: 1.19.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: relaton-index
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,7 +77,6 @@ files:
|
|
77
77
|
- grammars/relaton-iana-compile.rng
|
78
78
|
- grammars/relaton-iana.rng
|
79
79
|
- lib/relaton_iana.rb
|
80
|
-
- lib/relaton_iana/config.rb
|
81
80
|
- lib/relaton_iana/data_fetcher.rb
|
82
81
|
- lib/relaton_iana/hash_converter.rb
|
83
82
|
- lib/relaton_iana/iana_bibliographic_item.rb
|
@@ -108,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
107
|
- !ruby/object:Gem::Version
|
109
108
|
version: '0'
|
110
109
|
requirements: []
|
111
|
-
rubygems_version: 3.3.
|
110
|
+
rubygems_version: 3.3.27
|
112
111
|
signing_key:
|
113
112
|
specification_version: 4
|
114
113
|
summary: 'RelatonIana: Ruby XMLDOC impementation.'
|