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 +4 -4
- data/README.md +1 -0
- data/grape-middleware-logger.gemspec +1 -1
- data/lib/grape/middleware/logger.rb +2 -7
- data/spec/lib/grape/middleware/logger_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efcf5674de9e8fcbcce7aebfda90fa8231e35475
|
4
|
+
data.tar.gz: 856cc2ebb17f174185c02103200457da79841acc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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`)
|
@@ -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
|
-
|
59
|
-
|
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(:
|
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(
|
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(
|
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
|
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.
|
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-
|
11
|
+
date: 2015-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|