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 +4 -4
- data/lib/relaton_cen/cen_bibliography.rb +6 -6
- data/lib/relaton_cen/config.rb +10 -0
- data/lib/relaton_cen/util.rb +9 -0
- data/lib/relaton_cen/version.rb +1 -1
- data/lib/relaton_cen.rb +7 -5
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c14f063a878f0d9c6267fd71b74fad6cb2500e91c3bdfded0f3ccf3b1c920b76
|
4
|
+
data.tar.gz: b744cd4445f3e322e07fa8a37cf5733efa9028a1a03269ad6992ef01f435abeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "
|
51
|
-
|
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 "
|
54
|
-
|
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 "
|
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 "
|
109
|
+
Util.warn "(#{ref}) found `#{bib.docidentifier.first&.id}`"
|
110
110
|
bib
|
111
111
|
else
|
112
112
|
fetch_ref_err(code, year, ret[:years])
|
data/lib/relaton_cen/version.rb
CHANGED
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.
|
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-
|
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
|