europeana-blacklight 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2dffb082424290fd5b9bc9dd1b8cd87d71444535
4
- data.tar.gz: afc2cf62dcc397c80ba298085940a94cb6c77665
3
+ metadata.gz: e06e950f7d8839a8f3adcf6383f6ad14d90fe04b
4
+ data.tar.gz: 5d98016e3a0bd6b6dd627bc0cdd239c4c52ae529
5
5
  SHA512:
6
- metadata.gz: 6c731bb9b10a12a12efa8deb62720c33734aaf0ed2a9cd97e5ec734681f9a84c6e4dd6e1ec514a3e291a8532637186dd6b8ae06fb6e21ac50b70827d59372952
7
- data.tar.gz: 65d3cbcdd1d8648f3df4bfbcaccc69f8f477cafd1e0a9eafe9ae9455356afa7725faca1fe3d330abc7217abc63652d156ed2c77b90bff3a305e2e46aa900b9ef
6
+ metadata.gz: 6c19a7a7227141539622f58bcb0b7225125d6b5a2f391a047829e82194785ca8683d588b908cb7726d5039ac45e95981c0513444c9d7e77b525f583ebfc354e8
7
+ data.tar.gz: 1da07143ac3430f3941f82ad205ab608fd900d4afbf18cd9a89c8474c14847579fc06d14b21a91f04bea5d91487e34584354f2bb8abc73b12ca49d9d01c4399f
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .ruby-version
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
data/Gemfile CHANGED
@@ -3,6 +3,8 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in europeana-blacklight.gemspec
4
4
  gemspec
5
5
 
6
+ gem 'europeana-api', github: 'europeana/europeana-api-client-ruby', branch: 'develop'
7
+
6
8
  group :test do
7
9
  gem 'coveralls', require: false
8
10
  end
@@ -47,7 +47,7 @@ module Europeana
47
47
  return nil unless string_terms.present?
48
48
 
49
49
  or_terms = string_terms.map do |v|
50
- '"' + Europeana::API::Search.escape(v) + '"'
50
+ '"' + Europeana::API.record.escape(v) + '"'
51
51
  end.join(' OR ')
52
52
  "#{param}: (#{or_terms})^#{boost}"
53
53
  end
@@ -13,7 +13,7 @@ module Europeana
13
13
  # @return (see blacklight_config.response_model)
14
14
  def find(id, params = {})
15
15
  id = "/#{id}" unless id[0] == '/'
16
- res = connection.record(id, params)
16
+ res = connection.record.fetch(params.merge(id: id))
17
17
 
18
18
  blacklight_config.response_model.new(
19
19
  res, params, document_model: blacklight_config.document_model,
@@ -22,7 +22,7 @@ module Europeana
22
22
  end
23
23
 
24
24
  def search(params = {})
25
- res = connection.search(params)
25
+ res = connection.record.search(params.to_h)
26
26
 
27
27
  blacklight_config.response_model.new(
28
28
  res, params, document_model: blacklight_config.document_model,
@@ -42,23 +42,7 @@ module Europeana
42
42
 
43
43
  def build_connection
44
44
  Europeana::API.tap do |api|
45
- api.api_key = blacklight_config.connection_config[:europeana_api_key]
46
- api.cache_store = cache_store
47
- api.cache_expires_in = cache_expires_in
48
- end
49
- end
50
-
51
- protected
52
-
53
- def cache_store
54
- @cache_store ||= begin
55
- blacklight_config.europeana_api_cache || ActiveSupport::Cache::NullStore.new
56
- end
57
- end
58
-
59
- def cache_expires_in
60
- @expires_in ||= begin
61
- blacklight_config.europeana_api_cache_expires_in || 24.hours
45
+ api.key = blacklight_config.connection_config[:europeana_api_key]
62
46
  end
63
47
  end
64
48
  end
@@ -22,7 +22,12 @@ module Europeana
22
22
 
23
23
  delegate :to_query, :delete, to: :to_hash
24
24
 
25
- STANDALONE_FACETS = %w(COLOURPALETTE MEDIA REUSABILITY)
25
+ STANDALONE_FACETS = %w(COLOURPALETTE MEDIA REUSABILITY THUMBNAIL).freeze
26
+
27
+ MEDIA_FACETS = %w(COLOURPALETTE IMAGE_ASPECTRATIO IMAGE_COLOR IMAGE_COLOUR
28
+ IMAGE_GRAYSCALE IMAGE_GREYSCALE IMAGE_SIZE MEDIA MIME_TYPE
29
+ SOUND_DURATION SOUND_HQ TEXT_FULLTEXT VIDEO_DURATION
30
+ VIDEO_HD).freeze
26
31
 
27
32
  ##
28
33
  # Start with general defaults from BL config. Need to use custom
@@ -103,7 +108,7 @@ module Europeana
103
108
  end
104
109
 
105
110
  def quote_facet_value(facet_field, value)
106
- return value if Europeana::API::Search::Fields::MEDIA.include?(facet_field)
111
+ return value if MEDIA_FACETS.include?(facet_field)
107
112
  return value if value.include?('*')
108
113
  '"' + value.gsub('"', '\"') + '"'
109
114
  end
@@ -1,5 +1,5 @@
1
1
  module Europeana
2
2
  module Blacklight
3
- VERSION = '0.5.0'.freeze
3
+ VERSION = '0.5.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: europeana-blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Doe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-15 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blacklight
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  version: '0'
257
257
  requirements: []
258
258
  rubyforge_project:
259
- rubygems_version: 2.5.1
259
+ rubygems_version: 2.5.2
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: Europeana REST API adapter for Blacklight