File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,17 @@ module Failure
15
15
# # optional proxy support
16
16
# config.proxy_host = 'x.y.z.t'
17
17
# config.proxy_port = 8080
18
+ #
19
+ # # server env support, defaults to RAILS_ENV or RACK_ENV
20
+ # config.server_environment = "test"
18
21
# end
19
22
class Hoptoad < Base
20
23
# From the hoptoad plugin
21
24
INPUT_FORMAT = /^([^:]+):(\d +)(?::in `([^']+)')?$/
22
25
23
26
class << self
24
27
attr_accessor :secure , :api_key , :proxy_host , :proxy_port
28
+ attr_accessor :server_environment
25
29
end
26
30
27
31
def self . count
@@ -105,7 +109,7 @@ def xml
105
109
def fill_in_backtrace_lines ( x )
106
110
exception . backtrace . each do |unparsed_line |
107
111
_ , file , number , method = unparsed_line . match ( INPUT_FORMAT ) . to_a
108
- x . line :file => file , :number => number
112
+ x . line :file => file , :number => number
109
113
end
110
114
end
111
115
@@ -118,9 +122,9 @@ def api_key
118
122
end
119
123
120
124
def server_environment
125
+ return self . class . server_environment if self . class . server_environment
121
126
defined? ( RAILS_ENV ) ? RAILS_ENV : ( ENV [ 'RACK_ENV' ] || 'development' )
122
127
end
123
-
124
128
end
125
129
end
126
130
end
You can’t perform that action at this time.
0 commit comments