trace_tree 0.2.10 → 0.2.11
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 +2 -2
- data/lib/trace_tree/native_console.js +7 -0
- data/lib/trace_tree/return_value.rb +25 -13
- data/lib/trace_tree/version.rb +1 -1
- data/lib/trace_tree.rb +5 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b718ef2ac65f359114fe71dfb0fc137ae6aefb11
|
4
|
+
data.tar.gz: d2c1e1142e2f877ac500915a92400f968a3b7eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0efbac5f49d16b1cff0b07818f81aee2c401c0997ad0939e3bca281d7fff3bffa3109a332bf114773a8e0bd7d8eed18c48a3b8425f7921613f645f9c234b73be
|
7
|
+
data.tar.gz: d5748c338201b73c875d901904e1bca2ee6c41ef4859bad477bac85c841242078b0069607ff4e353f6f07c3a0856490af7b3b7da3ba057688bc51099799c8356
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ end
|
|
52
52
|
* `:html => nil` by default. Set it true to generate a html in which a tree constructed with `<ul>`, `<li>`. (No need to set `color`).
|
53
53
|
* `:tmp => nil` by default. Set it true or a string or an array of string to specify a tmp file under the default tmp dir of your system. (No need to provide `file` argument. It makes parent directories as needed)
|
54
54
|
* `:htmp => nil` by default. It is combination of `:html` and `:tmp`.
|
55
|
-
* `:return => true` by default. It
|
55
|
+
* `:return => true` by default. It stores return values of functions in generated html. Hover function call and press `r` to print return value in console.
|
56
56
|
* `:args => false` by default. Set it true to puts arguments of `:call` functions into html. Since arguments are always return values of other functions, so this option is not necessary.
|
57
57
|
* `:in => //, :out => nil` by default. Give them regexp(s) to include/exclude methods defined in files match that regexp(s). Notice thread-calls and methods defined by `define_method` are always included. Also, once you set any of these two options, the code to trace should not be in same line with `binding.trace_tree() do`.
|
58
58
|
* `:timer => nil` by default. Set it true if you want to know how much time spent in tracing and drawing tree. Notice the `file` should be appendable, otherwise the time will overwrite the tree.
|
@@ -68,7 +68,7 @@ Try to remove a non-existing index:
|
|
68
68
|
ArgumentError: Index name 'index_cars_on_online_at' on table 'cars' does not exist
|
69
69
|
```
|
70
70
|
|
71
|
-
Then find the result HTML in tmp dir. Move your mouse on any method name, and press `f`/`u` to fold/unfold it's callee, press `p`/`n` to jump to it's previous/next sibling call, press `r` to print return value in
|
71
|
+
Then find the result HTML in tmp dir. Move your mouse on any method name, and press `f`/`u` to fold/unfold it's callee, press `p`/`n` to jump to it's previous/next sibling call, press `r` to print return value in console.
|
72
72
|
|
73
73
|

|
74
74
|
|
@@ -3,11 +3,6 @@ require 'pp'
|
|
3
3
|
|
4
4
|
class TraceTree
|
5
5
|
module ReturnValue
|
6
|
-
|
7
|
-
CONSOLE_JS = File.read File.expand_path('../console.js', __FILE__)
|
8
|
-
|
9
|
-
CONSOLE_CSS = File.read File.expand_path('../console.css', __FILE__)
|
10
|
-
|
11
6
|
BLANK = ''.freeze
|
12
7
|
|
13
8
|
NEED_PP = (
|
@@ -23,14 +18,6 @@ class TraceTree
|
|
23
18
|
super.merge!({return: attr_value})
|
24
19
|
end
|
25
20
|
|
26
|
-
def css_for_tree_html
|
27
|
-
super + CONSOLE_CSS
|
28
|
-
end
|
29
|
-
|
30
|
-
def body_js_for_tree_html
|
31
|
-
super.push({text: CONSOLE_JS})
|
32
|
-
end
|
33
|
-
|
34
21
|
def self.formatted klass, &block
|
35
22
|
klass.send :define_method, :_trace_tree_pp, &block
|
36
23
|
end
|
@@ -64,4 +51,29 @@ class TraceTree
|
|
64
51
|
end
|
65
52
|
|
66
53
|
end
|
54
|
+
|
55
|
+
module ConsoleReturnValue
|
56
|
+
include ReturnValue
|
57
|
+
|
58
|
+
JS = File.read File.expand_path('../native_console.js', __FILE__)
|
59
|
+
|
60
|
+
def body_js_for_tree_html
|
61
|
+
super.push({text: JS})
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
module LuxuryReturnValue
|
66
|
+
include ReturnValue
|
67
|
+
|
68
|
+
JS = File.read File.expand_path('../console.js', __FILE__)
|
69
|
+
CSS = File.read File.expand_path('../console.css', __FILE__)
|
70
|
+
|
71
|
+
def css_for_tree_html
|
72
|
+
super + CSS
|
73
|
+
end
|
74
|
+
|
75
|
+
def body_js_for_tree_html
|
76
|
+
super.push({text: JS})
|
77
|
+
end
|
78
|
+
end
|
67
79
|
end
|
data/lib/trace_tree/version.rb
CHANGED
data/lib/trace_tree.rb
CHANGED
@@ -71,7 +71,11 @@ class TraceTree
|
|
71
71
|
enhancement = []
|
72
72
|
enhancement << TraceTree::Color unless opt[:color] == false
|
73
73
|
enhancement << TraceTree::ShortGemPath unless opt[:gem] == false
|
74
|
-
|
74
|
+
if opt[:return].nil? || opt[:return] == true
|
75
|
+
enhancement << TraceTree::ConsoleReturnValue
|
76
|
+
elsif opt[:return] == :lux
|
77
|
+
enhancement << TraceTree::LuxuryReturnValue
|
78
|
+
end
|
75
79
|
enhancement << TraceTree::Args if opt[:args] == true
|
76
80
|
@point_loader = Point::Loader.new *enhancement, config
|
77
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trace_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/trace_tree/console.css
|
148
148
|
- lib/trace_tree/console.js
|
149
149
|
- lib/trace_tree/gem_paths.rb
|
150
|
+
- lib/trace_tree/native_console.js
|
150
151
|
- lib/trace_tree/point.rb
|
151
152
|
- lib/trace_tree/point/call_activesupportconcern_appendfeatures.rb
|
152
153
|
- lib/trace_tree/point/call_modulemutexm_extendobject.rb
|