trace_tree 0.3.1 → 0.3.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
  SHA256:
3
- metadata.gz: 8e369c5e99d5fbc0625e52c52e3e91255f4feb3e4a7a7c8cc89c4b1f9becebc3
4
- data.tar.gz: 57d3d1e6d68cc3e453f07ae531c3c84ef860a1d51236f75a085dbbd32444bea3
3
+ metadata.gz: 5faac3e419aae49a1d520caabd21eca4b4569b60bed6be5f29d69b26561781e6
4
+ data.tar.gz: 95441a432f9fdd29d4cd3ffa50ae468fec4764ccada641d0cdd25e6db5564da0
5
5
  SHA512:
6
- metadata.gz: 5d3780b5fcfe831b44b5cf9cb1429b5c025781dfba8ce4e035512905e29f9a76a4285136975f28e8f8860d35076f7d069c646aead70c36abaec3178880387df7
7
- data.tar.gz: 4e08b2bdfa70d08ee69e65047cc4c4e664734ba49c356f79a768e5c48d1579fae3e289398556f5a5f413dc6c52012fbd22de5c7c3be90a05cbb38a939701cd03
6
+ metadata.gz: 510554091628f1449c479cb0a218a9875e446fb6414cb53d101390c6bff35490deb409979e73e8eddeb7edbffd56e6682ca3c96cfd60fab7ede0a7d0a9c27abb
7
+ data.tar.gz: 516bf6a7a61ddc1c2487261fd2b24aaf58fa105a6b914bd87ab3ae95771d9e70a5f854c72fb1c634a850631e350bc377bf25df7cd617100b2dc30e080b43f8f9
data/README.md CHANGED
@@ -60,6 +60,14 @@ end
60
60
  * `:debug => nil` by default. Give it `STDOUT`/`STDERR` or anything responds to `:puts` to output a whole list of TracePoints. Or give it a file name in the default tmp dir of your system.
61
61
  * `transcode => false` by default. Set it true to convert unknown character into `"?"` when you see `Encoding::UndefinedConversionError`.
62
62
 
63
+ ### Methods' return values
64
+
65
+ By default it stores return values of functions in generated html. If there is any kind of value can not be stringified, you can do something like this to avoid exception:
66
+
67
+ ```ruby
68
+ TraceTree::ReturnValue.formatted(Mongo::Protocol::Message) { |_| "Mongo::Protocol::Message" }
69
+ ```
70
+
63
71
  ### Example 1: Output to HTML
64
72
 
65
73
  Try to remove a non-existing index:
data/lib/trace_tree.rb CHANGED
@@ -109,11 +109,14 @@ class TraceTree
109
109
  log.puts tree
110
110
  log.puts timer.to_s if opt[:timer]
111
111
  rescue => e
112
- log.puts timer.to_s, e.inspect, e.backtrace, table_of_points
112
+ log.puts timer.to_s, e.inspect, e.backtrace
113
+ log.puts table_of_points
113
114
  end
114
115
 
115
116
  def table_of_points
116
117
  Terminal::Table.from_hashes trace_points_array.map(&:to_h)
118
+ rescue => e
119
+ log.puts "#{__method__}", e.inspect, e.backtrace
117
120
  end
118
121
 
119
122
  def make_filter
@@ -1,3 +1,3 @@
1
1
  class TraceTree
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-16 00:00:00.000000000 Z
11
+ date: 2021-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler