grape-middleware-logger 1.5.0 → 1.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: 3669f6ad5c3a84da925373a79582e997b707fd3a
4
- data.tar.gz: 94f09b4036667d394c5f794eab4782aedf656bb6
3
+ metadata.gz: efcf5674de9e8fcbcce7aebfda90fa8231e35475
4
+ data.tar.gz: 856cc2ebb17f174185c02103200457da79841acc
5
5
  SHA512:
6
- metadata.gz: 80804fc3261ce716e57e458c32381f4bb83c330fd6801f901d394b22a62d68d5b0574b197e9b3bf3467f5bcc633a2e0d1754beef86a239d04cd1dbe63dd4c63a
7
- data.tar.gz: 46d9aadf9b6ee7ea7ff9201e2dc8dd596f53d9727d2c25b6c1a8de919fa592ab7dd420ce8a9a4302f406afdf5668c9f150c470cd6d4ee10b31b90f6fba961b34
6
+ metadata.gz: 98ad10db03c07d57c1264d06fbb3cb54ab312746998873ae1e0b3aa9c73d7e503ca2a5d252d78a5d685bc08f75819c80c8b0a2192541e53b97db083b483b6df8
7
+ data.tar.gz: 0e1975f5d77664c5cfa05d73d74d45fbf4c4daab48af8c2de17eff7ca51c1744933ff3048121537cb978476cb6dfc1029202fcd982d1b957a5399243c0374ad2
data/README.md CHANGED
@@ -93,6 +93,7 @@ and would love to see these two consolidated at some point.
93
93
  ## Contributing
94
94
 
95
95
  1. Fork it ( https://github.com/ridiculous/grape-middleware-logger/fork )
96
+ 1. Run the test suite with `bin/test`
96
97
  2. Create your feature branch (`git checkout -b my-new-feature`)
97
98
  3. Commit your changes (`git commit -am 'Add some feature'`)
98
99
  4. Push to the branch (`git push origin my-new-feature`)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'grape-middleware-logger'
5
- spec.version = '1.5.0'
5
+ spec.version = '1.5.1'
6
6
  spec.platform = Gem::Platform::RUBY
7
7
  spec.authors = ['Ryan Buckley']
8
8
  spec.email = ['arebuckley@gmail.com']
@@ -55,13 +55,8 @@ class Grape::Middleware::Logger < Grape::Middleware::Globals
55
55
  after_failure(error)
56
56
  throw(:error, error)
57
57
  else
58
- # Usually a rack response object is returned: https://github.com/ruby-grape/grape/blob/master/UPGRADING.md#changes-in-middleware
59
- # However, rack/auth/abstract/handler.rb still returns an array instead of a rack response object.
60
- if @app_response.is_a?(Array)
61
- after(@app_response[0])
62
- else
63
- after(@app_response.status)
64
- end
58
+ status, _, _ = *@app_response
59
+ after(status)
65
60
  end
66
61
  @app_response
67
62
  end
@@ -40,20 +40,20 @@ describe Grape::Middleware::Logger do
40
40
  end
41
41
 
42
42
  context 'when calling the app results in an array response' do
43
- let(:app_response_array) { [401, {}, []] }
43
+ let(:app_response) { [401, {}, []] }
44
44
 
45
45
  it 'calls +after+ with the correct status' do
46
- expect(app).to receive(:call).with(env).and_return(app_response_array)
46
+ expect(app).to receive(:call).with(env).and_return(app_response)
47
47
  expect(subject).to receive(:before)
48
48
  expect(subject).to receive(:after).with(401)
49
49
  subject.call!(env)
50
50
  end
51
51
 
52
52
  it 'returns the @app_response' do
53
- expect(app).to receive(:call).with(env).and_return(app_response_array)
53
+ expect(app).to receive(:call).with(env).and_return(app_response)
54
54
  allow(subject).to receive(:before)
55
55
  allow(subject).to receive(:after)
56
- expect(subject.call!(env)).to eq app_response_array
56
+ expect(subject.call!(env)).to eq app_response
57
57
  end
58
58
  end
59
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-middleware-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-12 00:00:00.000000000 Z
11
+ date: 2015-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape