cruft_tracker 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/cruft_tracker/cleanup_untracked_methods.rb +8 -6
- data/app/services/cruft_tracker/record_arguments.rb +2 -2
- data/app/services/cruft_tracker/record_backtrace.rb +2 -2
- data/app/services/cruft_tracker/track_method.rb +13 -8
- data/lib/cruft_tracker/version.rb +1 -1
- 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: 7dc443c51a9e3e97dce2c669591a34eb840d6ea0e7ea99e2d9fae20410c2a49a
|
4
|
+
data.tar.gz: 81b3d73761b33e0ce81dc2967686502e2c16d796f12826651221209fadf9a08e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 583a4dd4ccb6f97e1c10a9dd3e5e2855ae3898bd97ba20abeadf13fe7e2441b0f24a1a1d4208e14054712812a84bb41db1bc7af5f2ed9d259fbdd175f0736a62
|
7
|
+
data.tar.gz: f88a8a2c8bd7a2a652f8dad3f416f84f7b430b4373dd0180b69ee6ff5fe4c982b79beb8ba0b1ca5d939ec66b560605020360e6b2d20528f76add7f67f98d525e
|
@@ -5,13 +5,15 @@ module CruftTracker
|
|
5
5
|
private
|
6
6
|
|
7
7
|
def execute
|
8
|
-
CruftTracker::
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
method.
|
8
|
+
CruftTracker::LogSuppressor.suppress_logging do
|
9
|
+
CruftTracker::Method
|
10
|
+
.where(deleted_at: nil)
|
11
|
+
.each do |method|
|
12
|
+
unless method.still_exists? && method.still_tracked?
|
13
|
+
method.update(deleted_at: Time.current)
|
14
|
+
end
|
13
15
|
end
|
14
|
-
|
16
|
+
end
|
15
17
|
rescue StandardError
|
16
18
|
# I'm actively ignoring all errors. Chances are, these are due to something like running rake
|
17
19
|
# tasks in CI when the DB doesn't already exist.
|
@@ -9,8 +9,8 @@ module CruftTracker
|
|
9
9
|
private
|
10
10
|
|
11
11
|
def execute
|
12
|
-
|
13
|
-
|
12
|
+
CruftTracker::LogSuppressor.suppress_logging do
|
13
|
+
arguments_record.with_lock do
|
14
14
|
arguments_record.reload
|
15
15
|
arguments_record.update(occurrences: arguments_record.occurrences + 1)
|
16
16
|
end
|
@@ -7,8 +7,8 @@ module CruftTracker
|
|
7
7
|
private
|
8
8
|
|
9
9
|
def execute
|
10
|
-
|
11
|
-
|
10
|
+
CruftTracker::LogSuppressor.suppress_logging do
|
11
|
+
backtrace_record.with_lock do
|
12
12
|
backtrace_record.reload
|
13
13
|
backtrace_record.update(occurrences: backtrace_record.occurrences + 1)
|
14
14
|
end
|
@@ -56,14 +56,19 @@ module CruftTracker
|
|
56
56
|
arguments_transformer
|
57
57
|
)
|
58
58
|
target_method.owner.define_method target_method.name do |*args|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
begin
|
60
|
+
CruftTracker::RecordInvocation.run!(method: method_record)
|
61
|
+
CruftTracker::RecordBacktrace.run!(method: method_record)
|
62
|
+
if arguments_transformer.present?
|
63
|
+
CruftTracker::RecordArguments.run!(
|
64
|
+
method: method_record,
|
65
|
+
arguments: args,
|
66
|
+
transformer: arguments_transformer
|
67
|
+
)
|
68
|
+
end
|
69
|
+
rescue StandardError
|
70
|
+
# I am intentionally swallowing errors here. If CruftTracker flakes out, we should never
|
71
|
+
# stop the original method from being run correctly.
|
67
72
|
end
|
68
73
|
if method_type == CruftTracker::Method::INSTANCE_METHOD
|
69
74
|
target_method.bind(self).call(*args)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cruft_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adwerx Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-04-
|
12
|
+
date: 2022-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_interaction
|