airbrake-statsd 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,21 +1,15 @@
|
|
1
1
|
module Airbrake
|
2
2
|
class << self
|
3
3
|
|
4
|
-
|
5
|
-
Airbrake::Statsd.increment
|
6
|
-
notify_without_statsd(*args)
|
7
|
-
end
|
8
|
-
|
9
|
-
alias :notify_without_statsd :notify
|
10
|
-
alias :notify :notify_with_statds
|
4
|
+
private
|
11
5
|
|
12
|
-
def
|
6
|
+
def send_notice_with_statsd(*args)
|
13
7
|
Airbrake::Statsd.increment
|
14
|
-
|
8
|
+
send_notice_without_statsd(*args)
|
15
9
|
end
|
16
10
|
|
17
|
-
alias :
|
18
|
-
alias :
|
11
|
+
alias :send_notice_without_statsd :send_notice
|
12
|
+
alias :send_notice :send_notice_with_statsd
|
19
13
|
|
20
14
|
end
|
21
15
|
end
|
@@ -4,58 +4,33 @@ describe Airbrake do
|
|
4
4
|
|
5
5
|
subject { Airbrake }
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
it '#notify_or_ignore is an alias to #notify_or_ignore_with_statsd' do
|
12
|
-
subject.method(:notify_or_ignore).
|
13
|
-
should == subject.method(:notify_or_ignore_with_statsd)
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '#notify_without_statsd' do
|
17
|
-
it 'does not call Airbrake::Statsd.increment' do
|
18
|
-
Airbrake.stub(:send_notice).and_return(nil)
|
19
|
-
|
20
|
-
Airbrake.should_receive(:build_notice_for).with('oops', {})
|
21
|
-
Airbrake::Statsd.should_not_receive(:increment)
|
7
|
+
let(:notice) { mock('Notice', :to_xml => '') }
|
8
|
+
let(:configuration) { mock('Configuration', :public? => true) }
|
22
9
|
|
23
|
-
|
24
|
-
|
10
|
+
let(:sender) do
|
11
|
+
sender = mock('Sender')
|
12
|
+
sender.stub(:send_to_airbrake)
|
13
|
+
sender
|
25
14
|
end
|
26
15
|
|
27
|
-
describe '#
|
28
|
-
|
29
|
-
Airbrake.stub(:
|
30
|
-
|
31
|
-
Airbrake.should_receive(:build_notice_for).with('oops', {})
|
32
|
-
Airbrake::Statsd.should_receive(:increment)
|
33
|
-
|
34
|
-
Airbrake.notify('oops', {})
|
16
|
+
describe '#send_notice_without_statsd' do
|
17
|
+
before do
|
18
|
+
Airbrake.stub(:configuration).and_return(configuration)
|
19
|
+
Airbrake.stub(:sender).and_return(sender)
|
35
20
|
end
|
36
|
-
end
|
37
21
|
|
38
|
-
describe '#notify_or_ignore_without_statsd' do
|
39
22
|
it 'does not call Airbrake::Statsd.increment' do
|
40
|
-
Airbrake.stub(:send_notice).and_return(nil)
|
41
|
-
|
42
|
-
Airbrake.should_receive(:build_notice_for).with('oops', {}).
|
43
|
-
and_return(mock('Notice', :ignore? => false))
|
44
23
|
Airbrake::Statsd.should_not_receive(:increment)
|
45
|
-
|
46
|
-
Airbrake.notify_or_ignore_without_statsd('oops', {})
|
24
|
+
Airbrake.send(:send_notice_without_statsd, notice)
|
47
25
|
end
|
48
26
|
end
|
49
27
|
|
50
|
-
describe '#
|
28
|
+
describe '#send_notice' do
|
51
29
|
it 'calls Airbrake::Statsd.increment' do
|
52
|
-
Airbrake.stub(:send_notice).and_return(nil)
|
53
|
-
|
54
|
-
Airbrake.should_receive(:build_notice_for).with('oops', {}).
|
55
|
-
and_return(mock('Notice', :ignore? => false))
|
56
30
|
Airbrake::Statsd.should_receive(:increment)
|
31
|
+
Airbrake.should_receive(:send_notice_without_statsd)
|
57
32
|
|
58
|
-
Airbrake.
|
33
|
+
Airbrake.send(:send_notice, notice)
|
59
34
|
end
|
60
35
|
end
|
61
36
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake-statsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-03 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70351921134160 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70351921134160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70351921132700 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70351921132700
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: simplecov
|
38
|
-
requirement: &
|
38
|
+
requirement: &70351921132100 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70351921132100
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: airbrake
|
49
|
-
requirement: &
|
49
|
+
requirement: &70351921130780 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70351921130780
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: statsd-ruby
|
60
|
-
requirement: &
|
60
|
+
requirement: &70351921130220 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70351921130220
|
69
69
|
description: Increment an exception counter in StatsD whenever the Airbrake gem reports
|
70
70
|
and exception.
|
71
71
|
email:
|
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
segments:
|
104
104
|
- 0
|
105
|
-
hash:
|
105
|
+
hash: 3298473845107013173
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
segments:
|
113
113
|
- 0
|
114
|
-
hash:
|
114
|
+
hash: 3298473845107013173
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
117
|
rubygems_version: 1.8.11
|