europeana-blacklight 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/QUICKSTART.md +2 -1
- data/europeana-blacklight.gemspec +1 -1
- data/lib/europeana/blacklight/response/facets.rb +4 -0
- data/lib/europeana/blacklight/routes.rb +1 -1
- data/lib/europeana/blacklight/version.rb +1 -1
- data/lib/europeana/blacklight.rb +1 -0
- data/lib/generators/europeana/blacklight/install_generator.rb +2 -1
- data/spec/europeana/blacklight/repository_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdc8eda7f1866737f406348228cc88fd59b228ce
|
4
|
+
data.tar.gz: 95920756f24cf7dd857f01b1aa3c6b0bb265817c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78009641836391f5b337581d9d49982f9771f5d5c65c1aad42c73ae6a4211699da39b81322da55b7d8402fbfd37c831190bb5b4e110bb5c6de8c81efbd2e4d91
|
7
|
+
data.tar.gz: 5c2915e1e65cdd4e55c572426eee17eac8a2ab03639c238820af4d28bc76d5c20d7ffeb26ea030652ebdf245305ac3af25ec6f11c15e3c939c32f08c54658cce
|
data/QUICKSTART.md
CHANGED
@@ -16,7 +16,7 @@ cd culture_vulture
|
|
16
16
|
## Bundle europeana-blacklight
|
17
17
|
Add to the Gemfile:
|
18
18
|
```ruby
|
19
|
-
gem 'europeana-blacklight', '~> 0.3'
|
19
|
+
gem 'europeana-blacklight', '~> 0.3', '< 0.4'
|
20
20
|
```
|
21
21
|
|
22
22
|
## Get a Europeana API key
|
@@ -26,6 +26,7 @@ From http://labs.europeana.eu/api/
|
|
26
26
|
```
|
27
27
|
bundle install
|
28
28
|
bundle exec rails generate blacklight:install --devise
|
29
|
+
# This will ask if you want to overwrite some files; just say yes in a new app.
|
29
30
|
bundle exec rails generate europeana:blacklight:install YOUR_API_KEY
|
30
31
|
bundle exec rake db:migrate
|
31
32
|
```
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.required_ruby_version = '>= 2.0.0'
|
20
20
|
|
21
21
|
spec.add_dependency 'blacklight', '~> 6.0.0'
|
22
|
-
spec.add_dependency 'europeana-api', '~> 0.
|
22
|
+
spec.add_dependency 'europeana-api', '~> 0.5.0'
|
23
23
|
spec.add_dependency 'iso-639', '~> 0.2.5'
|
24
24
|
spec.add_dependency 'rails', '>= 4.2.2', '< 5'
|
25
25
|
|
@@ -8,7 +8,7 @@ module Europeana
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def call(mapper, _options = {})
|
11
|
-
constraints id: %r{[^/]+/[^/]+} do
|
11
|
+
mapper.constraints id: %r{[^/]+/[^/]+} do
|
12
12
|
mapper.post 'record/*id/track', action: 'track', as: 'track'
|
13
13
|
mapper.get 'record/*id', action: 'show', as: 'show'
|
14
14
|
end
|
data/lib/europeana/blacklight.rb
CHANGED
@@ -6,7 +6,8 @@ module Europeana
|
|
6
6
|
argument :europeana_api_key, type: :string
|
7
7
|
argument :controller_name, type: :string, default: 'catalog'
|
8
8
|
|
9
|
-
def
|
9
|
+
def disable_solr_gems
|
10
|
+
comment_lines('Gemfile', /gem 'solr_wrapper'/)
|
10
11
|
comment_lines('Gemfile', /gem 'rsolr'/)
|
11
12
|
end
|
12
13
|
|
@@ -24,13 +24,13 @@ RSpec.describe Europeana::Blacklight::Repository do
|
|
24
24
|
|
25
25
|
it 'should send a record query to the API' do
|
26
26
|
subject.find(record_id)
|
27
|
-
expect(a_request(:get, "www.europeana.eu/api/v2/record#{record_id}.json").
|
27
|
+
expect(a_request(:get, "https://www.europeana.eu/api/v2/record#{record_id}.json").
|
28
28
|
with(query: hash_including({ 'wskey' => api_key }))).to have_been_made
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'should pass on API query params' do
|
32
32
|
subject.find(record_id, callback: 'showRecord')
|
33
|
-
expect(a_request(:get, "www.europeana.eu/api/v2/record#{record_id}.json").
|
33
|
+
expect(a_request(:get, "https://www.europeana.eu/api/v2/record#{record_id}.json").
|
34
34
|
with(query: hash_including({ 'wskey' => api_key, 'callback' => 'showRecord' }))).to have_been_made
|
35
35
|
end
|
36
36
|
|
@@ -44,7 +44,7 @@ RSpec.describe Europeana::Blacklight::Repository do
|
|
44
44
|
|
45
45
|
it 'should send a search query to the API' do
|
46
46
|
subject.search('query' => query)
|
47
|
-
expect(a_request(:get, 'www.europeana.eu/api/v2/search.json').
|
47
|
+
expect(a_request(:get, 'https://www.europeana.eu/api/v2/search.json').
|
48
48
|
with(query: hash_including({ 'wskey' => api_key, 'query' => query }))).to have_been_made
|
49
49
|
end
|
50
50
|
|
data/spec/spec_helper.rb
CHANGED
@@ -25,11 +25,11 @@ RSpec.configure do |config|
|
|
25
25
|
end
|
26
26
|
|
27
27
|
config.before(:each) do
|
28
|
-
stub_request(:get, %r{
|
28
|
+
stub_request(:get, %r{https://www.europeana.eu/api/v2/record/[^/]+/[^/.]+\.json}).
|
29
29
|
with(query: hash_including(:wskey)).
|
30
30
|
to_return(body: '{"success":true}', headers: { 'content-type' => 'application/json' })
|
31
31
|
|
32
|
-
stub_request(:get, '
|
32
|
+
stub_request(:get, 'https://www.europeana.eu/api/v2/search.json').
|
33
33
|
with(query: hash_including(:wskey, :query)).
|
34
34
|
to_return(body: '{"success":true}', headers: { 'content-type' => 'application/json' })
|
35
35
|
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.4.
|
4
|
+
version: 0.4.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
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.5.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: iso-639
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.
|
259
|
+
rubygems_version: 2.5.1
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Europeana REST API adapter for Blacklight
|
@@ -312,3 +312,4 @@ test_files:
|
|
312
312
|
- spec/models/europeana/blacklight/document_spec.rb
|
313
313
|
- spec/presenters/europeana/blacklight/document_presenter_spec.rb
|
314
314
|
- spec/spec_helper.rb
|
315
|
+
has_rdoc:
|