newrelic-slack-ruby-bot 0.2.1 → 0.2.2

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
- SHA1:
3
- metadata.gz: 93eb40878e93b48b07f21362a982459d05b7e676
4
- data.tar.gz: 9e3c8a237a1200ffbc76f1aa257800bb671e81e3
2
+ SHA256:
3
+ metadata.gz: 2cb67fa2a3365be4cf7624aad1b391739dbc1d5fe31193c3ca694c926b8ada97
4
+ data.tar.gz: 8d98258d66a8b9d0e337bec40f2938ea2e3040f90b400f990aa198899d949a30
5
5
  SHA512:
6
- metadata.gz: 65c659cd156786c01e79638898ac9695a1a5be8e8348122d52c1b56ff66fd92a9de519bdcbf69d5285a21fde5785aca487504503a403f43fe36f6ca019ea810c
7
- data.tar.gz: f090f404c0a52570d5dc4927c470989e62ea11a1966065ef8b16a6cc5fa7718ce41f7a4fd1fe86df76792ae73f34efb6e909ef0411857713fe46da549f3de9a9
6
+ metadata.gz: 5cb7049323accdd887f3cdf68f1e897bbe8454b594abf81bb7cbd7cc7aad108f4153edacd052f47c3ca65b77cba92407b1ce3d149dc86be9ecdfdf02bcf947e3
7
+ data.tar.gz: e66bd3876eac0c16c7d04a7a0c3b49b574a3cec37128147d24652edd1f635ae64d26e21e3e3f1292d17c4e976ed921468633dddd95cf6221547c0d35ecc36c35
@@ -1,3 +1,7 @@
1
+ ### 0.2.2 (4/7/2020)
2
+
3
+ * [#12](https://github.com/slack-ruby/newrelic-slack-ruby-bot/pull/12): Add support for slack-ruby-bot 0.14.0 - [@dblock](https://github.com/dblock).
4
+
1
5
  ### 0.2.1 (11/10/2017)
2
6
 
3
7
  * [#6](https://github.com/slack-ruby/newrelic-slack-ruby-bot/pull/6): Add team, channel, and user attributes to New Relic traces - [@kstole](https://github.com/kstole).
data/Gemfile CHANGED
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
7
  group :test do
6
- gem 'celluloid-io', require: %w(celluloid/current celluloid/io)
8
+ gem 'async-websocket', '~> 0.8.0'
7
9
  gem 'rake', '< 11.0'
8
10
  gem 'rspec', '~> 3.4.0'
9
- gem 'rubocop', '0.35.1'
11
+ gem 'rubocop', '0.81.0'
10
12
  end
@@ -1,64 +1,51 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- newrelic-slack-ruby-bot (0.2.1)
4
+ newrelic-slack-ruby-bot (0.2.2)
5
5
  newrelic_rpm
6
6
  slack-ruby-bot (>= 0.10.5)
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- activesupport (5.1.4)
11
+ activesupport (6.0.2.2)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (~> 0.7)
13
+ i18n (>= 0.7, < 2)
14
14
  minitest (~> 5.1)
15
15
  tzinfo (~> 1.1)
16
- ast (2.3.0)
17
- astrolabe (1.3.1)
18
- parser (~> 2.2)
19
- celluloid (0.17.3)
20
- celluloid-essentials
21
- celluloid-extras
22
- celluloid-fsm
23
- celluloid-pool
24
- celluloid-supervision
25
- timers (>= 4.1.1)
26
- celluloid-essentials (0.20.5)
27
- timers (>= 4.1.1)
28
- celluloid-extras (0.20.5)
29
- timers (>= 4.1.1)
30
- celluloid-fsm (0.20.5)
31
- timers (>= 4.1.1)
32
- celluloid-io (0.17.3)
33
- celluloid (>= 0.17.2)
34
- nio4r (>= 1.1)
35
- timers (>= 4.1.1)
36
- celluloid-pool (0.20.5)
37
- timers (>= 4.1.1)
38
- celluloid-supervision (0.20.6)
39
- timers (>= 4.1.1)
40
- concurrent-ruby (1.0.5)
16
+ zeitwerk (~> 2.2)
17
+ ast (2.4.0)
18
+ async (1.24.2)
19
+ console (~> 1.0)
20
+ nio4r (~> 2.3)
21
+ timers (~> 4.1)
22
+ async-io (1.28.0)
23
+ async (~> 1.14)
24
+ async-websocket (0.8.0)
25
+ async-io
26
+ websocket-driver (~> 0.7.0)
27
+ concurrent-ruby (1.1.6)
28
+ console (1.8.2)
41
29
  diff-lcs (1.3)
42
- faraday (0.13.1)
30
+ faraday (1.0.1)
43
31
  multipart-post (>= 1.2, < 3)
44
- faraday_middleware (0.12.2)
45
- faraday (>= 0.7.4, < 1.0)
46
- gli (2.17.0)
47
- hashie (3.5.6)
48
- hitimes (1.2.6)
49
- i18n (0.9.1)
32
+ faraday_middleware (1.0.0)
33
+ faraday (~> 1.0)
34
+ gli (2.19.0)
35
+ hashie (4.1.0)
36
+ i18n (1.8.2)
50
37
  concurrent-ruby (~> 1.0)
51
- json (2.1.0)
52
- minitest (5.10.3)
53
- multipart-post (2.0.0)
54
- newrelic_rpm (4.5.0.337)
55
- nio4r (2.1.0)
56
- parser (2.4.0.0)
57
- ast (~> 2.2)
58
- powerpack (0.1.1)
59
- rainbow (2.2.2)
60
- rake
38
+ jaro_winkler (1.5.4)
39
+ minitest (5.14.0)
40
+ multipart-post (2.1.1)
41
+ newrelic_rpm (6.9.0.363)
42
+ nio4r (2.5.2)
43
+ parallel (1.19.1)
44
+ parser (2.7.1.0)
45
+ ast (~> 2.4.0)
46
+ rainbow (3.0.0)
61
47
  rake (10.5.0)
48
+ rexml (3.2.4)
62
49
  rspec (3.4.0)
63
50
  rspec-core (~> 3.4.0)
64
51
  rspec-expectations (~> 3.4.0)
@@ -72,44 +59,44 @@ GEM
72
59
  diff-lcs (>= 1.2.0, < 2.0)
73
60
  rspec-support (~> 3.4.0)
74
61
  rspec-support (3.4.1)
75
- rubocop (0.35.1)
76
- astrolabe (~> 1.3)
77
- parser (>= 2.2.3.0, < 3.0)
78
- powerpack (~> 0.1)
79
- rainbow (>= 1.99.1, < 3.0)
62
+ rubocop (0.81.0)
63
+ jaro_winkler (~> 1.5.1)
64
+ parallel (~> 1.10)
65
+ parser (>= 2.7.0.1)
66
+ rainbow (>= 2.2.2, < 4.0)
67
+ rexml
80
68
  ruby-progressbar (~> 1.7)
81
- tins (<= 1.6.0)
82
- ruby-progressbar (1.8.3)
83
- slack-ruby-bot (0.10.5)
69
+ unicode-display_width (>= 1.4.0, < 2.0)
70
+ ruby-progressbar (1.10.1)
71
+ slack-ruby-bot (0.14.0)
84
72
  hashie
85
- slack-ruby-client (>= 0.6.0)
86
- slack-ruby-client (0.10.0)
73
+ slack-ruby-client (>= 0.14.0)
74
+ slack-ruby-client (0.14.6)
87
75
  activesupport
88
76
  faraday (>= 0.9)
89
77
  faraday_middleware
90
78
  gli
91
79
  hashie
92
- json
93
80
  websocket-driver
94
81
  thread_safe (0.3.6)
95
- timers (4.1.2)
96
- hitimes
97
- tins (1.6.0)
98
- tzinfo (1.2.4)
82
+ timers (4.3.0)
83
+ tzinfo (1.2.7)
99
84
  thread_safe (~> 0.1)
100
- websocket-driver (0.7.0)
85
+ unicode-display_width (1.7.0)
86
+ websocket-driver (0.7.1)
101
87
  websocket-extensions (>= 0.1.0)
102
- websocket-extensions (0.1.2)
88
+ websocket-extensions (0.1.4)
89
+ zeitwerk (2.3.0)
103
90
 
104
91
  PLATFORMS
105
92
  ruby
106
93
 
107
94
  DEPENDENCIES
108
- celluloid-io
95
+ async-websocket (~> 0.8.0)
109
96
  newrelic-slack-ruby-bot!
110
97
  rake (< 11.0)
111
98
  rspec (~> 3.4.0)
112
- rubocop (= 0.35.1)
99
+ rubocop (= 0.81.0)
113
100
 
114
101
  BUNDLED WITH
115
- 1.15.4
102
+ 1.17.2
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2015 Daniel Doubrovkine.
3
+ Copyright (c) 2015-2020 Daniel Doubrovkine.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  NewRelic Instrumentation for SlackRubyBot
2
2
  =========================================
3
3
 
4
- [![Gem Version](http://img.shields.io/gem/v/newrelic-slack-ruby-bot.svg)](http://badge.fury.io/rb/newrelic-slack-ruby-bot)
5
- [![Build Status](http://img.shields.io/travis/slack-ruby/newrelic-slack-ruby-bot.svg)](https://travis-ci.org/slack-ruby/newrelic-slack-ruby-bot)
6
- [![Code Climate](https://codeclimate.com/github/dblock/newrelic-slack-ruby-bot.svg)](https://codeclimate.com/github/dblock/newrelic-slack-ruby-bot)
4
+ [![Gem Version](https://badge.fury.io/rb/newrelic-slack-ruby-bot.svg)](https://badge.fury.io/rb/newrelic-slack-ruby-bot)
5
+ [![Build Status](https://travis-ci.org/slack-ruby/newrelic-slack-ruby-bot.svg?branch=master)](https://travis-ci.org/slack-ruby/newrelic-slack-ruby-bot)
6
+ [![Code Climate](https://codeclimate.com/github/slack-ruby/newrelic-slack-ruby-bot.svg)](https://codeclimate.com/github/slack-ruby/newrelic-slack-ruby-bot)
7
7
 
8
8
  NewRelic instrumentation for [slack-ruby-bot](https://github.com/slack-ruby/slack-ruby-bot).
9
9
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler/gem_tasks'
3
5
 
@@ -13,4 +15,4 @@ end
13
15
  require 'rubocop/rake_task'
14
16
  RuboCop::RakeTask.new(:rubocop)
15
17
 
16
- task default: [:rubocop, :spec]
18
+ task default: %i[rubocop spec]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'newrelic_rpm'
2
4
  require 'slack-ruby-bot'
3
5
  require 'newrelic-slack-ruby-bot/version'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  DependencyDetection.defer do
2
4
  named :slack_ruby_bot
3
5
 
@@ -19,9 +21,11 @@ DependencyDetection.defer do
19
21
 
20
22
  def message_with_new_relic(client, data)
21
23
  perform_action_with_newrelic_trace(name: 'call', category: 'OtherTransaction/Slack') do
22
- ::NewRelic::Agent.add_custom_attributes(team: data.team,
23
- channel: data.channel,
24
- user: data.user)
24
+ ::NewRelic::Agent.add_custom_attributes(
25
+ team: data.team,
26
+ channel: data.channel,
27
+ user: data.user
28
+ )
25
29
  message_without_new_relic(client, data)
26
30
  end
27
31
  end
@@ -35,7 +39,7 @@ DependencyDetection.defer do
35
39
  ::SlackRubyBot::Commands::Base.class_eval do
36
40
  class << self
37
41
  def command_name(match)
38
- if match.is_a? MatchData
42
+ if match.respond_to?(:names) && match.respond_to?(:[])
39
43
  if match.names.include? 'command'
40
44
  match[:command].downcase
41
45
  elsif match.names.include? 'operator'
@@ -50,9 +54,11 @@ DependencyDetection.defer do
50
54
 
51
55
  def call_command_with_new_relic(client, data, match, block)
52
56
  ::NewRelic::Agent.set_transaction_name("#{self}/#{command_name(match)}")
53
- if match.is_a? MatchData
57
+ if match.respond_to?(:names) && match.respond_to?(:captures)
54
58
  ::NewRelic::Agent
55
- .add_custom_attributes(Hash[match.names.map(&:to_sym).zip(match.captures)])
59
+ .add_custom_attributes(
60
+ Hash[match.names.map(&:to_sym).zip(match.captures)]
61
+ )
56
62
  end
57
63
  call_command_without_new_relic(client, data, match, block)
58
64
  end
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module NewRelic
2
4
  module Agent
3
5
  module Instrumentation
4
6
  # New Relic instrumentation for SlackRubyBot
5
7
  module SlackRubyBot
6
- VERSION = '0.2.1'.freeze
8
+ VERSION = '0.2.2'
7
9
  end
8
10
  end
9
11
  end
@@ -1,4 +1,6 @@
1
- $LOAD_PATH.push File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
2
4
  require 'newrelic-slack-ruby-bot/version'
3
5
 
4
6
  Gem::Specification.new do |s|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe NewRelic::Agent::Instrumentation do
@@ -11,11 +13,16 @@ describe NewRelic::Agent::Instrumentation do
11
13
  .with(hash_including(name: 'call', category: 'OtherTransaction/Slack'))
12
14
  .and_yield
13
15
 
14
- subject.call(client, Slack::Messages::Message.new(message: 'message',
15
- text: 'hi',
16
- team: 'TEAM',
17
- channel: 'CHANNEL',
18
- user: 'USER'))
16
+ subject.call(
17
+ client,
18
+ Slack::Messages::Message.new(
19
+ message: 'message',
20
+ text: 'hi',
21
+ team: 'TEAM',
22
+ channel: 'CHANNEL',
23
+ user: 'USER'
24
+ )
25
+ )
19
26
  end
20
27
 
21
28
  context 'operator' do
@@ -32,20 +39,30 @@ describe NewRelic::Agent::Instrumentation do
32
39
  .to receive(:add_custom_attributes)
33
40
  .with(hash_including(operator: '+', expression: '42'))
34
41
 
35
- subject.call(client, Slack::Messages::Message.new(message: 'message',
36
- text: '+42',
37
- team: 'TEAM',
38
- channel: 'CHANNEL',
39
- user: 'USER'))
42
+ subject.call(
43
+ client,
44
+ Slack::Messages::Message.new(
45
+ message: 'message',
46
+ text: '+42',
47
+ team: 'TEAM',
48
+ channel: 'CHANNEL',
49
+ user: 'USER'
50
+ )
51
+ )
40
52
  end
41
53
  it 'sets transaction name' do
42
54
  expect(::NewRelic::Agent).to receive(:set_transaction_name).with('MyOperatorClass/+')
43
55
 
44
- subject.call(client, Slack::Messages::Message.new(message: 'message',
45
- text: '+42',
46
- team: 'TEAM',
47
- channel: 'CHANNEL',
48
- user: 'USER'))
56
+ subject.call(
57
+ client,
58
+ Slack::Messages::Message.new(
59
+ message: 'message',
60
+ text: '+42',
61
+ team: 'TEAM',
62
+ channel: 'CHANNEL',
63
+ user: 'USER'
64
+ )
65
+ )
49
66
  end
50
67
  end
51
68
 
@@ -63,20 +80,30 @@ describe NewRelic::Agent::Instrumentation do
63
80
  .to receive(:add_custom_attributes)
64
81
  .with(hash_including(bot: 'mybot', command: 'this', expression: 'is the command'))
65
82
 
66
- subject.call(client, Slack::Messages::Message.new(message: 'message',
67
- text: "#{client.name} this is the command",
68
- team: 'TEAM',
69
- channel: 'CHANNEL',
70
- user: 'USER'))
83
+ subject.call(
84
+ client,
85
+ Slack::Messages::Message.new(
86
+ message: 'message',
87
+ text: "#{client.name} this is the command",
88
+ team: 'TEAM',
89
+ channel: 'CHANNEL',
90
+ user: 'USER'
91
+ )
92
+ )
71
93
  end
72
94
  it 'sets transaction name' do
73
95
  expect(::NewRelic::Agent).to receive(:set_transaction_name).with('MyCommandClass/this')
74
96
 
75
- subject.call(client, Slack::Messages::Message.new(message: 'message',
76
- text: "#{client.name} this is the command",
77
- team: 'TEAM',
78
- channel: 'CHANNEL',
79
- user: 'USER'))
97
+ subject.call(
98
+ client,
99
+ Slack::Messages::Message.new(
100
+ message: 'message',
101
+ text: "#{client.name} this is the command",
102
+ team: 'TEAM',
103
+ channel: 'CHANNEL',
104
+ user: 'USER'
105
+ )
106
+ )
80
107
  end
81
108
  end
82
109
 
@@ -92,20 +119,24 @@ describe NewRelic::Agent::Instrumentation do
92
119
  .with(hash_including(team: 'TEAM', channel: 'CHANNEL', user: 'USER'))
93
120
  expect(::NewRelic::Agent).to receive(:add_custom_attributes).with({})
94
121
 
95
- subject.call(client, Slack::Messages::Message.new(message: 'message',
96
- text: 'read this',
97
- team: 'TEAM',
98
- channel: 'CHANNEL',
99
- user: 'USER'))
122
+ subject.call(client, Slack::Messages::Message.new(
123
+ message: 'message',
124
+ text: 'read this',
125
+ team: 'TEAM',
126
+ channel: 'CHANNEL',
127
+ user: 'USER'
128
+ ))
100
129
  end
101
130
  it 'sets transaction name' do
102
131
  expect(::NewRelic::Agent).to receive(:set_transaction_name).with('MyMatchClass/match')
103
132
 
104
- subject.call(client, Slack::Messages::Message.new(message: 'message',
105
- text: 'read this',
106
- team: 'TEAM',
107
- channel: 'CHANNEL',
108
- user: 'USER'))
133
+ subject.call(client, Slack::Messages::Message.new(
134
+ message: 'message',
135
+ text: 'read this',
136
+ team: 'TEAM',
137
+ channel: 'CHANNEL',
138
+ user: 'USER'
139
+ ))
109
140
  end
110
141
  end
111
142
 
@@ -121,20 +152,24 @@ describe NewRelic::Agent::Instrumentation do
121
152
  .with(hash_including(team: 'TEAM', channel: 'CHANNEL', user: 'USER'))
122
153
  expect(::NewRelic::Agent).not_to receive(:add_custom_attributes)
123
154
 
124
- subject.call(client, Slack::Messages::Message.new(message: 'message',
125
- text: 'I scanned this',
126
- team: 'TEAM',
127
- channel: 'CHANNEL',
128
- user: 'USER'))
155
+ subject.call(client, Slack::Messages::Message.new(
156
+ message: 'message',
157
+ text: 'I scanned this',
158
+ team: 'TEAM',
159
+ channel: 'CHANNEL',
160
+ user: 'USER'
161
+ ))
129
162
  end
130
163
  it 'sets transaction name' do
131
164
  expect(::NewRelic::Agent).to receive(:set_transaction_name).with('MyScanClass/scan')
132
165
 
133
- subject.call(client, Slack::Messages::Message.new(message: 'message',
134
- text: 'I scanned this',
135
- team: 'TEAM',
136
- channel: 'CHANNEL',
137
- user: 'USER'))
166
+ subject.call(client, Slack::Messages::Message.new(
167
+ message: 'message',
168
+ text: 'I scanned this',
169
+ team: 'TEAM',
170
+ channel: 'CHANNEL',
171
+ user: 'USER'
172
+ ))
138
173
  end
139
174
  end
140
175
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe NewRelic::Agent::Instrumentation::SlackRubyBot do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
4
 
3
5
  require 'rubygems'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-slack-ruby-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-11 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: newrelic_rpm
@@ -56,8 +56,6 @@ files:
56
56
  - lib/newrelic-slack-ruby-bot/instrumentation.rb
57
57
  - lib/newrelic-slack-ruby-bot/version.rb
58
58
  - newrelic-slack-ruby-bot.gemspec
59
- - pkg/newrelic-slack-ruby-bot-0.1.1.gem
60
- - pkg/newrelic-slack-ruby-bot-0.2.0.gem
61
59
  - screenshots/newrelic_calculate_breakdown.png
62
60
  - screenshots/newrelic_transactions.png
63
61
  - spec/newrelic-slack-ruby-bot/instrumentation_spec.rb
@@ -82,8 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
80
  - !ruby/object:Gem::Version
83
81
  version: 1.3.6
84
82
  requirements: []
85
- rubyforge_project:
86
- rubygems_version: 2.6.13
83
+ rubygems_version: 3.0.3
87
84
  signing_key:
88
85
  specification_version: 4
89
86
  summary: NewRelic instrumentation for slack-ruby-bot.