relaton-oasis 1.16.0 → 1.16.1

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: 3908ef54f79de05bfa9ee81c64f27b03e923f13fdd68df2c3a78b14bdc137bcf
4
- data.tar.gz: 8e120eac3b886e8536532747a89b64f3c7fd9e64d098435e3e2135bde6f17acb
3
+ metadata.gz: 6667e673a229cfd5518f00a5c6d021382effa374ad0dfaad7da60865829f6b40
4
+ data.tar.gz: 82b404a95e5f02139f6a79c601c1a13102d64d8b006d2ac1cf84c5c3c2cbc173
5
5
  SHA512:
6
- metadata.gz: 2f97cd29537cce17fa2f3ce144a7074727a277131a1ea5739480efe6adc3c7dfd6b7b2fc913c029e9ade56694f243311b7b30f7c5df878d34a46af6d80437fb3
7
- data.tar.gz: 7e9373716c8c693c1532c7a0b413dd0d114597baba2c4a95be9d76b3796d76b16a38e2c44255f45b53642428ddbf7cb55c2562a6688c0cf63ca87ceb3f82ade8
6
+ metadata.gz: 7c0025fadba0c8c04c32b0b35e2212673bed7396953ae5b9164c8a88e958815e5cf932abe44d09d248a24d0f33876fb11c891a08559171d59da01db87ba34f68
7
+ data.tar.gz: e9c189383c69ed791232f05fd4a2fa52bf3f07040f67f7cc87cd8bb394352b1b891b88aeee9fb0ac7daa998f01c3ec96c679e12b623aba091f1baaf0e95a7a28
@@ -0,0 +1,10 @@
1
+ module RelatonOasis
2
+ module Config
3
+ include RelatonBib::Config
4
+ end
5
+ extend Config
6
+
7
+ class Configuration < RelatonBib::Configuration
8
+ PROGNAME = "relaton-oasis".freeze
9
+ end
10
+ end
@@ -16,8 +16,9 @@ module RelatonOasis
16
16
  @technology_area = args.delete(:technology_area) || []
17
17
  uta = @technology_area.reject { |a| AREAS.include? a }
18
18
  if uta.any?
19
- warn "[relaton-oasis] WARNING Unknown technology area: #{uta.join(', ')}"
20
- warn "[relaton-oasis] (Valid values are: #{AREAS.join(', ')})"
19
+ area = uta.size > 1 ? "areas" : "area"
20
+ Util.warn "WARNING Unknown technology #{area}: `#{uta.join('`, `')}`"
21
+ Util.warn "Valid values are: `#{AREAS.join('`, `')}`"
21
22
  end
22
23
  super
23
24
  end
@@ -34,15 +34,15 @@ module RelatonOasis
34
34
  # reference is required
35
35
  # @return [RelatonOasis::OasisBibliographicItem, nil]
36
36
  def get(code, year = nil, _opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
37
- warn "[relaton-oasis] (#{code}) fetching..."
37
+ Util.warn "(#{code}) fetching..."
38
38
  bibitem = search code, year
39
39
  if bibitem
40
40
  docid = bibitem.docidentifier.detect(&:primary).id
41
- warn "[relaton-oasis] (#{code}) found #{docid}"
42
- bibitem
41
+ Util.warn "(#{code}) found `#{docid}`"
43
42
  else
44
- warn "[relaton-oasis] (#{code}) not found"
43
+ Util.warn "(#{code}) not found"
45
44
  end
45
+ bibitem
46
46
  end
47
47
  end
48
48
  end
@@ -0,0 +1,9 @@
1
+ module RelatonOasis
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonOasis.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonOasis
4
- VERSION = "1.16.0"
4
+ VERSION = "1.16.1"
5
5
  end
data/lib/relaton_oasis.rb CHANGED
@@ -4,6 +4,8 @@ require "mechanize"
4
4
  require "relaton/index"
5
5
  require "relaton_bib"
6
6
  require_relative "relaton_oasis/version"
7
+ require_relative "relaton_oasis/config"
8
+ require_relative "relaton_oasis/util"
7
9
  require_relative "relaton_oasis/oasis_bibliographic_item"
8
10
  require_relative "relaton_oasis/xml_parser"
9
11
  require_relative "relaton_oasis/hash_converter"
@@ -21,9 +23,9 @@ module RelatonOasis
21
23
  # Returns hash of XML reammar
22
24
  # @return [String]
23
25
  def self.grammar_hash
24
- gem_path = File.expand_path "..", __dir__
25
- grammars_path = File.join gem_path, "grammars", "*"
26
- grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
27
- Digest::MD5.hexdigest grammars
26
+ # gem_path = File.expand_path "..", __dir__
27
+ # grammars_path = File.join gem_path, "grammars", "*"
28
+ # grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
29
+ Digest::MD5.hexdigest RelatonOasis::VERSION + RelatonBib::VERSION # grammars
28
30
  end
29
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-oasis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.16.1
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-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -92,6 +92,7 @@ files:
92
92
  - grammars/relaton-oasis-compile.rng
93
93
  - grammars/relaton-oasis.rng
94
94
  - lib/relaton_oasis.rb
95
+ - lib/relaton_oasis/config.rb
95
96
  - lib/relaton_oasis/data_fetcher.rb
96
97
  - lib/relaton_oasis/data_parser.rb
97
98
  - lib/relaton_oasis/data_parser_utils.rb
@@ -101,6 +102,7 @@ files:
101
102
  - lib/relaton_oasis/oasis_bibliographic_item.rb
102
103
  - lib/relaton_oasis/oasis_bibliography.rb
103
104
  - lib/relaton_oasis/processor.rb
105
+ - lib/relaton_oasis/util.rb
104
106
  - lib/relaton_oasis/version.rb
105
107
  - lib/relaton_oasis/xml_parser.rb
106
108
  - relaton_oasis.gemspec