exceptio-ruby 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +10 -0
- data/lib/exceptio/client.rb +8 -0
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -22,6 +22,16 @@ Then run "bundle install", and once installed, you can configure your app:
|
|
22
22
|
|
23
23
|
You can find these details in the except.io web app when you setup the application ready to receive error notifications.
|
24
24
|
|
25
|
+
For Rails 2.3 and Rails 3 apps, exceptions should now automatically track. They will track across all environments by default - you can filter exceptions by environment on the except.io website, or to choose only certain environments to track exceptions on, add this to your initializer:
|
26
|
+
|
27
|
+
ExceptIO::Client.configure "app-name", "api-key" if ["staging", "production"].include?(Rails.env)
|
28
|
+
|
29
|
+
If you are using something other than Rails, or have additional areas outside of the controllers that you want to track exceptions for, you can make a call to log an exception directly:
|
30
|
+
|
31
|
+
ExceptIO::Client.log @exception, "environment", params_hash, session_hash
|
32
|
+
|
33
|
+
Everything besides the exception itself is optional, with the environment defaulting to "production" if not supplied.
|
34
|
+
|
25
35
|
== REQUIREMENTS:
|
26
36
|
|
27
37
|
exceptio-ruby depends upon httparty.
|
data/lib/exceptio/client.rb
CHANGED
@@ -7,6 +7,7 @@ module ExceptIO
|
|
7
7
|
def self.configure(application, app_key, endpoint = 'except.io')
|
8
8
|
@application = application
|
9
9
|
@app_key = app_key
|
10
|
+
@configured = true
|
10
11
|
base_uri endpoint
|
11
12
|
if defined?(Rails)
|
12
13
|
if Rails.version.starts_with?("2.3")
|
@@ -17,7 +18,14 @@ module ExceptIO
|
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
21
|
+
def self.reset!
|
22
|
+
@application = nil
|
23
|
+
@app_key = nil
|
24
|
+
@configured = false
|
25
|
+
end
|
26
|
+
|
20
27
|
def self.log(exception, environment = "production", params = {}, session = {})
|
28
|
+
return false unless @configured
|
21
29
|
res = self.post("/applications/#{@application}/errors", {:query => {:app_key => @app_key}, :body => {:error => {:message => exception.message, :backtrace => exception.backtrace, :environment => environment, :params => params, :session => session}}})
|
22
30
|
res.code == 201
|
23
31
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Elliott Draper
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2012-02-08 00:00:00 +00:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|