trace_tree 0.2.15 → 0.2.16

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: '049be0b5875c06742a76fbc283f9a124f20fd574d5bdc529e5f5094181997ebe'
4
- data.tar.gz: 7e98c2c3cffc65244f69873d41a1925af401e5c02aee917046eef611f87b4aba
3
+ metadata.gz: cb7a1e555384e2acad9ff6f9b7f51a120cbd35bca05afa9ce7470e358d3f3ea7
4
+ data.tar.gz: 4cfb486a427b2c6dc2aaff7b1fa5e4a9183bdf52249ee20b23cc580ea76e8081
5
5
  SHA512:
6
- metadata.gz: 6c297f28ffe610ddbf6e920350f9ba76f86ff1561b600775d59921d26e83abf1332a65d084be21252e7e93d71c58284738373b2051698404379951ee19916573
7
- data.tar.gz: a35991a7ebd980020a5c82b42d2c0da53b9b4d25b6617d77979d148fff3d7257fed9b2fd3f264bf7fc19b3e5863b243960c3006878a198bbbaa933481d90d98b
6
+ metadata.gz: a9ee20d2b1adbb2105567b5d392f2e586b13abe14da5e471d1379af837848379f7b6f52e4f76d45668d98e814125b0bb5c4596194840ad2de21fc613853ea3e7
7
+ data.tar.gz: bfa96688b71d085e54ec44990de682d4054c0d28d0b9d0c5bfc2e84b71c85830e916ee7c4d4d5f37a7ea985b7ccd3b5d25a7c2612e42401f49c7ec17762521cc
@@ -1,3 +1,3 @@
1
1
  class TraceTree
2
- VERSION = "0.2.15"
2
+ VERSION = "0.2.16"
3
3
  end
data/lib/trace_tree.rb CHANGED
@@ -96,35 +96,39 @@ class TraceTree
96
96
  end
97
97
 
98
98
  def make_filter
99
- filters = []
100
-
101
- if opt.key?(:in)
102
- @in = Array(opt[:in] || //)
103
- filters << '@in.any?{ |pattern| pattern =~ point.path }'
104
- end
105
-
106
- if opt.key?(:out)
107
- @out = Array(opt[:out])
108
- filters << '@out.all?{ |pattern| pattern !~ point.path }'
109
- end
99
+ stack_filter =
100
+ if (@no_methods = Array(opt[:no_methods])).empty?
101
+ nil
102
+ else
103
+ stack_filter = 'return false unless outside_hidden_stack?(point)'
104
+ end
110
105
 
111
- if opt.key?(:no_methods)
112
- @no_methods = Array(opt[:no_methods])
113
- filters << 'outside_hidden_stack?(point)'
114
- end
106
+ path_filter =
107
+ if opt.key?(:in) || opt.key?(:out)
108
+ @in = Array(opt[:in] || //)
109
+ @out = Array(opt[:out])
110
+ 'return false unless @in.any?{ |pattern| pattern =~ point.path } && @out.all?{ |pattern| pattern !~ point.path }'
111
+ else
112
+ nil
113
+ end
115
114
 
116
- if filters.empty?
115
+ if stack_filter.nil? && path_filter.nil?
117
116
  return @deal = -> point { trace_points << point_loader.create(point) }
118
117
  end
119
118
 
120
- self.singleton_class.class_eval <<-EOM
119
+ filter_method = <<-EOM
121
120
  def wanted? point
122
121
  return false if point.end_of_trace?
123
- return true if native?(point) || point.thread_relative? || point.method_defined_by_define_method?
124
- #{filters.join(' && ')}
122
+ return true if native?(point) || point.thread_relative?
123
+ #{stack_filter}
124
+ return true if point.method_defined_by_define_method?
125
+ #{path_filter}
126
+ true
125
127
  end
126
128
  EOM
127
129
 
130
+ self.singleton_class.class_eval filter_method
131
+
128
132
  @deal = -> point do
129
133
  po = point_loader.create(point)
130
134
  trace_points << po if wanted? po
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.15
4
+ version: 0.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-17 00:00:00.000000000 Z
11
+ date: 2019-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler