maremma 4.0 → 4.0.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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad189d5396ce84f2c65102d1bf3cf78948a48a1832a2671e564b6295a9845984
4
- data.tar.gz: 5f652d8d24529b497e38267c9db1bddafe5ff765d74a44f9cbe07d63a1425ac7
3
+ metadata.gz: cc62b0bd0709860d97cca4c1d471484e8f5e8ccf52f26a5270abf0828d883361
4
+ data.tar.gz: d66f0facf5294818014a230070db395979316a2b0c630fd223a76b0320539b0f
5
5
  SHA512:
6
- metadata.gz: 5741c4134caf4c4cfede09805ae373b9fe6a5a22c578252c5eda37d84dd05916f3f25dbc7e92765bd1c72eb6b9f3502f10d7accee2db84688535712a734c54c6
7
- data.tar.gz: abc317fa189d84741b7892a9788cf76b5275b08915c0d1b06c63db8f63a2d104911a630ec0c7f9699948d06553787fd03a41c878f0dc457d392fa1912a3666de
6
+ metadata.gz: 54e1bace317878561d996df304802dff88d70ff3365ee961effe25bcfc3aefc3b56b742d2f52550e1d2ddf7ba5ddfe97b31fc5674300a59fa0a7f5079c5f7b79
7
+ data.tar.gz: bbeb42dd81859cab365d8514c295e2043b5e517ff80193d4edf340803aaf6be468a105cbdff7a8d70d547423b2d79f1d42bc1b8cdff51f687c11a059b25c819a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maremma (4.0)
4
+ maremma (4.0.1)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  addressable (>= 2.3.6)
7
7
  builder (~> 3.2, >= 3.2.2)
@@ -48,10 +48,10 @@ GEM
48
48
  multipart-post (2.0.0)
49
49
  nokogiri (1.8.2)
50
50
  mini_portile2 (~> 2.3.0)
51
- oj (3.4.0)
51
+ oj (3.5.0)
52
52
  public_suffix (3.0.2)
53
53
  rack (2.0.4)
54
- rack-test (0.8.2)
54
+ rack-test (0.8.3)
55
55
  rack (>= 1.0, < 3)
56
56
  rake (12.3.0)
57
57
  rspec (3.7.0)
data/lib/maremma.rb CHANGED
@@ -65,7 +65,7 @@ module Maremma
65
65
  end
66
66
 
67
67
  # return error if we are close to the rate limit, if supported in headers
68
- if get_rate_limit_remaining(response.headers) < 10
68
+ if get_rate_limit_remaining(response.headers) < 3
69
69
  return OpenStruct.new(body: { "errors" => [{ 'status' => 429, 'title' => "Too many requests" }] },
70
70
  headers: response.headers,
71
71
  status: response.status)
@@ -1,3 +1,3 @@
1
1
  module Maremma
2
- VERSION = "4.0"
2
+ VERSION = "4.0.1"
3
3
  end
data/spec/maremma_spec.rb CHANGED
@@ -368,21 +368,21 @@ describe Maremma do
368
368
 
369
369
  context "rate limit exceeded" do
370
370
  it "get json" do
371
- stub = stub_request(:get, url).to_return(status: 200, headers: { 'X-Rate-Limit-Remaining' => 3 })
371
+ stub = stub_request(:get, url).to_return(status: 200, headers: { 'X-Rate-Limit-Remaining' => 2 })
372
372
  response = subject.get(url)
373
373
  expect(response.body).to eq("errors"=>[{"status"=>429, "title"=>"Too many requests"}])
374
374
  expect(stub).to have_been_requested
375
375
  end
376
376
 
377
377
  it "get xml" do
378
- stub = stub_request(:get, url).to_return(status: 200, headers: { 'X-Rate-Limit-Remaining' => 3 })
378
+ stub = stub_request(:get, url).to_return(status: 200, headers: { 'X-Rate-Limit-Remaining' => 2 })
379
379
  response = subject.get(url, accept: 'xml')
380
380
  expect(response.body).to eq("errors"=>[{"status"=>429, "title"=>"Too many requests"}])
381
381
  expect(stub).to have_been_requested
382
382
  end
383
383
 
384
384
  it "get html" do
385
- stub = stub_request(:get, url).to_return(status: 200, headers: { 'X-Rate-Limit-Remaining' => 3 })
385
+ stub = stub_request(:get, url).to_return(status: 200, headers: { 'X-Rate-Limit-Remaining' => 2 })
386
386
  response = subject.get(url, accept: 'html')
387
387
  expect(response.body).to eq("errors"=>[{"status"=>429, "title"=>"Too many requests"}])
388
388
  expect(stub).to have_been_requested
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: '4.0'
4
+ version: 4.0.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: 2018-02-25 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday