Skip to content

Commit 8f4c4d4

Browse files
committed
update gems, rubocop
1 parent 15261a3 commit 8f4c4d4

File tree

7 files changed

+76
-67
lines changed

7 files changed

+76
-67
lines changed

.rubocop.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ AllCops:
22
DisplayCopNames: true
33
DisplayStyleGuide: true
44
StyleGuideCopsOnly: true
5-
TargetRubyVersion: 2.5
5+
TargetRubyVersion: 3.4
66

7-
Metrics/LineLength:
7+
Layout/LineLength:
88
Max: 120
99

10-
Documentation:
10+
Style/Documentation:
1111
Enabled: false
1212

13-
FrozenStringLiteralComment:
13+
Style/FrozenStringLiteralComment:
1414
Enabled: false
1515

16-
Style/FileName:
16+
Naming/FileName:
1717
Enabled: false
1818

1919
Metrics/ModuleLength:

Gemfile.lock

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,79 +9,88 @@ PATH
99
GEM
1010
remote: https://rubygems.org/
1111
specs:
12-
activesupport (7.1.3)
12+
activesupport (8.0.2.1)
1313
base64
14+
benchmark (>= 0.3)
1415
bigdecimal
15-
concurrent-ruby (~> 1.0, >= 1.0.2)
16+
concurrent-ruby (~> 1.0, >= 1.3.1)
1617
connection_pool (>= 2.2.5)
1718
drb
1819
i18n (>= 1.6, < 2)
20+
logger (>= 1.4.2)
1921
minitest (>= 5.1)
20-
mutex_m
21-
tzinfo (~> 2.0)
22-
ast (2.4.2)
23-
base64 (0.2.0)
24-
bigdecimal (3.1.6)
25-
byebug (11.1.3)
26-
concurrent-ruby (1.2.3)
27-
connection_pool (2.4.1)
28-
diff-lcs (1.5.1)
29-
drb (2.2.0)
30-
ruby2_keywords
31-
dry-configurable (1.1.0)
32-
dry-core (~> 1.0, < 2)
22+
securerandom (>= 0.3)
23+
tzinfo (~> 2.0, >= 2.0.5)
24+
uri (>= 0.13.1)
25+
ast (2.4.3)
26+
base64 (0.3.0)
27+
benchmark (0.4.1)
28+
bigdecimal (3.2.2)
29+
byebug (12.0.0)
30+
concurrent-ruby (1.3.5)
31+
connection_pool (2.5.3)
32+
diff-lcs (1.6.2)
33+
drb (2.2.3)
34+
dry-configurable (1.3.0)
35+
dry-core (~> 1.1)
3336
zeitwerk (~> 2.6)
34-
dry-core (1.0.1)
37+
dry-core (1.1.0)
3538
concurrent-ruby (~> 1.0)
39+
logger
3640
zeitwerk (~> 2.6)
37-
i18n (1.14.1)
41+
i18n (1.14.7)
3842
concurrent-ruby (~> 1.0)
39-
json (2.7.1)
40-
language_server-protocol (3.17.0.3)
41-
minitest (5.22.2)
42-
mutex_m (0.2.0)
43-
parallel (1.24.0)
44-
parser (3.3.0.5)
43+
json (2.13.2)
44+
language_server-protocol (3.17.0.5)
45+
lint_roller (1.1.0)
46+
logger (1.7.0)
47+
minitest (5.25.5)
48+
parallel (1.27.0)
49+
parser (3.3.9.0)
4550
ast (~> 2.4.1)
4651
racc
47-
racc (1.7.3)
52+
prism (1.4.0)
53+
racc (1.8.1)
4854
rainbow (3.1.1)
49-
rake (13.1.0)
50-
regexp_parser (2.9.0)
51-
rexml (3.2.6)
52-
rspec (3.13.0)
55+
rake (13.3.0)
56+
regexp_parser (2.11.2)
57+
rspec (3.13.1)
5358
rspec-core (~> 3.13.0)
5459
rspec-expectations (~> 3.13.0)
5560
rspec-mocks (~> 3.13.0)
56-
rspec-core (3.13.0)
61+
rspec-core (3.13.5)
5762
rspec-support (~> 3.13.0)
58-
rspec-expectations (3.13.0)
63+
rspec-expectations (3.13.5)
5964
diff-lcs (>= 1.2.0, < 2.0)
6065
rspec-support (~> 3.13.0)
61-
rspec-mocks (3.13.0)
66+
rspec-mocks (3.13.5)
6267
diff-lcs (>= 1.2.0, < 2.0)
6368
rspec-support (~> 3.13.0)
64-
rspec-support (3.13.0)
65-
rubocop (1.60.2)
69+
rspec-support (3.13.5)
70+
rubocop (1.79.2)
6671
json (~> 2.3)
67-
language_server-protocol (>= 3.17.0)
72+
language_server-protocol (~> 3.17.0.2)
73+
lint_roller (~> 1.1.0)
6874
parallel (~> 1.10)
6975
parser (>= 3.3.0.2)
7076
rainbow (>= 2.2.2, < 4.0)
71-
regexp_parser (>= 1.8, < 3.0)
72-
rexml (>= 3.2.5, < 4.0)
73-
rubocop-ast (>= 1.30.0, < 2.0)
77+
regexp_parser (>= 2.9.3, < 3.0)
78+
rubocop-ast (>= 1.46.0, < 2.0)
7479
ruby-progressbar (~> 1.7)
75-
unicode-display_width (>= 2.4.0, < 3.0)
76-
rubocop-ast (1.30.0)
77-
parser (>= 3.2.1.0)
80+
unicode-display_width (>= 2.4.0, < 4.0)
81+
rubocop-ast (1.46.0)
82+
parser (>= 3.3.7.2)
83+
prism (~> 1.4)
7884
ruby-progressbar (1.13.0)
79-
ruby2_keywords (0.0.5)
85+
securerandom (0.4.1)
8086
slack_hook (0.1.2)
8187
tzinfo (2.0.6)
8288
concurrent-ruby (~> 1.0)
83-
unicode-display_width (2.5.0)
84-
zeitwerk (2.6.13)
89+
unicode-display_width (3.1.5)
90+
unicode-emoji (~> 4.0, >= 4.0.4)
91+
unicode-emoji (4.0.4)
92+
uri (1.0.3)
93+
zeitwerk (2.7.3)
8594

