trace_tree 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trace_tree/tree_htmlable.rb +6 -1
- data/lib/trace_tree/version.rb +1 -1
- data/lib/trace_tree.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b478148d5729cfc3ac49d26ce98f52915be0590
|
4
|
+
data.tar.gz: 0eb6e66af1ef36d4122ecac647af6bf6b3ee425d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a9339620c05bf4e7e1203582e89f5159bcb810b57b265ce65588fc8d500401067bc80efd65976f5deb584afc17dc5394d3b8b0e6a9102915f6d52e1fd9d9ba1
|
7
|
+
data.tar.gz: b56dfc293f06a8cc0306363e25241e783b287516b0c435267f49d75024db241cfb9050105267f565efde8e083ebc1e8cb9ff0c7dcc0d940f87849d22515dd140
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'tree_html'
|
2
|
+
require 'cgi'
|
2
3
|
|
3
4
|
class TraceTree
|
4
5
|
module TreeHtmlable
|
@@ -6,11 +7,15 @@ class TraceTree
|
|
6
7
|
include TreeHtml
|
7
8
|
|
8
9
|
def label_for_tree_html
|
9
|
-
"<span class='highlight'>#{class_and_method}</span> #{source_location}"
|
10
|
+
"<span class='highlight'>#{CGI::escapeHTML class_and_method}</span> #{CGI::escapeHTML source_location}"
|
10
11
|
end
|
11
12
|
|
12
13
|
def children_for_tree_html
|
13
14
|
callees
|
14
15
|
end
|
16
|
+
|
17
|
+
def css_for_tree_html
|
18
|
+
'.highlight{color: #a50000;}'
|
19
|
+
end
|
15
20
|
end
|
16
21
|
end
|
data/lib/trace_tree/version.rb
CHANGED
data/lib/trace_tree.rb
CHANGED
@@ -20,7 +20,7 @@ class TraceTree
|
|
20
20
|
def generate *log, **opt, &to_do
|
21
21
|
@log = log.empty? ? STDOUT : log[0]
|
22
22
|
node_class = optional_node opt
|
23
|
-
@
|
23
|
+
@build_command = opt[:html] ? :tree_html_full : :tree_graph
|
24
24
|
|
25
25
|
tp = TracePoint.trace(:call, :b_call, :raise, :c_call) do |point|
|
26
26
|
trace_points << node_class.new(point) if wanted? point
|
@@ -34,7 +34,7 @@ class TraceTree
|
|
34
34
|
|
35
35
|
private
|
36
36
|
|
37
|
-
attr_reader :bi, :trace_points, :log, :
|
37
|
+
attr_reader :bi, :trace_points, :log, :build_command
|
38
38
|
|
39
39
|
def optional_node opt
|
40
40
|
Class.new TraceTree::Node do
|
@@ -44,7 +44,7 @@ class TraceTree
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def dump_trace_tree
|
47
|
-
tree = sort(trace_points).send
|
47
|
+
tree = sort(trace_points).send build_command
|
48
48
|
log.puts tree
|
49
49
|
end
|
50
50
|
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.5.2
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: Print TracePoint(normal ruby call, block call, raise call, throw call) in
|