safely 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/safely/strategy/hoptoad.rb +6 -3
- data/lib/safely/version.rb +1 -1
- data/spec/strategies/hoptoad_spec.rb +18 -1
- metadata +129 -136
@@ -6,7 +6,8 @@ module Safely
|
|
6
6
|
|
7
7
|
# Hoptoad API key to use for reporting errors
|
8
8
|
attr_accessor :hoptoad_key
|
9
|
-
|
9
|
+
attr_accessor :hoptoad_host
|
10
|
+
|
10
11
|
def load!
|
11
12
|
begin
|
12
13
|
require 'toadhopper'
|
@@ -16,13 +17,15 @@ module Safely
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def report!( exception )
|
20
|
+
params = {}
|
21
|
+
params[:notify_host] = self.hoptoad_host if !self.hoptoad_host.nil?
|
22
|
+
|
19
23
|
if defined?( Toadhopper ) && !self.hoptoad_key.nil?
|
20
|
-
Toadhopper(
|
24
|
+
Toadhopper.new(self.hoptoad_key, params).post!(exception)
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
24
28
|
end
|
25
|
-
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
data/lib/safely/version.rb
CHANGED
@@ -1,15 +1,32 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Safely::Strategy::Hoptoad do
|
4
|
+
|
4
5
|
it "should be configurable" do
|
5
6
|
Safely::Strategy::Hoptoad.should respond_to(:hoptoad_key)
|
6
7
|
Safely::Strategy::Hoptoad.should respond_to(:hoptoad_key=)
|
8
|
+
Safely::Strategy::Hoptoad.should respond_to(:hoptoad_host)
|
9
|
+
Safely::Strategy::Hoptoad.should respond_to(:hoptoad_host=)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should send the hoptoad_host when config set" do
|
13
|
+
Safely::Strategy::Hoptoad.hoptoad_key = "foo"
|
14
|
+
Safely::Strategy::Hoptoad.hoptoad_host = "http://foo"
|
15
|
+
|
16
|
+
toadhopper_instance = mock(:post!)
|
17
|
+
Toadhopper.expects(:new).with("foo", { :notify_host => "http://foo" }).returns(toadhopper_instance)
|
18
|
+
|
19
|
+
safely do
|
20
|
+
raise "Argh"
|
21
|
+
end
|
7
22
|
end
|
8
23
|
|
9
24
|
it "should report when configured" do
|
10
25
|
Safely::Strategy::Hoptoad.hoptoad_key = "foo"
|
26
|
+
Safely::Strategy::Hoptoad.hoptoad_host = nil
|
11
27
|
|
12
|
-
|
28
|
+
toadhopper_instance = mock(:post!)
|
29
|
+
Toadhopper.expects(:new).with("foo", {}).returns(toadhopper_instance)
|
13
30
|
|
14
31
|
safely do
|
15
32
|
raise "Argh"
|
metadata
CHANGED
@@ -1,148 +1,151 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: safely
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 1
|
10
|
-
version: 0.3.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Kenneth Kalmer
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 3
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
version: "0"
|
30
|
-
prerelease: false
|
31
|
-
requirement: *id001
|
32
|
-
type: :development
|
12
|
+
date: 2012-05-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
33
15
|
name: bundler
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
hash: 3
|
41
|
-
segments:
|
42
|
-
- 0
|
43
|
-
version: "0"
|
44
|
-
prerelease: false
|
45
|
-
requirement: *id002
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
46
22
|
type: :development
|
47
|
-
name: rake
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
hash: 3
|
55
|
-
segments:
|
56
|
-
- 0
|
57
|
-
version: "0"
|
58
23
|
prerelease: false
|
59
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
60
38
|
type: :development
|
61
|
-
name: toadhopper
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
64
|
-
none: false
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
hash: 3
|
69
|
-
segments:
|
70
|
-
- 0
|
71
|
-
version: "0"
|
72
39
|
prerelease: false
|
73
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: toadhopper
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
74
54
|
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
75
63
|
name: mail
|
76
|
-
|
77
|
-
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
73
|
none: false
|
79
|
-
requirements:
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
80
83
|
- - ~>
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
hash: 27
|
83
|
-
segments:
|
84
|
-
- 2
|
85
|
-
- 5
|
86
|
-
- 0
|
84
|
+
- !ruby/object:Gem::Version
|
87
85
|
version: 2.5.0
|
88
|
-
prerelease: false
|
89
|
-
requirement: *id005
|
90
86
|
type: :development
|
91
|
-
|
92
|
-
|
93
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 2.5.0
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: yard
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
94
97
|
none: false
|
95
|
-
requirements:
|
98
|
+
requirements:
|
96
99
|
- - ~>
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
hash: 7
|
99
|
-
segments:
|
100
|
-
- 0
|
101
|
-
- 6
|
102
|
-
- 0
|
100
|
+
- !ruby/object:Gem::Version
|
103
101
|
version: 0.6.0
|
104
|
-
prerelease: false
|
105
|
-
requirement: *id006
|
106
102
|
type: :development
|
107
|
-
name: yard
|
108
|
-
- !ruby/object:Gem::Dependency
|
109
|
-
version_requirements: &id007 !ruby/object:Gem::Requirement
|
110
|
-
none: false
|
111
|
-
requirements:
|
112
|
-
- - ">="
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
hash: 3
|
115
|
-
segments:
|
116
|
-
- 0
|
117
|
-
version: "0"
|
118
103
|
prerelease: false
|
119
|
-
|
120
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.6.0
|
110
|
+
- !ruby/object:Gem::Dependency
|
121
111
|
name: rcov
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
hash: 3
|
129
|
-
segments:
|
130
|
-
- 0
|
131
|
-
version: "0"
|
132
|
-
prerelease: false
|
133
|
-
requirement: *id008
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
134
118
|
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
135
127
|
name: mocha
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
136
142
|
description: Safely run your code in a loving error reporting embrace
|
137
|
-
email:
|
143
|
+
email:
|
138
144
|
- kenneth.kalmer@gmail.com
|
139
145
|
executables: []
|
140
|
-
|
141
146
|
extensions: []
|
142
|
-
|
143
147
|
extra_rdoc_files: []
|
144
|
-
|
145
|
-
files:
|
148
|
+
files:
|
146
149
|
- .document
|
147
150
|
- .gitignore
|
148
151
|
- .rspec
|
@@ -175,36 +178,26 @@ files:
|
|
175
178
|
- spec/support/fake_logger.rb
|
176
179
|
homepage: https://github.com/kennethkalmer/safely
|
177
180
|
licenses: []
|
178
|
-
|
179
181
|
post_install_message:
|
180
182
|
rdoc_options: []
|
181
|
-
|
182
|
-
require_paths:
|
183
|
+
require_paths:
|
183
184
|
- lib
|
184
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
185
186
|
none: false
|
186
|
-
requirements:
|
187
|
-
- -
|
188
|
-
- !ruby/object:Gem::Version
|
189
|
-
|
190
|
-
|
191
|
-
- 0
|
192
|
-
version: "0"
|
193
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
192
|
none: false
|
195
|
-
requirements:
|
196
|
-
- -
|
197
|
-
- !ruby/object:Gem::Version
|
198
|
-
|
199
|
-
segments:
|
200
|
-
- 0
|
201
|
-
version: "0"
|
193
|
+
requirements:
|
194
|
+
- - ! '>='
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
202
197
|
requirements: []
|
203
|
-
|
204
198
|
rubyforge_project:
|
205
|
-
rubygems_version: 1.8.
|
199
|
+
rubygems_version: 1.8.22
|
206
200
|
signing_key:
|
207
201
|
specification_version: 3
|
208
202
|
summary: Safely run your code, keep track of exceptions
|
209
203
|
test_files: []
|
210
|
-
|