callback_hell 0.2.0 → 0.2.1

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: 1e3c885812a73a0a4fd89036e2d1897b64a467130924de668bdfb7dd4c90091b
4
- data.tar.gz: 55d44b2e7296574ec3657b9e4d44ea4dfc5b68b9510f87853ff33e41fc40ad9c
3
+ metadata.gz: d1d4c93ffb49c622e2bec61ef6c52cc8b1811efbe1431450853171158ae7dbde
4
+ data.tar.gz: c7cff82da86a6c680b9d4e3b1b4749bfb7e29e3814e50e1535bc354b04ee957b
5
5
  SHA512:
6
- metadata.gz: a43af18de970ceab56f70a67cbe08c7348b3ff69a5acdbeba4dbdb395173bcfe96c40bc9a1f441074512d42a142e58183c43bcb415c875fdbb93d3e7753b15b7
7
- data.tar.gz: 7f51fd27e54b2ee70cf3927d716f3d5c95bfb1d14f240deadd0806ccd9200e480644240c24db0ea045dfb735786519ef844c83794955de24d2c78ae03f3f9bdf
6
+ metadata.gz: 7801e52db155cbcc5cbd18b6bcc6178caa11e9f98831a814f48bf66d944dd2adf0f9dc9ce53288db62995335f66dbe3ff6efc358ebd1d0deb116325b3864065f
7
+ data.tar.gz: d5a0f91436781b3b0c0c9881b34bbe221f904735b3d23c7823aed9f5385cd7c66768fea2e53c19bf2104f3d6e3761fc95c2dd00cbdd086b00b6083d61637dbab
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change log
2
2
 
3
+ ## 0.2.1
4
+
5
+ - Proper support for Rails 7.0 and its lack of `normalizes` (https://github.com/evilmartians/callback_hell/issues/1) ([@yaroslav][])
6
+
3
7
  ## 0.2.0
4
8
 
5
9
  - Initial public release. ([@yaroslav][])
data/README.md CHANGED
@@ -4,9 +4,7 @@
4
4
 
5
5
  > You live in it.
6
6
 
7
- Callback Hell is a Ruby gem for use with Ruby on Rails applications.
8
-
9
- It analyzes your Rails application models and provides actionable insights on callbacks and validations. Use it to identify models that might benefit from refactoring, spot callback pollution from gems and associations, and keep your models clean and maintainable.
7
+ Callback Hell is a Ruby gem that analyzes your Ruby on Rails application models and provides actionable insights on callbacks and validations. Use it to identify models that might benefit from refactoring, spot callback pollution from gems and associations, and keep your models clean and maintainable.
10
8
 
11
9
  <a href="https://evilmartians.com/?utm_source=callback_hell">
12
10
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54">
@@ -64,7 +62,7 @@ We support Ruby 3.0+ and Rails 7.0+.
64
62
 
65
63
  ## Usage
66
64
 
67
- **Note:** you can use both `rake` or `bin/rails` as you wish.
65
+ **Note:** you can use either `rake` or `bin/rails` as you wish.
68
66
 
69
67
  ### Command line options
70
68
 
@@ -74,13 +72,13 @@ All rake tasks support the following options:
74
72
 
75
73
  ```bash
76
74
  # Table format (default)
77
- bin/rails callback_hell:callbacks format=table
75
+ bin/rails ch:callbacks format=table
78
76
 
79
- # Line format: detailed per-callback breakdown, useful for debugging
80
- bin/rails callback_hell:callbacks format=line
77
+ # Line format: detailed per-callback breakdown
78
+ bin/rails ch:callbacks format=line
81
79
 
82
80
  # GitHub Actions format for CI/CD
83
- bin/rails callback_hell:callbacks format=github
81
+ bin/rails ch:callbacks format=github
84
82
  ```
85
83
 
86
84
  #### Model filtering
@@ -100,19 +98,19 @@ bin/rails ch model=Admin::User
100
98
 
101
99
  ```bash
102
100
  # Sort by callback count (default)
103
- bin/rails ch sort=size:desc
101
+ bin/rails ch sort=total
104
102
 
105
103
  # Sort alphabetically
106
- bin/rails ch sort=name:asc
104
+ bin/rails ch sort=name
107
105
  ```
108
106
 
109
107
  #### Analysis modes
110
108
 
111
109
  ```bash
112
- # Default mode - your callbacks only
110
+ # Default mode: your callbacks only
113
111
  bin/rails ch mode=default
114
112
 
115
- # Full mode - includes Rails internals and associations
113
+ # Full mode: includes Rails internals and associations
116
114
  bin/rails ch mode=full
117
115
  ```
118
116
 
@@ -161,9 +159,11 @@ jobs:
161
159
 
162
160
  ## Credits and acknowledgements
163
161
 
164
- Callback Hell is a spiritual successor of the [arca](https://github.com/jonmagic/arca) gem by [Jonathan Hoyt](https://github.com/jonmagic).
162
+ Callback Hell is supposed to be a spiritual successor of the [arca](https://github.com/jonmagic/arca) gem by [Jonathan Hoyt](https://github.com/jonmagic).
163
+
164
+ The entire idea and a detailed specification for the gem were done by [Vladimir Dementyev](https://github.com/palkan) who initially offered it as a Ruby developer candidate take-home task for [Evil Martians](https://evilmartians.com/?utm_source=callback_hell).
165
165
 
166
- The entire idea and a detailed specification for the gem was done by [Vladimir Dementyev](https://github.com/palkan) who initially offered it as a test task for [Evil Martians](https://evilmartians.com/?utm_source=callback_hell) Ruby developer take-home task.
166
+ Shout-out to [Adam Doppelt](https://github.com/gurgeous) for [table_tennis](https://github.com/gurgeous/table_tennis) that we use for formatting tables.
167
167
 
168
168
  ## Contributing
169
169
 
@@ -10,9 +10,13 @@ module CallbackHell
10
10
  ].freeze
11
11
 
12
12
  RAILS_ATTRIBUTE_OWNERS = [
13
- defined?(ActiveRecord::Normalization) ? ActiveRecord::Normalization : ActiveModel::Attributes::Normalization,
14
- ActiveRecord::Encryption::EncryptableRecord
15
- ].freeze
13
+ defined?(ActiveRecord::Normalization) &&
14
+ ActiveRecord::Normalization,
15
+ defined?(ActiveModel::Attributes::Normalization) &&
16
+ ActiveModel::Attributes::Normalization,
17
+ defined?(ActiveRecord::Encryption::EncryptableRecord) &&
18
+ ActiveRecord::Encryption::EncryptableRecord
19
+ ].compact.freeze
16
20
 
17
21
  def initialize(callback, model, defining_class)
18
22
  @callback = callback
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CallbackHell
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: callback_hell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Markin