datadog-notifications 0.6.5 → 0.6.6

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
  SHA256:
3
- metadata.gz: 22dc145596f1b9ff7ce13aa1d288721b1b91b2b7de2a3ca79eefcc0d9608735b
4
- data.tar.gz: 0470ffefc29242921d54223a46459f9324c55cc4d8ccf970deb7989dcc0576d8
3
+ metadata.gz: 299177adeebc9ed3fd6984f9725fb88ae46ab24b1582548976e8d4aa1a48f55a
4
+ data.tar.gz: bdea7f81d306dbb4f45d77b1870475596a3b9e04ef4675ca7ef117c03066be9a
5
5
  SHA512:
6
- metadata.gz: 3f4692ee83c9af8255074edf39e3957bc98bc0ff514d595f83a52e0c704488088b81c0f51e72c10a40c2ca66f59e9776b5d134fc79cb1f4e70cb7eb4079da2e2
7
- data.tar.gz: 75624cd42572dd722293c4432f6b456b1a5ad42e977e5d98cf1932c804d9d95b1316779019ffedab6383fd2d8ee3930771715d22bd73cffad3201236ac7dc2e2
6
+ metadata.gz: 4c7a6359a6b6abc80be605d04dd8934d7460de1a16ec1f2c7d6018c7f37c5b036658b8fa022f459117ea2367157cdc1e601c6482b72ff5ecf85e6965835e4d4e
7
+ data.tar.gz: f72472a2cfee96d1cb79f6ceddccdc8103ba8dffdd86465866dc17236ac95b59822558bad85cb40e848f4372a2ef588ba1bcd2fc7e3834a8e0415a2f23f0cbc7
@@ -0,0 +1,21 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ["2.6", "2.7", "3.0"]
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: ${{ matrix.ruby-version }}
20
+ bundler-cache: true
21
+ - run: bundle exec rake
data/.rubocop.yml CHANGED
@@ -1,8 +1,12 @@
1
- inherit_from:
2
- - https://gitlab.com/bsm/misc/raw/master/rubocop/default.yml
1
+ inherit_gem:
2
+ rubocop-bsm:
3
+ - default.yml
4
+ inherit_mode:
5
+ merge:
6
+ - Exclude
3
7
 
4
8
  AllCops:
5
- TargetRubyVersion: "2.5"
9
+ TargetRubyVersion: "2.6"
6
10
 
7
11
  Naming/FileName:
8
12
  Exclude:
data/Gemfile.lock CHANGED
@@ -1,109 +1,122 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- datadog-notifications (0.6.5)
4
+ datadog-notifications (0.6.6)
5
5
  activesupport
