prosopite 1.2.2 → 1.3.0

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
  SHA256:
3
- metadata.gz: 7579093e51b4e3b1cf5c3ca8d5b5a072fcc7cc92750a2f2daa263eb937e091ae
4
- data.tar.gz: 77314c08c37d6c0bde6fe68143ab9c0520a3e36eb9046565a962379a743f1bd4
3
+ metadata.gz: 71358661958f67bb09075fa89db0f0c09868c0a53780afa3780a8cc7d4ded49a
4
+ data.tar.gz: 1de6a0ab099524457cf49c60d1f5ae0041dffc1b9e281202ccea77cb2cd89ba9
5
5
  SHA512:
6
- metadata.gz: 463ffb84a224f48d143c2fc5867342ae83db230b742ed35e722069aa12c988fa04c1c4377eabbaa3e1ee3574c51c505ba303c36b18b43408c62f8861209e5ef5
7
- data.tar.gz: b6adbcf4b7785c90c4f937f10eb51429bf50d09a98420ccc7836ef7467abfbe8a59ac5247e9fb369fe876ecec1311d25db637566ec72f8421ea4db2f21ef261d
6
+ metadata.gz: 8478248b48b55a59eedfde1c472382eccc543a0f2ce03a891174c326d03a17db19cd3c9a393a2f1a89568a2c275e04ae8ca71d13f30cf67fef64870ed5531494
7
+ data.tar.gz: de26d196d0a767511b7a9e1f6cf5c87b00c838e17dc2e630f3689a0d43b7a47542c5c0e28f70f3b49a9dca7b577349c6dc66c97b14535cd9e010f83be9f2c58c
@@ -4,7 +4,7 @@ jobs:
4
4
  test:
5
5
  strategy:
6
6
  matrix:
7
- ruby: [2.5, 2.6, 2.7, '3.0', 3.1, head]
7
+ ruby: [2.7, '3.0', 3.1, head]
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
10
  - uses: actions/checkout@v2
