cruft_tracker 0.1.1 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a4f4e86cc2ed9ea76486127249b9ada54cd1c1499a15e7683bbdc1d996e10c7
4
- data.tar.gz: f9306506d77f24352cf2046a428d15062e3de15028f3fc00b8d0c40dd444b5e7
3
+ metadata.gz: 7dc443c51a9e3e97dce2c669591a34eb840d6ea0e7ea99e2d9fae20410c2a49a
4
+ data.tar.gz: 81b3d73761b33e0ce81dc2967686502e2c16d796f12826651221209fadf9a08e
5
5
  SHA512:
6
- metadata.gz: 2486fbd72ff1efc6621e3197e7c77e8a28f326daddae376a1a6b68eaf144757dcda46bc0b6bd9da6b783844e327b98fec6ca8e4aff491ead2ab83a9519a51560
7
- data.tar.gz: ae3bc92c247015e2b896c206bdec8aa1fc508a520c8059659e9ba82703aed0bbad1d31a5fa1f88609b25da45ff44b51aa25a83239b067e0f2c87f45e57772025
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::Method
9
- .where(deleted_at: nil)
10
- .each do |method|
11
- unless method.still_exists? && method.still_tracked?
12
- method.update(deleted_at: Time.current)
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
- end
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
- arguments_record.with_lock do
13
- CruftTracker::LogSuppressor.suppress_logging do
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
- backtrace_record.with_lock do
11
- CruftTracker::LogSuppressor.suppress_logging do
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
- CruftTracker::RecordInvocation.run!(method: method_record)
60
- CruftTracker::RecordBacktrace.run!(method: method_record)
61
- if arguments_transformer.present?
62
- CruftTracker::RecordArguments.run!(
63
- method: method_record,
64
- arguments: args,
65
- transformer: arguments_transformer
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)
@@ -1,3 +1,3 @@
1
1
  module CruftTracker
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.4'
3
3
  end
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.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-22 00:00:00.000000000 Z
12
+ date: 2022-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: active_interaction