grape-appsignal 0.4.0 → 0.4.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: eca276a652910634f9bc78d02cea3c704f9322be
4
- data.tar.gz: 8516f43b625fcf4bb519d03cb6a8d2a1b6488cd4
3
+ metadata.gz: 7bacb69629bb0ce1b5d12fe5b7530f6e3b0da479
4
+ data.tar.gz: 39df3b28bb87097d8a32d2a9d4bdba7f5a48187f
5
5
  SHA512:
6
- metadata.gz: b4b817a504e242701e9b087158679dd4d41d5c29535c5bf355829ea1a23640a6e1b1870c450a7ee73abb7646f232b50deca4fed7e088336d411c7e5b31e88671
7
- data.tar.gz: 5f6be88e8678dfbede37021e9f7d33a5fccaab04819885029c3cce38cfaeb4ee83ca8ada2327920af5932a7a8db1ee1ba43ca7b716be207b48d2d72f9335ea0e
6
+ metadata.gz: fcfce259d320d53a1743b25eb7c8aa8355171f40e8afbb3b26c8dac30e3dea285d12840f3e1f917002c07a74abdb9f6704f200acc37c725bb563e283bcd5fbd8
7
+ data.tar.gz: 8cc64653b024fea9229daa715dfbf66483b431f0d262970a6fb4fc48a8580443f7348ff177c486578a3550230eb2cf386e221bf1bedb33007f33eae0e278102b
@@ -14,9 +14,9 @@ module Appsignal
14
14
 
15
15
  api_endpoint = env['api.endpoint']
16
16
 
17
- puts api_endpoint.method_name
18
17
 
19
18
  method_name = api_endpoint.method_name.gsub(/ ?[ \/]/, '/') if api_endpoint && api_endpoint.method_name
19
+ method_name = method_name.gsub(/\/\//, '/') if method_name
20
20
 
21
21
  request_path = api_endpoint.routes.first.route_path[1..-1].sub(/\(\.:format\)\z/, "")
22
22
 
@@ -1,5 +1,5 @@
1
1
  module Appsignal
2
2
  module Grape
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
-
3
2
  describe Appsignal::Grape::Middleware do
4
3
 
5
4
  class ComplexAPI < Grape::API
@@ -11,6 +10,9 @@ describe Appsignal::Grape::Middleware do
11
10
  get 'name/:name' do
12
11
  "hello #{params['name']}"
13
12
  end
13
+ get '/goodbye' do
14
+ "hello #{params['name']}"
15
+ end
14
16
  end
15
17
  end
16
18
 
@@ -88,5 +90,27 @@ describe Appsignal::Grape::Middleware do
88
90
  expect(subject.status).to eq(200)
89
91
  end
90
92
  end
93
+
94
+ context "with a complex API" do
95
+ let(:events){ [] }
96
+ let(:app){ ComplexAPI }
97
+ before do
98
+ ActiveSupport::Notifications.subscribe(/^[^!]/) do |*args|
99
+ events << ActiveSupport::Notifications::Event.new(*args)
100
+ end
101
+ end
102
+
103
+ subject { get "/api/v1/hello/goodbye/"; events.last}
104
+
105
+ it "delivers a payload consistent with the API call."do
106
+ expect(subject.payload ).to eq(
107
+ { method: "GET" , path: "api/:version/hello/goodbye", action: "Grape(v1)(api)::GET/hello/goodbye", class: "API"}
108
+ )
109
+ end
110
+
111
+ it "names the payload consistent with the API call."do
112
+ expect(subject.name ).to eq("process_action.grape.GET.api.version.hello.goodbye")
113
+ end
114
+ end
91
115
  end
92
116
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Madsen