activerecord_callback_lens 0.5.0 → 0.6.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 07d96f844203e807055440482bba6493ff956a872c892e3fe4fdaea261d64f4c
|
|
4
|
+
data.tar.gz: 967b5f1c25f07455693a5296897f5c33e60e1ff214b22c15f36cefe462207e48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c54f27dfb04fbdb3279d7da8b7132747cd019116ddbff84bbadda8d4228083482e630d1af045fdf0ad91e19f373ed1327990f4971fbd1d4200ffcf7764a1de2
|
|
7
|
+
data.tar.gz: 5d699043e98d1a5e12dad02295170087f384c346e50ac0a4e16c69da5a115b212178ccaea0cd4869d58f598766f6f73b342380f96e3aa761ae54d11599edd043
|
data/README.md
CHANGED
|
@@ -33,10 +33,10 @@ Point the `callback_lens` binary at any loaded ActiveRecord model:
|
|
|
33
33
|
callback_lens analyze User
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
This prints a Mermaid `graph
|
|
36
|
+
This prints a Mermaid `graph LR` diagram to stdout showing every callback and its condition dependencies.
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
graph
|
|
39
|
+
graph LR
|
|
40
40
|
n0["before_save"]
|
|
41
41
|
n1["AndNode"]
|
|
42
42
|
n2["saved_change_to_title?"]
|
|
@@ -176,7 +176,7 @@ command matrix and expected output.
|
|
|
176
176
|
| Resolver | `MethodResolver` | Recursively expands `MethodRefNode` symbols into full `ConditionTree` sub-trees (up to 5 levels deep) with cycle detection |
|
|
177
177
|
| Graph | `GraphBuilder` | Assembles a DAG of `CallbackNode`, `ConditionNode`, `PredicateNode`, and `MethodNode` values |
|
|
178
178
|
| Analyzer | `ExecutionOrderAnalyzer` | Sorts definitions into canonical Rails execution order (create or update path) |
|
|
179
|
-
| Renderer | `MermaidRenderer` | Serializes the graph to a Mermaid `graph
|
|
179
|
+
| Renderer | `MermaidRenderer` | Serializes the graph to a Mermaid `graph LR` (left-to-right) string |
|
|
180
180
|
| Renderer | `GraphvizRenderer` | Serializes the graph to a Graphviz DOT string; `#to_svg` shells out to `dot` |
|
|
181
181
|
| Renderer | `HtmlRenderer` | Produces a self-contained HTML report embedding Mermaid, SVG, callback table, execution flow, and dependency tree |
|
|
182
182
|
|
|
@@ -4,12 +4,12 @@ require_relative "../graph/nodes"
|
|
|
4
4
|
|
|
5
5
|
module ActiverecordCallbackLens
|
|
6
6
|
module Renderer
|
|
7
|
-
# Renders a Graph::Graph as a Mermaid `graph
|
|
7
|
+
# Renders a Graph::Graph as a Mermaid `graph LR` (left-to-right) diagram string.
|
|
8
8
|
#
|
|
9
9
|
# The output is a header line followed by one declaration per node and one
|
|
10
10
|
# arrow per edge:
|
|
11
11
|
#
|
|
12
|
-
# graph
|
|
12
|
+
# graph LR
|
|
13
13
|
# n0["before_save"]
|
|
14
14
|
# n1["active?"]
|
|
15
15
|
# n1 --> n0
|
|
@@ -34,7 +34,7 @@ module ActiverecordCallbackLens
|
|
|
34
34
|
|
|
35
35
|
# @return [String]
|
|
36
36
|
def render
|
|
37
|
-
lines = ["graph
|
|
37
|
+
lines = ["graph LR"]
|
|
38
38
|
lines.concat(node_declarations)
|
|
39
39
|
lines.concat(edge_declarations)
|
|
40
40
|
lines.join("\n")
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord_callback_lens
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eraxel.Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|