data/Gemfile.lock CHANGED
@@ -1,11 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- prosopite (1.2.2)
4
+ prosopite (1.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ actionpack (6.1.3)
10
+ actionview (= 6.1.3)
11
+ activesupport (= 6.1.3)
12
+ rack (~> 2.0, >= 2.0.9)
13
+ rack-test (>= 0.6.3)
14
+ rails-dom-testing (~> 2.0)
15
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
16
+ actionview (6.1.3)
17
+ activesupport (= 6.1.3)
18
+ builder (~> 3.1)
19
+ erubi (~> 1.4)
20
+ rails-dom-testing (~> 2.0)
21
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
9
22
  activemodel (6.1.3)
10
23
  activesupport (= 6.1.3)
11
24
  activerecord (6.1.3)
@@ -17,20 +30,55 @@ GEM
17
30
  minitest (>= 5.1)
18
31
  tzinfo (~> 2.0)
19
32
  zeitwerk (~> 2.3)
33
+ ansi (1.5.0)
34
+ builder (3.2.4)
20
35
  coderay (1.1.3)
21
36
  concurrent-ruby (1.1.8)
37
+ crass (1.0.6)
38
+ erubi (1.12.0)
22
39
  factory_bot (6.1.0)
23
40
  activesupport (>= 5.0.0)
24
41
  i18n (1.8.9)
25
42
  concurrent-ruby (~> 1.0)
43
+ loofah (2.19.1)
44
+ crass (~> 1.0.2)
45
+ nokogiri (>= 1.5.9)
26
46
  method_source (1.0.0)
47
+ mini_portile2 (2.8.1)
27
48
  minitest (5.14.3)
49
+ minitest-reporters (1.5.0)
50
+ ansi
51
+ builder
52
+ minitest (>= 5.0)
53
+ ruby-progressbar
54
+ nokogiri (1.14.1)
55
+ mini_portile2 (~> 2.8.0)
56
+ racc (~> 1.4)
57
+ nokogiri (1.14.1-x86_64-linux)
58
+ racc (~> 1.4)
28
59
  pg_query (1.3.0)
29
60
  pry (0.14.0)
30
61
  coderay (~> 1.1)
31
62
  method_source (~> 1.0)
32
- rake (13.0.3)
63
+ racc (1.6.2)
64
+ rack (2.2.6.2)
65
+ rack-test (2.0.2)
66
+ rack (>= 1.3)
67
+ rails-dom-testing (2.0.3)
68
+ activesupport (>= 4.2.0)
69
+ nokogiri (>= 1.6)
70
+ rails-html-sanitizer (1.5.0)
71
+ loofah (~> 2.19, >= 2.19.1)
72
+ railties (6.1.3)
73
+ actionpack (= 6.1.3)
74
+ activesupport (= 6.1.3)
75
+ method_source
76
+ rake (>= 0.8.7)
77
+ thor (~> 1.0)
78
+ rake (13.0.6)
79
+ ruby-progressbar (1.11.0)
33
80
  sqlite3 (1.4.2)
81
+ thor (1.2.1)
34
82
  tzinfo (2.0.4)
35
83
  concurrent-ruby (~> 1.0)
36
84
  zeitwerk (2.4.2)
@@ -43,9 +91,11 @@ DEPENDENCIES
43
91
  activerecord
44
92
  factory_bot
45
93
  minitest
94
+ minitest-reporters
46
95
  pg_query
47
96
  prosopite!
48
97
  pry
98
+ railties
49
99
  rake (~> 13.0)
50
100
  sqlite3
51
101
 
data/README.md CHANGED
@@ -121,6 +121,7 @@ The preferred type of notifications can be configured with:
121
121
  * `Prosopite.prosopite_logger = true`: Send warnings to `log/prosopite.log`
122
122
  * `Prosopite.stderr_logger = true`: Send warnings to STDERR
123
123
  * `Prosopite.custom_logger = my_custom_logger`:
124
+ * `Prosopite.backtrace_cleaner = my_custom_backtrace_cleaner`: use a different [ActiveSupport::BacktraceCleaner](https://api.rubyonrails.org/classes/ActiveSupport/BacktraceCleaner.html). Default to `Rails.backtrace_cleaner` if present.
124
125
 
125
126
  ### Custom Logging Configuration
126
127
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prosopite
4
- VERSION = "1.2.2"
4
+ VERSION = "1.3.0"
5
5
  end
data/lib/prosopite.rb CHANGED
@@ -12,7 +12,8 @@ module Prosopite
12
12
  :allow_stack_paths,
13
13
  :ignore_queries,
14
14
  :ignore_pauses,
15
- :min_n_queries
15
+ :min_n_queries,
16
+ :backtrace_cleaner
16
17
 
17
18
  def allow_list=(value)
18
19
  puts "Prosopite.allow_list= is deprecated. Use Prosopite.allow_stack_paths= instead."
@@ -20,6 +21,10 @@ module Prosopite
20
21
  self.allow_stack_paths = value
21
22
  end
22
23
 
24
+ def backtrace_cleaner
25
+ @backtrace_cleaner ||= Rails.backtrace_cleaner
26
+ end
27
+
23
28
  def scan
24
29
  tc[:prosopite_scan] ||= false
25
30
  return if scan?
@@ -193,11 +198,15 @@ module Prosopite
193
198
 
194
199
  tc[:prosopite_notifications].each do |queries, kaller|
195
200
  notifications_str << "N+1 queries detected:\n"
201
+
196
202
  queries.each { |q| notifications_str << " #{q}\n" }
203
+
197
204
  notifications_str << "Call stack:\n"
205
+ kaller = backtrace_cleaner.clean(kaller)
198
206
  kaller.each do |f|
199
- notifications_str << " #{f}\n" unless f.include?(Bundler.bundle_path.to_s)
207
+ notifications_str << " #{f}\n"
200
208
  end
209
+
201
210
  notifications_str << "\n"
202
211
  end
203
212
 
data/prosopite.gemspec CHANGED
@@ -28,5 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "minitest"
29
29
  spec.add_development_dependency "factory_bot"
30
30
  spec.add_development_dependency "activerecord"
31
+ spec.add_development_dependency "railties"
31
32
  spec.add_development_dependency "sqlite3"
33
+ spec.add_development_dependency "minitest-reporters"
32
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prosopite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mpampis Kostas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-02 00:00:00.000000000 Z
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: railties
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: sqlite3
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,20 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: minitest-reporters
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: N+1 auto-detection for Rails with zero false positives / false negatives
84
112
  email:
85
113
  - charkost.rb@gmail.com