relaton-ogc 1.18.1 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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"/>
@@ -72,7 +72,7 @@ module RelatonOgc
72
72
  get_data do |etag, json|
73
73
  no_errors = true
74
74
  json.each { |_, hit| fetch_doc(hit) || no_errors = false }
75
- warn "WARNING Duplicated documents: #{@dupids.to_a.join(', ')}" if @dupids.any?
75
+ Util.warn "Duplicated documents: #{@dupids.to_a.join(', ')}" if @dupids.any?
76
76
  self.etag = etag if no_errors
77
77
  index.save
78
78
  end
@@ -85,9 +85,8 @@ module RelatonOgc
85
85
  write_document bib
86
86
  true
87
87
  rescue StandardError => e
88
- warn "Fetching document: #{hit['identifier']}"
89
- warn "#{e.class} #{e.message}"
90
- warn e.backtrace
88
+ Util.error "Fetching document: #{hit['identifier']}\n" \
89
+ "#{e.class} #{e.message}\n#{e.backtrace}"
91
90
  false
92
91
  end
93
92
 
@@ -15,7 +15,7 @@ module RelatonOgc
15
15
 
16
16
  def check_type(type)
17
17
  unless DOCTYPES.include? type
18
- Util.warn "WARNING: invalid doctype: `#{type}`"
18
+ Util.warn "invalid doctype: `#{type}`"
19
19
  end
20
20
  end
21
21
  end
@@ -8,7 +8,7 @@ module RelatonOgc
8
8
 
9
9
  def initialize(**args)
10
10
  if args[:subdoctype] && !SUBTYPES.include?(args[:subdoctype])
11
- Util.warn "WARNING: Invalid document subtype: `#{args[:subdoctype]}`"
11
+ Util.warn "Invalid document subtype: `#{args[:subdoctype]}`"
12
12
  end
13
13
 
14
14
  # @docsubtype = args.delete :docsubtype
@@ -24,7 +24,7 @@ module RelatonOgc
24
24
  result = bib_search_filter(code, year, opts) || (return nil)
25
25
  ret = bib_results_filter(result, year)
26
26
  if ret[:ret]
27
- Util.warn "(#{code}) Found: `#{ret[:ret].docidentifier.first.id}`"
27
+ Util.info "Found: `#{ret[:ret].docidentifier.first.id}`", key: code
28
28
  ret[:ret]
29
29
  else
30
30
  fetch_ref_err(code, year, ret[:years])
@@ -34,7 +34,7 @@ module RelatonOgc
34
34
  private
35
35
 
36
36
  def bib_search_filter(code, year, opts)
37
- Util.warn "(#{code}) Fetching from Relaton repository ..."
37
+ Util.info "Fetching from Relaton repository ...", key: code
38
38
  search(code, year, opts)
39
39
  end
40
40
 
@@ -68,10 +68,10 @@ module RelatonOgc
68
68
  # @param year [String]
69
69
  # @param missed_years [Array<Strig>]
70
70
  def fetch_ref_err(code, year, missed_years)
71
- Util.warn "(#{code}) Not found."
71
+ Util.info "Not found.", key: code
72
72
  unless missed_years.empty?
73
- Util.warn "There was no match for `#{year}`, though there " \
74
- "were matches found for `#{missed_years.join('`, `')}`."
73
+ Util.info "There was no match for `#{year}`, though there " \
74
+ "were matches found for `#{missed_years.join('`, `')}`.", key: code
75
75
  end
76
76
  nil
77
77
  end
@@ -1,9 +1,6 @@
1
1
  module RelatonOgc
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonOgc.configuration.logger
7
- end
4
+ PROGNAME = "relaton-ogc".freeze
8
5
  end
9
6
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
2
- VERSION = "1.18.1".freeze
2
+ VERSION = "1.19.0".freeze
3
3
  end
@@ -38,9 +38,7 @@ module RelatonOgc
38
38
  committe = eg&.at("committee")&.text
39
39
  sc = iso_subgroup eg&.at("subcommittee")
40
40
  wg = iso_subgroup eg&.at("workgroup")
41
- EditorialGroup.new(
42
- committee: committe, subcommittee: sc, workgroup: wg,
43
- )
41
+ EditorialGroup.new(committee: committe, subcommittee: sc, workgroup: wg)
44
42
  end
45
43
  end
46
44
  end
data/lib/relaton_ogc.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "relaton/index"
2
2
  require "relaton_iso_bib"
3
3
  require "relaton_ogc/version"
4
- require "relaton_ogc/config"
5
4
  require "relaton_ogc/util"
6
5
  require "relaton_ogc/document_type"
7
6
  require "relaton_ogc/ogc_bibliographic_item"
data/relaton_ogc.gemspec CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency "faraday", "~> 2.7.0"
29
29
  spec.add_dependency "relaton-index", "~> 0.2.0"
30
- spec.add_dependency "relaton-iso-bib", "~> 1.18.0"
30
+ spec.add_dependency "relaton-iso-bib", "~> 1.19.0"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ogc
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-07 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: faraday
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.18.0
47
+ version: 1.19.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.18.0
54
+ version: 1.19.0
55
55
  description: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
56
56
  model'
57
57
  email:
@@ -72,14 +72,13 @@ files:
72
72
  - bin/console
73
73
  - bin/rspec
74
74
  - bin/setup
75
- - docs.json
75
+ - docs1.json
76
76
  - grammars/basicdoc.rng
77
77
  - grammars/biblio-standoc.rng
78
78
  - grammars/biblio.rng
79
79
  - grammars/relaton-ogc-compile.rng
80
80
  - grammars/relaton-ogc.rng
81
81
  - lib/relaton_ogc.rb
82
- - lib/relaton_ogc/config.rb
83
82
  - lib/relaton_ogc/data_fetcher.rb
84
83
  - lib/relaton_ogc/document_type.rb
85
84
  - lib/relaton_ogc/editorial_group.rb
@@ -113,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
112
  - !ruby/object:Gem::Version
114
113
  version: '0'
115
114
  requirements: []
116
- rubygems_version: 3.3.26
115
+ rubygems_version: 3.3.27
117
116
  signing_key:
118
117
  specification_version: 4
119
118
  summary: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
@@ -1,10 +0,0 @@
1
- module RelatonOgc
2
- module Config
3
- include RelatonBib::Config
4
- end
5
- extend Config
6
-
7
- class Configuration < RelatonBib::Configuration
8
- PROGNAME = "relaton-ogc".freeze
9
- end
10
- end