maremma 2.1.1 → 2.2.1

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmViMTFhMmVkNTczYTJmNmJkN2VkZWIzMTJhNTM3M2Q0NjlhM2QxYw==
4
+ MmI3OWViNmU5ZTMyYTNiYzU5ZTg0MzJkNjY3Nzc3MmU2ZGJkN2NhNQ==
5
5
  data.tar.gz: !binary |-
6
- NGFkMDVkNWEzODdhNDExOWY5ZTE0ZjA1OGM0ZjJkYjY4MjI4ZTg2Nw==
6
+ YWFhNmNmNjkxOGI4ODQxOWQwMjYxNWQzOWVmYzBlZWVlNGYwMDdhNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWNkZjkyNjUzOWRmOTQ2NjcwZTk4MTRmNTQzZjQ0NTA4ZGNjZDAxMDNmMGI3
10
- MzcwMDAxMDEyYTc1ZWRhOGYxNDY4Nzg4NTQzOWYzNWY0YmYyMDdiNjVkMmQ5
11
- NzRjMWViZTQ2MDc3ZWIxMTgyYTg1NTVmMTkxMTk4YzIzYzIzMmM=
9
+ NWMxMjVjMGJlMDZmZGJhOTg5MjYwY2IyMTEzMjgzNDA0YTBmYzE1N2QzNWEx
10
+ YTBjODQ0ZTFjMjIxNjU5N2I2MGNjYmNkYjhjNjkyMGIxMDVlMTNhZDFmMjNl
11
+ YzlmN2MyZWVjODRjMzQ2ZTYyMDc5NWU5YzkwM2I4ZTM3ODcxZTM=
12
12
  data.tar.gz: !binary |-
13
- MTQ0NDhhMzc3ODIzOTI5YjRmZjliNzRlNDZjMTc1OWRlOWQxMjViMTBlNDhj
14
- ODQzNGY5OGY1ZDYwOGU5MWQxNGRhYTUzZWZjMTU4ZmRmYzViODcyNGExZTM1
15
- NWNlYjEzNzJmNTE4NjYyOGI4Yzg1MDQwNDVmNDAyOTA1ODA2ZTI=
13
+ OWZhNjRmMDliYmRhOTI1YWEyOWMxNDBjYjhiMGZmOWFmODQyNTY3ZGUyNjMy
14
+ ZGRmNzUxMzdhYzVmYjMzNzlhN2RhMGE2YzA2YTNlZTQ4MWU5Y2ZjODFmNDhl
15
+ NjY2NTRjYTRlMDE0M2I3OTg0OGM0ZmEzMjcwMDM4NDhmODFmMTE=
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2
3
+ - 2.2.4
4
4
  install:
5
5
  - travis_retry bundle install
6
6
  script: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v.2.2 (July 1, 2016)
