relaton-w3c 1.16.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.adoc +14 -3
- data/lib/relaton_w3c/config.rb +10 -0
- data/lib/relaton_w3c/data_parser.rb +1 -1
- data/lib/relaton_w3c/util.rb +9 -0
- data/lib/relaton_w3c/version.rb +1 -1
- data/lib/relaton_w3c/w3c_bibliographic_item.rb +1 -1
- data/lib/relaton_w3c/w3c_bibliography.rb +3 -3
- data/lib/relaton_w3c.rb +6 -4
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0440b77d73c24a978935bfba1bd94b9ddc58c8ebcf90cc229c4a5339a901c18c
|
4
|
+
data.tar.gz: a4b299f58a4c4c4b79946ef56e075cbff224fb8f6a639e11958a4dba996eeb5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81e2bd181d0a55948a36d831d39ebb13edfc7a0d28bcff8e035f5e6544305b67bd6a28db4d647c45417ff4504aa8dde2459bd7b848b274c53c286fcc08edc360
|
7
|
+
data.tar.gz: ff49763539341324fc1d0e612d90404b52b25d11e9b2141cc7801e050abfb81e03c8c94de29c4278af452415eaf92293467b7d9817a87fbb2122fd0177a5b038
|
data/README.adoc
CHANGED
@@ -23,16 +23,27 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
== Usage
|
25
25
|
|
26
|
-
===
|
26
|
+
=== Configuration
|
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 `RelatonW3c.configure` block.
|
27
29
|
|
28
30
|
[source,ruby]
|
29
31
|
----
|
30
32
|
require 'relaton_w3c'
|
31
33
|
=> true
|
32
34
|
|
35
|
+
RelatonW3c.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
|
+
----
|
33
44
|
item = RelatonW3c::W3cBibliography.get "W3C REC-json-ld11-20200716"
|
34
|
-
[relaton-w3c] (
|
35
|
-
[relaton-w3c] (
|
45
|
+
[relaton-w3c] (W3C REC-json-ld11-20200716) Fetching from Relaton repository ...
|
46
|
+
[relaton-w3c] (W3C REC-json-ld11-20200716) Found: `REC-json-ld11-20200716`
|
36
47
|
=> #<RelatonW3c::W3cBibliographicItem:0x00007fc4ea03c6c0
|
37
48
|
...
|
38
49
|
----
|
@@ -434,7 +434,7 @@ module RelatonW3c
|
|
434
434
|
rwg = RelatonBib::WorkGroup.new name: wg["name"]
|
435
435
|
obj << RelatonBib::TechnicalCommittee.new(rwg)
|
436
436
|
else
|
437
|
-
warn "Working group name not found for
|
437
|
+
Util.warn "WARNING: Working group name not found for: `#{edg.home_page}`"
|
438
438
|
end
|
439
439
|
end
|
440
440
|
RelatonBib::EditorialGroup.new tc
|
data/lib/relaton_w3c/version.rb
CHANGED
@@ -8,7 +8,7 @@ module RelatonW3c
|
|
8
8
|
# @param doctype [String]
|
9
9
|
def initialize(**args)
|
10
10
|
if args[:doctype] && !TYPES.include?(args[:doctype])
|
11
|
-
warn "
|
11
|
+
Util.warn "Invalid document type: `#{args[:doctype]}`"
|
12
12
|
end
|
13
13
|
super
|
14
14
|
end
|
@@ -39,15 +39,15 @@ module RelatonW3c
|
|
39
39
|
# @param opts [Hash] options
|
40
40
|
# @return [RelatonW3c::W3cBibliographicItem]
|
41
41
|
def get(ref, _year = nil, _opts = {})
|
42
|
-
warn "
|
42
|
+
Util.warn "(#{ref}) Fetching from Relaton repository ..."
|
43
43
|
result = search(ref)
|
44
44
|
unless result
|
45
|
-
warn "
|
45
|
+
Util.warn "(#{ref}) Not found."
|
46
46
|
return
|
47
47
|
end
|
48
48
|
|
49
49
|
found = result.docnumber
|
50
|
-
warn "
|
50
|
+
Util.warn "(#{ref}) Found: `#{found}`"
|
51
51
|
result
|
52
52
|
end
|
53
53
|
end
|
data/lib/relaton_w3c.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require "relaton_bib"
|
2
2
|
require "relaton/index"
|
3
3
|
require "relaton_w3c/version"
|
4
|
+
require "relaton_w3c/config"
|
5
|
+
require "relaton_w3c/util"
|
4
6
|
require "relaton_w3c/w3c_bibliography"
|
5
7
|
require "relaton_w3c/w3c_bibliographic_item"
|
6
8
|
require "relaton_w3c/xml_parser"
|
@@ -16,9 +18,9 @@ module RelatonW3c
|
|
16
18
|
# Returns hash of XML reammar
|
17
19
|
# @return [String]
|
18
20
|
def self.grammar_hash
|
19
|
-
gem_path = File.expand_path "..", __dir__
|
20
|
-
grammars_path = File.join gem_path, "grammars", "*"
|
21
|
-
grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
22
|
-
Digest::MD5.hexdigest grammars
|
21
|
+
# gem_path = File.expand_path "..", __dir__
|
22
|
+
# grammars_path = File.join gem_path, "grammars", "*"
|
23
|
+
# grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
24
|
+
Digest::MD5.hexdigest RelatonW3c::VERSION + RelatonBib::VERSION # grammars
|
23
25
|
end
|
24
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-w3c
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.16.
|
4
|
+
version: 1.16.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: 2023-
|
11
|
+
date: 2023-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: linkeddata
|
@@ -164,12 +164,14 @@ files:
|
|
164
164
|
- grammars/relaton-w3c.rng
|
165
165
|
- lib/relaton_w3c.rb
|
166
166
|
- lib/relaton_w3c/bibxml_parser.rb
|
167
|
+
- lib/relaton_w3c/config.rb
|
167
168
|
- lib/relaton_w3c/data_fetcher.rb
|
168
169
|
- lib/relaton_w3c/data_index.rb
|
169
170
|
- lib/relaton_w3c/data_parser.rb
|
170
171
|
- lib/relaton_w3c/hash_converter.rb
|
171
172
|
- lib/relaton_w3c/processor.rb
|
172
173
|
- lib/relaton_w3c/pubid.rb
|
174
|
+
- lib/relaton_w3c/util.rb
|
173
175
|
- lib/relaton_w3c/version.rb
|
174
176
|
- lib/relaton_w3c/w3c_bibliographic_item.rb
|
175
177
|
- lib/relaton_w3c/w3c_bibliography.rb
|