prosopite 1.3.1 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/prosopite/version.rb +1 -1
- data/lib/prosopite.rb +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c8b1d214700a04038d35504395ed1fa721fdd5104ae1f35543e3413911c3b02
|
4
|
+
data.tar.gz: 26916d6b3aa02125a33a68c088bfc0ea6d45c7c59176fb94cba71d141262fc15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24e5417f68bdec3257ce28f1c0f08e3cd4c7ada8c39306e97afebde974e996655000dd6418799d0974c67793d83415c07ba3df68a19b66a37dc88f57166fb8ff
|
7
|
+
data.tar.gz: ffa1c74fb3e3d20fb0b34a68259ebe7098a54aade4224b7f4ae92fb933e33eee68e9ff6bb7f656d281874ee7b1a6447af72e8e063e6d11cae2271d451dac2905
|
data/Gemfile.lock
CHANGED
data/lib/prosopite/version.rb
CHANGED
data/lib/prosopite.rb
CHANGED
@@ -12,12 +12,13 @@ module Prosopite
|
|
12
12
|
:rails_logger,
|
13
13
|
:prosopite_logger,
|
14
14
|
:custom_logger,
|
15
|
-
:allow_stack_paths,
|
16
|
-
:ignore_queries,
|
17
15
|
:ignore_pauses,
|
18
|
-
:min_n_queries,
|
19
16
|
:backtrace_cleaner
|
20
17
|
|
18
|
+
attr_accessor :allow_stack_paths,
|
19
|
+
:ignore_queries,
|
20
|
+
:min_n_queries
|
21
|
+
|
21
22
|
def allow_list=(value)
|
22
23
|
puts "Prosopite.allow_list= is deprecated. Use Prosopite.allow_stack_paths= instead."
|
23
24
|
|
@@ -179,6 +180,8 @@ module Prosopite
|
|
179
180
|
|
180
181
|
query.gsub!(/\b(in|values?)(?:[\s,]*\([\s?,]*\))+/, "\\1(?+)")
|
181
182
|
|
183
|
+
query.gsub!(/(?<!\w)field\s*\(\s*(\S+)\s*,\s*(\?+)(?:\s*,\s*\?+)*\)/, 'field(\1, \2+)')
|
184
|
+
|
182
185
|
query.gsub!(/\b(select\s.*?)(?:(\sunion(?:\sall)?)\s\1)+/, "\\1 /*repeat\\2*/")
|
183
186
|
|
184
187
|
query.gsub!(/\blimit \?(?:, ?\?| offset \?)/, "limit ?")
|
@@ -244,13 +247,14 @@ module Prosopite
|
|
244
247
|
sql, name = data[:sql], data[:name]
|
245
248
|
|
246
249
|
if scan? && name != "SCHEMA" && sql.include?('SELECT') && data[:cached].nil? && !ignore_query?(sql)
|
247
|
-
|
250
|
+
query_caller = caller
|
251
|
+
location_key = Digest::SHA256.hexdigest(query_caller.join)
|
248
252
|
|
249
253
|
tc[:prosopite_query_counter][location_key] += 1
|
250
254
|
tc[:prosopite_query_holder][location_key] << sql
|
251
255
|
|
252
256
|
if tc[:prosopite_query_counter][location_key] > 1
|
253
|
-
tc[:prosopite_query_caller][location_key] =
|
257
|
+
tc[:prosopite_query_caller][location_key] = query_caller.dup
|
254
258
|
end
|
255
259
|
end
|
256
260
|
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.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mpampis Kostas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|