sapience 1.0.10 → 1.0.11
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sapience/extensions/grape/middleware/logging.rb +11 -1
- data/lib/sapience/version.rb +1 -1
- data/test_apps/grape/.rspec +1 -1
- data/test_apps/grape/gemfiles/grape_0.16.2.gemfile.lock +2 -2
- data/test_apps/grape/gemfiles/grape_0.17.0.gemfile.lock +2 -2
- data/test_apps/grape/spec/lib/ping/api_spec.rb +5 -5
- data/test_apps/rails/.rspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3000f95011dbbb20f73e3cb9ba95f7df3270b84a
|
4
|
+
data.tar.gz: c079d45e7bd0aecb28c38e98fc656b8a38167ebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb03d2e5cdfecbb017f61d9e93557dd5d53fbe1c7687a60758da8b0cbc14dc149ed3daa3ebd38040747316840f1622b1e8432eced86196bccf6e081b129276b
|
7
|
+
data.tar.gz: f5156e824985e613c78deb80b9f32ce14c83c4907cd81294cf86fbc428f19f7473b3d46b80fac296f9d7032727ad7da8ef3b30e8ad32882470b48a9c687a1eb8
|
data/CHANGELOG.md
CHANGED
@@ -39,7 +39,7 @@ module Sapience
|
|
39
39
|
{
|
40
40
|
method: request.request_method,
|
41
41
|
request_path: request.path,
|
42
|
-
format:
|
42
|
+
format: response_format,
|
43
43
|
status: response.try(:status) || 404,
|
44
44
|
class_name: env["api.endpoint"].options[:for].to_s,
|
45
45
|
action: "index",
|
@@ -60,6 +60,16 @@ module Sapience
|
|
60
60
|
|
61
61
|
private
|
62
62
|
|
63
|
+
def content_type
|
64
|
+
request.env.fetch("CONTENT_TYPE") do
|
65
|
+
request.env["CONTENT-TYPE"]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def response_format
|
70
|
+
content_type.to_s.split("/").last
|
71
|
+
end
|
72
|
+
|
63
73
|
def request
|
64
74
|
@request ||= ::Rack::Request.new(env)
|
65
75
|
end
|
data/lib/sapience/version.rb
CHANGED
data/test_apps/grape/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
test_apps/grape/../../.rspec
|
@@ -12,7 +12,7 @@ describe Ping::API do
|
|
12
12
|
let(:logger) { Grape::API.logger }
|
13
13
|
|
14
14
|
specify do
|
15
|
-
get "/api/ping"
|
15
|
+
get "/api/ping", {}, "CONTENT-TYPE" => "application/json"
|
16
16
|
expect(last_response.body).to match(/PONG/)
|
17
17
|
end
|
18
18
|
|
@@ -34,7 +34,7 @@ describe Ping::API do
|
|
34
34
|
expect(logger).to receive(:info).with(
|
35
35
|
method: "GET",
|
36
36
|
request_path: "/api/ping",
|
37
|
-
format:
|
37
|
+
format: "json",
|
38
38
|
status: 200,
|
39
39
|
class_name: "Ping::API",
|
40
40
|
action: "index",
|
@@ -50,7 +50,7 @@ describe Ping::API do
|
|
50
50
|
),
|
51
51
|
)
|
52
52
|
|
53
|
-
get "/api/ping"
|
53
|
+
get "/api/ping", {}, "CONTENT-TYPE" => "application/json"
|
54
54
|
end
|
55
55
|
|
56
56
|
context "no routes defined" do
|
@@ -58,7 +58,7 @@ describe Ping::API do
|
|
58
58
|
expect(logger).to receive(:info).with(
|
59
59
|
method: "GET",
|
60
60
|
request_path: "/api/404",
|
61
|
-
format:
|
61
|
+
format: "json",
|
62
62
|
status: 404,
|
63
63
|
class_name: "Ping::API",
|
64
64
|
action: "index",
|
@@ -74,7 +74,7 @@ describe Ping::API do
|
|
74
74
|
),
|
75
75
|
)
|
76
76
|
|
77
|
-
get "/api/404"
|
77
|
+
get "/api/404", {}, "CONTENT-TYPE" => "application/json"
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
data/test_apps/rails/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
test_apps/rails/../../.rspec
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sapience
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-10-
|
12
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|
@@ -456,7 +456,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
456
456
|
version: '0'
|
457
457
|
requirements: []
|
458
458
|
rubyforge_project:
|
459
|
-
rubygems_version: 2.
|
459
|
+
rubygems_version: 2.6.7
|
460
460
|
signing_key:
|
461
461
|
specification_version: 4
|
462
462
|
summary: Hasslefree autoconfiguration for logging, metrics and exception collection.
|