exceptional 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,7 +47,8 @@ module Exceptional
47
47
  end
48
48
 
49
49
  def should_send_to_api?
50
- @enabled ||= DEFAULTS[:disabled_by_default].include?(application_environment) ? false : true
50
+ return @enabled unless @enabled.nil?
51
+ @enabled = !(DEFAULTS[:disabled_by_default].include?(application_environment))
51
52
  end
52
53
 
53
54
  def application_root
@@ -1,3 +1,3 @@
1
1
  module Exceptional
2
- VERSION = '2.0.8'
3
- end
2
+ VERSION = '2.0.9'
3
+ end
@@ -21,11 +21,13 @@ describe Exceptional::Config, 'defaults' do
21
21
  Exceptional::Config.remote_host.should == 'plugin.getexceptional.com'
22
22
  Exceptional::Config.remote_port.should == 443
23
23
  end
24
- it "be enabled based on environment by default" do
24
+ it "be disabled based on environment by default" do
25
25
  %w(development test).each do |env|
26
26
  Exceptional::Config.stub!(:application_environment).and_return(env)
27
27
  Exceptional::Config.should_send_to_api?.should == false
28
- end
28
+ end
29
+ end
30
+ it "be enabled based on environment by default" do
29
31
  %w(production staging).each do |env|
30
32
  Exceptional::Config.stub!(:application_environment).and_return(env)
31
33
  Exceptional::Config.should_send_to_api?.should == true
@@ -35,7 +37,7 @@ describe Exceptional::Config, 'defaults' do
35
37
  before :each do
36
38
  Exceptional::Config.stub!(:application_environment).and_return('production')
37
39
  end
38
- it "allow a new simpler format for exception.yml" do
40
+ it "allow a new simpler format for " do
39
41
  Exceptional::Config.load('spec/fixtures/exceptional.yml')
40
42
  Exceptional::Config.api_key.should == 'abc123'
41
43
  Exceptional::Config.ssl?.should == true
@@ -49,6 +51,11 @@ describe Exceptional::Config, 'defaults' do
49
51
  Exceptional::Config.http_open_timeout.should == 5
50
52
  Exceptional::Config.http_read_timeout.should == 10
51
53
  end
54
+ it "allow disable production environment" do
55
+ Exceptional::Config.load('spec/fixtures/exceptional_disabled.yml')
56
+ Exceptional::Config.api_key.should == 'abc123'
57
+ Exceptional::Config.should_send_to_api?.should == false
58
+ end
52
59
  it "allow olded format for exception.yml" do
53
60
  Exceptional::Config.load('spec/fixtures/exceptional_old.yml')
54
61
  Exceptional::Config.api_key.should == 'abc123'
@@ -0,0 +1,4 @@
1
+ api-key: abc123
2
+
3
+ production:
4
+ enabled: false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exceptional
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contrast
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-02 00:00:00 +00:00
12
+ date: 2010-02-11 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -46,6 +46,7 @@ files:
46
46
  - spec/exceptional/startup_spec.rb
47
47
  - spec/exceptional_rescue_spec.rb
48
48
  - spec/fixtures/exceptional.yml
49
+ - spec/fixtures/exceptional_disabled.yml
49
50
  - spec/fixtures/exceptional_old.yml
50
51
  - spec/fixtures/favicon.png
51
52
  - spec/ginger_scenarios.rb