ebsco-eds 1.1.0 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +76 -4
- data/README.md +1 -1
- data/ebsco-eds.gemspec +7 -7
- data/lib/ebsco/eds/error.rb +3 -0
- data/lib/ebsco/eds/record.rb +16 -2
- data/lib/ebsco/eds/results.rb +2 -0
- data/lib/ebsco/eds/session.rb +2 -2
- data/lib/ebsco/eds/version.rb +1 -1
- metadata +46 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f533a29b42465203037e110bc29e55e3b354167256dae976f529a6ec418b1e2
|
4
|
+
data.tar.gz: f023e20630cc99b1938399dae75a0d3e361ded5454c20ece21470e82f3c3a8d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff6502a5c7b96620b7b30419d8513ae4a9c143e5451e9e99d79c6a8a94f4dc3de2723c6bcdb08276d969788979a7b258bae6527757292a8ffcd8eaaca240dc38
|
7
|
+
data.tar.gz: 83967b0d453b97e95e75da4693b13c7726a6cfd7ede6fd29cd7d541236fd882ee4eeac2736b01a7a3248b2c2cb0f790790e1bb4c4dfdaf8e5a2e1b7da3a56184
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,100 +1,172 @@
|
|
1
1
|
# Changelog
|
2
|
+
|
2
3
|
All notable changes to this project will be documented in this file.
|
3
4
|
|
4
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
-
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [1.1.1] - 2021-03-05
|
6
9
|
|
7
|
-
## [1.0.8] - 2019-08-12
|
8
10
|
### Fixed
|
11
|
+
|
12
|
+
- Some tests had incorrect VCR cassettes that were erroneously causing our build to fail.
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- Loosened various dependencies, including on activesupport. Activesupport now can use either version 5 or 6. Many thanks to @sandbergja for help on that.
|
17
|
+
- Added an attribute read option for smarttext_failover on EBSCO::EDS::Results. If this is true, it's an indication that the search results come from a failed-over smarttext search; if it's false, no smarttext failover occurred.
|
18
|
+
|
19
|
+
## [1.1.0] - 2020-09-04
|
20
|
+
|
21
|
+
### Added
|
22
|
+
|
23
|
+
- Added an option to the session intializer to accept a smarttext_failover parameter. Setting this to true will instruct the gem to issue a SECOND search with mode=smarttext if the original search had zero results. This mirrors behavior available in the native EDS interface.
|
24
|
+
|
25
|
+
## [1.0.9] - 2019-08-12
|
26
|
+
|
27
|
+
### Fixed
|
28
|
+
|
9
29
|
- Throws error when query fails with a 200 status code and html error message (query = `the meaning of life or 4=2`), see #90.
|
10
30
|
- Raises a specific "record not found" error instead of a generic "bad request" error when a record cannot be retrieved, see #88.
|
11
31
|
|
32
|
+
## [1.0.8] - 2019-08-12
|
33
|
+
|
34
|
+
### Fixed
|
35
|
+
|
36
|
+
- Access issues for EBSCO contributors fixed.
|
37
|
+
|
12
38
|
## [1.0.7] - 2018-12-05
|
39
|
+
|
13
40
|
### Changed
|
41
|
+
|
14
42
|
- logger dependency removed since it's been part of the standard library.
|
15
43
|
|
16
44
|
## [1.0.6] - 2018-11-14
|
45
|
+
|
17
46
|
### Fixed
|
47
|
+
|
18
48
|
- Fixed a bug where the cached auth key isn't deleted if it expires before its cache expiration. This should only occur in rare cases where the auth token cache expiration exceeds 30 minutes.
|
49
|
+
|
19
50
|
### Added
|
51
|
+
|
20
52
|
- Cache expiration is configurable for individual EDS API calls (time unit = seconds).
|
53
|
+
|
21
54
|
### Changed
|
55
|
+
|
22
56
|
- Default cache expiration for auth keys is now 25 minutes instead of 30 to make sure they are always refreshed before their 30 minute expiration. If an expiration is configured longer than 25 minutes, it is reset to 25 minutes automatically.
|
23
57
|
|
24
58
|
## [1.0.5] - 2018-11-02
|
59
|
+
|
25
60
|
### Fixed
|
26
|
-
|
61
|
+
|
62
|
+
- Fixed a bug where fulltext html becomes nil after sanitizing. [#85](https://github.com/ebsco/edsapi-ruby/issues/85)
|
27
63
|
- Fixed a bug where the url protocol is missing from fulltext custom links. [#86](https://github.com/ebsco/edsapi-ruby/issues/86)
|
28
64
|
|
29
65
|
## [1.0.4] - 2018-10-29
|
66
|
+
|
30
67
|
### Fixed
|
31
|
-
|
68
|
+
|
69
|
+
- List retrieval returns a repeating list of just the first record.
|
32
70
|
- List retrieval fails to increment the EDS result id.
|
33
71
|
|
34
72
|
## [1.0.3] - 2018-10-18
|
73
|
+
|
35
74
|
### Changed
|
75
|
+
|
36
76
|
- Citation style and export links can now be removed entirely or replaced by specifying regular expressions in several configuration options that can include ruby erb variable expressions for an item's `dbid` and `an`. This was added to address situations where customer proxy urls are returned. See: [Citation link replacement](https://github.com/ebsco/edsapi-ruby/wiki/Citation-link-replacement)
|
37
77
|
|
38
78
|
## [1.0.2] - 2018-10-15
|
79
|
+
|
39
80
|
### Added
|
81
|
+
|
40
82
|
- EBSCOhost links are removed from citation styles and exports by default
|
41
83
|
|
42
84
|
## [1.0.1] - 2018-10-10
|
85
|
+
|
43
86
|
### Added
|
87
|
+
|
44
88
|
- Citation styles/exports are added to Records
|
45
89
|
- Retrieve citation styles/exports for a Record ID or list of Record IDs
|
46
90
|
- Retrieve a list of available citation styles/exports from Info
|
47
91
|
- Citation styles/exports available in guest mode
|
92
|
+
|
48
93
|
### Fixed
|
94
|
+
|
49
95
|
- Double-unescapes data with an ephtml section (sul-dlss/SearchWorks #1504)
|
50
96
|
- Adds searchlinks to subject items when they don't exist #80 (sul-dlss/SearchWorks #1791)
|
97
|
+
|
51
98
|
### Changed
|
99
|
+
|
52
100
|
- Updates test cassettes with new citation styles/exports API calls
|
53
101
|
|
54
102
|
## [1.0.0] - 2018-03-05
|
103
|
+
|
55
104
|
### Changed
|
105
|
+
|
56
106
|
- Increments version to reflect production ready status
|
57
107
|
|
58
108
|
## [0.3.19.pre] - 2018-03-05
|
109
|
+
|
59
110
|
### Added
|
111
|
+
|
60
112
|
- Optionally (default=off) include quick view images with Records
|
113
|
+
|
61
114
|
### Changed
|
115
|
+
|
62
116
|
- Reorganizes VCR tests
|
63
117
|
|
64
118
|
## [0.3.18.pre] - 2017-10-10
|
119
|
+
|
65
120
|
### Fixed
|
121
|
+
|
66
122
|
- Fixes session config bug #84
|
67
123
|
|
68
124
|
## [0.3.17.pre] - 2017-09-27
|
125
|
+
|
69
126
|
### Changed
|
127
|
+
|
70
128
|
- Optionally (default=off) titleize facets via `titleize_facets` in config
|
71
129
|
|
72
130
|
## [0.3.16.pre] - 2017-09-20
|
131
|
+
|
73
132
|
### Added
|
133
|
+
|
74
134
|
- Titleize facets
|
75
135
|
- Autocorrect feature
|
76
136
|
|
77
137
|
## [0.3.15.pre] - 2017-09-18
|
138
|
+
|
78
139
|
### Added
|
140
|
+
|
79
141
|
- Optionally (default=off) converts all searchLink field codes to DE via `all_subjects_search_links` in config
|
80
142
|
- Optionally (default=off) decodes/sanitizes html in item data and fulltext html via `decode_sanitize_html` in config
|
81
143
|
|
82
144
|
## [0.3.14.pre] - 2017-09-14
|
145
|
+
|
83
146
|
### Fixed
|
147
|
+
|
84
148
|
- Fixes 250+ pagination issues with SourceType and ContentProvider facets
|
85
149
|
|
86
150
|
## [0.3.13.pre] - 2017-09-13
|
151
|
+
|
87
152
|
### Fixed
|
153
|
+
|
88
154
|
- Includes additional Subject and Geographic Subject metadata
|
89
155
|
|
90
156
|
## [0.3.12.pre] - 2017-09-11
|
157
|
+
|
91
158
|
### Fixed
|
159
|
+
|
92
160
|
- Fixes some 250+ pagination issues
|
161
|
+
|
93
162
|
### Changed
|
163
|
+
|
94
164
|
- Updates tests
|
95
165
|
|
96
166
|
## [0.3.11.pre] - 2017-09-06
|
167
|
+
|
97
168
|
### Added
|
169
|
+
|
98
170
|
- Adds KW (keywords) and SH (subject heading) to solr search fields
|
99
171
|
|
100
172
|
[1.0.8]: https://github.com/ebsco/edsapi-ruby/compare/1.0.7...1.0.8
|
data/README.md
CHANGED
data/ebsco-eds.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'ebsco/eds/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'ebsco-eds'
|
8
8
|
spec.version = EBSCO::EDS::VERSION
|
9
|
-
spec.authors = ['
|
10
|
-
spec.email = ['
|
9
|
+
spec.authors = ['Mike Abrahamson','Ellie Collier','Carolyn Clini']
|
10
|
+
spec.email = ['mabrahamson@ebsco.com','ecollier@ebsco.com', 'cclini@ebsco.com']
|
11
11
|
spec.summary = 'Summary: EBSCO EDS API'
|
12
12
|
spec.description = 'Description: EBSCO EDS API'
|
13
13
|
spec.homepage = 'https://github.com/ebsco/edsapi-ruby'
|
@@ -37,14 +37,13 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_dependency 'dotenv', '~> 2.2'
|
38
38
|
spec.add_dependency 'climate_control', '~> 0'
|
39
39
|
spec.add_dependency 'require_all', '~> 2.0'
|
40
|
-
spec.add_dependency 'bibtex-ruby', '
|
40
|
+
spec.add_dependency 'bibtex-ruby', '>= 5.1.0', '< 7.0'
|
41
41
|
spec.add_dependency 'citeproc', '>= 1.0.4', '< 2.0'
|
42
|
-
spec.add_dependency 'csl', '
|
42
|
+
spec.add_dependency 'csl', '>= 1.4.0', '< 1.6'
|
43
43
|
spec.add_dependency 'citeproc-ruby', '~> 1.0', '>= 1.0.2'
|
44
44
|
spec.add_dependency 'csl-styles', '~> 1.0', '>= 1.0.1.5'
|
45
|
-
spec.add_dependency 'activesupport', '
|
46
|
-
spec.add_dependency 'net-http-persistent', '
|
47
|
-
spec.add_dependency 'sanitize', '~> 5.0'
|
45
|
+
spec.add_dependency 'activesupport', '>= 5.2'
|
46
|
+
spec.add_dependency 'net-http-persistent', '>= 3.1', '< 5'
|
48
47
|
spec.add_dependency 'public_suffix', '~>4.0'
|
49
48
|
|
50
49
|
spec.add_development_dependency 'bundler'
|
@@ -55,5 +54,6 @@ Gem::Specification.new do |spec|
|
|
55
54
|
spec.add_development_dependency 'vcr', '~> 5.0', '>= 5.0.0'
|
56
55
|
spec.add_development_dependency 'minitest-vcr', '~> 1.4', '>= 1.4.0'
|
57
56
|
spec.add_development_dependency 'webmock', '~> 3.6'
|
57
|
+
spec.add_development_dependency 'sanitize', '~> 5.0'
|
58
58
|
|
59
59
|
end
|
data/lib/ebsco/eds/error.rb
CHANGED
data/lib/ebsco/eds/record.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
require 'json'
|
3
3
|
require 'cgi'
|
4
|
-
require 'sanitize'
|
5
4
|
|
6
5
|
module EBSCO
|
7
6
|
|
@@ -152,6 +151,9 @@ module EBSCO
|
|
152
151
|
@decode_sanitize_html = ENV['EDS_DECODE_SANITIZE_HTML']
|
153
152
|
end
|
154
153
|
|
154
|
+
require_sanitize if @decode_sanitize_html
|
155
|
+
|
156
|
+
|
155
157
|
if results_record.key? 'Record'
|
156
158
|
@record = results_record['Record'] # single record returned by retrieve api
|
157
159
|
else
|
@@ -997,7 +999,13 @@ module EBSCO
|
|
997
999
|
# add searchlinks when they don't exist
|
998
1000
|
def add_subject_searchlinks(data)
|
999
1001
|
subjects = data
|
1000
|
-
|
1002
|
+
if data.include? '<link '
|
1003
|
+
subjects = bib_subjects
|
1004
|
+
subjects = subjects.map do |su|
|
1005
|
+
'<searchLink fieldCode="DE" term="%22' + su + '%22">' + su + '</searchLink>'
|
1006
|
+
end.join('<br />')
|
1007
|
+
end
|
1008
|
+
unless subjects.include? 'searchLink'
|
1001
1009
|
subjects = subjects.split('<br />').map do |su|
|
1002
1010
|
'<searchLink fieldCode="DE" term="%22' + su + '%22">' + su + '</searchLink>'
|
1003
1011
|
end.join('<br />')
|
@@ -1005,6 +1013,12 @@ module EBSCO
|
|
1005
1013
|
subjects
|
1006
1014
|
end
|
1007
1015
|
|
1016
|
+
def require_sanitize
|
1017
|
+
require 'sanitize'
|
1018
|
+
rescue Gem::LoadError, LoadError
|
1019
|
+
raise EBSCO::EDS::MissingDependency.new 'Sanitize is turned on, but the sanitize gem is not loaded'
|
1020
|
+
end
|
1021
|
+
|
1008
1022
|
end # Class Record
|
1009
1023
|
end # Module EDS
|
1010
1024
|
end # Module EBSCO
|
data/lib/ebsco/eds/results.rb
CHANGED
@@ -17,6 +17,8 @@ module EBSCO
|
|
17
17
|
attr_accessor :records
|
18
18
|
# Array of EBSCO::EDS::Record Research Starters
|
19
19
|
attr_reader :research_starters
|
20
|
+
# Bool
|
21
|
+
attr_reader :smarttext_failover
|
20
22
|
# Array of EBSCO::EDS::Record Exact Publication Matches
|
21
23
|
attr_reader :publication_match
|
22
24
|
|
data/lib/ebsco/eds/session.rb
CHANGED
@@ -326,11 +326,11 @@ module EBSCO
|
|
326
326
|
payload = { DbId: dbid, An: an, HighlightTerms: highlight, EbookPreferredFormat: ebook }
|
327
327
|
retrieve_response = do_request(:post, path: @config[:retrieve_url], payload: payload)
|
328
328
|
record = EBSCO::EDS::Record.new(retrieve_response, @config)
|
329
|
-
record_citation_exports = get_citation_exports(
|
329
|
+
record_citation_exports = get_citation_exports(dbid: dbid, an: an, format: @config[:citation_exports_formats])
|
330
330
|
unless record_citation_exports.nil?
|
331
331
|
record.set_citation_exports(record_citation_exports)
|
332
332
|
end
|
333
|
-
record_citation_styles = get_citation_styles(
|
333
|
+
record_citation_styles = get_citation_styles(dbid: dbid, an: an, format: @config[:citation_styles_formats])
|
334
334
|
unless record_citation_styles.nil?
|
335
335
|
record.set_citation_styles(record_citation_styles)
|
336
336
|
end
|
data/lib/ebsco/eds/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ebsco-eds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
-
|
7
|
+
- Mike Abrahamson
|
8
|
+
- Ellie Collier
|
9
|
+
- Carolyn Clini
|
9
10
|
autorequire:
|
10
11
|
bindir: exe
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: faraday
|
@@ -102,9 +103,9 @@ dependencies:
|
|
102
103
|
- - ">="
|
103
104
|
- !ruby/object:Gem::Version
|
104
105
|
version: 5.1.0
|
105
|
-
- - "
|
106
|
+
- - "<"
|
106
107
|
- !ruby/object:Gem::Version
|
107
|
-
version: '
|
108
|
+
version: '7.0'
|
108
109
|
type: :runtime
|
109
110
|
prerelease: false
|
110
111
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -112,9 +113,9 @@ dependencies:
|
|
112
113
|
- - ">="
|
113
114
|
- !ruby/object:Gem::Version
|
114
115
|
version: 5.1.0
|
115
|
-
- - "
|
116
|
+
- - "<"
|
116
117
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
118
|
+
version: '7.0'
|
118
119
|
- !ruby/object:Gem::Dependency
|
119
120
|
name: citeproc
|
120
121
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,16 +140,22 @@ dependencies:
|
|
139
140
|
name: csl
|
140
141
|
requirement: !ruby/object:Gem::Requirement
|
141
142
|
requirements:
|
142
|
-
- - "
|
143
|
+
- - ">="
|
143
144
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
145
|
+
version: 1.4.0
|
146
|
+
- - "<"
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '1.6'
|
145
149
|
type: :runtime
|
146
150
|
prerelease: false
|
147
151
|
version_requirements: !ruby/object:Gem::Requirement
|
148
152
|
requirements:
|
149
|
-
- - "
|
153
|
+
- - ">="
|
150
154
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
155
|
+
version: 1.4.0
|
156
|
+
- - "<"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '1.6'
|
152
159
|
- !ruby/object:Gem::Dependency
|
153
160
|
name: citeproc-ruby
|
154
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,44 +200,36 @@ dependencies:
|
|
193
200
|
name: activesupport
|
194
201
|
requirement: !ruby/object:Gem::Requirement
|
195
202
|
requirements:
|
196
|
-
- - "
|
203
|
+
- - ">="
|
197
204
|
- !ruby/object:Gem::Version
|
198
205
|
version: '5.2'
|
199
206
|
type: :runtime
|
200
207
|
prerelease: false
|
201
208
|
version_requirements: !ruby/object:Gem::Requirement
|
202
209
|
requirements:
|
203
|
-
- - "
|
210
|
+
- - ">="
|
204
211
|
- !ruby/object:Gem::Version
|
205
212
|
version: '5.2'
|
206
213
|
- !ruby/object:Gem::Dependency
|
207
214
|
name: net-http-persistent
|
208
215
|
requirement: !ruby/object:Gem::Requirement
|
209
216
|
requirements:
|
210
|
-
- - "
|
217
|
+
- - ">="
|
211
218
|
- !ruby/object:Gem::Version
|
212
219
|
version: '3.1'
|
220
|
+
- - "<"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '5'
|
213
223
|
type: :runtime
|
214
224
|
prerelease: false
|
215
225
|
version_requirements: !ruby/object:Gem::Requirement
|
216
226
|
requirements:
|
217
|
-
- - "
|
227
|
+
- - ">="
|
218
228
|
- !ruby/object:Gem::Version
|
219
229
|
version: '3.1'
|
220
|
-
-
|
221
|
-
name: sanitize
|
222
|
-
requirement: !ruby/object:Gem::Requirement
|
223
|
-
requirements:
|
224
|
-
- - "~>"
|
225
|
-
- !ruby/object:Gem::Version
|
226
|
-
version: '5.0'
|
227
|
-
type: :runtime
|
228
|
-
prerelease: false
|
229
|
-
version_requirements: !ruby/object:Gem::Requirement
|
230
|
-
requirements:
|
231
|
-
- - "~>"
|
230
|
+
- - "<"
|
232
231
|
- !ruby/object:Gem::Version
|
233
|
-
version: '5
|
232
|
+
version: '5'
|
234
233
|
- !ruby/object:Gem::Dependency
|
235
234
|
name: public_suffix
|
236
235
|
requirement: !ruby/object:Gem::Requirement
|
@@ -369,9 +368,25 @@ dependencies:
|
|
369
368
|
- - "~>"
|
370
369
|
- !ruby/object:Gem::Version
|
371
370
|
version: '3.6'
|
371
|
+
- !ruby/object:Gem::Dependency
|
372
|
+
name: sanitize
|
373
|
+
requirement: !ruby/object:Gem::Requirement
|
374
|
+
requirements:
|
375
|
+
- - "~>"
|
376
|
+
- !ruby/object:Gem::Version
|
377
|
+
version: '5.0'
|
378
|
+
type: :development
|
379
|
+
prerelease: false
|
380
|
+
version_requirements: !ruby/object:Gem::Requirement
|
381
|
+
requirements:
|
382
|
+
- - "~>"
|
383
|
+
- !ruby/object:Gem::Version
|
384
|
+
version: '5.0'
|
372
385
|
description: 'Description: EBSCO EDS API'
|
373
386
|
email:
|
374
|
-
-
|
387
|
+
- mabrahamson@ebsco.com
|
388
|
+
- ecollier@ebsco.com
|
389
|
+
- cclini@ebsco.com
|
375
390
|
executables: []
|
376
391
|
extensions: []
|
377
392
|
extra_rdoc_files: []
|
@@ -425,7 +440,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
425
440
|
- !ruby/object:Gem::Version
|
426
441
|
version: '0'
|
427
442
|
requirements: []
|
428
|
-
rubygems_version: 3.0.
|
443
|
+
rubygems_version: 3.0.3
|
429
444
|
signing_key:
|
430
445
|
specification_version: 4
|
431
446
|
summary: 'Summary: EBSCO EDS API'
|