8695
PLATFORMS
8796
ruby

lib/query_track.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class << self
1818

1919
def logger
2020
@logger ||= Logger.new($stdout).tap do |log|
21-
log.progname = self.name
21+
log.progname = name
2222
end
2323
end
2424
end

lib/query_track/event_processor.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ def call
1313

1414
return if under_filter?(caller)
1515

16-
if duration_seconds > QueryTrack::Settings.config.duration
17-
QueryTrack::Notifications::Slack.new(event.payload[:sql], duration_seconds).call
18-
QueryTrack::Notifications::Log.new(event.payload[:sql], duration_seconds).call
19-
QueryTrack::Notifications::Custom.new(event.payload[:sql], duration_seconds).call
20-
end
16+
return unless duration_seconds > QueryTrack::Settings.config.duration
17+
18+
QueryTrack::Notifications::Slack.new(event.payload[:sql], duration_seconds).call
19+
QueryTrack::Notifications::Log.new(event.payload[:sql], duration_seconds).call
20+
QueryTrack::Notifications::Custom.new(event.payload[:sql], duration_seconds).call
2121
end
2222

2323
private
@@ -32,7 +32,7 @@ def duration_seconds
3232
event.duration / 1000
3333
end
3434

35-
def under_filter?(trace)
35+
def under_filter?(_trace)
3636
QueryTrack::Filters.new(caller).call
3737
end
3838
end

lib/query_track/filters.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ def initialize(full_trace)
77
end
88

99
def call
10-
QueryTrack::Settings.config.filters.find do |filter|
11-
full_trace.select { |v| v =~ %r{#{filter}} }[0]
10+
QueryTrack::Settings.config.filters.find do |filter|
11+
full_trace.select { |v| v =~ /#{filter}/ }[0]
1212
end
1313
end
1414
end

spec/query_track/event_processor_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
RSpec.describe QueryTrack::EventProcessor do
22
let(:payload) do ['sql.active_record', Time.now, Time.now, '1e07319',
3-
{
4-
sql: "SET client_min_messages TO 'warning'",
5-
name: 'SCHEMA',
6-
binds: [],
7-
type_casted_binds: [],
8-
statement_name: nil,
9-
connection_id: 1
10-
}
3+
{
4+
sql: "SET client_min_messages TO 'warning'",
5+
name: 'SCHEMA',
6+
binds: [],
7+
type_casted_binds: [],
8+
statement_name: nil,
9+
connection_id: 1
10+
}
1111
] end
1212

1313
let!(:event) { ActiveSupport::Notifications::Event.new(*payload) }
@@ -21,7 +21,7 @@
2121
subject.call
2222
end
2323
end
24-
24+
2525
context 'processing' do
2626
before do
2727
QueryTrack::Settings.configure do |config|

spec/query_track/notifications/slack_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
end
1414

1515
it 'should post notification to slack' do
16-
#allow(SlackHook::Incoming).to receive(:new).and_return(slack_stub)
16+
# allow(SlackHook::Incoming).to receive(:new).and_return(slack_stub)
1717
expect(slack_stub).not_to receive(:post)
1818
subject.call
1919
end

0 commit comments

Comments
 (0)