trailblazer-developer 0.0.26 → 0.0.28
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/.github/workflows/ci.yml +3 -4
- data/CHANGES.md +35 -0
- data/Gemfile +7 -4
- data/lib/trailblazer/developer/introspect/graph.rb +83 -0
- data/lib/trailblazer/developer/introspect.rb +17 -0
- data/lib/trailblazer/developer/render/circuit.rb +6 -49
- data/lib/trailblazer/developer/render/linear.rb +1 -1
- data/lib/trailblazer/developer/render/task_wrap.rb +79 -0
- data/lib/trailblazer/developer/trace/debugger/normalizer.rb +68 -0
- data/lib/trailblazer/developer/trace/debugger.rb +72 -0
- data/lib/trailblazer/developer/trace/present.rb +25 -43
- data/lib/trailblazer/developer/trace/stack.rb +21 -0
- data/lib/trailblazer/developer/trace/tree.rb +86 -0
- data/lib/trailblazer/developer/trace.rb +51 -112
- data/lib/trailblazer/developer/version.rb +1 -1
- data/lib/trailblazer/developer/wtf/renderer.rb +15 -16
- data/lib/trailblazer/developer/wtf.rb +44 -57
- data/lib/trailblazer/developer.rb +8 -2
- data/trailblazer-developer.gemspec +3 -2
- metadata +28 -10
- data/gems.local.rb +0 -11
- data/lib/trailblazer/developer/trace/focusable.rb +0 -78
- data/lib/trailblazer/developer/trace/inspector.rb +0 -48
@@ -1,48 +0,0 @@
|
|
1
|
-
module Trailblazer
|
2
|
-
module Developer
|
3
|
-
module Trace
|
4
|
-
|
5
|
-
# This module does the inspection of given `ctx` with deep traversal.
|
6
|
-
# It only gets called when focusing is going on (i.e. focus_on API).
|
7
|
-
module Inspector
|
8
|
-
module_function
|
9
|
-
|
10
|
-
def call(value, default_inspector: method(:default_inspector), **)
|
11
|
-
return hash_inspector(value, default_inspector: default_inspector) if value.is_a?(Hash)
|
12
|
-
return array_inspector(value, default_inspector: default_inspector) if value.is_a?(Array)
|
13
|
-
|
14
|
-
default_inspector.(value)
|
15
|
-
end
|
16
|
-
|
17
|
-
def hash_inspector(value, default_inspector:)
|
18
|
-
Hash[
|
19
|
-
value.collect do |key, nested_value|
|
20
|
-
[key, call(nested_value, default_inspector: default_inspector)]
|
21
|
-
end
|
22
|
-
]
|
23
|
-
end
|
24
|
-
|
25
|
-
def array_inspector(value, default_inspector:)
|
26
|
-
value.collect do |nested_value|
|
27
|
-
call(nested_value, default_inspector: default_inspector)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# To avoid additional query that AR::Relation#inspect makes,
|
32
|
-
# we're calling AR::Relation#to_sql to get plain SQL string instead.
|
33
|
-
def activerecord_relation_inspector(value)
|
34
|
-
{ query: value.to_sql }
|
35
|
-
end
|
36
|
-
|
37
|
-
def default_inspector(value)
|
38
|
-
if defined?(ActiveRecord) && value.is_a?(ActiveRecord::Relation)
|
39
|
-
return activerecord_relation_inspector(value)
|
40
|
-
end
|
41
|
-
|
42
|
-
value.inspect
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|