relaton-un 1.14.1 → 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: 7e704658b3773eb8347be22f467a49f320cc5efd06503e72095ee9b2398803b0
4
- data.tar.gz: 5d25a613fe0d9a9f8e44246d092962907f1794aef97b4dc2a0296c03d474785b
3
+ metadata.gz: 8f1fa9196d2c00a4740b08e4ed793b3f0073defdfe9efde37f609aa3ae8755e8
4
+ data.tar.gz: 97752fd7f24738baa8fe97de080c141dba11eab434697cbd04eca1dd158af5f6
5
5
  SHA512:
6
- metadata.gz: 3bf607afc7975c55eb50bad68d30b710f90e3db0774629fec910df6e0aff35cc2e5520769e18ee459de7b802609a5c9b6d025bc681b992c1294addc56e23c4bf
7
- data.tar.gz: d48eb2b4e1195a91e2ee47e00d6146c6bc396c6eef357020fc71c9527e8dfafa0896c81f80630de0b32c1b42dc8ee67ece8c0ac7058883886b40371d3576b091
6
+ metadata.gz: 5af293100d6b96a28da1b8c56e5f404f282bfcf06ea77408f3297b7a65d5a24375a2da5350f5e2fad4a75262d491e51eb334223f0ca5a90ecca2851d3bd1634b
7
+ data.tar.gz: 2eb898c7ec22ee17ba302a7bdfb2d167466b1e0500b04048ab0be68f8ec118006f8d18a7af2596c5bf65573674b525516319f1a5bc1bd9a34b89e5b490b40a5a
@@ -7,7 +7,8 @@ on:
7
7
  inputs:
8
8
  next_version:
9
9
  description: |
10
- Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
10
+ Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
11
+ Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
11
12
  required: true
12
13
  default: 'skip'
13
14
  repository_dispatch:
data/.gitignore CHANGED
@@ -8,6 +8,7 @@
8
8
  /tmp/
9
9
  /.pryrc
10
10
  /.rubocop-https*
11
+ /vendor/
11
12
 
12
13
  .rspec_status
13
14
  .vscode/
data/Gemfile CHANGED
@@ -3,6 +3,7 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in relaton-un.gemspec
4
4
  gemspec
5
5
 
6
+ gem "equivalent-xml", "~> 0.6"
6
7
  gem "rake", "~> 13.0"
7
8
  gem "rspec", "~> 3.0"
8
9
  gem "ruby-jing"
data/grammars/biblio.rng CHANGED
@@ -1283,7 +1283,7 @@
1283
1283
  <value>mergedInto</value>
1284
1284
  <value>splits</value>
1285
1285
  <value>splitInto</value>
1286
- <value>instance</value>
1286
+ <value>instanceOf</value>
1287
1287
  <value>hasInstance</value>
1288
1288
  <value>exemplarOf</value>
1289
1289
  <value>hasExemplar</value>
@@ -0,0 +1,10 @@
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
@@ -23,6 +23,9 @@ module RelatonUn
23
23
  # ca_file = "/Users/andrej/Library/Preferences/httptoolkit/ca.pem"
24
24
  # @http.cert_store.set_default_paths
25
25
  # @http.cert_store.add_file ca_file
26
+ if RUBY_VERSION.to_f > 3.0
27
+ @http.ssl_version = :TLSv1_2 # rubocop:disable Naming/VariableNumber
28
+ end
26
29
  @http.read_timeout = 120
27
30
  if (form_resp = get_page)
28
31
  # doc = Nokogiri::HTML page_resp(form_resp, text).body
@@ -24,7 +24,7 @@ module RelatonUn
24
24
  # @param job_number [String, nil]
25
25
  def initialize(**args)
26
26
  if args[:distribution] && !DISTRIBUTIONS.has_value?(args[:distribution])
27
- warn "[relaton-un] WARNING: invalid distribution: #{args[:distribution]}"
27
+ Util.warn "WARNING: invalid distribution: `#{args[:distribution]}`"
28
28
  end
29
29
  @submissionlanguage = args.delete :submissionlanguage
