exceptiontrap 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/exceptiontrap/data.rb +3 -1
- data/lib/exceptiontrap/railtie.rb +1 -2
- data/lib/exceptiontrap/version.rb +1 -1
- data/lib/exceptiontrap.rb +12 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39876629b7ad8f573df03fea4a1c163b68a24727
|
4
|
+
data.tar.gz: 24fbe651e1eb13486b75d2afa3319c93a0f4edcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 293433525a8b53f84d90c2fa4c8564548a55bdab575861e150dce1d8ba09cbc25ab8df8d1b8c5f5b86856d32bfb3ea3c7f69d5a96ca14948622ee4164f01c2b6
|
7
|
+
data.tar.gz: 0a540e69173a1702ee3a3816aea53f52bd31ddcb53397639216adbec8bcd2618e395b8f1cca601cce8cceb832cb89ee47c991cd9c83a8c727199c9d40afb5fc3
|
data/lib/exceptiontrap/data.rb
CHANGED
@@ -47,12 +47,14 @@ module Exceptiontrap
|
|
47
47
|
|
48
48
|
def rack_request_url(env)
|
49
49
|
protocol = rack_scheme(env)
|
50
|
+
protocol = protocol.nil? ? "" : "#{protocol}://"
|
51
|
+
|
50
52
|
host = env['SERVER_NAME'] || ""
|
51
53
|
path = env['REQUEST_URI'] || ""
|
52
54
|
port = env['SERVER_PORT'] || "80"
|
53
55
|
port = ["80", "443"].include?(port.to_s) ? "" : ":#{port}"
|
54
56
|
|
55
|
-
|
57
|
+
protocol.to_s + host.to_s + port.to_s + path.to_s;
|
56
58
|
end
|
57
59
|
|
58
60
|
def rack_scheme(env)
|
@@ -6,8 +6,7 @@ module Exceptiontrap
|
|
6
6
|
class ExceptiontrapRailtie < Rails::Railtie
|
7
7
|
initializer 'exceptiontrap.middleware' do |app|
|
8
8
|
Exceptiontrap::Config.load(File.join(Rails.root, '/config/exceptiontrap.yml'))
|
9
|
-
if
|
10
|
-
# puts "-> Activated Exceptiontrap::Rack for Rails 3 (Railtie)"
|
9
|
+
if Exceptiontrap::enabled?
|
11
10
|
app.config.middleware.insert_after 'ActionDispatch::ShowExceptions', 'Exceptiontrap::Rack'
|
12
11
|
end
|
13
12
|
end
|
data/lib/exceptiontrap.rb
CHANGED
@@ -26,7 +26,7 @@ module Exceptiontrap
|
|
26
26
|
if !defined?(Rails::Railtie) && defined?(Rails.configuration) && Rails.configuration.respond_to?(:middleware)
|
27
27
|
Exceptiontrap::Config.load(File.join(Rails.root, '/config/exceptiontrap.yml'))
|
28
28
|
|
29
|
-
if
|
29
|
+
if enabled?
|
30
30
|
if defined?(ActionController::Base) && !ActionController::Base.include?(Exceptiontrap::Catcher)
|
31
31
|
ActionController::Base.send(:include, Exceptiontrap::Catcher) # puts "-> Activated Exceptiontrap::Catcher for Rails 2"
|
32
32
|
end
|
@@ -35,4 +35,14 @@ module Exceptiontrap
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
def self.notify(exception, params = {})
|
39
|
+
if enabled?
|
40
|
+
data = Data.rack_data(exception, params)
|
41
|
+
Notifier.notify(data)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.enabled?
|
46
|
+
Config.enabled_environments.include?(Data.application_environment)
|
47
|
+
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptiontrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tbuehl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Exception notifier. The Gem catches your applications exceptions and
|
14
14
|
sends those to the exceptiontrap webservice hosted at http://exceptiontrap.com
|