ebsco-eds 0.3.19.pre → 1.0.0
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/Rakefile +19 -5
- data/lib/ebsco/eds/info.rb +4 -0
- data/lib/ebsco/eds/options.rb +8 -1
- data/lib/ebsco/eds/record.rb +23 -1
- data/lib/ebsco/eds/results.rb +1 -1
- data/lib/ebsco/eds/session.rb +9 -2
- data/lib/ebsco/eds/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3be68963a219aa4dd86acf2b408b432f2d8e9de7
|
4
|
+
data.tar.gz: 859682c8f1051b9066d8ba2c3c8d3eb907d00327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93a9aa9296c9319dbae1ca448ac70e0377b4b64c00a818cebd3193ddff229d94ed392d772d8123b0e472eeffc7351802a4001401e0132757c6423ed19ab066d5
|
7
|
+
data.tar.gz: d943f5bb8b41edfe53f5ca5aa29c9d766bbfea8486a108918f37a0fdd62cb501ba2fb3834188342794e5b8f876257587d12f45d184eaa2cda7d5b31d607618db
|
data/.gitignore
CHANGED
data/Rakefile
CHANGED
@@ -1,10 +1,24 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/testtask'
|
3
3
|
|
4
4
|
Rake::TestTask.new(:test) do |t|
|
5
|
-
t.libs <<
|
6
|
-
t.libs <<
|
7
|
-
t.test_files = FileList['test
|
5
|
+
t.libs << 'test'
|
6
|
+
t.libs << 'lib'
|
7
|
+
t.test_files = FileList['test/*_test.rb']
|
8
|
+
t.warning = false
|
9
|
+
end
|
10
|
+
|
11
|
+
Rake::TestTask.new(:test_caching) do |t|
|
12
|
+
t.libs << 'test'
|
13
|
+
t.libs << 'lib'
|
14
|
+
t.test_files = FileList['test/caching/*_test.rb']
|
15
|
+
t.warning = false
|
16
|
+
end
|
17
|
+
|
18
|
+
Rake::TestTask.new(:test_session_using_env_vars) do |t|
|
19
|
+
t.libs << 'test'
|
20
|
+
t.libs << 'lib'
|
21
|
+
t.test_files = FileList['test/sessions/*_test.rb']
|
8
22
|
t.warning = false
|
9
23
|
end
|
10
24
|
|
data/lib/ebsco/eds/info.rb
CHANGED
@@ -167,6 +167,10 @@ module EBSCO
|
|
167
167
|
true
|
168
168
|
end
|
169
169
|
|
170
|
+
def default_include_image_quick_view
|
171
|
+
false
|
172
|
+
end
|
173
|
+
|
170
174
|
# ====================================================================================
|
171
175
|
# API SETTINGS
|
172
176
|
# ====================================================================================
|
data/lib/ebsco/eds/options.rb
CHANGED
@@ -534,11 +534,12 @@ module EBSCO
|
|
534
534
|
|
535
535
|
class RetrievalCriteria
|
536
536
|
include JSONable
|
537
|
-
attr_accessor :View, :ResultsPerPage, :PageNumber, :Highlight
|
537
|
+
attr_accessor :View, :ResultsPerPage, :PageNumber, :Highlight, :IncludeImageQuickView
|
538
538
|
def initialize(options = {}, info)
|
539
539
|
|
540
540
|
# defaults
|
541
541
|
@View = info.default_result_list_view
|
542
|
+
@IncludeImageQuickView = info.default_include_image_quick_view
|
542
543
|
@ResultsPerPage = info.default_results_per_page
|
543
544
|
@PageNumber = 1
|
544
545
|
|
@@ -588,6 +589,12 @@ module EBSCO
|
|
588
589
|
@Highlight = 'y' # API bug: if set to 'n' you won't get research starter abstracts!
|
589
590
|
end
|
590
591
|
|
592
|
+
# ====================================================================================
|
593
|
+
# image quick view
|
594
|
+
# ====================================================================================
|
595
|
+
when :include_image_quick_view, 'include_image_quick_view'
|
596
|
+
@IncludeImageQuickView = value ? 'y' : 'n'
|
597
|
+
|
591
598
|
else
|
592
599
|
|
593
600
|
end
|
data/lib/ebsco/eds/record.rb
CHANGED
@@ -71,6 +71,7 @@ module EBSCO
|
|
71
71
|
:eds_html_fulltext_available,
|
72
72
|
:eds_html_fulltext,
|
73
73
|
:eds_images,
|
74
|
+
:eds_quick_view_images,
|
74
75
|
:eds_all_links,
|
75
76
|
:eds_fulltext_links,
|
76
77
|
:eds_non_fulltext_links,
|
@@ -166,6 +167,8 @@ module EBSCO
|
|
166
167
|
.fetch('BibRelationships', {})
|
167
168
|
.fetch('IsPartOfRelationships', {})[0]
|
168
169
|
|
170
|
+
@image_quick_view_items = @record.fetch('ImageQuickViewItems', {})
|
171
|
+
|
169
172
|
# accessors:
|
170
173
|
@eds_result_id = @record['ResultId']
|
171
174
|
@eds_plink = @record['PLink']
|
@@ -229,6 +232,7 @@ module EBSCO
|
|
229
232
|
@eds_html_fulltext_available = html_fulltext_available
|
230
233
|
@eds_html_fulltext = html_fulltext
|
231
234
|
@eds_images = images
|
235
|
+
@eds_quick_view_images = quick_view_images
|
232
236
|
@eds_all_links = all_links
|
233
237
|
# init fulltext available props, reset by fulltext_links method later
|
234
238
|
@eds_pdf_fulltext_available = false
|
@@ -366,6 +370,23 @@ module EBSCO
|
|
366
370
|
returned_images
|
367
371
|
end
|
368
372
|
|
373
|
+
# List of image quick view
|
374
|
+
def quick_view_images
|
375
|
+
returned_images = []
|
376
|
+
images = @record.fetch('ImageQuickViewItems', {})
|
377
|
+
if images.count > 0
|
378
|
+
images.each do |quick_view_item|
|
379
|
+
image_id = quick_view_item['DbId']
|
380
|
+
image_accession = quick_view_item['An']
|
381
|
+
image_type = quick_view_item['Type']
|
382
|
+
# todo: change to https, large/small url?
|
383
|
+
image_url = quick_view_item['Url']
|
384
|
+
returned_images.push({url: image_url, id: image_id, accession_number: image_accession, type: image_type})
|
385
|
+
end
|
386
|
+
end
|
387
|
+
returned_images
|
388
|
+
end
|
389
|
+
|
369
390
|
# related ISBNs
|
370
391
|
def item_related_isbns
|
371
392
|
isbns = get_item_data({label: 'Related ISBNs'})
|
@@ -767,7 +788,8 @@ module EBSCO
|
|
767
788
|
var != :@items &&
|
768
789
|
var != :@bib_entity &&
|
769
790
|
var != :@bib_part &&
|
770
|
-
var != :@bib_relationships
|
791
|
+
var != :@bib_relationships &&
|
792
|
+
var != :@image_quick_view_items
|
771
793
|
hash[var.to_s.sub(/^@/, '')] = instance_variable_get(var)
|
772
794
|
end
|
773
795
|
end
|
data/lib/ebsco/eds/results.rb
CHANGED
@@ -29,7 +29,7 @@ module EBSCO
|
|
29
29
|
|
30
30
|
# Creates search results from the \EDS API search response. It includes information about the results and a list
|
31
31
|
# of Record items.
|
32
|
-
def initialize(search_results, eds_config =
|
32
|
+
def initialize(search_results, eds_config = nil, additional_limiters = {}, options = {})
|
33
33
|
|
34
34
|
@results = search_results
|
35
35
|
@limiters = additional_limiters
|
data/lib/ebsco/eds/session.rb
CHANGED
@@ -265,7 +265,7 @@ module EBSCO
|
|
265
265
|
end
|
266
266
|
@search_results
|
267
267
|
else
|
268
|
-
@search_results = EBSCO::EDS::Results.new(empty_results
|
268
|
+
@search_results = EBSCO::EDS::Results.new(empty_results)
|
269
269
|
end
|
270
270
|
end
|
271
271
|
end
|
@@ -501,6 +501,12 @@ module EBSCO
|
|
501
501
|
add_actions "includerelatedcontent(#{val})"
|
502
502
|
end
|
503
503
|
|
504
|
+
# Not available currently.
|
505
|
+
# TODO: ask for this to be added for consistency with other criteria
|
506
|
+
# def set_include_image_quick_view(val)
|
507
|
+
# add_actions "includeimagequickview(#{val})"
|
508
|
+
# end
|
509
|
+
|
504
510
|
# :category: Setter Methods
|
505
511
|
# Specify to include facets in the results or not. Either 'y' or 'n'.
|
506
512
|
# Returns search Results.
|
@@ -1049,7 +1055,8 @@ module EBSCO
|
|
1049
1055
|
{
|
1050
1056
|
'View'=>'brief',
|
1051
1057
|
'ResultsPerPage'=>20,
|
1052
|
-
'Highlight'=>'y'
|
1058
|
+
'Highlight'=>'y',
|
1059
|
+
'IncludeImageQuickView'=>'n'
|
1053
1060
|
},
|
1054
1061
|
'SearchCriteriaWithActions'=>
|
1055
1062
|
{
|
data/lib/ebsco/eds/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ebsco-eds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill McKinney
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -407,9 +407,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
407
407
|
version: 1.9.3
|
408
408
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
409
409
|
requirements:
|
410
|
-
- - "
|
410
|
+
- - ">="
|
411
411
|
- !ruby/object:Gem::Version
|
412
|
-
version:
|
412
|
+
version: '0'
|
413
413
|
requirements: []
|
414
414
|
rubyforge_project:
|
415
415
|
rubygems_version: 2.6.8
|