exceptiontrap 1.0.5 → 1.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49907b23c4e9af081032e2c5580fc5a621635d92
4
- data.tar.gz: 1dd093050c116d3fc04100109d679de0e6470a5e
3
+ metadata.gz: 39876629b7ad8f573df03fea4a1c163b68a24727
4
+ data.tar.gz: 24fbe651e1eb13486b75d2afa3319c93a0f4edcf
5
5
  SHA512:
6
- metadata.gz: 729ccbf4a33cf1c096a08696552c5c6cf63e7bb2cc42dbe51a520a120fcb2db81808576a9a7774ca2862681cb458a9acb007da6eb262708ee534ef7b366a18fa
7
- data.tar.gz: 7869390f0b205b5ece24837fb8ad6eb8604287698c5dd588a3895928b66c6a6fba91652cb6d4a553aa68083f5e37093d96450dffbc677eb6fd493ef41a5eee31
6
+ metadata.gz: 293433525a8b53f84d90c2fa4c8564548a55bdab575861e150dce1d8ba09cbc25ab8df8d1b8c5f5b86856d32bfb3ea3c7f69d5a96ca14948622ee4164f01c2b6
7
+ data.tar.gz: 0a540e69173a1702ee3a3816aea53f52bd31ddcb53397639216adbec8bcd2618e395b8f1cca601cce8cceb832cb89ee47c991cd9c83a8c727199c9d40afb5fc3
@@ -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
- "#{protocol}://" + host.to_s + port.to_s + path.to_s;
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 Config.enabled_environments.include?(Exceptiontrap::Data.application_environment)
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
@@ -1,3 +1,3 @@
1
1
  module Exceptiontrap
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.6'
3
3
  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 Config.enabled_environments.include?(Exceptiontrap::Data.application_environment)
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
- end
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.5
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-09-13 00:00:00.000000000 Z
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