yeller_ruby 0.0.2 → 0.0.3

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: 698ad55a6a18513724ff97a0896585191a3a579f
4
- data.tar.gz: bb09b021ef217c667c2b5978563c852e76d6cc78
3
+ metadata.gz: fd6aa5fa6208ebd1b16791b49ef819b386499d07
4
+ data.tar.gz: 62a009475578a506ffa64294861663a59f2cd23d
5
5
  SHA512:
6
- metadata.gz: 75f14d12c0b974cf5ce2d8263156f82c23670f1b1c18a7ccf5d2d5ffc075f440054f1662bae8cc85fae934e6caf844249a04cbb56625c26ee492a6a3e6e319d5
7
- data.tar.gz: 649cd6159cca96897695bf596a191116cc1ddf455d955b58c90db6c35d0d8808504819d4ae6c56f01311b84a497564c84fb05b9f9b085e4a7bf5d7e53cd76a4d
6
+ metadata.gz: 6ae37a2e4041c17eba040a3fea4a56167d4996f5139a35e2a8a7d690f91b02343638c802914af33c9bbbca7e9f9c6e31649497a614fed4847dc52cc4f49ec404
7
+ data.tar.gz: 3f5b20b1ce20899da40e6f4000e2e6d5df03fa032adfce607a9f315651f6c6d7efe5d49d1ed4d033d4d4cdb2ef362f718492e389e2a1ea12ee0c0908b2a41f3b
@@ -2,7 +2,7 @@ require_relative 'server'
2
2
 
3
3
  module Yeller
4
4
  class Configuration
5
- attr_reader :token, :servers, :startup_params, :error_handler, :project_root
5
+ attr_reader :token, :servers, :startup_params, :error_handler, :project_root, :development_environments
6
6
  DEFAULT_SERVERS = [
7
7
  Yeller::SecureServer.new("collector1.yellerapp.com", 443),
8
8
  Yeller::SecureServer.new("collector2.yellerapp.com", 443),
@@ -15,6 +15,7 @@ module Yeller
15
15
  @servers = DEFAULT_SERVERS
16
16
  @startup_params = {}
17
17
  @error_handler = Yeller::LogErrorHandler.new
18
+ @development_environments = Set.new(['development', 'test'])
18
19
  end
19
20
 
20
21
  def remove_default_servers
@@ -67,6 +68,15 @@ module Yeller
67
68
  end
68
69
  end
69
70
 
71
+ def development_environments=(new_development_environments)
72
+ @development_environments = new_development_environments
73
+ end
74
+
75
+ def ignore_exceptions?
76
+ development_environments.include?(
77
+ @startup_params[:"application-environment"])
78
+ end
79
+
70
80
  def token=(token)
71
81
  @token = token
72
82
  end
@@ -0,0 +1,6 @@
1
+ module Yeller
2
+ class IgnoringClient
3
+ def report(*_)
4
+ end
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Yeller
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/yeller.rb CHANGED
@@ -3,6 +3,7 @@ require 'yajl/json_gem'
3
3
 
4
4
  require_relative 'yeller/backtrace_filter'
5
5
  require_relative 'yeller/client'
6
+ require_relative 'yeller/ignoring_client'
6
7
  require_relative 'yeller/configuration'
7
8
  require_relative 'yeller/exception_formatter'
8
9
  require_relative 'yeller/server'
@@ -18,12 +19,16 @@ module Yeller
18
19
  end
19
20
 
20
21
  def self.build_client(config)
21
- Yeller::Client.new(
22
- config.servers,
23
- config.token,
24
- Yeller::StartupParams.defaults(config.startup_params),
25
- Yeller::BacktraceFilter.new(config.backtrace_filters),
26
- config.error_handler
27
- )
22
+ if config.ignore_exceptions?
23
+ Yeller::IgnoringClient.new
24
+ else
25
+ Yeller::Client.new(
26
+ config.servers,
27
+ config.token,
28
+ Yeller::StartupParams.defaults(config.startup_params),
29
+ Yeller::BacktraceFilter.new(config.backtrace_filters),
30
+ config.error_handler
31
+ )
32
+ end
28
33
  end
29
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yeller_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Crayford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-07 00:00:00.000000000 Z
11
+ date: 2014-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,6 +64,7 @@ files:
64
64
  - lib/yeller/client.rb
65
65
  - lib/yeller/configuration.rb
66
66
  - lib/yeller/exception_formatter.rb
67
+ - lib/yeller/ignoring_client.rb
67
68
  - lib/yeller/log_error_handler.rb
68
69
  - lib/yeller/rack.rb
69
70
  - lib/yeller/rails.rb