relaton-w3c 1.18.1 → 1.19.0
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/lib/relaton_w3c/data_fetcher.rb +2 -3
- data/lib/relaton_w3c/data_parser.rb +1 -1
- data/lib/relaton_w3c/document_type.rb +1 -1
- data/lib/relaton_w3c/hash_converter.rb +4 -0
- data/lib/relaton_w3c/util.rb +1 -4
- data/lib/relaton_w3c/version.rb +1 -1
- data/lib/relaton_w3c/w3c_bibliography.rb +3 -3
- data/lib/relaton_w3c/xml_parser.rb +4 -0
- data/lib/relaton_w3c.rb +0 -1
- data/relaton_w3c.gemspec +1 -1
- metadata +4 -5
- data/lib/relaton_w3c/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: dde70fdc615a88c4343add641e193635a5377af68180d96122b02af747aa50e5
|
4
|
+
data.tar.gz: 363d74d0a170b307006310bbbe2f6e645da40aabf12dbc2a94ebac4887f2452f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec1491eaa3108fd8726dfa0af50f54b98d7c28286c936d827088eed8ee7badbe6be430dd4588ad6324936f6cce8824379750a71ac4da9aa8d88788a47fceec4
|
7
|
+
data.tar.gz: e9d4074458f1a01e12ab84619861dda851ce668573d3b3e843a2c7ba8effed42e6c94545b49157626ba922ebfc31b57ff9d5877461626d2578a9ebdf128d314c
|
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 `RelatonW3c.configure` block.
|
26
|
+
=== Search for a standard using keywords
|
29
27
|
|
30
28
|
[source,ruby]
|
31
29
|
----
|
32
30
|
require 'relaton_w3c'
|
33
31
|
=> true
|
34
32
|
|
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
|
-
----
|
44
33
|
item = RelatonW3c::W3cBibliography.get "W3C REC-json-ld11-20200716"
|
45
34
|
[relaton-w3c] (W3C REC-json-ld11-20200716) Fetching from Relaton repository ...
|
46
35
|
[relaton-w3c] (W3C REC-json-ld11-20200716) Found: `REC-json-ld11-20200716`
|
@@ -139,6 +128,10 @@ Done in: 155 sec.
|
|
139
128
|
=> nil
|
140
129
|
----
|
141
130
|
|
131
|
+
=== Logging
|
132
|
+
|
133
|
+
RelatonW3c 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.
|
134
|
+
|
142
135
|
== Development
|
143
136
|
|
144
137
|
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.
|
@@ -55,8 +55,7 @@ module RelatonW3c
|
|
55
55
|
save_doc bib
|
56
56
|
rescue StandardError => e
|
57
57
|
link = sl.respond_to?(:link) ? sl.link : sl.version_of
|
58
|
-
|
59
|
-
warn e.backtrace.join("\n")
|
58
|
+
Util.error "Error: document #{link} #{e.message}\n#{e.backtrace.join("\n")}"
|
60
59
|
end
|
61
60
|
end
|
62
61
|
end
|
@@ -218,7 +217,7 @@ module RelatonW3c
|
|
218
217
|
# id = bib.docidentifier.detect(&:primary)&.id || bib.formattedref.content
|
219
218
|
file = file_name(bib.docnumber)
|
220
219
|
if @files.include?(file)
|
221
|
-
warn "File #{file} already exists. Document: #{bib.docnumber}" if warn_duplicate
|
220
|
+
Util.warn "File #{file} already exists. Document: #{bib.docnumber}" if warn_duplicate
|
222
221
|
else
|
223
222
|
pubid = PubId.parse bib.docnumber
|
224
223
|
@index.add pubid, file
|
@@ -443,7 +443,7 @@ module RelatonW3c
|
|
443
443
|
rwg = RelatonBib::WorkGroup.new name: wg["name"]
|
444
444
|
obj << RelatonBib::TechnicalCommittee.new(rwg)
|
445
445
|
else
|
446
|
-
Util.warn "
|
446
|
+
Util.warn "Working group name not found for: `#{edg.home_page}`"
|
447
447
|
end
|
448
448
|
end
|
449
449
|
RelatonBib::EditorialGroup.new tc
|
data/lib/relaton_w3c/util.rb
CHANGED
data/lib/relaton_w3c/version.rb
CHANGED
@@ -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
|
-
Util.
|
42
|
+
Util.info "Fetching from Relaton repository ...", key: ref
|
43
43
|
result = search(ref)
|
44
44
|
unless result
|
45
|
-
Util.
|
45
|
+
Util.info "Not found.", key: ref
|
46
46
|
return
|
47
47
|
end
|
48
48
|
|
49
49
|
found = result.docidentifier.first.id
|
50
|
-
Util.
|
50
|
+
Util.info "Found: `#{found}`", key: ref
|
51
51
|
result
|
52
52
|
end
|
53
53
|
end
|
data/lib/relaton_w3c.rb
CHANGED
data/relaton_w3c.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_dependency "mechanize", "~> 2.10"
|
36
36
|
spec.add_dependency "rdf", "~> 3.2"
|
37
37
|
spec.add_dependency "rdf-normalize", "~> 0.6"
|
38
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
38
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
39
39
|
spec.add_dependency "relaton-index", "~> 0.2.8"
|
40
40
|
spec.add_dependency "rubyzip", "~> 2.3"
|
41
41
|
spec.add_dependency "shex", "~> 0.7"
|
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.
|
4
|
+
version: 1.19.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: 2024-
|
11
|
+
date: 2024-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: linkeddata
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.19.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.19.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: relaton-index
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +178,6 @@ files:
|
|
178
178
|
- grammars/relaton-w3c.rng
|
179
179
|
- lib/relaton_w3c.rb
|
180
180
|
- lib/relaton_w3c/bibxml_parser.rb
|
181
|
-
- lib/relaton_w3c/config.rb
|
182
181
|
- lib/relaton_w3c/data_fetcher.rb
|
183
182
|
- lib/relaton_w3c/data_index.rb
|
184
183
|
- lib/relaton_w3c/data_parser.rb
|