tracer_client 0.1.3 → 0.1.4

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: c5c7b9c2872319e0d62eba9beb595cf6b1b6b05e
4
- data.tar.gz: b3f8648e4b16e1e42c8e8be8a9cbd7f5a8bafbc4
3
+ metadata.gz: a7fe59b044f122fd47816154bfa58fc2264f7df2
4
+ data.tar.gz: 15fb0e53a246406873ae8301d230c2e92c7f1170
5
5
  SHA512:
6
- metadata.gz: 3f2fa211abf7b0dae1e452e3f36328494ad09720d00744e98129ea110d81e41468a083456b3d543342996938c43a6e84f3f7fa70df4ee693b3e509acfeea084e
7
- data.tar.gz: 6189b7b856aef013aab3dd0f3d52fe46f5b7b7d5a16d7f205a5a22cedb142631ba921cf2bc4ae600daa3fb901021dcb16eac92dc185b994c1c834df07a8d8b7d
6
+ metadata.gz: 6564603d864559b4693ee8c1fecea7d188e30a10ae0a42736394e45fb685e540d8193574379d777e947681fb20fe8a0a77ed288d27d4b1d46ec6ec191f30f777
7
+ data.tar.gz: c51d39df19da621c538208aa2db95dae7086fde3012d257e510f8a2d48d9ac968b7c3350ec4e7e7619cc4b6959f617edafb8efb5bbb7cdf5179ad73fbc78e0b3
@@ -18,7 +18,7 @@ module Tracer
18
18
  [changes_logging_options[k]].flatten.compact.map { |attr| attr.is_a?(Hash) ? attr.stringify_keys : attr.to_s }
19
19
  end
20
20
 
21
- options_on = Array(options[:on]) # so that a single symbol can be passed in without wrapping it in an `Array`
21
+ options_on = Array.wrap(options[:on]) # so that a single symbol can be passed in without wrapping it in an `Array`
22
22
 
23
23
  after_create :log_create, :if => :log_changes? if options_on.empty? || options_on.include?(:create)
24
24
 
@@ -44,7 +44,7 @@ module Tracer
44
44
  event: 'create',
45
45
  changes: changes_for_tracing,
46
46
  )
47
- rescue Exception => e
47
+ rescue => e
48
48
  Log.exception_with_alert(e, 'Ошибка регистрации создания', 'log_changes create',
49
49
  item_id: id,
50
50
  item_type: self.class.base_class.name)
@@ -61,7 +61,7 @@ module Tracer
61
61
  changes: changes_for_tracing,
62
62
  )
63
63
  end
64
- rescue Exception => e
64
+ rescue => e
65
65
  Log.exception_with_alert(e, 'Ошибка регистрации изменения', 'log_changes update',
66
66
  item_id: id,
67
67
  item_type: self.class.base_class.name)
@@ -77,7 +77,7 @@ module Tracer
77
77
  object: object_attrs_for_tracing(item_before_change),
78
78
  )
79
79
  end
80
- rescue Exception => e
80
+ rescue => e
81
81
  Log.exception_with_alert(e, 'Ошибка регистрации удаления', 'log_changes destroy',
82
82
  item_id: id,
83
83
  item_type: self.class.base_class.name)
@@ -127,7 +127,7 @@ module Tracer
127
127
  previous = self.dup
128
128
  # `dup` clears timestamps so we add them back.
129
129
  all_timestamp_attributes.each do |column|
130
- previous[column] = send(column) if self.class.column_names.include?(column.to_s) and not send(column).nil?
130
+ previous[column] = send(column) if self.class.column_names.include?(column.to_s) and not try(column).nil?
131
131
  end
132
132
  previous.tap do |prev|
133
133
  prev.id = id # `dup` clears the `id` so we add that back
@@ -57,8 +57,12 @@ module Log
57
57
 
58
58
 
59
59
  def self.exception(exception, subject, tags = '', data = {})
60
- exception_message(exception, :crit, subject, tags, data, exception.backtrace)
61
- exception
60
+ if Rails.env.development?
61
+ raise exception
62
+ else
63
+ exception_message(exception, :crit, subject, tags, data, exception.backtrace)
64
+ exception
65
+ end
62
66
  end
63
67
 
64
68
 
@@ -1,3 +1,3 @@
1
1
  module TracerClient
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracer_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serge Galanin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-07 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: config