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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dde73dc09260674db2ebe47a9b589e5c60bc0b1d5ea1096df990301b841e91b
4
- data.tar.gz: bddb4a7fe6e4e8b3119dc272634cf6492f6388f8151fe4262857d6afb5137756
3
+ metadata.gz: 852074eca70e37185fece3ea6d720f0b23af4144ba7d4f28c8c4a04a3516abee
4
+ data.tar.gz: e22768cb97a2b566cc89845be62064a77ea7626bf928aee4a2b93304f9a7ebb9
5
5
  SHA512:
6
- metadata.gz: 99d20c25fed779ef7c8285ad97ae0b7352393e4d6804785cfe40c5c7d0fab4453ba550c290d9a25f9d3001430869c99420be94457cf3c79dab9f04c11cd40308
7
- data.tar.gz: 6f1c161f0f480b4209a2b155bbaaa0d62e5cfd2bce6be9542561c7a37f6aa7ecba5daeeae9a2cef93f5dc0bd1fafa813bd73db06c08371ccabcc79c4bece4e86
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
- return ret[:ret] if ret[:ret]
87
-
88
- fetch_ref_err(code, year, ret[:years])
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 "fetching #{code}..."
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonGb
4
- VERSION = "0.11.1"
4
+ VERSION = "0.12.0"
5
5
  end
@@ -37,5 +37,5 @@ Gem::Specification.new do |spec|
37
37
 
38
38
  spec.add_dependency "cnccs", "~> 0.1.1"
39
39
  spec.add_dependency "gb-agencies", "~> 0.0.1"
40
- spec.add_dependency "relaton-iso-bib", "~> 0.8.0"
40
+ spec.add_dependency "relaton-iso-bib", "~> 0.9.0"
41
41
  end
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.11.1
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-02-26 00:00:00.000000000 Z
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.8.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.8.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: