relaton-un 1.18.0 → 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/grammars/basicdoc.rng +3 -0
- data/lib/relaton_un/document_type.rb +1 -1
- data/lib/relaton_un/processor.rb +1 -1
- data/lib/relaton_un/un_bibliographic_item.rb +1 -1
- data/lib/relaton_un/un_bibliography.rb +3 -3
- data/lib/relaton_un/util.rb +1 -4
- data/lib/relaton_un/version.rb +1 -1
- data/lib/relaton_un/xml_parser.rb +4 -0
- data/lib/relaton_un.rb +0 -1
- data/relaton_un.gemspec +1 -1
- metadata +5 -6
- data/lib/relaton_un/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: ff20c5706705ecaa88945f97b061a823977c356880f4dd45c8556f262d848b74
|
4
|
+
data.tar.gz: 4e291e62cc9cceb8694e332076c32679c4dff39a4d7d77adb8cee0013e0e95e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4cbfa1a929c3a833c9172806fa433f5b4343e5411f6f881f4bf34740c664be847271efc8b32b7bbe7e64dbdabacbe96f6873c67c8788ecfc50b4a114c5b85c4
|
7
|
+
data.tar.gz: edee2e4000a82cfb833ada16951d4e49c345c6480b2afe86dda3fd7bf88f19e8ffb25d427ccb912878de13fd0541a6091bdec0a3c3cc5e3423d09273e90955bc
|
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 `RelatonUn.configure` block.
|
26
|
+
=== Search for a standard using keywords
|
29
27
|
|
30
28
|
[source,ruby]
|
31
29
|
----
|
32
30
|
require 'relaton_un'
|
33
31
|
=> true
|
34
32
|
|
35
|
-
RelatonUn.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
|
hits = RelatonUn::UnBibliography.search("TRADE/CEFACT/2004/32")
|
45
34
|
=> <RelatonUn::HitCollection:0x007fc4e6ec2018 @ref=TRADE/CEFACT/2004/32 @fetched=false>
|
46
35
|
|
@@ -122,6 +111,10 @@ RelatonUn::UnBibliographicItem.new **bib_hash
|
|
122
111
|
...
|
123
112
|
----
|
124
113
|
|
114
|
+
=== Logging
|
115
|
+
|
116
|
+
RelatonUn 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.
|
117
|
+
|
125
118
|
== Development
|
126
119
|
|
127
120
|
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/lib/relaton_un/processor.rb
CHANGED
@@ -19,7 +19,7 @@ module RelatonUn
|
|
19
19
|
# @param job_number [String, nil]
|
20
20
|
def initialize(**args)
|
21
21
|
if args[:distribution] && !DISTRIBUTIONS.has_value?(args[:distribution])
|
22
|
-
Util.warn "
|
22
|
+
Util.warn "Invalid distribution: `#{args[:distribution]}`"
|
23
23
|
end
|
24
24
|
@submissionlanguage = args.delete :submissionlanguage
|
25
25
|
@distribution = args.delete :distribution
|
@@ -21,14 +21,14 @@ module RelatonUn
|
|
21
21
|
# @param opts [Hash] options
|
22
22
|
# @return [RelatonUn::UnBibliographicItem]
|
23
23
|
def get(ref, _year = nil, _opts = {})
|
24
|
-
Util.
|
24
|
+
Util.info "Fetching from documents.un.org ...", key: ref
|
25
25
|
/^(?:UN\s)?(?<code>.*)/ =~ ref
|
26
26
|
result = isobib_search_filter(code)
|
27
27
|
if result
|
28
|
-
Util.
|
28
|
+
Util.info "Found: `#{result.fetch.docidentifier[0].id}`", key: ref
|
29
29
|
result.fetch
|
30
30
|
else
|
31
|
-
Util.
|
31
|
+
Util.info "Not found.", key: ref
|
32
32
|
nil
|
33
33
|
end
|
34
34
|
end
|
data/lib/relaton_un/util.rb
CHANGED
data/lib/relaton_un/version.rb
CHANGED
data/lib/relaton_un.rb
CHANGED
data/relaton_un.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_dependency "addressable", "~> 2.8.0"
|
36
36
|
spec.add_dependency "faraday", "~> 2.7.0"
|
37
37
|
spec.add_dependency "http-cookie", "~> 1.0.5"
|
38
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
38
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
39
39
|
spec.add_dependency "unf_ext", ">= 0.0.7.7"
|
40
40
|
end
|
41
41
|
# rubocop:enable Metrics/BlockLength
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-un
|
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: addressable
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.19.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.19.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: unf_ext
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,6 @@ files:
|
|
106
106
|
- grammars/relaton-un-compile.rng
|
107
107
|
- grammars/relaton-un.rng
|
108
108
|
- lib/relaton_un.rb
|
109
|
-
- lib/relaton_un/config.rb
|
110
109
|
- lib/relaton_un/document_type.rb
|
111
110
|
- lib/relaton_un/editorialgroup.rb
|
112
111
|
- lib/relaton_un/hash_converter.rb
|
@@ -142,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
141
|
- !ruby/object:Gem::Version
|
143
142
|
version: '0'
|
144
143
|
requirements: []
|
145
|
-
rubygems_version: 3.3.
|
144
|
+
rubygems_version: 3.3.27
|
146
145
|
signing_key:
|
147
146
|
specification_version: 4
|
148
147
|
summary: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
|