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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd7f003c22fa41c883484585a8044f5d623884fd
4
- data.tar.gz: d29f04a6137ec76d11e29250c0121404d79e50b2
3
+ metadata.gz: 3000f95011dbbb20f73e3cb9ba95f7df3270b84a
4
+ data.tar.gz: c079d45e7bd0aecb28c38e98fc656b8a38167ebe
5
5
  SHA512:
6
- metadata.gz: 68a3f162e0a5e98f4147f597af4fecc041d711eb7400c470b26452da5da65c77eede3215a6861f130b0dbec6aa95516ee741a0a209675a6ecd9e68b0cf456672
7
- data.tar.gz: 2a92fa93050032dd204d9d1a37f626424b867926ed099def4c48eec20c1ab3e7bf5c09b5158d22d947e5cc4ab1f4142f4f32e1af4b520fc4f8b569bdc006db84
6
+ metadata.gz: 1cb03d2e5cdfecbb017f61d9e93557dd5d53fbe1c7687a60758da8b0cbc14dc149ed3daa3ebd38040747316840f1622b1e8432eced86196bccf6e081b129276b
7
+ data.tar.gz: f5156e824985e613c78deb80b9f32ce14c83c4907cd81294cf86fbc428f19f7473b3d46b80fac296f9d7032727ad7da8ef3b30e8ad32882470b48a9c687a1eb8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v1.0.11
2
+
3
+ - Fix a NoMethodError with logging the response format in grape
4
+
1
5
  ## v1.0.10
2
6
 
3
7
  - Automatically add default `datadog` appender when calling `Sapience.metrics`
@@ -39,7 +39,7 @@ module Sapience
39
39
  {
40
40
  method: request.request_method,
41
41
  request_path: request.path,
42
- format: env["api.endpoint"].instance_variable_get(:@app).instance_variable_get(:@app).options[: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
@@ -1,3 +1,3 @@
1
1
  module Sapience
2
- VERSION = "1.0.10"
2
+ VERSION = "1.0.11"
3
3
  end
@@ -1 +1 @@
1
- ../../.rspec
1
+ test_apps/grape/../../.rspec
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../..
3
3
  specs:
4
- sapience (1.0.9)
4
+ sapience (1.0.10)
5
5
  concurrent-ruby (~> 1.0)
6
6
 
7
7
  GEM
@@ -137,4 +137,4 @@ DEPENDENCIES
137
137
  simplecov-json
138
138
 
139
139
  BUNDLED WITH
140
- 1.13.1
140
+ 1.13.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../..
3
3
  specs:
4
- sapience (1.0.9)
4
+ sapience (1.0.10)
5
5
  concurrent-ruby (~> 1.0)
6
6
 
7
7
  GEM
@@ -135,4 +135,4 @@ DEPENDENCIES
135
135
  simplecov-json
136
136
 
137
137
  BUNDLED WITH
138
- 1.13.1
138
+ 1.13.2
@@ -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: :json,
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: :json,
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
@@ -1 +1 @@
1
- ../../.rspec
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.10
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-11 00:00:00.000000000 Z
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.5.1
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.