yeller_ruby 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yeller.rb +1 -1
- data/lib/yeller/backtrace_filter.rb +13 -5
- data/lib/yeller/configuration.rb +9 -1
- data/lib/yeller/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fb27b695dfdb1504682392c8130436e0390ef5a
|
4
|
+
data.tar.gz: 21887a8a02ed2a4bdc28e407e57c52185c2c7015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8818a911cff332badf57e1e235eb22d106ce82444a125f206f4ee03af440afc547fbc6c8768ec7aa5dd6c1400b07fe2e2cc6b001b0cdd675e5412e444c998091
|
7
|
+
data.tar.gz: ee85ebf9b82bfc914f5aa454879e49b78412cdc28ed4ad443538af88b3de6c8df6630e543424b2ae2e8bf9408560e51d3dacfde5cdfa942c2b083d1c2463b825
|
data/lib/yeller.rb
CHANGED
@@ -26,7 +26,7 @@ module Yeller
|
|
26
26
|
config.servers,
|
27
27
|
config.token,
|
28
28
|
Yeller::StartupParams.defaults(config.startup_params),
|
29
|
-
Yeller::BacktraceFilter.new(config.
|
29
|
+
Yeller::BacktraceFilter.new(config.backtrace_filename_filters, config.backtrace_method_filters),
|
30
30
|
config.error_handler
|
31
31
|
)
|
32
32
|
end
|
@@ -1,21 +1,29 @@
|
|
1
1
|
module Yeller
|
2
2
|
class BacktraceFilter
|
3
|
-
attr_reader :
|
4
|
-
def initialize(
|
5
|
-
@
|
3
|
+
attr_reader :filename_filters, :method_filters
|
4
|
+
def initialize(filename_filters, method_filters)
|
5
|
+
@filename_filters = filename_filters
|
6
|
+
@method_filters = method_filters
|
6
7
|
end
|
7
8
|
|
8
9
|
def filter(trace)
|
9
10
|
trace.map do |frame|
|
10
|
-
[filter_filename(frame[0]), frame[1], frame[2]]
|
11
|
+
[filter_filename(frame[0]), frame[1], filter_method(frame[2])]
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
14
15
|
def filter_filename(filename)
|
15
|
-
|
16
|
+
filename_filters.each do |filter|
|
16
17
|
filename.gsub!(filter[0], filter[1])
|
17
18
|
end
|
18
19
|
filename
|
19
20
|
end
|
21
|
+
|
22
|
+
def filter_method(method)
|
23
|
+
method_filters.each do |filter|
|
24
|
+
method.gsub!(filter[0], filter[1])
|
25
|
+
end
|
26
|
+
method
|
27
|
+
end
|
20
28
|
end
|
21
29
|
end
|
data/lib/yeller/configuration.rb
CHANGED
@@ -32,7 +32,7 @@ module Yeller
|
|
32
32
|
@servers << Yeller::Server.new(host, port)
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
35
|
+
def backtrace_filename_filters
|
36
36
|
filters = []
|
37
37
|
if defined?(Gem)
|
38
38
|
Gem.path.each do |gem_path|
|
@@ -47,6 +47,14 @@ module Yeller
|
|
47
47
|
filters
|
48
48
|
end
|
49
49
|
|
50
|
+
def backtrace_method_filters
|
51
|
+
filters = []
|
52
|
+
if defined?(Rails)
|
53
|
+
filters << [/_run__\d+__.*callbacks/, 'process_callbacks']
|
54
|
+
end
|
55
|
+
filters
|
56
|
+
end
|
57
|
+
|
50
58
|
def environment=(new_environment)
|
51
59
|
@startup_params[:"application-environment"] = new_environment
|
52
60
|
end
|
data/lib/yeller/version.rb
CHANGED