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 +4 -4
- data/README.md +8 -0
- data/lib/trace_tree.rb +4 -1
- data/lib/trace_tree/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5faac3e419aae49a1d520caabd21eca4b4569b60bed6be5f29d69b26561781e6
|
4
|
+
data.tar.gz: 95441a432f9fdd29d4cd3ffa50ae468fec4764ccada641d0cdd25e6db5564da0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/trace_tree/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2021-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|