6
- dogstatsd-ruby (>= 4.2, < 5.0)
6
+ dogstatsd-ruby (>= 4.8, < 5.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (6.0.3.1)
12
- activesupport (= 6.0.3.1)
13
- activerecord (6.0.3.1)
14
- activemodel (= 6.0.3.1)
15
- activesupport (= 6.0.3.1)
16
- activesupport (6.0.3.1)
11
+ activemodel (6.1.3)
12
+ activesupport (= 6.1.3)
13
+ activerecord (6.1.3)
14
+ activemodel (= 6.1.3)
15
+ activesupport (= 6.1.3)
16
+ activesupport (6.1.3)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (>= 0.7, < 2)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- zeitwerk (~> 2.2, >= 2.2.2)
22
- ast (2.4.0)
18
+ i18n (>= 1.6, < 2)
19
+ minitest (>= 5.1)
20
+ tzinfo (~> 2.0)
21
+ zeitwerk (~> 2.3)
22
+ ast (2.4.2)
23
23
  builder (3.2.4)
24
- concurrent-ruby (1.1.6)
25
- diff-lcs (1.3)
26
- dogstatsd-ruby (4.8.1)
27
- dry-configurable (0.11.5)
24
+ concurrent-ruby (1.1.8)
25
+ diff-lcs (1.4.4)
26
+ dogstatsd-ruby (4.8.3)
27
+ dry-configurable (0.12.1)
28
28
  concurrent-ruby (~> 1.0)
29
- dry-core (~> 0.4, >= 0.4.7)
30
- dry-equalizer (~> 0.2)
29
+ dry-core (~> 0.5, >= 0.5.0)
31
30
  dry-container (0.7.2)
32
31
  concurrent-ruby (~> 1.0)
33
32
  dry-configurable (~> 0.1, >= 0.1.3)
34
- dry-core (0.4.9)
33
+ dry-core (0.5.0)
35
34
  concurrent-ruby (~> 1.0)
36
- dry-equalizer (0.3.0)
37
35
  dry-inflector (0.2.0)
38
- dry-logic (1.0.6)
36
+ dry-logic (1.1.0)
39
37
  concurrent-ruby (~> 1.0)
40
- dry-core (~> 0.2)
41
- dry-equalizer (~> 0.2)
42
- dry-types (1.4.0)
38
+ dry-core (~> 0.5, >= 0.5)
39
+ dry-types (1.5.1)
43
40
  concurrent-ruby (~> 1.0)
44
41
  dry-container (~> 0.3)
45
- dry-core (~> 0.4, >= 0.4.4)
46
- dry-equalizer (~> 0.3)
42
+ dry-core (~> 0.5, >= 0.5)
47
43
  dry-inflector (~> 0.1, >= 0.1.2)
48
44
  dry-logic (~> 1.0, >= 1.0.2)
49
- grape (1.3.3)
45
+ grape (1.5.2)
50
46
  activesupport
51
47
  builder
52
48
  dry-types (>= 1.1)
53
49
  mustermann-grape (~> 1.0.0)
54
50
  rack (>= 1.3.0)
55
51
  rack-accept
56
- i18n (1.8.3)
52
+ i18n (1.8.9)
57
53
  concurrent-ruby (~> 1.0)
58
- minitest (5.14.1)
54
+ minitest (5.14.4)
59
55
  mustermann (1.1.1)
60
56
  ruby2_keywords (~> 0.0.1)
61
57
  mustermann-grape (1.0.1)
62
58
  mustermann (>= 1.0.0)
63
- parallel (1.19.1)
64
- parser (2.7.1.3)
65
- ast (~> 2.4.0)
66
- rack (2.2.2)
59
+ parallel (1.20.1)
60
+ parser (3.0.0.0)
61
+ ast (~> 2.4.1)
62
+ rack (2.2.3)
67
63
  rack-accept (0.4.5)
68
64
  rack (>= 0.4)
69
65
  rack-test (1.1.0)
70
66
  rack (>= 1.0, < 3)
71
67
  rainbow (3.0.0)
72
- rake (13.0.1)
73
- regexp_parser (1.7.0)
68
+ rake (13.0.3)
69
+ regexp_parser (2.1.1)
74
70
  rexml (3.2.4)
75
- rspec (3.9.0)
76
- rspec-core (~> 3.9.0)
77
- rspec-expectations (~> 3.9.0)
78
- rspec-mocks (~> 3.9.0)
79
- rspec-core (3.9.2)
80
- rspec-support (~> 3.9.3)
81
- rspec-expectations (3.9.2)
71
+ rspec (3.10.0)
72
+ rspec-core (~> 3.10.0)
73
+ rspec-expectations (~> 3.10.0)
74
+ rspec-mocks (~> 3.10.0)
75
+ rspec-core (3.10.1)
76
+ rspec-support (~> 3.10.0)
77
+ rspec-expectations (3.10.1)
82
78
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.9.0)
84
- rspec-mocks (3.9.1)
79
+ rspec-support (~> 3.10.0)
80
+ rspec-mocks (3.10.2)
85
81
  diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.9.0)
