ebsco-eds 0.1.6.pre → 0.1.7.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/README.md +2 -1
- data/lib/ebsco/eds/options.rb +39 -23
- data/lib/ebsco/eds/record.rb +3 -3
- data/lib/ebsco/eds/results.rb +10 -0
- 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: 3d77f232f59d0394231f3b1ad9e01366e549b7ce
|
4
|
+
data.tar.gz: ce77a40006520d940d6bd668103fbd49078b40b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8806ae9eff53f3334ca2d64be2b068e036d2349d9585b91c47c2c3cbfcf27ab84b183ff1aaed14894e875fe82f131ccbfcc8f1345d6605877ef60f8b66dd615
|
7
|
+
data.tar.gz: 434ecced7c11e8220e9fdc1dc640dac20b8886f0db6b41f09f5aa647b3676d0d5e28cedbf6d345cac42b0847ef8dc363dae99bb63ab5fe18024ce7c85707563e
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ A Ruby interface to the EBSCO Discovery Services API.
|
|
10
10
|
|
11
11
|
## Dependencies
|
12
12
|
|
13
|
-
* Ruby 2.
|
13
|
+
* Ruby 2.2+
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -33,6 +33,7 @@ Or install it yourself as:
|
|
33
33
|
- [Configuration](https://github.com/ebsco/edsapi-ruby/wiki/Configuration)
|
34
34
|
- [Quick Start](https://github.com/ebsco/edsapi-ruby/wiki/Quick-Start)
|
35
35
|
- [Blacklight Support](https://github.com/ebsco/edsapi-ruby/wiki/Solr-and-Blacklight-Support)
|
36
|
+
- [Citation Formats (Experimental)](https://github.com/ebsco/edsapi-ruby/wiki/Citation-Formats-(Experimental))
|
36
37
|
|
37
38
|
### Models
|
38
39
|
|
data/lib/ebsco/eds/options.rb
CHANGED
@@ -30,73 +30,89 @@ module EBSCO
|
|
30
30
|
# solr facet translation
|
31
31
|
# "f"=>{"format"=>["eBooks"]}
|
32
32
|
when 'f'
|
33
|
-
if value.has_key?('
|
34
|
-
format_list = value['
|
33
|
+
if value.has_key?('eds_publication_type_facet')
|
34
|
+
format_list = value['eds_publication_type_facet']
|
35
35
|
format_list.each do |item|
|
36
36
|
@Actions.push "addfacetfilter(SourceType:#{item})"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
if value.has_key?('
|
41
|
-
lang_list = value['
|
40
|
+
if value.has_key?('eds_language_facet')
|
41
|
+
lang_list = value['eds_language_facet']
|
42
42
|
lang_list.each do |item|
|
43
43
|
@Actions.push "addfacetfilter(Language:#{item})"
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
if value.has_key?('
|
48
|
-
subj_list = value['
|
47
|
+
if value.has_key?('eds_subject_topic_facet')
|
48
|
+
subj_list = value['eds_subject_topic_facet']
|
49
49
|
subj_list.each do |item|
|
50
50
|
@Actions.push "addfacetfilter(SubjectEDS:#{item})"
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
if value.has_key?('
|
55
|
-
subj_list = value['
|
54
|
+
if value.has_key?('eds_subjects_geographic_facet')
|
55
|
+
subj_list = value['eds_subjects_geographic_facet']
|
56
56
|
subj_list.each do |item|
|
57
57
|
@Actions.push "addfacetfilter(SubjectGeographic:#{item})"
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
if value.has_key?('
|
62
|
-
subj_list = value['
|
61
|
+
if value.has_key?('eds_publisher_facet')
|
62
|
+
subj_list = value['eds_publisher_facet']
|
63
63
|
subj_list.each do |item|
|
64
64
|
@Actions.push "addfacetfilter(Publisher:#{item})"
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
if value.has_key?('
|
69
|
-
subj_list = value['
|
68
|
+
if value.has_key?('eds_journal_facet')
|
69
|
+
subj_list = value['eds_journal_facet']
|
70
70
|
subj_list.each do |item|
|
71
71
|
@Actions.push "addfacetfilter(Journal:#{item})"
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
if value.has_key?('
|
76
|
-
subj_list = value['
|
75
|
+
if value.has_key?('eds_category_facet')
|
76
|
+
subj_list = value['eds_category_facet']
|
77
77
|
subj_list.each do |item|
|
78
78
|
@Actions.push "addfacetfilter(Category:#{item})"
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
if value.has_key?('
|
83
|
-
subj_list = value['
|
82
|
+
if value.has_key?('eds_content_provider_facet')
|
83
|
+
subj_list = value['eds_content_provider_facet']
|
84
84
|
subj_list.each do |item|
|
85
85
|
item = eds_sanitize item
|
86
86
|
@Actions.push "addfacetfilter(ContentProvider:#{item})"
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
if value.has_key?('
|
91
|
-
subj_list = value['
|
90
|
+
if value.has_key?('eds_library_location_facet')
|
91
|
+
subj_list = value['eds_library_location_facet']
|
92
92
|
subj_list.each do |item|
|
93
93
|
item = eds_sanitize item
|
94
94
|
@Actions.push "addfacetfilter(LocationLibrary:#{item})"
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
if value.has_key?('
|
99
|
-
|
98
|
+
if value.has_key?('eds_library_collection_facet')
|
99
|
+
subj_list = value['eds_library_collection_facet']
|
100
|
+
subj_list.each do |item|
|
101
|
+
item = eds_sanitize item
|
102
|
+
@Actions.push "addfacetfilter(CollectionLibrary:#{item})"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
if value.has_key?('eds_author_university_facet')
|
107
|
+
subj_list = value['eds_author_university_facet']
|
108
|
+
subj_list.each do |item|
|
109
|
+
item = eds_sanitize item
|
110
|
+
@Actions.push "addfacetfilter(AuthorUniversity:#{item})"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
if value.has_key?('eds_search_limiters_facet')
|
115
|
+
_list = value['eds_search_limiters_facet']
|
100
116
|
_list.each do |item|
|
101
117
|
if item == 'Full Text'
|
102
118
|
@Actions.push "addlimiter(FT:y)"
|
@@ -110,8 +126,8 @@ module EBSCO
|
|
110
126
|
end
|
111
127
|
end
|
112
128
|
|
113
|
-
if value.has_key?('
|
114
|
-
_list = value['
|
129
|
+
if value.has_key?('eds_publication_year_facet')
|
130
|
+
_list = value['eds_publication_year_facet']
|
115
131
|
_this_year = Date.today.year
|
116
132
|
_this_month = Date.today.month
|
117
133
|
_list.each do |item|
|
@@ -161,7 +177,7 @@ module EBSCO
|
|
161
177
|
end
|
162
178
|
|
163
179
|
def eds_sanitize(str)
|
164
|
-
pattern = /(\'|\"
|
180
|
+
pattern = /(\'|\"|\*|\/|\-|\\|\)|\$|\+|\(|\^|\?|\!|\~|\`)/
|
165
181
|
str = str.gsub(pattern){ |match| '\\' + match }
|
166
182
|
str
|
167
183
|
end
|
data/lib/ebsco/eds/record.rb
CHANGED
@@ -113,7 +113,7 @@ module EBSCO
|
|
113
113
|
@eds_publication_type_id = @record['Header']['PubTypeId']
|
114
114
|
@eds_publication_date = bib_publication_date || get_item_data_by_name('DatePub')
|
115
115
|
@eds_publication_year = bib_publication_year || get_item_data_by_name('DatePub')
|
116
|
-
@
|
116
|
+
@eds_publication_info = get_item_data_by_label('Publication Information')
|
117
117
|
@eds_document_type = get_item_data_by_name('TypeDocument')
|
118
118
|
@eds_document_doi = get_item_data_by_name('DOI') || bib_doi
|
119
119
|
@eds_document_oclc = get_item_data_by_label('OCLC')
|
@@ -150,8 +150,8 @@ module EBSCO
|
|
150
150
|
# \Options hash containing accession number and database ID. This can be passed to the retrieve method.
|
151
151
|
def retrieve_options
|
152
152
|
options = {}
|
153
|
-
options['an'] =
|
154
|
-
options['dbid'] =
|
153
|
+
options['an'] = @eds_accession_number
|
154
|
+
options['dbid'] = @eds_database_id
|
155
155
|
options
|
156
156
|
end
|
157
157
|
|
data/lib/ebsco/eds/results.rb
CHANGED
@@ -88,6 +88,8 @@ module EBSCO
|
|
88
88
|
solr_start = (page_number-1) * results_per_page
|
89
89
|
hl_hash = {}
|
90
90
|
solr_docs = []
|
91
|
+
research_starters = []
|
92
|
+
publication_matches = []
|
91
93
|
|
92
94
|
if @records.any?
|
93
95
|
@records.each { |record|
|
@@ -102,6 +104,14 @@ module EBSCO
|
|
102
104
|
}
|
103
105
|
end
|
104
106
|
|
107
|
+
if @research_starters.any?
|
108
|
+
@research_starters.each { |record| research_starters.push(record.to_attr_hash) }
|
109
|
+
end
|
110
|
+
|
111
|
+
if publication_match.any?
|
112
|
+
publication_match.each { |record| publication_matches.push(record.to_attr_hash) }
|
113
|
+
end
|
114
|
+
|
105
115
|
status = 0
|
106
116
|
wt = 'ruby'
|
107
117
|
qtime = stat_total_time
|
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.7.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-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|