relaton-w3c 1.14.3 → 1.16.1
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/README.adoc +14 -3
- data/grammars/biblio.rng +1 -1
- data/lib/relaton_w3c/config.rb +10 -0
- data/lib/relaton_w3c/data_fetcher.rb +2 -2
- 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
- data/relaton_w3c.gemspec +1 -1
- metadata +6 -4
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
|
@@ -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/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
|
----
|
data/grammars/biblio.rng
CHANGED
@@ -74,13 +74,13 @@ module RelatonW3c
|
|
74
74
|
if File.exist? file
|
75
75
|
item = send "read_#{@format}", file
|
76
76
|
item.relation.each do |r1|
|
77
|
-
r1.type = "hasEdition" if r1.type == "
|
77
|
+
r1.type = "hasEdition" if r1.type == "instanceOf"
|
78
78
|
same_edition = bib.relation.detect { |r2| same_edition?(r1, r2) }
|
79
79
|
bib.relation << r1 unless same_edition
|
80
80
|
end
|
81
81
|
end
|
82
82
|
bib.relation.select { |r| r.type == "hasEdition" }
|
83
|
-
.max_by { |r| r.bibitem.id.match(/(?<=-)\d{8}$/).to_s }&.type = "
|
83
|
+
.max_by { |r| r.bibitem.id.match(/(?<=-)\d{8}$/).to_s }&.type = "instanceOf"
|
84
84
|
end
|
85
85
|
|
86
86
|
#
|
@@ -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
|
data/relaton_w3c.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_dependency "mechanize", "~> 2.8.0"
|
36
36
|
spec.add_dependency "rdf", "~> 3.2.0"
|
37
37
|
spec.add_dependency "rdf-normalize", "~> 0.5.0"
|
38
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
38
|
+
spec.add_dependency "relaton-bib", "~> 1.16.0"
|
39
39
|
spec.add_dependency "relaton-index", "~> 0.2.4"
|
40
40
|
spec.add_dependency "rubyzip", "~> 2.3.0"
|
41
41
|
spec.add_dependency "shex", "~> 0.7.0"
|
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.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
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.16.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.16.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: relaton-index
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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
|