87
- rspec-support (3.9.3)
88
- rubocop (0.85.0)
82
+ rspec-support (~> 3.10.0)
83
+ rspec-support (3.10.2)
84
+ rubocop (1.11.0)
89
85
  parallel (~> 1.10)
90
- parser (>= 2.7.0.1)
86
+ parser (>= 3.0.0.0)
91
87
  rainbow (>= 2.2.2, < 4.0)
92
- regexp_parser (>= 1.7)
88
+ regexp_parser (>= 1.8, < 3.0)
93
89
  rexml
94
- rubocop-ast (>= 0.0.3)
90
+ rubocop-ast (>= 1.2.0, < 2.0)
95
91
  ruby-progressbar (~> 1.7)
96
- unicode-display_width (>= 1.4.0, < 2.0)
97
- rubocop-ast (0.0.3)
98
- parser (>= 2.7.0.1)
99
- ruby-progressbar (1.10.1)
100
- ruby2_keywords (0.0.2)
92
+ unicode-display_width (>= 1.4.0, < 3.0)
93
+ rubocop-ast (1.4.1)
94
+ parser (>= 2.7.1.5)
95
+ rubocop-bsm (0.5.4)
96
+ rubocop (~> 1.0)
97
+ rubocop-performance
98
+ rubocop-rails
99
+ rubocop-rake
100
+ rubocop-rspec
101
+ rubocop-performance (1.10.1)
102
+ rubocop (>= 0.90.0, < 2.0)
103
+ rubocop-ast (>= 0.4.0)
104
+ rubocop-rails (2.9.1)
105
+ activesupport (>= 4.2.0)
106
+ rack (>= 1.1)
107
+ rubocop (>= 0.90.0, < 2.0)
108
+ rubocop-rake (0.5.1)
109
+ rubocop
110
+ rubocop-rspec (2.2.0)
111
+ rubocop (~> 1.0)
112
+ rubocop-ast (>= 1.1.0)
113
+ ruby-progressbar (1.11.0)
114
+ ruby2_keywords (0.0.4)
101
115
  sqlite3 (1.4.2)
102
- thread_safe (0.3.6)
103
- tzinfo (1.2.7)
104
- thread_safe (~> 0.1)
105
- unicode-display_width (1.7.0)
106
- zeitwerk (2.3.0)
116
+ tzinfo (2.0.4)
117
+ concurrent-ruby (~> 1.0)
118
+ unicode-display_width (2.0.0)
119
+ zeitwerk (2.4.2)
107
120
 
108
121
  PLATFORMS
109
122
  ruby
@@ -116,7 +129,7 @@ DEPENDENCIES
116
129
  rack-test
117
130
  rake
118
131
  rspec
119
- rubocop
132
+ rubocop-bsm
120
133
  sqlite3
121
134
 
122
135
  BUNDLED WITH
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
14
14
  s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
15
15
  s.test_files = s.files.grep(%r{^(spec)/})
16
16
  s.require_paths = ['lib']
17
- s.required_ruby_version = '>= 2.5'
17
+ s.required_ruby_version = '>= 2.6'
18
18
 
19
19
  s.add_runtime_dependency 'activesupport'
20
- s.add_runtime_dependency 'dogstatsd-ruby', '>= 4.2', '< 5.0'
20
+ s.add_runtime_dependency 'dogstatsd-ruby', '>= 4.8', '< 5.0'
21
21
 
22
22
  s.add_development_dependency 'activerecord'
23
23
  s.add_development_dependency 'bundler'
@@ -25,6 +25,6 @@ Gem::Specification.new do |s|
25
25
  s.add_development_dependency 'rack-test'
26
26
  s.add_development_dependency 'rake'
27
27
  s.add_development_dependency 'rspec'
28
- s.add_development_dependency 'rubocop'
28
+ s.add_development_dependency 'rubocop-bsm'
29
29
  s.add_development_dependency 'sqlite3'
