datadog-notifications 0.3.1 → 0.4.0

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: b3d668af2da1cc25472d44d939c5da4dfba44d70
4
- data.tar.gz: 6b7460e6c592e56d9a6e40be585fe906937cd747
3
+ metadata.gz: 10fe24906ae47d9adc63c38b816c2a0037031a5b
4
+ data.tar.gz: d246fe0ea9503450f1a07877603912ccbb63604f
5
5
  SHA512:
6
- metadata.gz: d735a792588b792d58b5b4ce1bae1ccb4dc078b8d309196cdd2e2681436c3f6514989bb2946a124adc8837bc1377de0658c9b1b591dc365798c318d557cf9515
7
- data.tar.gz: f2682eda37b015a12c8605f1d924a6b1d09e2080201e0eff4f18858b4f1d3ad208f8b4da4649f6fdaff224eb56f58ae8a9be54c63c873f473b261124bdbfcadc
6
+ metadata.gz: e59089271f9102c824bdf60774a71bc5addea3375d3267f43fc40f3f3b873148d06e5f9be9ae4ef9e9315f944c211ae724ab6136dbed335ab513098a413396f4
7
+ data.tar.gz: 8e62d04b05baba9d2476842b04e17a2d3354a6d639e304f6a4c246b82d744da0ece0c8e27fdb6bdd2deab4b1f7dab200249fdd99646d14b1ffddb936396b24d3
@@ -25,10 +25,11 @@ module Datadog::Notifications::Plugins
25
25
  version = route.route_version
26
26
  method = route.route_method
27
27
 
28
- path = route.route_path
29
- path.sub!("(.:format)", "")
28
+ path = route.route_path.dup
29
+ path.sub!(/\(\.\:format\)$/, '')
30
30
  path.sub!(":version/", "") if version
31
- path.gsub!(/\(?:(\w+)\)?/) {|m| "_#{m[1..-1]}_" }
31
+ path.gsub!(/:(\w+)/) {|m| m[1..-1].upcase }
32
+ path.gsub!(/[^\w\/\-]+/, '_')
32
33
 
33
34
  tags = self.tags + %W|method:#{method} path:#{path} status:#{endpoint.status}|
34
35
  tags.push "version:#{version}" if version
@@ -1,5 +1,5 @@
1
1
  module Datadog
2
2
  class Notifications
3
- VERSION = "0.3.1"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -32,13 +32,13 @@ describe Datadog::Notifications::Plugins::Grape do
32
32
  expect(last_response.body).to eq('1 1234')
33
33
 
34
34
  expect(buffered).to eq([
35
- "api.request:1|c|#custom:tag,env:test,host:test.host,more:tags,method:GET,path:/echo/_key1_/_key2_,status:200",
36
- "api.request.time:333|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,path:/echo/_key1_/_key2_,status:200",
35
+ "api.request:1|c|#custom:tag,env:test,host:test.host,more:tags,method:GET,path:/echo/KEY1/KEY2,status:200",
36
+ "api.request.time:333|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,path:/echo/KEY1/KEY2,status:200",
37
37
  ])
38
38
  end
39
39
 
40
40
  it 'should support namespaces and versioning' do
41
- get '/api/v1/sub/versioned'
41
+ get '/api/v1/sub/versioned.txt'
42
42
  expect(last_response.status).to eq(200)
43
43
  expect(last_response.body).to eq('OK')
44
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog-notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport