yeller_ruby 0.3.3 → 0.4.0

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: 2db0d9eee98804d2e01f6e06a9be9037bbd91e9a
4
- data.tar.gz: 621fa7786e8a302f739477a223310ff08ae11d4c
3
+ metadata.gz: 75ca2ec992c7f228b51a61baf5b0b83bab8fa2af
4
+ data.tar.gz: 2d2a0c86c4b612992637d03c2e12b6183d54d6f5
5
5
  SHA512:
6
- metadata.gz: de45fe895d4b55f8bf5417a786387b06e7815f913db587ca3d5062a10b577ef6c2fa90c8338c8683134342ac229914e876e0566d3c51a0a4df89bf162854e1e6
7
- data.tar.gz: 5e72963f41ab11941c44b2cd5970ebca8a674203ae25f70ab529545dfcb8d1b41a27cf5c01e5c4853f65edf3b0203cf725dc687db765ccf71f5c3a4a06e4c7e0
6
+ metadata.gz: d6f51227e916ca49971edba31f466d90ae229bcafff389306672665567ee573ca3d89d4716a14403bde1e3599fabaabc0dc5aabc549279442226a2e78c9b5fd1
7
+ data.tar.gz: 230533d1187072dba5d59d05c8dbfcf0bd7c1d6aff6b57ba4b5bbf6f31ffba2cb992e8276b8257395253a8452d431f077b1f09b6e3716e5e6a94d3c43364e7af
@@ -1,14 +1,20 @@
1
1
  module Yeller
2
2
  class BacktraceFilter
3
- attr_reader :filename_filters, :method_filters
4
- def initialize(filename_filters, method_filters)
3
+ attr_reader :filename_filters, :method_filters, :project_root
4
+ def initialize(filename_filters, method_filters, project_root)
5
5
  @filename_filters = filename_filters
6
6
  @method_filters = method_filters
7
+ @project_root = project_root
7
8
  end
8
9
 
9
10
  def filter(trace)
10
11
  trace.map do |frame|
11
- [filter_filename(frame[0]), frame[1], filter_method(frame[2])]
12
+ in_app = filter_in_app(frame)
13
+ res = [filter_filename(in_app[0]), in_app[1], filter_method(in_app[2])]
14
+ if in_app[3]
15
+ res << in_app[3]
16
+ end
17
+ res
12
18
  end
13
19
  end
14
20
 
@@ -26,5 +32,13 @@ module Yeller
26
32
  end
27
33
  method
28
34
  end
35
+
36
+ def filter_in_app(frame)
37
+ filename = frame[0]
38
+ if filename.start_with?(project_root)
39
+ frame << {"in-app" => true}
40
+ end
41
+ frame
42
+ end
29
43
  end
30
44
  end
@@ -1,3 +1,3 @@
1
1
  module Yeller
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/yeller.rb CHANGED
@@ -34,7 +34,7 @@ module Yeller
34
34
  config.servers,
35
35
  config.token,
36
36
  Yeller::StartupParams.defaults(config.startup_params),
37
- Yeller::BacktraceFilter.new(config.backtrace_filename_filters, config.backtrace_method_filters),
37
+ Yeller::BacktraceFilter.new(config.backtrace_filename_filters, config.backtrace_method_filters, config.project_root),
38
38
  config.error_handler,
39
39
  config.skip_exceptions
40
40
  )
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.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Crayford