30
30
  end
@@ -49,16 +49,16 @@ module Datadog::Notifications::Plugins
49
49
 
50
50
  def extract_path(endpoint)
51
51
  route = begin
52
- endpoint.route
53
- rescue NoMethodError
54
- nil
55
- end
52
+ endpoint.route
53
+ rescue NoMethodError
54
+ nil
55
+ end
56
56
  return endpoint.request.path unless route
57
57
 
58
58
  path = endpoint.route.path.dup
59
59
  path.sub!(/\(\.:format\)$/, '')
60
60
  path.sub!(':version/', '') if endpoint.version
61
- path.gsub!(/:(\w+)/) {|m| m[1..-1].upcase }
61
+ path.gsub!(/:(\w+)/) {|m| m[1..].upcase }
62
62
  path
63
63
  end
64
64
  end
@@ -1,5 +1,5 @@
1
1
  module Datadog
2
2
  class Notifications
3
- VERSION = '0.6.5'.freeze
3
+ VERSION = '0.6.6'.freeze
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Datadog::Notifications::Config do
4
- it 'should be connect!' do
4
+ it 'is connect!' do
5
5
  subject.reporter = Mock::Reporter
6
6
  subject.hostname = 'test.host'
7
7
  subject.tags = ['custom:tag']
@@ -12,7 +12,7 @@ describe Datadog::Notifications::Config do
12
12
  end
13
13
 
14
14
  RSpec.shared_examples 'host tag is not picked up' do |hostname|
15
- it 'should not pick up the host tag' do
15
+ it 'does not pick up the host tag' do
16
16
  subject.reporter = Mock::Reporter
17
17
  subject.hostname = hostname
18
18
  subject.tags = ['custom:tag']
@@ -26,7 +26,7 @@ describe Datadog::Notifications::Config do
26
26
  include_examples 'host tag is not picked up', false
27
27
  include_examples 'host tag is not picked up', 'false'
28
28
 
29
- it 'should instantiate plugins on use' do
29
+ it 'instantiates plugins on use' do
30
30
  subject.use Datadog::Notifications::Plugins::ActionController
31
31
  expect(subject.plugins.size).to eq(1)
32
32
  expect(subject.plugins.first).to be_instance_of(Datadog::Notifications::Plugins::ActionController)
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Datadog::Notifications::Plugins::ActiveRecord do
4
- it 'should send an increment and timing event for each query' do
4
+ it 'sends an increment and timing event for each query' do
5
5
  Post.all.to_a
6
6
  expect(buffered).to eq [
7
7
  'activerecord.sql:1|c|#custom:tag,env:test,host:test.host,query:post.load',
@@ -9,7 +9,7 @@ describe Datadog::Notifications::Plugins::ActiveRecord do
9
9
  ]
10
10
  end
11
11
 
12
- it 'should support custom queries' do
12
+ it 'supports custom queries' do
13
13
  Post.find_by_sql('SELECT * FROM posts LIMIT 1').to_a
14
14
  expect(buffered).to eq [
15
15
  'activerecord.sql:1|c|#custom:tag,env:test,host:test.host,query:post.load',
@@ -36,7 +36,7 @@ describe Datadog::Notifications::Plugins::Grape do
36
36
  end
37
37
  end
38
38
 
39
- it 'should send an increment and timing event for each request' do
39
+ it 'sends an increment and timing event for each request' do
40
40
  get '/echo/1/1234'
41
41
  expect(last_response.status).to eq(200)
42
42
  expect(last_response.body).to eq('1 1234')
@@ -47,7 +47,7 @@ describe Datadog::Notifications::Plugins::Grape do
47
47
  ])
48
48
  end
49
49
 
50
- it 'should support namespaces and versioning' do
50
+ it 'supports namespaces and versioning' do
51
51
  get '/api/v1/sub/versioned.txt'