2
+
3
+ [maremma 2.2](https://github.com/datacite/maremma/releases/tag/v.2.2) was released on July 1, 2016:
4
+
5
+ * use `Faraday::FlatParamsEncoder` to enable sending the same URL parameter multiple times with different values
6
+
1
7
  ## v.2.1 (March 5, 2016)
2
8
 
3
9
  [maremma 2.1](https://github.com/datacite/maremma/releases/tag/v.2.1) was released on March 5, 2016:
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maremma (2.1.1)
4
+ maremma (2.2.1)
5
5
  activesupport (~> 4.2, >= 4.2.5)
6
6
  builder (~> 3.2, >= 3.2.2)
7
7
  excon (~> 0.45.0)
8
- faraday (~> 0.9.0)
8
+ faraday (~> 0.9.2)
9
9
  faraday-encoding (~> 0.0.1)
10
10
  faraday_middleware (~> 0.10.0)
11
11
  multi_json (~> 1.11.2)
@@ -15,13 +15,13 @@ PATH
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activesupport (4.2.5.1)
18
+ activesupport (4.2.6)
19
19
  i18n (~> 0.7)
20
20
  json (~> 1.7, >= 1.7.7)
21
21
  minitest (~> 5.1)
22
22
  thread_safe (~> 0.3, >= 0.3.4)
23
23
  tzinfo (~> 1.1)
24
- addressable (2.3.8)
24
+ addressable (2.4.0)
25
25
  builder (3.2.2)
26
26
  crack (0.4.3)
27
27
  safe_yaml (~> 1.0.0)
@@ -29,34 +29,36 @@ GEM
29
29
  excon (0.45.4)
30
30
  faraday (0.9.2)
31
31
  multipart-post (>= 1.2, < 3)
32
- faraday-encoding (0.0.1)
32
+ faraday-encoding (0.0.3)
33
33
  faraday
34
34
  faraday_middleware (0.10.0)
35
35
  faraday (>= 0.7.4, < 0.10)
36
- hashdiff (0.2.3)
36
+ hashdiff (0.3.0)
37
37
  i18n (0.7.0)
38
38
  json (1.8.3)
39
- mini_portile2 (2.0.0)
40
- minitest (5.8.4)
41
- multi_json (1.11.2)
39
+ mini_portile2 (2.1.0)
40
+ minitest (5.9.0)
41
+ multi_json (1.11.3)
42
42
  multipart-post (2.0.0)
43
- nokogiri (1.6.7.2)
44
- mini_portile2 (~> 2.0.0.rc2)
43
+ nokogiri (1.6.8)
44
+ mini_portile2 (~> 2.1.0)
45
+ pkg-config (~> 1.1.7)
45
46
  oj (2.13.1)
46
- rack (1.6.4)
47
+ pkg-config (1.1.7)
48
+ rack (2.0.1)
47
49
  rack-test (0.6.3)
48
50
  rack (>= 1.0)
49
- rake (10.4.2)
51
+ rake (11.2.2)
50
52
  rspec (3.4.0)
51
53
  rspec-core (~> 3.4.0)
52
54
  rspec-expectations (~> 3.4.0)
53
55
  rspec-mocks (~> 3.4.0)
54
- rspec-core (3.4.1)
56
+ rspec-core (3.4.4)
55
57
  rspec-support (~> 3.4.0)
56
58
  rspec-expectations (3.4.0)
57
59
  diff-lcs (>= 1.2.0, < 2.0)
58
60
  rspec-support (~> 3.4.0)
59
- rspec-mocks (3.4.0)
61
+ rspec-mocks (3.4.1)
60
62
  diff-lcs (>= 1.2.0, < 2.0)
61
63
  rspec-support (~> 3.4.0)
62
64
  rspec-support (3.4.1)
@@ -64,9 +66,9 @@ GEM
64
66
  thread_safe (0.3.5)
65
67
  tzinfo (1.2.2)
66
68
  thread_safe (~> 0.1)
67
- vcr (3.0.1)
68
- webmock (1.22.5)
69
- addressable (< 2.4.0)
69
+ vcr (3.0.3)
70
+ webmock (1.24.6)
71
+ addressable (>= 2.3.6)
70
72
  crack (>= 0.3.2)
71
73
  hashdiff
72
74
 
@@ -81,3 +83,6 @@ DEPENDENCIES
81
83
  rspec (~> 3.4)
82
84
  vcr
83
85
  webmock (~> 1.22, >= 1.22.3)
86
+
87
+ BUNDLED WITH
88
+ 1.12.5
data/lib/maremma.rb CHANGED
@@ -44,7 +44,9 @@ module Maremma
44
44
 
45
45
  conn.options[:timeout] = options[:timeout] || DEFAULT_TIMEOUT
46
46
 
47
- response = conn.get url, {}, options[:headers]
47
+ response = conn.get url, {}, options[:headers] do |request|
48
+ request.options.params_encoder = Faraday::FlatParamsEncoder
49
+ end
48
50
 
49
51
  # return error if we are close to the rate limit, if supported in headers
50
52
  if get_rate_limit_remaining(response.headers) < 10
@@ -1,3 +1,3 @@
1
1
  module Maremma
2
- VERSION = "2.1.1"
2
+ VERSION = "2.2.1"
3
3
  end
data/maremma.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  # Declary dependencies here, rather than in the Gemfile
22
- s.add_dependency 'faraday', '~> 0.9.0'
22
+ s.add_dependency 'faraday', '~> 0.9.2'
23
23
  s.add_dependency 'faraday_middleware', '~> 0.10.0'
24
24
  s.add_dependency 'faraday-encoding', '~> 0.0.1'
25
25
  s.add_dependency 'excon', '~> 0.45.0'
data/spec/maremma_spec.rb CHANGED
@@ -33,6 +33,23 @@ describe Maremma do
33
33
  subject.post(url, content_type: 'xml', data: post_data.to_xml) { |response| expect(Hash.from_xml(response.to_s)["hash"]).to eq(data) }
34
34
  expect(stub).to have_been_requested
35
35
  end
36
+
37
+ it "get json with params" do
38
+ params = { q: "*:*",
39
+ fl: "doi,title,description,publisher,publicationYear,resourceType,resourceTypeGeneral,rightsURI,datacentre_symbol,xml,minted,updated",
40
+ fq: %w(has_metadata:true is_active:true),
41
+ facet: "true",
42
+ 'facet.field' => %w(resourceType_facet publicationYear datacentre_facet),
43
+ 'facet.limit' => 10,
44
+ 'f.resourceType_facet.facet.limit' => 15,
45
+ wt: "json" }.compact
46
+ url = "http://example.org?" + URI.encode_www_form(params)
47
+ stub = stub_request(:get, url).to_return(:body => data.to_json, :status => 200, :headers => { "Content-Type" => "application/json" })
48
+ response = subject.get(url)
49
+ expect(response).to eq("data" => data)
50
+ expect(stub).to have_been_requested
51
+ expect(url).to eq("http://example.org?q=*%3A*&fl=doi%2Ctitle%2Cdescription%2Cpublisher%2CpublicationYear%2CresourceType%2CresourceTypeGeneral%2CrightsURI%2Cdatacentre_symbol%2Cxml%2Cminted%2Cupdated&fq=has_metadata%3Atrue&fq=is_active%3Atrue&facet=true&facet.field=resourceType_facet&facet.field=publicationYear&facet.field=datacentre_facet&facet.limit=10&f.resourceType_facet.facet.limit=15&wt=json")
52
+ end
36
53
  end
37
54
 
38
55
  context "empty response" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maremma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-05 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.0
19
+ version: 0.9.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.0
26
+ version: 0.9.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday_middleware
29
29
  requirement: !ruby/object:Gem::Requirement