ebsco-eds 0.1.8.pre → 0.1.9.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ebsco/eds/record.rb +17 -5
- data/lib/ebsco/eds/session.rb +10 -5
- 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: 9322677a3b97bef467b3d279b234faa7f781ac19
|
4
|
+
data.tar.gz: ca5db0366fda7a4b726f029eb72b28a9395f4445
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f526a7dd1c6b4d2f83d0f0d96d7bebd2a9c9f1c3560478cc86315109e929bf4c8f5c076885c04fd8ae573124005da87c4d3d1f954009e7c99a88f1290b8f0fd
|
7
|
+
data.tar.gz: 53927107a26b31dc85dc6c764547d537d48822c59d0fb164c35b1cf6973df01bbf1986d0a71d23fd017b20fcf15293477dbb75a9bf5d21789ca4f3e48d0fe7eb
|
data/lib/ebsco/eds/record.rb
CHANGED
@@ -23,11 +23,15 @@ module EBSCO
|
|
23
23
|
:eds_abstract,
|
24
24
|
:eds_authors,
|
25
25
|
:eds_author_affiliations,
|
26
|
+
:eds_authors_composed,
|
26
27
|
:eds_subjects,
|
27
28
|
:eds_subjects_geographic,
|
28
29
|
:eds_subjects_person,
|
30
|
+
:eds_subjects_genre,
|
29
31
|
:eds_author_supplied_keywords,
|
32
|
+
:eds_descriptors,
|
30
33
|
:eds_notes,
|
34
|
+
:eds_subset,
|
31
35
|
:eds_languages,
|
32
36
|
:eds_page_count,
|
33
37
|
:eds_page_start,
|
@@ -60,6 +64,8 @@ module EBSCO
|
|
60
64
|
:eds_all_links,
|
61
65
|
:eds_fulltext_links,
|
62
66
|
:eds_non_fulltext_links,
|
67
|
+
:eds_code_naics,
|
68
|
+
:eds_abstract_supplied_copyright,
|
63
69
|
# publication record attributes
|
64
70
|
:eds_publication_id,
|
65
71
|
:eds_publication_is_searchable,
|
@@ -95,23 +101,29 @@ module EBSCO
|
|
95
101
|
.fetch('IsPartOfRelationships', {})[0]
|
96
102
|
|
97
103
|
# accessors:
|
104
|
+
@eds_result_id = @record['ResultId']
|
105
|
+
@eds_plink = @record['PLink']
|
98
106
|
@eds_accession_number = @record['Header']['An'].to_s
|
99
107
|
@eds_database_id = @record['Header']['DbId'].to_s
|
100
108
|
@eds_database_name = @record['Header']['DbLabel']
|
101
109
|
@eds_access_level = @record['Header']['AccessLevel']
|
102
110
|
@eds_relevancy_score = @record['Header']['RelevancyScore']
|
111
|
+
@id = @eds_database_id + '__' + @eds_accession_number.gsub(/\./,'_')
|
103
112
|
@eds_title = title
|
104
113
|
@eds_source_title = source_title
|
105
114
|
@eds_composed_title = source_title_composed
|
106
115
|
@eds_other_titles = other_titles
|
107
116
|
@eds_abstract = abstract
|
108
|
-
@eds_authors =
|
117
|
+
@eds_authors = bib_authors_list
|
118
|
+
@eds_authors_composed = get_item_data_by_name('Author')
|
109
119
|
@eds_author_affiliations = get_item_data_by_name('AffiliationAuthor')
|
110
120
|
@eds_subjects = bib_subjects || get_item_data_by_name('Subject')
|
111
121
|
@eds_subjects_geographic = get_item_data_by_name('SubjectGeographic')
|
112
122
|
@eds_subjects_person = get_item_data_by_name('SubjectPerson')
|
113
|
-
@
|
123
|
+
@eds_subjects_genre = get_item_data_by_name('SubjectGenre')
|
124
|
+
@eds_author_supplied_keywords = get_item_data_by_name('Keyword')
|
114
125
|
@eds_notes = notes
|
126
|
+
@eds_subset = get_item_data_by_name('Subset')
|
115
127
|
@eds_languages = get_item_data_by_name('Language') || bib_languages
|
116
128
|
@eds_page_count = bib_page_count
|
117
129
|
@eds_page_start = bib_page_start
|
@@ -137,14 +149,14 @@ module EBSCO
|
|
137
149
|
@eds_cover_thumb_url = cover_thumb_url
|
138
150
|
@eds_cover_medium_url = cover_medium_url
|
139
151
|
@eds_fulltext_word_count = get_item_data_by_name('FullTextWordCount').to_i
|
140
|
-
@eds_result_id = @record['ResultId']
|
141
|
-
@eds_plink = @record['PLink']
|
142
152
|
@eds_html_fulltext = html_fulltext
|
143
153
|
@eds_images = images
|
144
154
|
@eds_all_links = all_links
|
145
155
|
@eds_fulltext_links = fulltext_links
|
146
156
|
@eds_non_fulltext_links = non_fulltext_links
|
147
|
-
@
|
157
|
+
@eds_code_naics = get_item_data_by_name('CodeNAICS')
|
158
|
+
@eds_abstract_supplied_copyright = get_item_data_by_name('AbstractSuppliedCopyright')
|
159
|
+
@eds_descriptors = get_item_data_by_label('Descriptors')
|
148
160
|
|
149
161
|
@eds_publication_id = @record['Header']['PublicationId']
|
150
162
|
@eds_publication_is_searchable = @record['Header']['IsSearchable']
|
data/lib/ebsco/eds/session.rb
CHANGED
@@ -2,6 +2,7 @@ require 'ebsco/eds/version'
|
|
2
2
|
require 'ebsco/eds/info'
|
3
3
|
require 'ebsco/eds/results'
|
4
4
|
require 'faraday'
|
5
|
+
require 'faraday/detailed_logger'
|
5
6
|
require 'faraday_middleware'
|
6
7
|
require 'logger'
|
7
8
|
require 'json'
|
@@ -99,6 +100,10 @@ module EBSCO
|
|
99
100
|
# these config options can be overridden by environment vars
|
100
101
|
@auth_type = (ENV.has_key? 'EDS_AUTH') ? ENV['EDS_AUTH'] : @config[:auth]
|
101
102
|
@org = (ENV.has_key? 'EDS_ORG') ? ENV['EDS_ORG'] : @config[:org]
|
103
|
+
@debug = (ENV.has_key? 'EDS_DEBUG') ? ENV['EDS_DEBUG'] : @config[:debug]
|
104
|
+
@use_cache = (ENV.has_key? 'EDS_USE_CACHE') ? ENV['EDS_USE_CACHE'] : @config[:use_cache]
|
105
|
+
@cache_dir = (ENV.has_key? 'EDS_CACHE_DIR') ? ENV['EDS_CACHE_DIR'] : @config[:eds_cache_dir]
|
106
|
+
|
102
107
|
if ENV.has_key? 'EDS_GUEST'
|
103
108
|
if ['n', 'N', 'no', 'No'].include?(ENV['EDS_GUEST'])
|
104
109
|
@guest = false
|
@@ -110,8 +115,8 @@ module EBSCO
|
|
110
115
|
end
|
111
116
|
|
112
117
|
# use cache for auth token and info calls?
|
113
|
-
if @
|
114
|
-
cache_dir = File.join(@
|
118
|
+
if @use_cache
|
119
|
+
cache_dir = File.join(@cache_dir, 'faraday_eds_cache')
|
115
120
|
@cache_store = ActiveSupport::Cache::FileStore.new cache_dir
|
116
121
|
end
|
117
122
|
|
@@ -132,7 +137,7 @@ module EBSCO
|
|
132
137
|
@current_page = 0
|
133
138
|
@search_options = nil
|
134
139
|
|
135
|
-
if @
|
140
|
+
if @debug
|
136
141
|
if options.key? :caller
|
137
142
|
puts 'CREATE SESSION CALLER: ' + options[:caller].inspect
|
138
143
|
puts 'CALLER OPTIONS: ' + options.inspect
|
@@ -676,10 +681,10 @@ module EBSCO
|
|
676
681
|
conn.headers['x-authenticationToken'] = @auth_token ? @auth_token : ''
|
677
682
|
conn.headers['User-Agent'] = @config[:user_agent]
|
678
683
|
conn.request :url_encoded
|
679
|
-
conn.use :eds_caching_middleware, store: @cache_store if @
|
684
|
+
conn.use :eds_caching_middleware, store: @cache_store if @use_cache
|
680
685
|
conn.use :eds_exception_middleware
|
681
686
|
conn.response :json, content_type: /\bjson$/
|
682
|
-
conn.response :
|
687
|
+
conn.response :detailed_logger, logger if @debug
|
683
688
|
conn.adapter Faraday.default_adapter
|
684
689
|
end
|
685
690
|
end
|
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.1.
|
4
|
+
version: 0.1.9.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-06
|
12
|
+
date: 2017-07-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|