52
52
  expect(last_response.status).to eq(200)
53
53
  expect(last_response.body).to eq('OK')
@@ -58,7 +58,7 @@ describe Datadog::Notifications::Plugins::Grape do
58
58
  ])
59
59
  end
60
60
 
61
- it 'should support deep nesting' do
61
+ it 'supports deep nesting' do
62
62
  get '/sub/secure/resource'
63
63
  expect(last_response.status).to eq(403)
64
64
  expect(last_response.body).to eq('forbidden')
@@ -69,7 +69,7 @@ describe Datadog::Notifications::Plugins::Grape do
69
69
  ])
70
70
  end
71
71
 
72
- it 'should handle rescued errors' do
72
+ it 'handles rescued errors' do
73
73
  get '/rescued'
74
74
  expect(last_response.status).to eq(401)
75
75
 
@@ -79,7 +79,7 @@ describe Datadog::Notifications::Plugins::Grape do
79
79
  ])
80
80
  end
81
81
 
82
- it 'should handle invalid method' do
82
+ it 'handles invalid method' do
83
83
  post '/rescued'
84
84
 
85
85
  expect(last_response.status).to eq(405)
@@ -89,7 +89,7 @@ describe Datadog::Notifications::Plugins::Grape do
89
89
  ])
90
90
  end
91
91
 
92
- it 'should not report paths on 404s' do
92
+ it 'does not report paths on 404s' do
93
93
  get '/sub/missing'
94
94
  expect(last_response.status).to eq(404)
95
95
 
@@ -2,6 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Datadog::Notifications do
4
4
  subject { described_class.instance }
5
+
5
6
  after { ActiveSupport::Notifications.unsubscribe(subscription) }
6
7
 
7
8
  let!(:subscription) do
@@ -17,11 +18,11 @@ describe Datadog::Notifications do
17
18
  end
18
19
  end
19
20
 
20
- it 'should have a reporter' do
21
+ it 'has a reporter' do
21
22
  expect(subject.send(:reporter)).to be_instance_of(Mock::Reporter)
22
23
  end
23
24
 
24
- it 'should subscribe and report' do
25
+ it 'subscribes and report' do
25
26
  Mock::Instrumentable.new(method: 'GET').perform
26
27
  expect(buffered).to eq([
27
28
  'web.render:1|c|#custom:tag,env:test,host:test.host,status:200,method:GET',
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.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.2'
33
+ version: '4.8'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '5.0'
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '4.2'
43
+ version: '4.8'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '5.0'
@@ -129,7 +129,7 @@ dependencies:
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  - !ruby/object:Gem::Dependency
132
- name: rubocop
132
+ name: rubocop-bsm
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - ">="
@@ -164,10 +164,9 @@ extensions: []
164
164
  extra_rdoc_files: []
165
165
  files:
166
166
  - ".editorconfig"
167
+ - ".github/workflows/ruby.yml"
167
168
  - ".gitignore"
168
- - ".rake_tasks~"
169
169
  - ".rubocop.yml"
170
- - ".travis.yml"
171
170
  - Gemfile
172
171
  - Gemfile.lock
173
172
  - MIT-LICENCE
@@ -202,7 +201,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
202
201
  requirements:
203
202
  - - ">="
204
203
  - !ruby/object:Gem::Version
205
- version: '2.5'
204
+ version: '2.6'
206
205
  required_rubygems_version: !ruby/object:Gem::Requirement
207
206
  requirements:
208
207
  - - ">="
data/.rake_tasks~ DELETED
@@ -1,9 +0,0 @@
1
- build
2
- clean
3
- clobber
4
- install
5
- install:local
6
- release[remote]
7
- rubocop
8
- rubocop:auto_correct
9
- spec
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- cache: bundler
2
- language: ruby
3
- before_install:
4
- - gem install bundler
5
- rvm:
6
- - 2.7
7
- - 2.6
8
- - 2.5