prosopite 2.1.1 → 2.1.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/prosopite/version.rb +1 -1
- data/lib/prosopite.rb +11 -10
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fa7674935ab767fc5eb216492948abd724d07b2a720d345a6da361a51e80efe
|
4
|
+
data.tar.gz: 23b72eae523301b0b95d244577a019a266420fb4dc1560751b965ad6c57ea517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 804e8468b23f1a6e3911a28932fb643d67aa2a5a9dc0d55662307b9ce8f412ff60c5ed3a0aded37bfa17f5dd6634f121132758f3997555147495f5ceed2a9beb
|
7
|
+
data.tar.gz: 120685a04d3a23e45b5cb6b14a8b544e40aeec4329e750156df91b3c42f4b51ce71ab1a26d28f9fb6334656a694337a58da51fa848ee46ea8341c2135e9c0b73
|
data/Gemfile.lock
CHANGED
data/lib/prosopite/version.rb
CHANGED
data/lib/prosopite.rb
CHANGED
@@ -146,7 +146,7 @@ module Prosopite
|
|
146
146
|
|
147
147
|
next unless queries.any?
|
148
148
|
|
149
|
-
kaller = tc[:prosopite_query_caller][location_key]
|
149
|
+
kaller = tc[:prosopite_query_caller][location_key].map(&:to_s)
|
150
150
|
allow_list = (@allow_stack_paths + DEFAULT_ALLOW_LIST)
|
151
151
|
is_allowed = kaller.any? { |f| allow_list.any? { |s| f.match?(s) } }
|
152
152
|
|
@@ -160,12 +160,7 @@ module Prosopite
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def fingerprint(query)
|
163
|
-
|
164
|
-
ActiveRecord::Base.lease_connection
|
165
|
-
else
|
166
|
-
ActiveRecord::Base.connection
|
167
|
-
end
|
168
|
-
db_adapter = conn.adapter_name.downcase
|
163
|
+
db_adapter = ActiveRecord::Base.connection_db_config.adapter
|
169
164
|
if db_adapter.include?('mysql') || db_adapter.include?('trilogy')
|
170
165
|
mysql_fingerprint(query)
|
171
166
|
else
|
@@ -281,14 +276,20 @@ module Prosopite
|
|
281
276
|
sql, name = data[:sql], data[:name]
|
282
277
|
|
283
278
|
if scan? && name != "SCHEMA" && sql.include?('SELECT') && data[:cached].nil? && !ignore_query?(sql)
|
284
|
-
query_caller =
|
285
|
-
|
279
|
+
query_caller = caller_locations
|
280
|
+
# Calculate the location key with as few allocations as possible
|
281
|
+
location_key = [].tap do |array|
|
282
|
+
query_caller.each do |loc|
|
283
|
+
array << loc.path
|
284
|
+
array << loc.lineno
|
285
|
+
end
|
286
|
+
end.hash
|
286
287
|
|
287
288
|
tc[:prosopite_query_counter][location_key] += 1
|
288
289
|
tc[:prosopite_query_holder][location_key] << sql
|
289
290
|
|
290
291
|
if tc[:prosopite_query_counter][location_key] > 1
|
291
|
-
tc[:prosopite_query_caller][location_key] = query_caller
|
292
|
+
tc[:prosopite_query_caller][location_key] = query_caller
|
292
293
|
end
|
293
294
|
end
|
294
295
|
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: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mpampis Kostas
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -133,7 +133,7 @@ licenses:
|
|
133
133
|
metadata:
|
134
134
|
homepage_uri: https://github.com/charkost/prosopite
|
135
135
|
source_code_uri: https://github.com/charkost/prosopite
|
136
|
-
post_install_message:
|
136
|
+
post_install_message:
|
137
137
|
rdoc_options: []
|
138
138
|
require_paths:
|
139
139
|
- lib
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubygems_version: 3.5.3
|
152
|
-
signing_key:
|
152
|
+
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: N+1 auto-detection for Rails with zero false positives / false negatives
|
155
155
|
test_files: []
|