relaton-gb 0.11.1 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_gb/gb_bibliography.rb +13 -10
- data/lib/relaton_gb/version.rb +1 -1
- data/relaton_gb.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 852074eca70e37185fece3ea6d720f0b23af4144ba7d4f28c8c4a04a3516abee
|
4
|
+
data.tar.gz: e22768cb97a2b566cc89845be62064a77ea7626bf928aee4a2b93304f9a7ebb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12790bcbf1c3837ba7d01647fb2fbc6e5cc70a372841c1f444ef6aa6c8d387f146190c03279578c73f652ce9875c73441453136ff1e12d717ef7863ffd5be63d
|
7
|
+
data.tar.gz: 61b70387d0f4d67984726d6696b055dc2b6ea35a1095ae9749dc7c5207bad34b9207108f842a665a2b478e686eb3fc1d8fe3bd72fdc7f507db0e3001a4abe2ac
|
@@ -54,8 +54,8 @@ module RelatonGb
|
|
54
54
|
ret = get1(code, year, opts)
|
55
55
|
return nil if ret.nil?
|
56
56
|
|
57
|
-
ret.to_most_recent_reference unless year
|
58
|
-
ret.to_all_parts if opts[:all_parts]
|
57
|
+
ret = ret.to_most_recent_reference unless year
|
58
|
+
ret = ret.to_all_parts if opts[:all_parts]
|
59
59
|
ret
|
60
60
|
end
|
61
61
|
|
@@ -63,15 +63,15 @@ module RelatonGb
|
|
63
63
|
|
64
64
|
def fetch_ref_err(code, year, missed_years)
|
65
65
|
id = year ? "#{code}:#{year}" : code
|
66
|
-
warn "WARNING: no match found on the GB website for #{id}. "\
|
66
|
+
warn "[relaton-gb] WARNING: no match found on the GB website for #{id}. "\
|
67
67
|
"The code must be exactly like it is on the website."
|
68
|
-
warn "(There was no match for #{year}, though there were matches "\
|
68
|
+
warn "[relaton-gb] (There was no match for #{year}, though there were matches "\
|
69
69
|
"found for #{missed_years.join(', ')}.)" unless missed_years.empty?
|
70
70
|
if /\d-\d/ =~ code
|
71
|
-
warn "The provided document part may not exist, or the document "\
|
71
|
+
warn "[relaton-gb] The provided document part may not exist, or the document "\
|
72
72
|
"may no longer be published in parts."
|
73
73
|
else
|
74
|
-
warn "If you wanted to cite all document parts for the reference, "\
|
74
|
+
warn "[relaton-gb] If you wanted to cite all document parts for the reference, "\
|
75
75
|
"use \"#{code} (all parts)\".\nIf the document is not a standard, "\
|
76
76
|
"use its document type abbreviation (TS, TR, PAS, Guide)."
|
77
77
|
end
|
@@ -83,15 +83,18 @@ module RelatonGb
|
|
83
83
|
searchcode = code + (year.nil? ? "" : "-#{year}")
|
84
84
|
result = search_filter(searchcode) || return
|
85
85
|
ret = results_filter(result, year)
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
if ret[:ret]
|
87
|
+
warn "[relaton-gb] (\"#{code}\") found #{ret[:ret].docidentifier.first.id}"
|
88
|
+
ret[:ret]
|
89
|
+
else
|
90
|
+
fetch_ref_err(code, year, ret[:years])
|
91
|
+
end
|
89
92
|
end
|
90
93
|
|
91
94
|
def search_filter(code)
|
92
95
|
# search filter needs to incorporate year
|
93
96
|
docidrx = %r{^[^\s]+\s[\d\.-]+}
|
94
|
-
warn "
|
97
|
+
warn "[relaton-gb] (\"#{code}\") fetching..."
|
95
98
|
result = search(code)
|
96
99
|
result.select do |hit|
|
97
100
|
hit.docref && hit.docref.match(docidrx).to_s.include?(code)
|
data/lib/relaton_gb/version.rb
CHANGED
data/relaton_gb.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-gb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0.
|
187
|
+
version: 0.9.0
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0.
|
194
|
+
version: 0.9.0
|
195
195
|
description: 'RelatonGb: retrieve Chinese GB Standards for bibliographic use using
|
196
196
|
the BibliographicItem model.'
|
197
197
|
email:
|