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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecfcbcac41a1a8ec231bc7c72ea1263e8c046e47
4
- data.tar.gz: 8a7041736a6b9944c85bb294027308f9fdaddacf
3
+ metadata.gz: 0b478148d5729cfc3ac49d26ce98f52915be0590
4
+ data.tar.gz: 0eb6e66af1ef36d4122ecac647af6bf6b3ee425d
5
5
  SHA512:
6
- metadata.gz: 7fff3e8f0fcc69ba556033c9f527309d3b38d5dbae074da4dff962782afc804e0a63449d8fd0b10ebaf6d0efdf233c6e0fdf5fcc5b2991dc765e490d89809b92
7
- data.tar.gz: 13bcc734c2dde452234e6b1865f054c46253f40d6a5139380c657e6d714e7e3e4fd05b67555459850f9206adf7a6d2b8dc6f9c583cf961482e3ce2a6f343ce05
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
@@ -1,3 +1,3 @@
1
1
  class TraceTree
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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
- @build = opt[:html] ? [:tree_html_full, '.highlight{color: blue;}'] : [:tree_graph]
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, :build
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 *build
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.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-15 00:00:00.000000000 Z
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.6.8
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