rollbar 0.9.7 → 0.9.8
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.
- data/CHANGELOG.md +3 -0
- data/lib/rollbar.rb +4 -1
- data/lib/rollbar/configuration.rb +1 -1
- data/lib/rollbar/version.rb +1 -1
- data/spec/rollbar_spec.rb +20 -1
- metadata +2 -3
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
**0.9.8**
|
4
|
+
- Fix bug introduced in 0.9.0 where setting `config.enabled = false` in `config/initializers/rollbar.rb` would be overwritten by subsequent calls to `Rollbar.configure` (as happens normally when using inside Rails).
|
5
|
+
|
3
6
|
**0.9.7**
|
4
7
|
- Use `include?` instead of `in?` for filtering (see [#34](https://github.com/rollbar/rollbar-gem/pull/34))
|
5
8
|
|
data/lib/rollbar.rb
CHANGED
@@ -36,7 +36,10 @@ module Rollbar
|
|
36
36
|
# config.access_token = 'abcdefg'
|
37
37
|
# end
|
38
38
|
def configure
|
39
|
-
configuration.enabled
|
39
|
+
# if configuration.enabled has not been set yet (is still 'nil'), set to true.
|
40
|
+
if configuration.enabled.nil?
|
41
|
+
configuration.enabled = true
|
42
|
+
end
|
40
43
|
yield(configuration)
|
41
44
|
end
|
42
45
|
|
@@ -33,7 +33,7 @@ module Rollbar
|
|
33
33
|
def initialize
|
34
34
|
@async_handler = nil
|
35
35
|
@default_logger = lambda { Logger.new(STDERR) }
|
36
|
-
@enabled =
|
36
|
+
@enabled = nil # set to true when configure is called
|
37
37
|
@endpoint = DEFAULT_ENDPOINT
|
38
38
|
@exception_level_filters = {
|
39
39
|
'ActiveRecord::RecordNotFound' => 'warning',
|
data/lib/rollbar/version.rb
CHANGED
data/spec/rollbar_spec.rb
CHANGED
@@ -38,9 +38,28 @@ describe Rollbar do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
it 'should be enabled when freshly configured' do
|
42
|
+
Rollbar.configuration.enabled.should == true
|
43
|
+
end
|
44
|
+
|
41
45
|
it 'should not be enabled when not configured' do
|
42
46
|
Rollbar.unconfigure
|
43
47
|
|
48
|
+
Rollbar.configuration.enabled.should be_nil
|
49
|
+
Rollbar.report_exception(@exception).should == 'disabled'
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'should stay disabled if configure is called again' do
|
53
|
+
Rollbar.unconfigure
|
54
|
+
|
55
|
+
# configure once, setting enabled to false.
|
56
|
+
Rollbar.configure do |config|
|
57
|
+
config.enabled = false
|
58
|
+
end
|
59
|
+
|
60
|
+
# now configure again (perhaps to change some other values)
|
61
|
+
Rollbar.configure do |config| end
|
62
|
+
|
44
63
|
Rollbar.configuration.enabled.should == false
|
45
64
|
Rollbar.report_exception(@exception).should == 'disabled'
|
46
65
|
end
|
@@ -439,7 +458,7 @@ describe Rollbar do
|
|
439
458
|
|
440
459
|
# configure with some basic params
|
441
460
|
def configure
|
442
|
-
Rollbar.
|
461
|
+
Rollbar.reconfigure do |config|
|
443
462
|
# special test access token
|
444
463
|
config.access_token = test_access_token
|
445
464
|
config.logger = ::Rails.logger
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -300,4 +300,3 @@ test_files:
|
|
300
300
|
- spec/rollbar_spec.rb
|
301
301
|
- spec/spec_helper.rb
|
302
302
|
- spec/support/devise.rb
|
303
|
-
has_rdoc:
|