ebsco-eds 0.3.1.pre → 0.3.2.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: c5bc349f6a65afd5f8dad6d89441d9a72a5d7ee0
4
- data.tar.gz: 7c028d8098e5555497964019848680acd3a5b5bb
3
+ metadata.gz: d797f190f1835212cd39343e0bb70daa23f82fb7
4
+ data.tar.gz: fdb7753803fe3c2b9b616eaee96eed718713cb5f
5
5
  SHA512:
6
- metadata.gz: fae36ea68f3dac43929a793b4e835f52537919a6a82319448904aa14881bbca3da12f68b0c951511a636c203e92715ef259b475b9249f61b66d5fefef6a5fcf3
7
- data.tar.gz: fd665b635c020835db13eb6d87f2f3ab4b87bd07e81b3cc8ff92a963e1cf2a7a2cb094810b118bb0cea35cd2c2aedf29218794d1f6da43f4eefde6342b4f7114
6
+ metadata.gz: 230197033cf210c6d2b89e74f2fcd1864cc7181a07cf06cf0a3a8aa59b234e10e842d4fd5eea616013703b1b31cb0913adbacae001b265d3bd40c380add0cfe1
7
+ data.tar.gz: 6d9655e553cf1eb0827724d47f54320ea64fcd30f004cbd960ace9a8ab62f0d6bf1e0446fbc239f17642f60b63210ffbd1a2b78c0569efea6415c4ed4ad7ca5c
@@ -211,7 +211,7 @@ module EBSCO
211
211
  end
212
212
 
213
213
  def eds_sanitize(str)
214
- pattern = /(\'|\"|\*|\/|\-|\\|\)|\$|\+|\(|\^|\?|\!|\~|\`)/
214
+ pattern = /(\'|\"|\*|\/|\-|\\|\)|\$|\+|\(|\^|\?|\!|\~|\`|\:)/
215
215
  str = str.gsub(pattern){ |match| '\\' + match }
216
216
  str
217
217
  end
@@ -63,6 +63,10 @@ module EBSCO
63
63
  :eds_fulltext_word_count,
64
64
  :eds_result_id,
65
65
  :eds_plink,
66
+ :eds_ebook_pdf_fulltext_available,
67
+ :eds_ebook_epub_fulltext_available,
68
+ :eds_pdf_fulltext_available,
69
+ :eds_html_fulltext_available,
66
70
  :eds_html_fulltext,
67
71
  :eds_images,
68
72
  :eds_all_links,
@@ -196,9 +200,14 @@ module EBSCO
196
200
  @eds_cover_thumb_url = cover_thumb_url
197
201
  @eds_cover_medium_url = cover_medium_url
198
202
  @eds_fulltext_word_count = get_item_data_by_name('FullTextWordCount').to_i
203
+ @eds_html_fulltext_available = html_fulltext_available
199
204
  @eds_html_fulltext = html_fulltext
200
205
  @eds_images = images
201
206
  @eds_all_links = all_links
207
+ # init fulltext available props, reset by fulltext_links method later
208
+ @eds_pdf_fulltext_available = false
209
+ @eds_ebook_pdf_fulltext_available = false
210
+ @eds_ebook_epub_fulltext_available = false
202
211
  @eds_fulltext_links = fulltext_links
203
212
  @eds_non_fulltext_links = non_fulltext_links
204
213
  @eds_code_naics = get_item_data_by_name('CodeNAICS')
@@ -267,7 +276,16 @@ module EBSCO
267
276
  end
268
277
  end
269
278
 
270
- # Fulltext.
279
+ # Fulltext available
280
+ def html_fulltext_available
281
+ if @record.fetch('FullText',{}).fetch('Text',{}).fetch('Availability',0) == '1'
282
+ true
283
+ else
284
+ false
285
+ end
286
+ end
287
+
288
+ # Fulltext - RETRIEVE ONLY
271
289
  def html_fulltext
272
290
  if @record.fetch('FullText',{}).fetch('Text',{}).fetch('Availability',0) == '1'
273
291
  @record.fetch('FullText',{}).fetch('Text',{})['Value']
@@ -334,6 +352,7 @@ module EBSCO
334
352
  link_icon = 'PDF Full Text Icon'
335
353
  link_url = ebscolink['Url'] || 'detail'
336
354
  links.push({url: link_url, label: link_label, icon: link_icon, type: 'pdf'})
355
+ @eds_pdf_fulltext_available = true
337
356
  end
338
357
  end
339
358
  end
@@ -354,6 +373,7 @@ module EBSCO
354
373
  link_icon = 'PDF eBook Full Text Icon'
355
374
  link_url = ebscolink['Url'] || 'detail'
356
375
  links.push({url: link_url, label: link_label, icon: link_icon, type: 'ebook-pdf'})
376
+ @eds_ebook_pdf_fulltext_available = true
357
377
  end
358
378
  end
359
379
  end
@@ -365,6 +385,7 @@ module EBSCO
365
385
  link_icon = 'ePub eBook Full Text Icon'
366
386
  link_url = ebscolink['Url'] || 'detail'
367
387
  links.push({url: link_url, label: link_label, icon: link_icon, type: 'ebook-epub'})
388
+ @eds_ebook_epub_fulltext_available = true
368
389
  end
369
390
  end
370
391
  end
@@ -402,6 +423,7 @@ module EBSCO
402
423
  link_icon = 'Linked Full Text Icon'
403
424
  link_url = ebscolink['Url'] || 'detail'
404
425
  links.push({url: link_url, label: link_label, icon: link_icon, type: 'smartlinks'})
426
+ @eds_pdf_fulltext_available = true
405
427
  end
406
428
  end
407
429
  end
@@ -528,6 +528,7 @@ module EBSCO
528
528
  # results = session.add_facet('SubjectEDS', 'water quality')
529
529
  #
530
530
  def add_facet(facet_id, facet_val)
531
+ facet_val = eds_sanitize(facet_val)
531
532
  add_actions "AddFacetFilter(#{facet_id}:#{facet_val})"
532
533
  end
533
534
 
@@ -841,6 +842,12 @@ module EBSCO
841
842
  end
842
843
  end
843
844
 
845
+ def eds_sanitize(str)
846
+ pattern = /(\'|\"|\*|\/|\-|\\|\)|\$|\+|\(|\^|\?|\!|\~|\`|\:)/
847
+ str = str.gsub(pattern){ |match| '\\' + match }
848
+ str
849
+ end
850
+
844
851
  end
845
852
 
846
853
  end
@@ -1,5 +1,5 @@
1
1
  module EBSCO
2
2
  module EDS
3
- VERSION = '0.3.1.pre'
3
+ VERSION = '0.3.2.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.3.1.pre
4
+ version: 0.3.2.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-08-09 00:00:00.000000000 Z
12
+ date: 2017-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday