cruft_tracker 0.2.1 → 0.2.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/README.md +11 -1
- data/lib/cruft_tracker/engine.rb +2 -5
- 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: e11661e18988d5a678417bb2295abf479c7eecd17644ab9e3fa3386188e6a25a
|
|
4
|
+
data.tar.gz: 104b7dc62a4590837655618f9eb82786f609e7a0b5733b629afc85628088ea9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 635d585bc91bc042b6713f40e2da1c782d4e42664c5a69e3b6377089f38cf5bb91744a6f202ff9ef61020d2ce6170b507644d5ec45908ee88b682f685f8a7fa0
|
|
7
|
+
data.tar.gz: ec22b4e3e545e2adec8094f4a5e6b46156d9d2cf35d0ef3f20f61c347f50e7c2160b98767fd8a1943ba366df13d0459de8391bbfa34f78e2dfa0f79e99d04904
|
data/README.md
CHANGED
|
@@ -47,6 +47,16 @@ CruftTracker.init do
|
|
|
47
47
|
end
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
Note: you may need to wrap the `CruftTracker.init` call in `Rails.application.reloader.to_prepare` to prevent deprecation warnings related to autoloading constants during initialization. For example:
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
Rails.application.reloader.to_prepare do
|
|
54
|
+
CruftTracker.init do
|
|
55
|
+
# your configuration.... (more on this below)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
```
|
|
59
|
+
|
|
50
60
|
### Tracking method invocations
|
|
51
61
|
|
|
52
62
|
CruftTracker is pretty simple. Let's say you have a class (or module) like this...
|
|
@@ -355,7 +365,7 @@ Let's say you have this view and you're just not sure it's being used anymore:
|
|
|
355
365
|
<!-- app/views/something/some_view.html.erb -->
|
|
356
366
|
|
|
357
367
|
<div>
|
|
358
|
-
|
|
368
|
+
<%- if @data.present? %>
|
|
359
369
|
<strong>Woo hoo!</strong>
|
|
360
370
|
<% end %>
|
|
361
371
|
</div>
|
data/lib/cruft_tracker/engine.rb
CHANGED
|
@@ -3,16 +3,13 @@ module CruftTracker
|
|
|
3
3
|
isolate_namespace CruftTracker
|
|
4
4
|
|
|
5
5
|
config.after_initialize do
|
|
6
|
+
ActionController::Base.helper CruftTracker::ApplicationHelper
|
|
6
7
|
CruftTracker::CleanupUntrackedMethods.run!
|
|
7
8
|
CruftTracker::CleanupUntrackedViews.run!
|
|
8
9
|
rescue StandardError
|
|
9
10
|
# Swallow all errors to prevent initialization failures.
|
|
10
11
|
end
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
ActiveSupport.on_load :action_controller do
|
|
14
|
-
helper CruftTracker::ApplicationHelper
|
|
15
|
-
end
|
|
16
|
-
end
|
|
13
|
+
|
|
17
14
|
end
|
|
18
15
|
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.2.
|
|
4
|
+
version: 0.2.2
|
|
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-07-
|
|
12
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: active_interaction
|