hubble 0.1.0 → 0.1.1
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/README.md +38 -0
- data/lib/hubble/middleware.rb +1 -1
- data/lib/hubble/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -13,3 +13,41 @@ Test posting from a console trivially:
|
|
13
13
|
$ bundle exec irb
|
14
14
|
irb(main):001:0> require "hubble"; Hubble.setup; Hubble.boomtown!
|
15
15
|
=> #<Net::HTTPOK 200 OK readbody=true>
|
16
|
+
|
17
|
+
Using inside a rails app
|
18
|
+
|
19
|
+
In application.rb
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
# Push extra information into the failbot context
|
23
|
+
def exception_reporting_filter
|
24
|
+
Failbot.reset!
|
25
|
+
env = request.env || {}
|
26
|
+
request_url =
|
27
|
+
"#{request.protocol}#{request.host_with_port}#{request.fullpath}" rescue nil
|
28
|
+
context = {
|
29
|
+
:user => current_user.to_s,
|
30
|
+
:method => request.try(:method),
|
31
|
+
:user_agent => env['HTTP_USER_AGENT'],
|
32
|
+
:accept => env['HTTP_ACCEPT'],
|
33
|
+
:language => env['HTTP_ACCEPT_LANGUAGE'],
|
34
|
+
:params => params,
|
35
|
+
:session => session.try(:to_hash),
|
36
|
+
:referrer => request.try(:referrer),
|
37
|
+
:remote_ip => request.try(:remote_ip),
|
38
|
+
:url => request_url,
|
39
|
+
:controller => self.class,
|
40
|
+
:action => params[:action]
|
41
|
+
}
|
42
|
+
Failbot.push(context)
|
43
|
+
end
|
44
|
+
before_filter :exception_reporting_filter
|
45
|
+
|
46
|
+
```
|
47
|
+
|
48
|
+
In config application
|
49
|
+
|
50
|
+
```
|
51
|
+
require 'hubble/middleware'
|
52
|
+
config.middleware.use "Hubble::Rescuer"
|
53
|
+
```
|
data/lib/hubble/middleware.rb
CHANGED
@@ -20,7 +20,7 @@ module Hubble
|
|
20
20
|
|
21
21
|
def self.report(boom, env, other={})
|
22
22
|
request = Rack::Request.new(env)
|
23
|
-
Hubble
|
23
|
+
Hubble.report(boom, other.merge({
|
24
24
|
:method => request.request_method,
|
25
25
|
:user_agent => env['HTTP_USER_AGENT'],
|
26
26
|
:params => (request.params.inspect rescue nil),
|
data/lib/hubble/version.rb
CHANGED
metadata
CHANGED