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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea78bba2ea103a181cd40cd253fdb8a7fd444f9e
4
- data.tar.gz: 6ac6d3498350c24b0f7ebc53692851476507d8cc
3
+ metadata.gz: 2fb27b695dfdb1504682392c8130436e0390ef5a
4
+ data.tar.gz: 21887a8a02ed2a4bdc28e407e57c52185c2c7015
5
5
  SHA512:
6
- metadata.gz: 9e90d025659eb77c3230ed955cb1a5e87975f30004693bf141f67ba2fb63ff727b46995d3b14332271126735902f7462dd395c59434c34c1f0d6ea439874589d
7
- data.tar.gz: 12db0c3e0d533bae61959d3aa5152a0f50347cacf967bc271ea10ed3b4f9836094c983c3a1620ae3452ed6f7be6f986edbaaba3cae6210d6270a785bc88343ba
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.backtrace_filters),
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 :filters
4
- def initialize(filters)
5
- @filters = filters
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
- filters.each do |filter|
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
@@ -32,7 +32,7 @@ module Yeller
32
32
  @servers << Yeller::Server.new(host, port)
33
33
  end
34
34
 
35
- def backtrace_filters
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
@@ -1,3 +1,3 @@
1
1
  module Yeller
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yeller_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Crayford