relaton-un 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dae4aa964d9746c12a509b7d9ff2d58b50d6465ec8a6d4eca8a5a24255118080
4
- data.tar.gz: c8b47b15603b0b1b9565c0c12b5c6fb4b4a4352d207c228c314473981fef635c
3
+ metadata.gz: ff20c5706705ecaa88945f97b061a823977c356880f4dd45c8556f262d848b74
4
+ data.tar.gz: 4e291e62cc9cceb8694e332076c32679c4dff39a4d7d77adb8cee0013e0e95e7
5
5
  SHA512:
6
- metadata.gz: b05b6dfcae803d7d0c3d8d9128258545f6487ce1e212f699ed1700d96d1de6abdc7d67a485185807b4c07d3749b4f0c23fae82a48bd2b32cb2979e65b93a925b
7
- data.tar.gz: 64cd19f4922196a8d5e2aaa914882031721b1fd6320ae516179a8a4360a1c9f310ae74bca238c810f78dee22b36bfdc44ed0f3fca396841fecd9663018d192a1
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
- === 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 `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.
@@ -244,6 +244,9 @@
244
244
  <data type="ID"/>
245
245
  </attribute>
246
246
  <attribute name="reviewer"/>
247
+ <optional>
248
+ <attribute name="type"/>
249
+ </optional>
247
250
  <optional>
248
251
  <attribute name="date">
249
252
  <data type="dateTime"/>
@@ -12,7 +12,7 @@ module RelatonUn
12
12
 
13
13
  def check_type(type)
14
14
  unless DOCTYPES.include? type
15
- Util.warn "WARNING: invalid doctype: `#{type}`"
15
+ Util.warn "invalid doctype: `#{type}`"
16
16
  end
17
17
  end
18
18
  end
@@ -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 "WARNING: Invalid distribution: `#{args[:distribution]}`"
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.warn "(#{ref}) Fetching from documents.un.org ..."
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.warn "(#{ref}) Found: `#{result.fetch.docidentifier[0].id}`"
28
+ Util.info "Found: `#{result.fetch.docidentifier[0].id}`", key: ref
29
29
  result.fetch
30
30
  else
31
- Util.warn "(#{ref}) Not found."
31
+ Util.info "Not found.", key: ref
32
32
  nil
33
33
  end
34
34
  end
@@ -1,9 +1,6 @@
1
1
  module RelatonUn
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonUn.configuration.logger
7
- end
4
+ PROGNAME = "relaton-un".freeze
8
5
  end
9
6
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonUn
2
- VERSION = "1.18.1".freeze
2
+ VERSION = "1.19.0".freeze
3
3
  end
@@ -57,6 +57,10 @@ module RelatonUn
57
57
  def fetch_submissionlanguage(ext)
58
58
  ext.xpath("./submissionlanguage").map(&:text)
59
59
  end
60
+
61
+ def create_doctype(type)
62
+ DocumentType.new type: type.text, abbreviation: type[:abbreviation]
63
+ end
60
64
  end
61
65
  end
62
66
  end
data/lib/relaton_un.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "addressable"
2
2
  require "relaton_bib"
3
3
  require "relaton_un/version"
4
- require "relaton_un/config"
5
4
  require "relaton_un/util"
6
5
  require "relaton_un/document_type"
7
6
  require "relaton_un/un_bibliographic_item"
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.18.0"
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.18.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-02-16 00:00:00.000000000 Z
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.18.0
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.18.0
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.26
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
@@ -1,10 +0,0 @@
1
- module RelatonUn
2
- module Config
3
- include RelatonBib::Config
4
- end
5
- extend Config
6
-
7
- class Configuration < RelatonBib::Configuration
8
- PROGNAME = "relaton-un".freeze
9
- end
10
- end