europeana-api 0.4.3 → 0.5.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fba551106fba355d9878fb53aac9efd8b9938f32
|
4
|
+
data.tar.gz: 5913c4dfa4a61a4c6051d01c975054b82ef3d1ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ffd2ef5e025994a124ad3a26ff9f60e240011f486bfdab48171b19b79d77708451b5955f96ba790d19d3d5d85986d5f81c901df7a95bf302f30f76a946f399b
|
7
|
+
data.tar.gz: 5d027f11539c31617e571166e8a2977ecf3e8263cad4dc653f1ff359b88b89988edb2d5eb366903ad04f8c1a0030bb7953c6516772f41f7ead6f9ab2e06ee37f
|
data/lib/europeana/api.rb
CHANGED
@@ -58,7 +58,7 @@ module Europeana
|
|
58
58
|
##
|
59
59
|
# Sets configuration values to their defaults
|
60
60
|
def defaults!
|
61
|
-
self.url = '
|
61
|
+
self.url = 'https://www.europeana.eu/api/v2'
|
62
62
|
self.max_retries = 5
|
63
63
|
self.retry_delay = 10
|
64
64
|
self.cache_store = ActiveSupport::Cache::NullStore.new
|
@@ -57,7 +57,7 @@ module Europeana
|
|
57
57
|
|
58
58
|
it "includes request params" do
|
59
59
|
subject.params[:query] = 'paris'
|
60
|
-
expect(subject.request_uri.to_s).to eq("
|
60
|
+
expect(subject.request_uri.to_s).to eq("https://www.europeana.eu/api/v2/search.json?query=paris&wskey=#{api_key}")
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
data/spec/europeana/api_spec.rb
CHANGED
@@ -12,7 +12,7 @@ module Europeana
|
|
12
12
|
|
13
13
|
describe '.url' do
|
14
14
|
it 'defaults to the live API URL' do
|
15
|
-
expect(subject.url).to eq('
|
15
|
+
expect(subject.url).to eq('https://www.europeana.eu/api/v2')
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -70,7 +70,7 @@ module Europeana
|
|
70
70
|
expect { described_class.defaults! }.
|
71
71
|
to change { described_class.url }.
|
72
72
|
from('http://www.example.com/v2').
|
73
|
-
to('
|
73
|
+
to('https://www.europeana.eu/api/v2')
|
74
74
|
end
|
75
75
|
|
76
76
|
it "sets retry delay to its default" do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
shared_examples 'search request' do
|
2
2
|
before(:each) do
|
3
|
-
stub_request(:get, %r{www.europeana.eu/api/v2/search.json}).
|
3
|
+
stub_request(:get, %r{https://www.europeana.eu/api/v2/search.json}).
|
4
4
|
to_return(body: '{"success":true}')
|
5
5
|
end
|
6
6
|
|
@@ -16,14 +16,14 @@ shared_examples 'search request' do
|
|
16
16
|
|
17
17
|
it 'sends a Search request to the API' do
|
18
18
|
subject
|
19
|
-
expect(a_request(:get, %r{www.europeana.eu/api/v2/search.json})).
|
19
|
+
expect(a_request(:get, %r{https://www.europeana.eu/api/v2/search.json})).
|
20
20
|
to have_been_made.once
|
21
21
|
end
|
22
22
|
|
23
23
|
context 'without query' do
|
24
24
|
it 'sends without query' do
|
25
25
|
subject
|
26
|
-
expect(a_request(:get, %r{www.europeana.eu/api/v2/search.json})).
|
26
|
+
expect(a_request(:get, %r{https://www.europeana.eu/api/v2/search.json})).
|
27
27
|
to have_been_made.once
|
28
28
|
end
|
29
29
|
end
|
@@ -33,7 +33,7 @@ shared_examples 'search request' do
|
|
33
33
|
|
34
34
|
it 'sends query' do
|
35
35
|
subject
|
36
|
-
expect(a_request(:get, 'www.europeana.eu/api/v2/search.json').
|
36
|
+
expect(a_request(:get, 'https://www.europeana.eu/api/v2/search.json').
|
37
37
|
with(query: hash_including({'query' => params[:query]}))).
|
38
38
|
to have_been_made.once
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: europeana-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
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: activesupport
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
161
|
+
rubygems_version: 2.5.1
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Ruby client library for the Europeana API
|
@@ -173,3 +173,4 @@ test_files:
|
|
173
173
|
- spec/support/shared_examples/record_request.rb
|
174
174
|
- spec/support/shared_examples/search_request.rb
|
175
175
|
- spec/support/webmock.rb
|
176
|
+
has_rdoc:
|