trackets 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a1a1bb64fefef5fed193ddc3bcaf4fadae73357
4
- data.tar.gz: 0637da6c7ebeaada21f452977c4ec89d455b3f6c
3
+ metadata.gz: 39b324faf07a639b3c18221aec426ab4e89127a1
4
+ data.tar.gz: 6c991c9f52bf05c7cb3e8a3fc5e3444231ed17f4
5
5
  SHA512:
6
- metadata.gz: bdb504ecf7ebb7d08689c6048d5d143806c6ad9eb49a6695560683ac1ff5dfdeb5ceeba58080eef722b01b4c5ab5a8a5b5d3f6883a7045c5dc9e481e3df92dc0
7
- data.tar.gz: c7d041c91ea0c9a6fb9b70e0eb1a8a7a2e2ed48b0ac07c7928aacf4d5c81f20a8d8c790a1785f12857ff6c4e9125b1c0408f1a9fb59c2b5887e96afade945c17
6
+ metadata.gz: 47662ce7e9357418172562eaa1202d5722bc12e6bd316da244e583b3e7b76c3b019c33c9d78c63753a9b0ac5a0493f766156482f8016b7aa04a1a8343756603f
7
+ data.tar.gz: dffe23ccec78042c164029e10b9815990881459b3cbdfe2e6b7ec0049a509eb280bcc28d554796b3f681961fb836e20adcbed3d8e356be96d6f2c29de637df5b
@@ -18,13 +18,13 @@ module Trackets
18
18
  @configuration ||= Configuration.new
19
19
  end
20
20
 
21
- def notify(exception, env = nil)
21
+ def notify(exception, env = nil, additional_info = nil)
22
22
  return unless Trackets.configuration.enabled?
23
23
 
24
24
  job = NoticeJob.new
25
25
  job = job.async if Trackets.configuration.async?
26
26
 
27
- job.perform(exception, env)
27
+ job.perform(exception, env, additional_info)
28
28
  end
29
29
 
30
30
  class TracketsCustomException < StandardError; end
@@ -11,17 +11,19 @@ module Trackets
11
11
 
12
12
  class << self
13
13
 
14
- def notify(exception, env)
15
- new(exception, env).send
14
+ def notify(exception, env, additional_info = {})
15
+ new(exception, env, additional_info).send
16
16
  end
17
17
 
18
18
  end
19
19
 
20
20
  attr_reader :exception, :env
21
+ attr_accessor :additional_info
21
22
 
22
- def initialize(exception, env)
23
+ def initialize(exception, env, additional_info)
23
24
  @exception = exception
24
25
  @env = env
26
+ @additional_info = additional_info
25
27
  end
26
28
 
27
29
  def backtrace
@@ -46,7 +48,8 @@ module Trackets
46
48
  environment_name: config.environment_name,
47
49
  project_root: config.project_root,
48
50
  framework: config.framework,
49
- params: params.filtered
51
+ params: params.filtered,
52
+ additional_info: additional_info
50
53
  }
51
54
  end
52
55
 
@@ -6,8 +6,8 @@ module Trackets
6
6
 
7
7
  include SuckerPunch::Job
8
8
 
9
- def perform(exception, env)
10
- Client.notify(exception, env)
9
+ def perform(exception, env, additional_info)
10
+ Client.notify(exception, env, additional_info)
11
11
  end
12
12
 
13
13
  end
@@ -3,8 +3,9 @@ module Trackets
3
3
 
4
4
  attr_reader :rack_env
5
5
 
6
- def initialize(rack_env)
6
+ def initialize(rack_env, hash = nil)
7
7
  @rack_env = rack_env
8
+ @hash = hash
8
9
  end
9
10
 
10
11
  def request
@@ -18,7 +19,7 @@ module Trackets
18
19
  def filtered
19
20
  hash.inject({}) do |ret, (key, value)|
20
21
  ret[key] = if value.kind_of?(Hash)
21
- self.class.new(value).filtered
22
+ self.class.new(nil, value).filtered
22
23
  else
23
24
  Trackets.configuration.blacklisted_key?(key, rack_env) ? "[FILTERED]" : value
24
25
  end
@@ -4,10 +4,10 @@ module Trackets
4
4
 
5
5
  def initialize
6
6
  Trackets.configuration.load_plugins.each do |plugin_name|
7
- require "trackets/plugins/#{plugin_name}"
8
-
9
- class_name = plugin_name.to_s.split('_').map{|e| e.capitalize}.join
10
- Trackets::Plugins.const_get(class_name).new
7
+ if require "trackets/plugins/#{plugin_name}"
8
+ class_name = plugin_name.to_s.split('_').map{|e| e.capitalize}.join
9
+ Trackets::Plugins.const_get(class_name).new
10
+ end
11
11
  end
12
12
  end
13
13
 
@@ -5,7 +5,7 @@ module Trackets
5
5
  def initialize
6
6
  if defined?(::Sidekiq)
7
7
  ::Sidekiq.configure_server do |config|
8
- config.error_handlers << Proc.new {|ex,ctx_hash| Trackets.notify(ex) }
8
+ config.error_handlers << Proc.new {|ex,ctx_hash| Trackets.notify(ex, nil, sidekiq_context: ctx_hash) }
9
9
  end
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Trackets
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trackets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-21 00:00:00.000000000 Z
11
+ date: 2014-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -205,3 +205,4 @@ test_files:
205
205
  - features/support/env.rb
206
206
  - features/support/rails.rb
207
207
  - features/support/templates/trackets_interceptor.rb
208
+ has_rdoc: