relaton-ogc 1.16.0 → 1.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87da152cca057f42adce0f783be7106960e30ef3f4360fb00c06c15d9c5ace18
4
- data.tar.gz: 6905a639a052950556325baca635bb9a124bc660b55711d50969d707f1c6ff0c
3
+ metadata.gz: fa6ff540d50e236a8e1aae32805840c0e24a4d17b7b1038b2357472ea74ff65a
4
+ data.tar.gz: ee011e12cc9aab1b0e0928e13d46627a4b0772cb34e107a401c8d06c3445e27e
5
5
  SHA512:
6
- metadata.gz: 7d1e6ec43cc8c8b5277ecff697dd8dff43d1b381a3b932844ab0194c0ab55e3fa5d472c62f030c09a7c8b3b97d186b1ed9f7252438fcd01bc7b61a9e3adb6254
7
- data.tar.gz: b7156ad6f5237cd742097146dfa620de9e8a030c4bb2e4a7e71d9eacc1b6f301be44ad134950fcbe7555e0df8655ff5d56d91e6e69a1ccaaf7a11067387ca3c6
6
+ metadata.gz: cc2f32138c399f241989b6288ca4682d55067d14e05ddb7a236119976e4ec725ac5f5362a431364c1704aab503a27112b5665592d3aa67563615380d06acfee1
7
+ data.tar.gz: 6db6033ad4d01acaedf66fe1bf6ae8fe7ab23127bd690e86e38849897b05961e0c5669a04921db398336d29b3cec1df4cc30ed307905bb944e28776eea32e916
@@ -0,0 +1,10 @@
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
@@ -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 "[relaton-ogc] WARNING Duplicated documents: #{@dupids.to_a.join(', ')}" if @dupids.any?
75
+ warn "WARNING Duplicated documents: #{@dupids.to_a.join(', ')}" if @dupids.any?
76
76
  self.etag = etag if no_errors
77
77
  index.save
78
78
  end
@@ -23,7 +23,7 @@ module RelatonOgc
23
23
  result = bib_search_filter(code, year, opts) || (return nil)
24
24
  ret = bib_results_filter(result, year)
25
25
  if ret[:ret]
26
- warn "[relaton-ogc] (\"#{code}\") found #{ret[:ret].docidentifier.first.id}"
26
+ Util.warn "(#{code}) found `#{ret[:ret].docidentifier.first.id}`"
27
27
  ret[:ret]
28
28
  else
29
29
  fetch_ref_err(code, year, ret[:years])
@@ -33,7 +33,7 @@ module RelatonOgc
33
33
  private
34
34
 
35
35
  def bib_search_filter(code, year, opts)
36
- warn "[relaton-ogc] (\"#{code}\") fetching..."
36
+ Util.warn "(#{code}) fetching..."
37
37
  search(code, year, opts)
38
38
  end
39
39
 
@@ -67,12 +67,12 @@ module RelatonOgc
67
67
  # @param year [String]
68
68
  # @param missed_years [Array<Strig>]
69
69
  def fetch_ref_err(code, year, missed_years)
70
- id = year ? "#{code} year #{year}" : code
71
- warn "[relaton-ogc] WARNING: no match found online for #{id}. " \
72
- "The code must be exactly like it is on the standards website."
70
+ id = year ? "`#{code}` year `#{year}`" : "#`{code}`"
71
+ Util.warn "WARNING: no match found online for #{id}. " \
72
+ "The code must be exactly like it is on the standards website."
73
73
  unless missed_years.empty?
74
- warn "[relaton-ogc] (There was no match for #{year}, though there " \
75
- "were matches found for #{missed_years.join(', ')}.)"
74
+ Util.warn "There was no match for `#{year}`, though there " \
75
+ "were matches found for `#{missed_years.join('`, `')}`."
76
76
  end
77
77
  nil
78
78
  end
@@ -0,0 +1,9 @@
1
+ module RelatonOgc
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonOgc.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
2
- VERSION = "1.16.0".freeze
2
+ VERSION = "1.16.2".freeze
3
3
  end
data/lib/relaton_ogc.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require "relaton/index"
2
2
  require "relaton_iso_bib"
3
3
  require "relaton_ogc/version"
4
+ require "relaton_ogc/config"
5
+ require "relaton_ogc/util"
4
6
  require "relaton_ogc/ogc_bibliographic_item"
5
7
  require "relaton_ogc/ogc_bibliography"
6
8
  require "relaton_ogc/data_fetcher"
@@ -17,9 +19,9 @@ module RelatonOgc
17
19
  # Returns hash of XML reammar
18
20
  # @return [String]
19
21
  def self.grammar_hash
20
- gem_path = File.expand_path "..", __dir__
21
- grammars_path = File.join gem_path, "grammars", "*"
22
- grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
23
- Digest::MD5.hexdigest grammars
22
+ # gem_path = File.expand_path "..", __dir__
23
+ # grammars_path = File.join gem_path, "grammars", "*"
24
+ # grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
25
+ Digest::MD5.hexdigest RelatonOgc::VERSION + RelatonIsoBib::VERSION + RelatonBib::VERSION # grammars
24
26
  end
25
27
  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.16.0
4
+ version: 1.16.2
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-09-03 00:00:00.000000000 Z
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -78,6 +78,7 @@ files:
78
78
  - grammars/relaton-ogc-compile.rng
79
79
  - grammars/relaton-ogc.rng
80
80
  - lib/relaton_ogc.rb
81
+ - lib/relaton_ogc/config.rb
81
82
  - lib/relaton_ogc/data_fetcher.rb
82
83
  - lib/relaton_ogc/editorial_group.rb
83
84
  - lib/relaton_ogc/hash_converter.rb
@@ -87,6 +88,7 @@ files:
87
88
  - lib/relaton_ogc/ogc_bibliography.rb
88
89
  - lib/relaton_ogc/processor.rb
89
90
  - lib/relaton_ogc/scrapper.rb
91
+ - lib/relaton_ogc/util.rb
90
92
  - lib/relaton_ogc/version.rb
91
93
  - lib/relaton_ogc/xml_parser.rb
92
94
  - relaton_ogc.gemspec