hoptoad_notifier 2.4.0 → 2.4.10
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 +70 -0
- data/{README.rdoc → README.md} +197 -142
- data/Rakefile +1 -4
- data/SUPPORTED_RAILS_VERSIONS +2 -0
- data/lib/hoptoad_notifier/backtrace.rb +2 -1
- data/lib/hoptoad_notifier/capistrano.rb +2 -1
- data/lib/hoptoad_notifier/configuration.rb +10 -5
- data/lib/hoptoad_notifier/notice.rb +5 -3
- data/lib/hoptoad_notifier/rack.rb +4 -2
- data/lib/hoptoad_notifier/rails/action_controller_catcher.rb +2 -1
- data/lib/hoptoad_notifier/rails/javascript_notifier.rb +17 -17
- data/lib/hoptoad_notifier/rails.rb +2 -0
- data/lib/hoptoad_notifier/railtie.rb +1 -0
- data/lib/hoptoad_notifier/sender.rb +5 -0
- data/lib/hoptoad_notifier/shared_tasks.rb +7 -1
- data/lib/hoptoad_notifier/tasks.rb +3 -3
- data/lib/hoptoad_notifier/user_informer.rb +25 -0
- data/lib/hoptoad_notifier/version.rb +1 -1
- data/lib/hoptoad_notifier.rb +1 -0
- data/lib/hoptoad_tasks.rb +9 -3
- data/lib/rails/generators/hoptoad/hoptoad_generator.rb +1 -1
- data/lib/templates/javascript_notifier.erb +12 -16
- data/test/backtrace_test.rb +19 -0
- data/test/catcher_test.rb +2 -0
- data/test/configuration_test.rb +9 -2
- data/test/helper.rb +3 -0
- data/test/hoptoad_tasks_test.rb +12 -1
- data/test/javascript_notifier_test.rb +52 -0
- data/test/recursion_test.rb +10 -0
- data/test/sender_test.rb +13 -3
- data/test/user_informer_test.rb +29 -0
- metadata +36 -14
data/CHANGELOG
CHANGED
@@ -1,3 +1,64 @@
|
|
1
|
+
Version 2.4.9 - Wed Mar 30 09:04:53 -0400 2011
|
2
|
+
===============================================================================
|
3
|
+
|
4
|
+
Jonathan Yurek(1):
|
5
|
+
The User Informer should adhere to only the Rack spec.
|
6
|
+
|
7
|
+
Version 2.4.8 - Mon Mar 21 11:11:16 -0400 2011
|
8
|
+
===============================================================================
|
9
|
+
|
10
|
+
Jonathan Yurek(1):
|
11
|
+
Prevent infinite loops from recursive data structures.
|
12
|
+
|
13
|
+
Version 2.4.7 - Thu Mar 10 16:21:31 -0500 2011
|
14
|
+
===============================================================================
|
15
|
+
|
16
|
+
Jonathan Yurek(1):
|
17
|
+
Rails generator requires './config/boot' for 1.9.2 compatibility.
|
18
|
+
|
19
|
+
Version 2.4.6 - Tue Feb 15 15:51:17 -0500 2011
|
20
|
+
===============================================================================
|
21
|
+
|
22
|
+
Jonathan Yurek(1):
|
23
|
+
Modify the error page's body in-place.
|
24
|
+
|
25
|
+
Version 2.4.5 - Wed Feb 02 13:24:29 -0500 2011
|
26
|
+
===============================================================================
|
27
|
+
|
28
|
+
Jonathan Yurek (1):
|
29
|
+
Don't require Rack::Lock's presence in the middleware for UserInformer
|
30
|
+
|
31
|
+
|
32
|
+
Version 2.4.4 - Fri Jan 28 13:50:10 -0500 2011
|
33
|
+
===============================================================================
|
34
|
+
|
35
|
+
Matt Jankowski (1):
|
36
|
+
Change the javascript notifier from a config option to a helper method
|
37
|
+
|
38
|
+
Jonathan Yurek (1):
|
39
|
+
Show the javascript notifier prevents XSS attempts from request.url
|
40
|
+
|
41
|
+
Version 2.4.3 - Wed Jan 26 11:35:15 -0500 2011
|
42
|
+
===============================================================================
|
43
|
+
|
44
|
+
Jon Yurek (1):
|
45
|
+
Allow the application to present the Hoptoad error number to the user
|
46
|
+
|
47
|
+
|
48
|
+
Version 2.4.2 - Sun Jan 09 09:37:31 -0500 2011
|
49
|
+
===============================================================================
|
50
|
+
|
51
|
+
Matt Jankowski (1):
|
52
|
+
fix issue where the gsub to replace the html head with javascript was removing the head element entirely
|
53
|
+
|
54
|
+
|
55
|
+
Version 2.4.1 - Sat Jan 08 12:17:15 -0500 2011
|
56
|
+
===============================================================================
|
57
|
+
|
58
|
+
Matt Jankowski (1):
|
59
|
+
restore method which may have been accidentally removed?
|
60
|
+
|
61
|
+
|
1
62
|
Version 2.4.0 - Thu Jan 06 15:03:58 -0500 2011
|
2
63
|
===============================================================================
|
3
64
|
|
@@ -352,6 +413,15 @@ Nick Quaranto (3):
|
|
352
413
|
|
353
414
|
|
354
415
|
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
355
425
|
|
356
426
|
|
357
427
|
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,96 +1,100 @@
|
|
1
|
-
|
1
|
+
HoptoadNotifier
|
2
|
+
===============
|
2
3
|
|
3
4
|
This is the notifier gem for integrating apps with Hoptoad.
|
4
5
|
|
5
6
|
When an uncaught exception occurs, HoptoadNotifier will POST the relevant data
|
6
7
|
to the Hoptoad server specified in your environment.
|
7
8
|
|
8
|
-
|
9
|
+
Help
|
10
|
+
----
|
9
11
|
|
10
|
-
|
11
|
-
* {mailing list}[http://groups.google.com/group/hoptoad-notifier-dev]
|
12
|
+
For help with using Hoptoad and the Hoptoad notifier visit [our support site](http://help.hoptoadapp.com)
|
12
13
|
|
13
|
-
|
14
|
+
For discussion of Hoptoad notifier development check out the [mailing list](http://groups.google.com/group/hoptoad-notifier-dev)
|
14
15
|
|
15
|
-
|
16
|
+
Rails Installation
|
17
|
+
------------------
|
18
|
+
|
19
|
+
### Remove exception_notifier
|
16
20
|
|
17
21
|
in your ApplicationController, REMOVE this line:
|
18
22
|
|
19
|
-
|
23
|
+
include ExceptionNotifiable
|
20
24
|
|
21
25
|
In your config/environment* files, remove all references to ExceptionNotifier
|
22
26
|
|
23
27
|
Remove the vendor/plugins/exception_notifier directory.
|
24
28
|
|
25
|
-
|
29
|
+
### Remove hoptoad_notifier plugin
|
26
30
|
|
27
31
|
Remove the vendor/plugins/hoptoad_notifier directory before installing the gem, or run:
|
28
32
|
|
29
|
-
|
33
|
+
script/plugin remove hoptoad_notifier
|
30
34
|
|
31
|
-
|
35
|
+
### Rails 3.x
|
32
36
|
|
33
37
|
Add the hoptoad_notifier gem to your Gemfile. In Gemfile:
|
34
38
|
|
35
|
-
|
39
|
+
gem "hoptoad_notifier", "~> 2.3"
|
36
40
|
|
37
41
|
Then from your project's RAILS_ROOT, run:
|
38
42
|
|
39
|
-
|
40
|
-
|
43
|
+
bundle install
|
44
|
+
script/rails generate hoptoad --api-key your_key_here
|
41
45
|
|
42
46
|
That's it!
|
43
47
|
|
44
|
-
|
48
|
+
### Rails 2.x
|
45
49
|
|
46
50
|
Add the hoptoad_notifier gem to your app. In config/environment.rb:
|
47
51
|
|
48
|
-
|
52
|
+
config.gem 'hoptoad_notifier'
|
49
53
|
|
50
54
|
Then from your project's RAILS_ROOT, run:
|
51
55
|
|
52
|
-
|
53
|
-
|
54
|
-
|
56
|
+
rake gems:install
|
57
|
+
rake gems:unpack GEM=hoptoad_notifier
|
58
|
+
script/generate hoptoad --api-key your_key_here
|
55
59
|
|
56
60
|
As always, if you choose not to vendor the hoptoad_notifier gem, make sure
|
57
61
|
every server you deploy to has the gem installed or your application won't start.
|
58
62
|
|
59
|
-
|
63
|
+
### Rails 1.2.6
|
60
64
|
|
61
65
|
Install the hoptoad_notifier gem:
|
62
66
|
|
63
|
-
|
67
|
+
gem install hoptoad_notifier
|
64
68
|
|
65
69
|
Once installed, you should vendor the hoptoad_notifier gem:
|
66
70
|
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
mkdir vendor/gems
|
72
|
+
cd vendor/gems
|
73
|
+
gem unpack hoptoad_notifier
|
70
74
|
|
71
75
|
And then add the following to the Rails::Initializer.run do |config|
|
72
76
|
block in environment.rb so that the vendored gem is loaded.
|
73
77
|
|
74
|
-
|
75
|
-
|
78
|
+
# Add the vendor/gems/*/lib directories to the LOAD_PATH
|
79
|
+
config.load_paths += Dir.glob(File.join(RAILS_ROOT, 'vendor', 'gems', '*', 'lib'))
|
76
80
|
|
77
81
|
Next add something like this at the bottom of your config/environment.rb:
|
78
82
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
83
|
+
require 'hoptoad_notifier'
|
84
|
+
require 'hoptoad_notifier/rails'
|
85
|
+
HoptoadNotifier.configure do |config|
|
86
|
+
config.api_key = 'your_key_here'
|
87
|
+
end
|
84
88
|
|
85
89
|
You will also need to copy the hoptoad_notifier_tasks.rake file into your
|
86
90
|
RAILS_ROOT/lib/tasks directory in order for the rake hoptoad:test task to work:
|
87
91
|
|
88
|
-
|
92
|
+
cp vendor/gems/hoptoad_notifier-*/generators/hoptoad/templates/hoptoad_notifier_tasks.rake lib/tasks
|
89
93
|
|
90
94
|
As always, if you choose not to vendor the hoptoad_notifier gem, make sure
|
91
95
|
every server you deploy to has the gem installed or your application won't start.
|
92
96
|
|
93
|
-
|
97
|
+
### Upgrading From Earlier Versions of Hoptoad
|
94
98
|
|
95
99
|
If you're currently using the plugin version (if you have a
|
96
100
|
vendor/plugins/hoptoad_notifier directory, you are), you'll need to perform a
|
@@ -131,7 +135,7 @@ As always, if you choose not to vendor the hoptoad_notifier gem, make sure
|
|
131
135
|
every server you deploy to has the gem installed or your application won't
|
132
136
|
start.
|
133
137
|
|
134
|
-
|
138
|
+
### Upgrading from Earlier Versions of the Hoptoad Gem (with config.gem)
|
135
139
|
|
136
140
|
If you're currently using the gem version of the hoptoad_notifier and have
|
137
141
|
a version of Rails that uses config.gem (in the 2.x series), there is
|
@@ -148,56 +152,59 @@ You can them continue to install normally. If you don't remove the rake file,
|
|
148
152
|
you will be unable to unpack this gem (Rails will think it's part of the
|
149
153
|
framework).
|
150
154
|
|
151
|
-
|
155
|
+
### Testing it out
|
152
156
|
|
153
157
|
You can test that Hoptoad is working in your production environment by using
|
154
158
|
this rake task (from RAILS_ROOT):
|
155
159
|
|
156
|
-
|
160
|
+
rake hoptoad:test
|
157
161
|
|
158
162
|
If everything is configured properly, that task will send a notice to Hoptoad
|
159
163
|
which will be visible immediately.
|
160
164
|
|
161
|
-
|
165
|
+
Rack
|
166
|
+
----
|
162
167
|
|
163
168
|
In order to use hoptoad_notifier in a non-Rails rack app, just load the
|
164
169
|
hoptoad_notifier, configure your API key, and use the HoptoadNotifier::Rack
|
165
170
|
middleware:
|
166
171
|
|
167
|
-
|
168
|
-
|
172
|
+
require 'rack'
|
173
|
+
require 'hoptoad_notifier'
|
169
174
|
|
170
|
-
|
171
|
-
|
172
|
-
|
175
|
+
HoptoadNotifier.configure do |config|
|
176
|
+
config.api_key = 'my_api_key'
|
177
|
+
end
|
173
178
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
179
|
+
app = Rack::Builder.app do
|
180
|
+
use HoptoadNotifier::Rack
|
181
|
+
run lambda { |env| raise "Rack down" }
|
182
|
+
end
|
178
183
|
|
179
|
-
|
184
|
+
Sinatra
|
185
|
+
-------
|
180
186
|
|
181
187
|
Using hoptoad_notifier in a Sinatra app is just like a Rack app, but you have
|
182
188
|
to disable Sinatra's error rescuing functionality:
|
183
189
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
190
|
+
require 'sinatra/base'
|
191
|
+
require 'hoptoad_notifier'
|
192
|
+
|
193
|
+
HoptoadNotifier.configure do |config|
|
194
|
+
config.api_key = 'my_api_key'
|
195
|
+
end
|
196
|
+
|
197
|
+
class MyApp < Sinatra::Default
|
198
|
+
use HoptoadNotifier::Rack
|
199
|
+
enable :raise_errors
|
200
|
+
|
201
|
+
get "/" do
|
202
|
+
raise "Sinatra has left the building"
|
203
|
+
end
|
197
204
|
end
|
198
|
-
end
|
199
205
|
|
200
|
-
|
206
|
+
Usage
|
207
|
+
-----
|
201
208
|
|
202
209
|
For the most part, Hoptoad works for itself. Once you've included the notifier
|
203
210
|
in your ApplicationController (which is now done automatically by the gem),
|
@@ -206,12 +213,12 @@ all errors will be rescued by the #rescue_action_in_public provided by the gem.
|
|
206
213
|
If you want to log arbitrary things which you've rescued yourself from a
|
207
214
|
controller, you can do something like this:
|
208
215
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
216
|
+
...
|
217
|
+
rescue => ex
|
218
|
+
notify_hoptoad(ex)
|
219
|
+
flash[:failure] = 'Encryptions could not be rerouted, try again.'
|
220
|
+
end
|
221
|
+
...
|
215
222
|
|
216
223
|
The #notify_hoptoad call will send the notice over to Hoptoad for later
|
217
224
|
analysis. While in your controllers you use the notify_hoptoad method, anywhere
|
@@ -221,7 +228,28 @@ To perform custom error processing after Hoptoad has been notified, define the
|
|
221
228
|
instance method #rescue_action_in_public_without_hoptoad(exception) in your
|
222
229
|
controller.
|
223
230
|
|
224
|
-
|
231
|
+
Informing the User
|
232
|
+
------------------
|
233
|
+
|
234
|
+
The Notifier gem is capable of telling the user information about the error that just happened
|
235
|
+
via the user_information option. They can give this error number in bug resports, for example.
|
236
|
+
By default, if your 500.html contains the text
|
237
|
+
|
238
|
+
<!-- HOPTOAD ERROR -->
|
239
|
+
|
240
|
+
then that comment will be replaced with the text "Hoptoad Error [errnum]". You can modify the text
|
241
|
+
of the informer by setting config.user_information. The Notifier will replace "{{ error_id }}" with the
|
242
|
+
ID of the error that is returned from Hoptoad.
|
243
|
+
|
244
|
+
HoptoadNotifier.configure do |config|
|
245
|
+
...
|
246
|
+
config.user_information = "<p>Tell the devs that it was <strong>{{ error_id }}</strong>'s fault.</p>"
|
247
|
+
end
|
248
|
+
|
249
|
+
You can also turn the middleware completely off by setting config.user_information to false.
|
250
|
+
|
251
|
+
Tracking deployments in Hoptoad
|
252
|
+
-------------------------------
|
225
253
|
|
226
254
|
Paying Hoptoad plans support the ability to track deployments of your application in Hoptoad.
|
227
255
|
By notifying Hoptoad of your application deployments, all errors are resolved when a deploy occurs,
|
@@ -231,7 +259,7 @@ Additionally, it's possible to review the errors in Hoptoad that occurred before
|
|
231
259
|
|
232
260
|
When Hoptoad is installed as a gem, you need to add
|
233
261
|
|
234
|
-
|
262
|
+
require 'hoptoad_notifier/capistrano'
|
235
263
|
|
236
264
|
to your deploy.rb
|
237
265
|
|
@@ -240,24 +268,25 @@ deployment process to notify Hoptoad:
|
|
240
268
|
|
241
269
|
rake hoptoad:deploy TO=#{rails_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}
|
242
270
|
|
243
|
-
|
271
|
+
Going beyond exceptions
|
272
|
+
-----------------------
|
244
273
|
|
245
274
|
You can also pass a hash to notify_hoptoad method and store whatever you want,
|
246
275
|
not just an exception. And you can also use it anywhere, not just in
|
247
276
|
controllers:
|
248
277
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
278
|
+
begin
|
279
|
+
params = {
|
280
|
+
# params that you pass to a method that can throw an exception
|
281
|
+
}
|
282
|
+
my_unpredicable_method(params)
|
283
|
+
rescue => e
|
284
|
+
HoptoadNotifier.notify(
|
285
|
+
:error_class => "Special Error",
|
286
|
+
:error_message => "Special Error: #{e.message}",
|
287
|
+
:parameters => params
|
288
|
+
)
|
289
|
+
end
|
261
290
|
|
262
291
|
While in your controllers you use the notify_hoptoad method, anywhere else in
|
263
292
|
your code, use HoptoadNotifier.notify. Hoptoad will get all the information
|
@@ -269,17 +298,17 @@ about the error itself. As for a hash, these are the keys you should pass:
|
|
269
298
|
|
270
299
|
Hoptoad merges the hash you pass with these default options:
|
271
300
|
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
301
|
+
{
|
302
|
+
:api_key => HoptoadNotifier.api_key,
|
303
|
+
:error_message => 'Notification',
|
304
|
+
:backtrace => caller,
|
305
|
+
:parameters => {},
|
306
|
+
:session => {}
|
307
|
+
}
|
279
308
|
|
280
309
|
You can override any of those parameters.
|
281
310
|
|
282
|
-
|
311
|
+
### Sending shell environment variables when "Going beyond exceptions"
|
283
312
|
|
284
313
|
One common request we see is to send shell environment variables along with
|
285
314
|
manual exception notification. We recommend sending them along with CGI data
|
@@ -288,7 +317,8 @@ or Rack environment (:cgi_data or :rack_env keys, respectively.)
|
|
288
317
|
See HoptoadNotifier::Notice#initialize in lib/hoptoad_notifier/notice.rb for
|
289
318
|
more details.
|
290
319
|
|
291
|
-
|
320
|
+
Filtering
|
321
|
+
---------
|
292
322
|
|
293
323
|
You can specify a whitelist of errors, that Hoptoad will not report on. Use
|
294
324
|
this feature when you are so apathetic to certain errors that you don't want
|
@@ -299,81 +329,84 @@ notifications (when #notify is called directly).
|
|
299
329
|
|
300
330
|
Hoptoad ignores the following exceptions by default:
|
301
331
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
332
|
+
AbstractController::ActionNotFound
|
333
|
+
ActiveRecord::RecordNotFound
|
334
|
+
ActionController::RoutingError
|
335
|
+
ActionController::InvalidAuthenticityToken
|
336
|
+
ActionController::UnknownAction
|
337
|
+
CGI::Session::CookieStore::TamperedWithCookie
|
308
338
|
|
309
339
|
To ignore errors in addition to those, specify their names in your Hoptoad
|
310
340
|
configuration block.
|
311
341
|
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
342
|
+
HoptoadNotifier.configure do |config|
|
343
|
+
config.api_key = '1234567890abcdef'
|
344
|
+
config.ignore << "ActiveRecord::IgnoreThisError"
|
345
|
+
end
|
316
346
|
|
317
347
|
To ignore *only* certain errors (and override the defaults), use the
|
318
348
|
#ignore_only attribute.
|
319
349
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
350
|
+
HoptoadNotifier.configure do |config|
|
351
|
+
config.api_key = '1234567890abcdef'
|
352
|
+
config.ignore_only = ["ActiveRecord::IgnoreThisError"]
|
353
|
+
end
|
324
354
|
|
325
355
|
To ignore certain user agents, add in the #ignore_user_agent attribute as a
|
326
356
|
string or regexp:
|
327
357
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
358
|
+
HoptoadNotifier.configure do |config|
|
359
|
+
config.api_key = '1234567890abcdef'
|
360
|
+
config.ignore_user_agent << /Ignored/
|
361
|
+
config.ignore_user_agent << 'IgnoredUserAgent'
|
362
|
+
end
|
333
363
|
|
334
364
|
To ignore exceptions based on other conditions, use #ignore_by_filter:
|
335
365
|
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
366
|
+
HoptoadNotifier.configure do |config|
|
367
|
+
config.api_key = '1234567890abcdef'
|
368
|
+
config.ignore_by_filter do |exception_data|
|
369
|
+
true if exception_data[:error_class] == "RuntimeError"
|
370
|
+
end
|
340
371
|
end
|
341
|
-
end
|
342
372
|
|
343
373
|
To replace sensitive information sent to the Hoptoad service with [FILTERED] use #params_filters:
|
344
374
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
375
|
+
HoptoadNotifier.configure do |config|
|
376
|
+
config.api_key = '1234567890abcdef'
|
377
|
+
config.params_filters << "credit_card_number"
|
378
|
+
end
|
349
379
|
|
350
380
|
Note that, when rescuing exceptions within an ActionController method,
|
351
381
|
hoptoad_notifier will reuse filters specified by #filter_parameter_logging.
|
352
382
|
|
353
|
-
|
383
|
+
Testing
|
384
|
+
-------
|
354
385
|
|
355
386
|
When you run your tests, you might notice that the Hoptoad service is recording
|
356
387
|
notices generated using #notify when you don't expect it to. You can
|
357
388
|
use code like this in your test_helper.rb to redefine that method so those
|
358
389
|
errors are not reported while running tests.
|
359
390
|
|
360
|
-
|
361
|
-
|
362
|
-
|
391
|
+
module HoptoadNotifier
|
392
|
+
def self.notify(thing)
|
393
|
+
# do nothing.
|
394
|
+
end
|
363
395
|
end
|
364
|
-
end
|
365
396
|
|
366
|
-
|
397
|
+
Proxy Support
|
398
|
+
-------------
|
367
399
|
|
368
400
|
The notifier supports using a proxy, if your server is not able to directly reach the Hoptoad servers. To configure the proxy settings, added the following information to your Hoptoad configuration block.
|
369
401
|
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
402
|
+
HoptoadNotifier.configure do |config|
|
403
|
+
config.proxy_host = ...
|
404
|
+
config.proxy_port = ...
|
405
|
+
config.proxy_user = ...
|
406
|
+
config.proxy_pass = ...
|
375
407
|
|
376
|
-
|
408
|
+
Supported Rails versions
|
409
|
+
------------------------
|
377
410
|
|
378
411
|
See SUPPORTED_RAILS_VERSIONS for a list of official supported versions of
|
379
412
|
Rails.
|
@@ -382,19 +415,41 @@ Please open up a support ticket on Tender ( http://help.hoptoadapp.com ) if
|
|
382
415
|
you're using a version of Rails that is not listed above and the notifier is
|
383
416
|
not working properly.
|
384
417
|
|
385
|
-
|
418
|
+
Javascript Notifer
|
419
|
+
------------------
|
386
420
|
|
387
|
-
To automatically include the Javascript node on every page,
|
388
|
-
:js_notifier to true:
|
421
|
+
To automatically include the Javascript node on every page, use this helper method from your layouts:
|
389
422
|
|
390
|
-
|
391
|
-
|
392
|
-
|
423
|
+
<%= hoptoad_javascript_notifier %>
|
424
|
+
|
425
|
+
It's important to insert this very high in the markup, above all other javascript. Example:
|
426
|
+
|
427
|
+
<!DOCTYPE html>
|
428
|
+
<html>
|
429
|
+
<head>
|
430
|
+
<meta charset="utf8">
|
431
|
+
<%= hoptoad_javascript_notifier %>
|
432
|
+
<!-- more javascript -->
|
433
|
+
</head>
|
434
|
+
<body>
|
435
|
+
...
|
436
|
+
</body>
|
437
|
+
</html>
|
438
|
+
|
439
|
+
This helper will automatically use the API key, host, and port specified in the configuration.
|
440
|
+
|
441
|
+
Credits
|
442
|
+
-------
|
443
|
+
|
444
|
+

|
445
|
+
|
446
|
+
HoptoadNotifier is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community)
|
447
|
+
|
448
|
+
Thank you to all [the contributors](https://github.com/thoughtbot/hoptoad_notifier/contributors)!
|
393
449
|
|
394
|
-
|
395
|
-
configuration.
|
450
|
+
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
396
451
|
|
397
|
-
|
452
|
+
License
|
453
|
+
-------
|
398
454
|
|
399
|
-
|
400
|
-
EXCEPTIONS, which we have included above.
|
455
|
+
HoptoadNotifier is Copyright © 2008-2011 thoughtbot. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/Rakefile
CHANGED
@@ -123,10 +123,6 @@ gemspec = Gem::Specification.new do |s|
|
|
123
123
|
s.require_path = 'lib'
|
124
124
|
s.test_files = Dir[*['test/**/*_test.rb']]
|
125
125
|
|
126
|
-
s.has_rdoc = true
|
127
|
-
s.extra_rdoc_files = ["README.rdoc"]
|
128
|
-
s.rdoc_options = ['--line-numbers', "--main", "README.rdoc"]
|
129
|
-
|
130
126
|
s.add_runtime_dependency("builder")
|
131
127
|
s.add_runtime_dependency("activesupport")
|
132
128
|
s.add_development_dependency("activerecord")
|
@@ -162,6 +158,7 @@ RAILS_VERSIONS = IO.read('SUPPORTED_RAILS_VERSIONS').strip.split("\n")
|
|
162
158
|
LOCAL_GEMS = [['sham_rack', nil], ['capistrano', nil], ['sqlite3-ruby', nil], ['sinatra', nil]] +
|
163
159
|
RAILS_VERSIONS.collect { |version| ['rails', version] }
|
164
160
|
|
161
|
+
desc "Vendor test gems: Run this once to prepare your test environment"
|
165
162
|
task :vendor_test_gems do
|
166
163
|
old_gem_path = ENV['GEM_PATH']
|
167
164
|
old_gem_home = ENV['GEM_HOME']
|
data/SUPPORTED_RAILS_VERSIONS
CHANGED
@@ -5,7 +5,8 @@ module HoptoadNotifier
|
|
5
5
|
# Handles backtrace parsing line by line
|
6
6
|
class Line
|
7
7
|
|
8
|
-
|
8
|
+
# regexp (optionnally allowing leading X: for windows support)
|
9
|
+
INPUT_FORMAT = %r{^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$}.freeze
|
9
10
|
|
10
11
|
# The file portion of the line (such as app/models/user.rb)
|
11
12
|
attr_reader :file
|
@@ -9,8 +9,9 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
9
9
|
task :notify_hoptoad, :except => { :no_release => true } do
|
10
10
|
rails_env = fetch(:hoptoad_env, fetch(:rails_env, "production"))
|
11
11
|
local_user = ENV['USER'] || ENV['USERNAME']
|
12
|
-
executable = RUBY_PLATFORM.downcase.include?('mswin') ? 'rake.bat' : 'rake'
|
12
|
+
executable = RUBY_PLATFORM.downcase.include?('mswin') ? fetch(:rake, 'rake.bat') : fetch(:rake, 'rake')
|
13
13
|
notify_command = "#{executable} hoptoad:deploy TO=#{rails_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}"
|
14
|
+
notify_command << " DRY_RUN=true" if dry_run
|
14
15
|
notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
|
15
16
|
puts "Notifying Hoptoad of Deploy (#{notify_command})"
|
16
17
|
`#{notify_command}`
|