30
30
  @distribution = args.delete :distribution
@@ -21,13 +21,15 @@ module RelatonUn
21
21
  # @param opts [Hash] options
22
22
  # @return [RelatonUn::UnBibliographicItem]
23
23
  def get(ref, _year = nil, _opts = {})
24
- warn "[relaton-un] (\"#{ref}\") fetching..."
24
+ Util.warn "(#{ref}) fetching..."
25
25
  /^(?:UN\s)?(?<code>.*)/ =~ ref
26
26
  result = isobib_search_filter(code)
27
27
  if result
28
- warn "[relaton-un] (\"#{ref}\") "\
29
- "found #{result.fetch.docidentifier[0].id}"
28
+ Util.warn "(#{ref}) found `#{result.fetch.docidentifier[0].id}`"
30
29
  result.fetch
30
+ else
31
+ Util.warn "(#{ref}) nothing found"
32
+ nil
31
33
  end
32
34
  end
33
35
 
@@ -0,0 +1,9 @@
1
+ module RelatonUn
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ RelatonUn.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module RelatonUn
2
- VERSION = "1.14.1".freeze
2
+ VERSION = "1.16.1".freeze
3
3
  end
data/lib/relaton_un.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require "addressable"
2
2
  require "relaton_bib"
3
3
  require "relaton_un/version"
4
+ require "relaton_un/config"
5
+ require "relaton_un/util"
4
6
  require "relaton_un/un_bibliographic_item"
5
7
  require "relaton_un/un_bibliography"
6
8
  require "relaton_un/hit_collection"
@@ -16,9 +18,9 @@ module RelatonUn
16
18
  # Returns hash of XML reammar
17
19
  # @return [String]
18
20
  def self.grammar_hash
19
- gem_path = File.expand_path "..", __dir__
20
- grammars_path = File.join gem_path, "grammars", "*"
21
- grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
22
- Digest::MD5.hexdigest grammars
21
+ # gem_path = File.expand_path "..", __dir__
22
+ # grammars_path = File.join gem_path, "grammars", "*"
23
+ # grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
24
+ Digest::MD5.hexdigest RelatonUn::VERSION + RelatonBib::VERSION # grammars
23
25
  end
24
26
  end
data/relaton_un.gemspec CHANGED
@@ -32,12 +32,10 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ["lib"]
34
34
 
35
- spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
-
37
35
  spec.add_dependency "addressable", "~> 2.8.0"
38
36
  spec.add_dependency "faraday", "~> 2.7.0"
39
37
  spec.add_dependency "http-cookie", "~> 1.0.5"
40
- spec.add_dependency "relaton-bib", "~> 1.14.0"
38
+ spec.add_dependency "relaton-bib", "~> 1.16.0"
41
39
  spec.add_dependency "unf_ext", ">= 0.0.7.7"
42
40
  end
43
41
  # rubocop:enable Metrics/BlockLength
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1
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-05-06 00:00:00.000000000 Z
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: equivalent-xml
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.6'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.6'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: addressable
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +58,14 @@ dependencies:
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: 1.14.0
61
+ version: 1.16.0
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: 1.14.0
68
+ version: 1.16.0
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: unf_ext
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -120,6 +106,7 @@ files:
120
106
  - grammars/relaton-un-compile.rng
121
107
  - grammars/relaton-un.rng
122
108
  - lib/relaton_un.rb
109
+ - lib/relaton_un/config.rb
123
110
  - lib/relaton_un/editorialgroup.rb
124
111
  - lib/relaton_un/hash_converter.rb
125
112
  - lib/relaton_un/hit.rb
@@ -128,6 +115,7 @@ files:
128
115
  - lib/relaton_un/session.rb
129
116
  - lib/relaton_un/un_bibliographic_item.rb
130
117
  - lib/relaton_un/un_bibliography.rb
118
+ - lib/relaton_un/util.rb
131
119
  - lib/relaton_un/version.rb
132
120
  - lib/relaton_un/xml_parser.rb
133
121
  - relaton_un.gemspec