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 +4 -4
- data/.github/workflows/macos.yml +2 -0
- data/lib/relaton_gb/gb_bibliography.rb +21 -16
- data/lib/relaton_gb/version.rb +1 -1
- data/relaton_gb.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a83e7ce3f7e4fd9dbb2bba842b4a841494de668f141efeba0bc44d61f1b0d83a
|
4
|
+
data.tar.gz: f1f3a05d9a7dedb8aad224ee85f648d68b490e877b31d1acd5b044f07fd8eacf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f90401ee88757dd7c670e6b79df9956292ae8f624ad697ef5e16e2412d300575bc050eb1612375ef89bcf74432191b8122305806063f5057fdc6c75e648786e8
|
7
|
+
data.tar.gz: f20cef8f620fb28b2aff44b8b414d68411a9135d7c1495e1684bf29441a393976e07c054b752e3b57de61d42803b2c78b6258f7d18fda84ef16488626b7721ad
|
data/.github/workflows/macos.yml
CHANGED
@@ -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
|
67
|
-
"The code must be exactly like it is on the website."
|
68
|
-
|
69
|
-
"
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
75
|
-
"use \"#{code} (all parts)\".\nIf the document is not
|
76
|
-
"use its document type abbreviation (TS, TR, PAS,
|
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
|
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
|
110
|
-
|
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).
|
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
|
122
|
+
return { ret: r } if year.to_i == d.on(:year)
|
118
123
|
|
119
|
-
missed_years << d.on
|
124
|
+
missed_years << d.on(:year)
|
120
125
|
end
|
121
126
|
end
|
122
127
|
end
|
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: 1.
|
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-
|
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.
|
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.
|
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:
|
257
|
+
version: 1.3.1
|
258
258
|
requirements: []
|
259
259
|
rubygems_version: 3.0.6
|
260
260
|
signing_key:
|