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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b3dbb922292492bd576647444871ee036ab22f3
4
- data.tar.gz: d3dd7ec0dfa262a0c0d57322c3f613c1ba88e9de
3
+ metadata.gz: 3d77f232f59d0394231f3b1ad9e01366e549b7ce
4
+ data.tar.gz: ce77a40006520d940d6bd668103fbd49078b40b5
5
5
  SHA512:
6
- metadata.gz: 4a3aaa3574121dc01e2f17b4ad9bf21bbdc153eb4de4f806a34e047efc712172634a7a2f69588c509f88e85db49cc556800026f22334c627affeb200ebd32661
7
- data.tar.gz: f6df3932a249f65bfbc8b94a25eebd97eed5b5ab9bf1d0b575659d8b9126976ce0cbf2043dde2ab4a413da7099bea0cca1d8af5d649d1699c6549aa01e50ad87
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.1+
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
 
@@ -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?('format')
34
- format_list = value['format']
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?('language_facet')
41
- lang_list = value['language_facet']
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?('subject_topic_facet')
48
- subj_list = value['subject_topic_facet']
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?('geographic_facet')
55
- subj_list = value['geographic_facet']
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?('publisher_facet')
62
- subj_list = value['publisher_facet']
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?('journal_facet')
69
- subj_list = value['journal_facet']
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?('category_facet')
76
- subj_list = value['category_facet']
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?('content_provider_facet')
83
- subj_list = value['content_provider_facet']
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?('library_location_facet')
91
- subj_list = value['library_location_facet']
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?('search_limiters')
99
- _list = value['search_limiters']
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?('pub_date_facet')
114
- _list = value['pub_date_facet']
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
@@ -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
- @eds_publisher_info = get_item_data_by_label('Publication Information')
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'] = accession_number
154
- options['dbid'] = database_id
153
+ options['an'] = @eds_accession_number
154
+ options['dbid'] = @eds_database_id
155
155
  options
156
156
  end
157
157
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  module EBSCO
2
2
  module EDS
3
- VERSION = '0.1.6.pre'
3
+ VERSION = '0.1.7.pre'
4
4
  end
5
5
  end
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.6.pre
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-27 00:00:00.000000000 Z
12
+ date: 2017-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday