relaton-cen 1.16.3 → 1.16.4

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: 2536bccf8d4ddbd3215a965683a22eea51e8739ea65a45b3f41a5f46fb63a035
4
- data.tar.gz: 148612cdbba0da00f7e81e34c3c79e038cb85cb6249ff9923b0dc7267acb9afb
3
+ metadata.gz: c14f063a878f0d9c6267fd71b74fad6cb2500e91c3bdfded0f3ccf3b1c920b76
4
+ data.tar.gz: b744cd4445f3e322e07fa8a37cf5733efa9028a1a03269ad6992ef01f435abeb
5
5
  SHA512:
6
- metadata.gz: 9eb0ea3431e54f1b1aade2bb02153c24ac4b2a531cd29e246b7b7cd0caf0af999da18ec56a4ecac1d2a7c125ac8148731d0dc27ec65a58b876f8a719006af9ce
7
- data.tar.gz: 56bf1b0df47893249c88a05547fe5c2048112079b32499a5c673979ff05cf2c7a54402cd533d58ad8c986302e26681c4c3f66fd2ea39c097993c977701c58e95
6
+ metadata.gz: 3fd672f854de8a98a20c471940b49e55b47a0b1a73f0d243bcbbc3de41b6899130201beefa6bc49995cf605d3a365959e6172336a07fd04e484e8c8841686462
7
+ data.tar.gz: f89b16fb321f85aada7534f1b6b06b398170e06161992ef291a8a97e47c6b8da73ee50d6454c977b1bc4c6e473dbcfaa37e86fa66d6ebbfbb474158451b964b0
@@ -47,11 +47,11 @@ module RelatonCen
47
47
 
48
48
  def fetch_ref_err(code, year, missed_years) # rubocop:disable Metrics/MethodLength
49
49
  id = year ? "#{code}:#{year}" : code
50
- warn "[relaton-cen] WARNING: no match found online for #{id}. "\
51
- "The code must be exactly like it is on the standards website."
50
+ Util.warn "WARNING: no match found online for `#{id}`. " \
51
+ "The code must be exactly like it is on the standards website."
52
52
  unless missed_years.empty?
53
- warn "[relaton-cen] (There was no match for #{year}, though there "\
54
- "were matches found for #{missed_years.join(', ')}.)"
53
+ Util.warn "(There was no match for `#{year}`, though there " \
54
+ "were matches found for `#{missed_years.join('`, `')}`.)"
55
55
  end
56
56
  # if /\d-\d/.match? code
57
57
  # warn "[relaton-cen] The provided document part may not exist, or "\
@@ -101,12 +101,12 @@ module RelatonCen
101
101
 
102
102
  def bib_get(code, year, opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength
103
103
  ref = year.nil? || code.match?(/:\d{4}/) ? code : "#{code}:#{year}"
104
- warn "[relaton-cen] (#{ref}) fetching..."
104
+ Util.warn "(#{ref}) fetching..."
105
105
  result = search_filter(code) || return
106
106
  ret = isobib_results_filter(result, year)
107
107
  if ret[:ret]
108
108
  bib = year || opts[:keep_year] ? ret[:ret] : ret[:ret].to_most_recent_reference
109
- warn "[relaton-cen] (#{ref}) found `#{bib.docidentifier.first&.id}`"
109
+ Util.warn "(#{ref}) found `#{bib.docidentifier.first&.id}`"
110
110
  bib
111
111
  else
112
112
  fetch_ref_err(code, year, ret[:years])
@@ -0,0 +1,10 @@
1
+ module RelatonCen
2
+ module Config
3
+ include RelatonBib::Config
4
+ end
5
+ extend Config
6
+
7
+ class Configuration < RelatonBib::Configuration
8
+ PROGNAME = "relaton-cen".freeze
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module RelatonCen
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonCen.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonCen
4
- VERSION = "1.16.3"
4
+ VERSION = "1.16.4"
5
5
  end
data/lib/relaton_cen.rb CHANGED
@@ -3,8 +3,10 @@
3
3
  require "digest/md5"
4
4
  require "mechanize"
5
5
  require "nokogiri"
6
- require_relative "relaton_cen/version"
7
6
  require "relaton_iso_bib"
7
+ require_relative "relaton_cen/version"
8
+ require "relaton_cen/config"
9
+ require "relaton_cen/util"
8
10
  require "relaton_cen/biblographic_item"
9
11
  require "relaton_cen/scrapper"
10
12
  require "relaton_cen/hit_collection"
@@ -17,9 +19,9 @@ module RelatonCen
17
19
  # Returns hash of XML greammar
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 RelatonCen::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-cen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.3
4
+ version: 1.16.4
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-07 00:00:00.000000000 Z
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -69,11 +69,13 @@ files:
69
69
  - lib/relaton_cen/biblographic_item.rb
70
70
  - lib/relaton_cen/cen_bibliography.rb
71
71
  - lib/relaton_cen/committees.yaml
72
+ - lib/relaton_cen/config.rb
72
73
  - lib/relaton_cen/hash_converter.rb
73
74
  - lib/relaton_cen/hit.rb
74
75
  - lib/relaton_cen/hit_collection.rb
75
76
  - lib/relaton_cen/processor.rb
76
77
  - lib/relaton_cen/scrapper.rb
78
+ - lib/relaton_cen/util.rb
77
79
  - lib/relaton_cen/version.rb
78
80
  - lib/relaton_cen/xml_parser.rb
79
81
  - relaton_cen.gemspec