relaton-gb 1.5.0 → 1.6.pre1

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: cdcf6f4c449c467339bf697fcd6aa713605e7ff91ac5ba9879b7221a63b0aa84
4
- data.tar.gz: b04b5b64cef0b79870c502d697bab4e78868b4e7730dae283aae4c10b1ec5b84
3
+ metadata.gz: a83e7ce3f7e4fd9dbb2bba842b4a841494de668f141efeba0bc44d61f1b0d83a
4
+ data.tar.gz: f1f3a05d9a7dedb8aad224ee85f648d68b490e877b31d1acd5b044f07fd8eacf
5
5
  SHA512:
6
- metadata.gz: 4c13f6d1a6667403fe2c49662d49455e4a29fe7e039f7abb8b3fc73ff7122bab44eb2b8185b4e8aaee19d9388556465896904651685158e74688a4645951f102
7
- data.tar.gz: e2c1eb2ff01e25cc136df5ee920d5eaed3055eecdcc13ef2d24534aaad50c357ff220560ac591d944442f0f8d7abad0221ed404886922b6330939a2d9fbe2b67
6
+ metadata.gz: f90401ee88757dd7c670e6b79df9956292ae8f624ad697ef5e16e2412d300575bc050eb1612375ef89bcf74432191b8122305806063f5057fdc6c75e648786e8
7
+ data.tar.gz: f20cef8f620fb28b2aff44b8b414d68411a9135d7c1495e1684bf29441a393976e07c054b752e3b57de61d42803b2c78b6258f7d18fda84ef16488626b7721ad
@@ -26,6 +26,8 @@ jobs:
26
26
  - name: Update gems
27
27
  run: |
28
28
  sudo gem install bundler --force
29
+ ruby -v | grep 2.5 && bundle config set build.debase --with-cflags="-Wno-error=implicit-function-declaration"
30
+ ruby -v | grep 2.5 && bundle config set build.ruby-debug-ide --with-cflags="-Wno-error=implicit-function-declaration"
29
31
  bundle install --jobs 4 --retry 3
30
32
  - name: Run specs
31
33
  run: |
@@ -63,17 +63,20 @@ module RelatonGb
63
63
 
64
64
  def fetch_ref_err(code, year, missed_years)
65
65
  id = year ? "#{code}:#{year}" : code
66
- warn "[relaton-gb] WARNING: no match found on the GB website for #{id}. "\
67
- "The code must be exactly like it is on the website."
68
- warn "[relaton-gb] (There was no match for #{year}, though there were matches "\
69
- "found for #{missed_years.join(', ')}.)" unless missed_years.empty?
70
- if /\d-\d/ =~ code
71
- warn "[relaton-gb] The provided document part may not exist, or the document "\
72
- "may no longer be published in parts."
66
+ warn "[relaton-gb] WARNING: no match found on the GB website "\
67
+ "for #{id}. The code must be exactly like it is on the website."
68
+ unless missed_years.empty?
69
+ warn "[relaton-gb] (There was no match for #{year}, though there "\
70
+ "were matches found for #{missed_years.join(', ')}.)"
71
+ end
72
+ if /\d-\d/.match? code
73
+ warn "[relaton-gb] The provided document part may not exist, or the "\
74
+ "document may no longer be published in parts."
73
75
  else
74
- warn "[relaton-gb] If you wanted to cite all document parts for the reference, "\
75
- "use \"#{code} (all parts)\".\nIf the document is not a standard, "\
76
- "use its document type abbreviation (TS, TR, PAS, Guide)."
76
+ warn "[relaton-gb] If you wanted to cite all document parts for the "\
77
+ "reference, use \"#{code} (all parts)\".\nIf the document is not "\
78
+ "a standard, use its document type abbreviation (TS, TR, PAS, "\
79
+ "Guide)."
77
80
  end
78
81
  nil
79
82
  end
@@ -103,20 +106,22 @@ module RelatonGb
103
106
 
104
107
  # Sort through the results from Isobib, fetching them three at a time,
105
108
  # and return the first result that matches the code,
106
- # matches the year (if provided), and which # has a title (amendments do not).
109
+ # matches the year (if provided), and which # has a title (amendments do
110
+ # not).
107
111
  # Only expects the first page of results to be populated.
108
112
  # Does not match corrigenda etc (e.g. ISO 3166-1:2006/Cor 1:2007)
109
- # If no match, returns any years which caused mismatch, for error reporting
110
- def results_filter(result, year)
113
+ # If no match, returns any years which caused mismatch, for error
114
+ # reporting
115
+ def results_filter(result, year) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength
111
116
  missed_years = []
112
117
  result.each_slice(3) do |s| # ISO website only allows 3 connections
113
- fetch_pages(s, 3).each_with_index do |r, i|
118
+ fetch_pages(s, 3).each do |r|
114
119
  return { ret: r } if !year
115
120
 
116
121
  r.date.select { |d| d.type == "published" }.each do |d|
117
- return { ret: r } if year.to_i == d.on.year
122
+ return { ret: r } if year.to_i == d.on(:year)
118
123
 
119
- missed_years << d.on.year
124
+ missed_years << d.on(:year)
120
125
  end
121
126
  end
122
127
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonGb
4
- VERSION = "1.5.0"
4
+ VERSION = "1.6.pre1"
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", ">= 1.5.0"
40
+ spec.add_dependency "relaton-iso-bib", ">= 1.6.pre"
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: 1.5.0
4
+ version: 1.6.pre1
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-10-09 00:00:00.000000000 Z
11
+ date: 2020-11-12 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: 1.5.0
187
+ version: 1.6.pre
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: 1.5.0
194
+ version: 1.6.pre
195
195
  description: 'RelatonGb: retrieve Chinese GB Standards for bibliographic use using
196
196
  the BibliographicItem model.'
197
197
  email:
@@ -252,9 +252,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
252
252
  version: 2.4.0
253
253
  required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - ">="
255
+ - - ">"
256
256
  - !ruby/object:Gem::Version
257
- version: '0'
257
+ version: 1.3.1
258
258
  requirements: []
259
259
  rubygems_version: 3.0.6
260
260
  signing_key: