prosopite 1.2.0 → 1.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
2
  SHA256:
3
- metadata.gz: ee61188281e95718d5a0b8faf642f6db6356befb1b126ede3f6fe26a032b0ba9
4
- data.tar.gz: 78596f3e5de98c354631229752fe42f3d682646782a3d633e24260100b7b4113
3
+ metadata.gz: 7579093e51b4e3b1cf5c3ca8d5b5a072fcc7cc92750a2f2daa263eb937e091ae
4
+ data.tar.gz: 77314c08c37d6c0bde6fe68143ab9c0520a3e36eb9046565a962379a743f1bd4
5
5
  SHA512:
6
- metadata.gz: 4d0b66d7d06563f6832008f0191ce68041d050c0d46d7baee591aead407d5e5789b08056cac7e1aa09034494c11ac84672b3163b831a3338a8483fd44f7262d4
7
- data.tar.gz: 651de4487b98786ba0de927e1b9edef804b7d40037a2c54cf2a007e8e74cf1ee84abd6bde9fad9997bfb8f04fce13d2c063ffe27c479d578f0f487a82c299acf
6
+ metadata.gz: 463ffb84a224f48d143c2fc5867342ae83db230b742ed35e722069aa12c988fa04c1c4377eabbaa3e1ee3574c51c505ba303c36b18b43408c62f8861209e5ef5
7
+ data.tar.gz: b6adbcf4b7785c90c4f937f10eb51429bf50d09a98420ccc7836ef7467abfbe8a59ac5247e9fb369fe876ecec1311d25db637566ec72f8421ea4db2f21ef261d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- prosopite (1.2.0)
4
+ prosopite (1.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prosopite
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.2"
5
5
  end
data/lib/prosopite.rb CHANGED
@@ -85,6 +85,10 @@ module Prosopite
85
85
 
86
86
  create_notifications
87
87
  send_notifications if tc[:prosopite_notifications].present?
88
+
89
+ tc[:prosopite_query_counter] = nil
90
+ tc[:prosopite_query_holder] = nil
91
+ tc[:prosopite_query_caller] = nil
88
92
  end
89
93
 
90
94
  def create_notifications
@@ -92,7 +96,7 @@ module Prosopite
92
96
 
93
97
  tc[:prosopite_query_counter].each do |location_key, count|
94
98
  if count >= @min_n_queries
95
- fingerprints = tc[:prosopite_query_holder][location_key].map do |q|
99
+ fingerprints = tc[:prosopite_query_holder][location_key].group_by do |q|
96
100
  begin
97
101
  fingerprint(q)
98
102
  rescue
@@ -100,15 +104,18 @@ module Prosopite
100
104
  end
101
105
  end
102
106
 
103
- next unless fingerprints.uniq.size == 1
107
+ queries = fingerprints.values.select { |q| q.size >= @min_n_queries }
108
+
109
+ next unless queries.any?
104
110
 
105
111
  kaller = tc[:prosopite_query_caller][location_key]
106
112
  allow_list = (@allow_stack_paths + DEFAULT_ALLOW_LIST)
107
113
  is_allowed = kaller.any? { |f| allow_list.any? { |s| f.match?(s) } }
108
114
 
109
115
  unless is_allowed
110
- queries = tc[:prosopite_query_holder][location_key]
111
- tc[:prosopite_notifications][queries] = kaller
116
+ queries.each do |q|
117
+ tc[:prosopite_notifications][q] = kaller
118
+ end
112
119
  end
113
120
  end
114
121
  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.0
4
+ version: 1.2.2
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-10-27 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry