ebsco-eds 0.3.12.pre → 0.3.13.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ebsco/eds/options.rb +4 -3
- data/lib/ebsco/eds/record.rb +48 -64
- data/lib/ebsco/eds/session.rb +0 -2
- data/lib/ebsco/eds/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9e860b62850669e12c05428b96cf60813ac78c8
|
|
4
|
+
data.tar.gz: 4554be6442500a21b804a15a2deebfbe33813344
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8343edbc0a89f8f06a1a7e39ef0dfbc5da128fd2f18f113bde79e9b72f2a8beeca2697145cacd475a3fe59476c93b50a9bc4a705e21ec765af39aef04ba4a1a3
|
|
7
|
+
data.tar.gz: cca4e95649cca637ea8cdbdc00394c07bb016d50005d0a1420f820261a12b9004dc240bc119551188dfeda5551f0e9c647df765ef5f2ebc2443b650fa6339186
|
data/lib/ebsco/eds/options.rb
CHANGED
|
@@ -86,6 +86,7 @@ module EBSCO
|
|
|
86
86
|
# end
|
|
87
87
|
|
|
88
88
|
|
|
89
|
+
# Caution: experimental, not ready for production
|
|
89
90
|
# query-1=AND,volcano&sort=relevance&includefacets=y&searchmode=all&autosuggest=n&view=brief&resultsperpage=20&pagenumber=1&highlight=y
|
|
90
91
|
def to_query_string
|
|
91
92
|
qs = ''
|
|
@@ -117,7 +118,7 @@ module EBSCO
|
|
|
117
118
|
|
|
118
119
|
# limiters
|
|
119
120
|
unless @SearchCriteria.Limiters.nil?
|
|
120
|
-
qs << '&limiter=' + @SearchCriteria.Limiters
|
|
121
|
+
qs << '&limiter=' + @SearchCriteria.Limiters.join(',')
|
|
121
122
|
end
|
|
122
123
|
|
|
123
124
|
# expanders
|
|
@@ -125,7 +126,7 @@ module EBSCO
|
|
|
125
126
|
|
|
126
127
|
# facet filters
|
|
127
128
|
unless @SearchCriteria.FacetFilters.nil?
|
|
128
|
-
qs << '&facetfilter=1,' + @SearchCriteria.FacetFilters
|
|
129
|
+
qs << '&facetfilter=1,' + @SearchCriteria.FacetFilters.join(',')
|
|
129
130
|
end
|
|
130
131
|
|
|
131
132
|
# related content
|
|
@@ -144,7 +145,7 @@ module EBSCO
|
|
|
144
145
|
qs << '&pagenumber=' + @RetrievalCriteria.PageNumber.to_s
|
|
145
146
|
end
|
|
146
147
|
unless @RetrievalCriteria.Highlight.nil?
|
|
147
|
-
qs << '&highlight=' + @RetrievalCriteria.Highlight
|
|
148
|
+
qs << '&highlight=' + @RetrievalCriteria.Highlight.to_s
|
|
148
149
|
end
|
|
149
150
|
|
|
150
151
|
unless @Actions.nil?
|
data/lib/ebsco/eds/record.rb
CHANGED
|
@@ -160,49 +160,54 @@ module EBSCO
|
|
|
160
160
|
@id = @eds_database_id + '__' + @eds_accession_number
|
|
161
161
|
@eds_title = title
|
|
162
162
|
@eds_source_title = source_title
|
|
163
|
-
@eds_composed_title =
|
|
164
|
-
@eds_other_titles =
|
|
165
|
-
@eds_abstract =
|
|
163
|
+
@eds_composed_title = get_item_data({name: 'TitleSource'})
|
|
164
|
+
@eds_other_titles = get_item_data({name: 'TitleAlt'})
|
|
165
|
+
@eds_abstract = get_item_data({name: 'Abstract'})
|
|
166
166
|
@eds_authors = bib_authors_list
|
|
167
|
-
@eds_authors_composed =
|
|
168
|
-
@eds_author_affiliations =
|
|
169
|
-
@eds_subjects =
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
@
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
@
|
|
177
|
-
@
|
|
178
|
-
@
|
|
179
|
-
@
|
|
167
|
+
@eds_authors_composed = get_item_data({name: 'Author'})
|
|
168
|
+
@eds_author_affiliations = get_item_data({name: 'AffiliationAuthor'})
|
|
169
|
+
@eds_subjects =
|
|
170
|
+
get_item_data({name: 'Subject', label: 'Subject Terms', group: 'Su'}) ||
|
|
171
|
+
get_item_data({name: 'Subject', label: 'Subject Indexing', group: 'Su'}) ||
|
|
172
|
+
bib_subjects
|
|
173
|
+
@eds_subjects_geographic =
|
|
174
|
+
get_item_data({name: 'SubjectGeographic', label: 'Geographic Terms', group: 'Su'}) ||
|
|
175
|
+
get_item_data({name: 'Subject', label: 'Subject Geographic', group: 'Su'})
|
|
176
|
+
@eds_subjects_person = get_item_data({name: 'SubjectPerson'})
|
|
177
|
+
@eds_subjects_company = get_item_data({name: 'SubjectCompany'})
|
|
178
|
+
@eds_subjects_bisac = get_item_data({name: 'SubjectBISAC'})
|
|
179
|
+
@eds_subjects_mesh = get_item_data({name: 'SubjectMESH'})
|
|
180
|
+
@eds_subjects_genre = get_item_data({name: 'SubjectGenre'})
|
|
181
|
+
@eds_author_supplied_keywords = get_item_data({name: 'Keyword'})
|
|
182
|
+
@eds_notes = get_item_data({name: 'Note'})
|
|
183
|
+
@eds_subset = get_item_data({name: 'Subset'})
|
|
184
|
+
@eds_languages = get_item_data({name: 'Language'}) || bib_languages
|
|
180
185
|
@eds_page_count = bib_page_count
|
|
181
186
|
@eds_page_start = bib_page_start
|
|
182
|
-
@eds_physical_description =
|
|
183
|
-
@eds_publication_type = @record['Header']['PubType'] ||
|
|
187
|
+
@eds_physical_description = get_item_data({name: 'PhysDesc'})
|
|
188
|
+
@eds_publication_type = @record['Header']['PubType'] || get_item_data({name: 'TypePub'})
|
|
184
189
|
@eds_publication_type_id = @record['Header']['PubTypeId']
|
|
185
|
-
@eds_publication_date = bib_publication_date ||
|
|
186
|
-
@eds_publication_year = bib_publication_year ||
|
|
187
|
-
@eds_publication_info =
|
|
188
|
-
@eds_publication_status =
|
|
189
|
-
@eds_publisher =
|
|
190
|
-
@eds_document_type =
|
|
191
|
-
@eds_document_doi =
|
|
192
|
-
@eds_document_oclc =
|
|
193
|
-
@eds_issn_print =
|
|
190
|
+
@eds_publication_date = bib_publication_date || get_item_data({name: 'DatePub'})
|
|
191
|
+
@eds_publication_year = bib_publication_year || get_item_data({name: 'DatePub'})
|
|
192
|
+
@eds_publication_info = get_item_data({label: 'Publication Information'})
|
|
193
|
+
@eds_publication_status = get_item_data({label: 'Publication Status'})
|
|
194
|
+
@eds_publisher = get_item_data({name: 'Publisher'})
|
|
195
|
+
@eds_document_type = get_item_data({name: 'TypeDocument'})
|
|
196
|
+
@eds_document_doi = get_item_data({name: 'DOI'}) || bib_doi
|
|
197
|
+
@eds_document_oclc = get_item_data({label: 'OCLC'})
|
|
198
|
+
@eds_issn_print = get_item_data({name: 'ISSN'}) || bib_issn_print
|
|
194
199
|
@eds_issns = bib_issns
|
|
195
200
|
@eds_isbn_print = bib_isbn_print
|
|
196
201
|
@eds_isbns_related = item_related_isbns
|
|
197
202
|
@eds_isbn_electronic = bib_isbn_electronic
|
|
198
203
|
@eds_isbns = bib_isbns || item_related_isbns
|
|
199
|
-
@eds_series =
|
|
204
|
+
@eds_series = get_item_data({name: 'SeriesInfo'})
|
|
200
205
|
@eds_volume = bib_volume
|
|
201
206
|
@eds_issue = bib_issue
|
|
202
207
|
@eds_covers = images
|
|
203
208
|
@eds_cover_thumb_url = cover_thumb_url
|
|
204
209
|
@eds_cover_medium_url = cover_medium_url
|
|
205
|
-
@eds_fulltext_word_count =
|
|
210
|
+
@eds_fulltext_word_count = get_item_data({name: 'FullTextWordCount'}).to_i
|
|
206
211
|
@eds_html_fulltext_available = html_fulltext_available
|
|
207
212
|
@eds_html_fulltext = html_fulltext
|
|
208
213
|
@eds_images = images
|
|
@@ -213,12 +218,12 @@ module EBSCO
|
|
|
213
218
|
@eds_ebook_epub_fulltext_available = false
|
|
214
219
|
@eds_fulltext_links = fulltext_links
|
|
215
220
|
@eds_non_fulltext_links = non_fulltext_links
|
|
216
|
-
@eds_code_naics =
|
|
217
|
-
@eds_abstract_supplied_copyright =
|
|
218
|
-
@eds_descriptors =
|
|
221
|
+
@eds_code_naics = get_item_data({name: 'CodeNAICS'})
|
|
222
|
+
@eds_abstract_supplied_copyright = get_item_data({name: 'AbstractSuppliedCopyright'})
|
|
223
|
+
@eds_descriptors = get_item_data({label: 'Descriptors'})
|
|
219
224
|
@eds_publication_id = @record['Header']['PublicationId']
|
|
220
225
|
@eds_publication_is_searchable = @record['Header']['IsSearchable']
|
|
221
|
-
@eds_publication_scope_note =
|
|
226
|
+
@eds_publication_scope_note = get_item_data({name: 'NoteScope'})
|
|
222
227
|
|
|
223
228
|
# add item metadata
|
|
224
229
|
@items.each do |item|
|
|
@@ -245,8 +250,7 @@ module EBSCO
|
|
|
245
250
|
|
|
246
251
|
# The title.
|
|
247
252
|
def title
|
|
248
|
-
|
|
249
|
-
_retval = bib_title || get_item_data_by_name('Title')
|
|
253
|
+
_retval = bib_title || get_item_data({name: 'Title'})
|
|
250
254
|
# TODO: make this configurable
|
|
251
255
|
if _retval.nil?
|
|
252
256
|
_retval = 'This title is unavailable for guests, please login to see more information.'
|
|
@@ -256,7 +260,7 @@ module EBSCO
|
|
|
256
260
|
|
|
257
261
|
# The source title (example: 'Salem Press Encyclopedia')
|
|
258
262
|
def source_title
|
|
259
|
-
_retval = bib_source_title ||
|
|
263
|
+
_retval = bib_source_title || get_item_data({name: 'TitleSource'})
|
|
260
264
|
_reval = nil? if _retval == title # suppress if it's identical to title
|
|
261
265
|
_retval.nil?? nil : _retval
|
|
262
266
|
end
|
|
@@ -313,7 +317,7 @@ module EBSCO
|
|
|
313
317
|
|
|
314
318
|
# related ISBNs
|
|
315
319
|
def item_related_isbns
|
|
316
|
-
isbns =
|
|
320
|
+
isbns = get_item_data({label: 'Related ISBNs'})
|
|
317
321
|
if isbns
|
|
318
322
|
isbns.split(' ').map!{|item| item.gsub(/\.$/, '')}
|
|
319
323
|
else
|
|
@@ -742,33 +746,6 @@ module EBSCO
|
|
|
742
746
|
# ITEM DATA HELPERS
|
|
743
747
|
# ====================================================================================
|
|
744
748
|
|
|
745
|
-
# look up by 'Name' and return 'Data'
|
|
746
|
-
def get_item_data_by_name(name)
|
|
747
|
-
if @items.empty?
|
|
748
|
-
nil
|
|
749
|
-
else
|
|
750
|
-
_item_property = @items.find{|item| item['Name'] == name}
|
|
751
|
-
if _item_property.nil?
|
|
752
|
-
nil
|
|
753
|
-
else
|
|
754
|
-
sanitize_data(_item_property['Data'])
|
|
755
|
-
end
|
|
756
|
-
end
|
|
757
|
-
end
|
|
758
|
-
|
|
759
|
-
# look up by 'Label' and return 'Data'
|
|
760
|
-
def get_item_data_by_label(label)
|
|
761
|
-
if @items.empty?
|
|
762
|
-
nil
|
|
763
|
-
else
|
|
764
|
-
_item_property = @items.find{|item| item['Label'] == label}
|
|
765
|
-
if _item_property.nil?
|
|
766
|
-
nil
|
|
767
|
-
else
|
|
768
|
-
sanitize_data(_item_property['Data'])
|
|
769
|
-
end
|
|
770
|
-
end
|
|
771
|
-
end
|
|
772
749
|
|
|
773
750
|
def get_item_data(options)
|
|
774
751
|
|
|
@@ -780,9 +757,11 @@ module EBSCO
|
|
|
780
757
|
|
|
781
758
|
@items.each do |item|
|
|
782
759
|
if item['Name'] == options[:name] && item['Label'] == options[:label] && item['Group'] == options[:group]
|
|
760
|
+
# puts 'FOUND ALL 3: ' + item.inspect
|
|
783
761
|
return sanitize_data(item['Data'])
|
|
784
762
|
end
|
|
785
763
|
end
|
|
764
|
+
return nil
|
|
786
765
|
|
|
787
766
|
elsif options[:name] and options[:label]
|
|
788
767
|
|
|
@@ -791,6 +770,7 @@ module EBSCO
|
|
|
791
770
|
return sanitize_data(item['Data'])
|
|
792
771
|
end
|
|
793
772
|
end
|
|
773
|
+
return nil
|
|
794
774
|
|
|
795
775
|
elsif options[:name] and options[:group]
|
|
796
776
|
|
|
@@ -799,6 +779,7 @@ module EBSCO
|
|
|
799
779
|
return sanitize_data(item['Data'])
|
|
800
780
|
end
|
|
801
781
|
end
|
|
782
|
+
return nil
|
|
802
783
|
|
|
803
784
|
elsif options[:label] and options[:group]
|
|
804
785
|
|
|
@@ -807,6 +788,7 @@ module EBSCO
|
|
|
807
788
|
return sanitize_data(item['Data'])
|
|
808
789
|
end
|
|
809
790
|
end
|
|
791
|
+
return nil
|
|
810
792
|
|
|
811
793
|
elsif options[:label]
|
|
812
794
|
|
|
@@ -815,6 +797,7 @@ module EBSCO
|
|
|
815
797
|
return sanitize_data(item['Data'])
|
|
816
798
|
end
|
|
817
799
|
end
|
|
800
|
+
return nil
|
|
818
801
|
|
|
819
802
|
elsif options[:name]
|
|
820
803
|
|
|
@@ -823,6 +806,7 @@ module EBSCO
|
|
|
823
806
|
return sanitize_data(item['Data'])
|
|
824
807
|
end
|
|
825
808
|
end
|
|
809
|
+
return nil
|
|
826
810
|
|
|
827
811
|
else
|
|
828
812
|
nil
|
data/lib/ebsco/eds/session.rb
CHANGED
|
@@ -761,12 +761,10 @@ module EBSCO
|
|
|
761
761
|
if jump_payload.Comment == 'jump_request'
|
|
762
762
|
is_jump_retry = true
|
|
763
763
|
puts '138 JUMP RETRY ================================================================' if @debug
|
|
764
|
-
sleep Random.new.rand(1..3)
|
|
765
764
|
do_jump_request(method, path: path, payload: jump_payload, attempt: attempt+1)
|
|
766
765
|
elsif jump_payload.Comment == 'jump_request_orig'
|
|
767
766
|
is_orig_retry = true
|
|
768
767
|
puts '138 ORIG RETRY ================================================================' if @debug
|
|
769
|
-
sleep Random.new.rand(1..3)
|
|
770
768
|
jump_response = do_jump_request(method, path: path, payload: payload, attempt: attempt+1)
|
|
771
769
|
if jump_response.success?
|
|
772
770
|
return jump_response.body
|
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.3.
|
|
4
|
+
version: 0.3.13.pre
|
|
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: 2017-09-
|
|
12
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: faraday
|