relaton-bib 1.18.5 → 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/.github/workflows/rake.yml +2 -0
- data/README.adoc +5 -12
- data/grammars/basicdoc.rng +3 -0
- data/grammars/versions.json +5 -5
- data/lib/relaton_bib/bib_item_locality.rb +1 -1
- data/lib/relaton_bib/bibliographic_item.rb +1 -1
- data/lib/relaton_bib/config.rb +0 -12
- data/lib/relaton_bib/contribution_info.rb +1 -1
- data/lib/relaton_bib/document_relation.rb +1 -1
- data/lib/relaton_bib/hash_converter.rb +1 -1
- data/lib/relaton_bib/util.rb +6 -7
- data/lib/relaton_bib/version.rb +1 -1
- data/lib/relaton_bib/xml_parser.rb +1 -1
- data/lib/relaton_bib.rb +1 -1
- data/relaton-bib.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '078eeaee528f7e51a51015dc49723903af554087be753a244d69ebb2d1c0ac83'
|
4
|
+
data.tar.gz: 1ab74dea087ac8a1a4366ed24630ca4869774cc8b8f938e275a3684e0a61ec69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62b65c967d716d9680b6e1ec1a361a3f1f2a0d48f032e793585b3630f1146a49897b2d2563c40e165bc04ceb437aeb7da70f7581945fb3f08a23563c79438e58
|
7
|
+
data.tar.gz: 34f6adc6c2998fe912879615f71079963331d83eb12cbb7d7bcff9c8ce4276da73b252aa8240cc105314a2f0aff786f401c99579a50a7df0255ac87673544059
|
data/.github/workflows/rake.yml
CHANGED
data/README.adoc
CHANGED
@@ -27,24 +27,13 @@ Or install it yourself as:
|
|
27
27
|
|
28
28
|
== Usage
|
29
29
|
|
30
|
-
===
|
31
|
-
|
32
|
-
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 `RelatonBib.configure` block.
|
30
|
+
=== Create bibliographic item
|
33
31
|
|
34
32
|
[source,ruby]
|
35
33
|
----
|
36
34
|
require 'relaton_bib'
|
37
35
|
=> true
|
38
36
|
|
39
|
-
RelatonBib.configure do |config|
|
40
|
-
config.logger.level = Logger::DEBUG
|
41
|
-
end
|
42
|
-
----
|
43
|
-
|
44
|
-
=== Create bibliographic item
|
45
|
-
|
46
|
-
[source,ruby]
|
47
|
-
----
|
48
37
|
hash = YAML.load_file "spec/examples/bib_item.yml"
|
49
38
|
=> {"id"=>"ISOTC211",
|
50
39
|
"fetched"=>"2022-05-02",
|
@@ -304,6 +293,10 @@ item.to_bibxml
|
|
304
293
|
</reference>"
|
305
294
|
----
|
306
295
|
|
296
|
+
=== Logging
|
297
|
+
|
298
|
+
RelatonBib 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.
|
299
|
+
|
307
300
|
== Development
|
308
301
|
|
309
302
|
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
data/grammars/versions.json
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
|
-
"relaton-models": "v1.2.
|
3
|
-
"basicdoc-models": "v1.1.
|
2
|
+
"relaton-models": "v1.2.9",
|
3
|
+
"basicdoc-models": "v1.1.3",
|
4
4
|
"metanorma-requirements-models": "v1.0.1",
|
5
5
|
"relaton-model-ieee": "v1.0.1",
|
6
|
-
"relaton-model-iso": "v1.0.
|
6
|
+
"relaton-model-iso": "v1.0.3",
|
7
7
|
"relaton-model-iec": "v1.0.0",
|
8
8
|
"relaton-model-bsi": "v1.0.2",
|
9
9
|
"relaton-model-gb": "v1.0.0",
|
@@ -29,6 +29,6 @@
|
|
29
29
|
"relaton-model-oasis": "v1.0.1",
|
30
30
|
"relaton-model-jis": "v0.0.1",
|
31
31
|
"relaton-model-etsi": "v0.0.3",
|
32
|
-
"metanorma-model": "v1.
|
33
|
-
"date": "2024-
|
32
|
+
"metanorma-model": "v1.3.0",
|
33
|
+
"date": "2024-02-21T18:15:14Z"
|
34
34
|
}
|
@@ -18,7 +18,7 @@ module RelatonBib
|
|
18
18
|
whole|table|annex|figure|note|list|example|volume|issue|time|anchor|
|
19
19
|
locality:[a-zA-Z0-9_]+}x
|
20
20
|
unless type&.match? type_ptrn
|
21
|
-
Util.warn "
|
21
|
+
Util.warn "Invalid locality type: `#{type}`"
|
22
22
|
end
|
23
23
|
|
24
24
|
@type = type
|
@@ -207,7 +207,7 @@ module RelatonBib
|
|
207
207
|
# @option link [String] :content
|
208
208
|
def initialize(**args)
|
209
209
|
if args[:type] && !TYPES.include?(args[:type])
|
210
|
-
Util.warn %{
|
210
|
+
Util.warn %{Type `#{args[:type]}` is invalid.}
|
211
211
|
end
|
212
212
|
|
213
213
|
@title = if args[:title].is_a?(TypedTitleStringCollection)
|
data/lib/relaton_bib/config.rb
CHANGED
@@ -10,18 +10,6 @@ module RelatonBib
|
|
10
10
|
end
|
11
11
|
|
12
12
|
class Configuration
|
13
|
-
PROGNAME = "relaton-bib".freeze
|
14
|
-
|
15
|
-
attr_accessor :logger
|
16
|
-
|
17
|
-
def initialize
|
18
|
-
@logger = ::Logger.new $stderr
|
19
|
-
@logger.level = ::Logger::WARN
|
20
|
-
@logger.progname = self.class::PROGNAME
|
21
|
-
@logger.formatter = proc do |_severity, _datetime, progname, msg|
|
22
|
-
"[#{progname}] #{msg}\n"
|
23
|
-
end
|
24
|
-
end
|
25
13
|
end
|
26
14
|
|
27
15
|
extend Config
|
@@ -22,7 +22,7 @@ module RelatonBib
|
|
22
22
|
# @param description [Array<String>]
|
23
23
|
def initialize(**args)
|
24
24
|
if args[:type] && !TYPES.include?(args[:type])
|
25
|
-
Util.warn %{
|
25
|
+
Util.warn %{Contributor's type `#{args[:type]}` is invalid.}
|
26
26
|
end
|
27
27
|
|
28
28
|
@type = args[:type]
|
@@ -46,7 +46,7 @@ module RelatonBib
|
|
46
46
|
source_locality: [])
|
47
47
|
type = "obsoletes" if type == "Now withdrawn"
|
48
48
|
unless self.class::TYPES.include? type
|
49
|
-
Util.warn "
|
49
|
+
Util.warn "Invalid relation type: `#{type}`"
|
50
50
|
end
|
51
51
|
@type = type
|
52
52
|
@description = description
|
data/lib/relaton_bib/util.rb
CHANGED
@@ -2,16 +2,15 @@ module RelatonBib
|
|
2
2
|
module Util
|
3
3
|
extend self
|
4
4
|
|
5
|
-
|
6
|
-
logger.send(...)
|
7
|
-
end
|
5
|
+
PROGNAME = "relaton-bib".freeze
|
8
6
|
|
9
|
-
def
|
10
|
-
|
7
|
+
def method_missing(method_name, msg = nil, prog = nil, **opts, &block)
|
8
|
+
prog ||= self::PROGNAME
|
9
|
+
Relaton.logger_pool.send method_name, msg, prog, **opts, &block
|
11
10
|
end
|
12
11
|
|
13
|
-
def
|
14
|
-
|
12
|
+
def respond_to_missing?(method_name, include_private = false)
|
13
|
+
Relaton.logger_pool.respond_to?(method_name) || super
|
15
14
|
end
|
16
15
|
end
|
17
16
|
end
|
data/lib/relaton_bib/version.rb
CHANGED
data/lib/relaton_bib.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
+
require "relaton/logger"
|
1
2
|
require "forwardable"
|
2
3
|
require "yaml"
|
3
4
|
require "htmlentities"
|
4
5
|
require "relaton_bib/version"
|
5
6
|
require "relaton_bib/deep_dup"
|
6
|
-
require "relaton_bib/config"
|
7
7
|
require "relaton_bib/util"
|
8
8
|
require "relaton_bib/localized_string"
|
9
9
|
require "relaton_bib/forename"
|
data/relaton-bib.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bib
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.16'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: relaton-logger
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.2.0
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.2.0
|
83
97
|
description: 'RelatonBib: Ruby XMLDOC impementation.'
|
84
98
|
email:
|
85
99
|
- open.source@ribose.com
|