technologic 0.4.3 → 0.5.0

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
  SHA256:
3
- metadata.gz: 4d1d248bef1496c9ff561e4c50643d464b9a76e02f089d4c54917a5ce9a22552
4
- data.tar.gz: a3292dcbda07946d9c4b3c8d86fa8354c79ff8b347250c2b0edcdb0f6c1c6bf5
3
+ metadata.gz: f14b4b0320578616d82c30b4b0ba74d0bad673c89f0118b39cb4e027a38f13ca
4
+ data.tar.gz: 5018f02892cc96e544f702b5ea482525c8196145150bb04e1ae66607ca0712ee
5
5
  SHA512:
6
- metadata.gz: b5830d5eaee4562a7dfdb97a19e8d0b46fd2bfcc2c4c550b996f6051ce321fc540bf4abf7a54798379a02435a13c4d20b3fd2be5a910fe21dfdc4f7736fd4058
7
- data.tar.gz: fb6c695b74b5bd4519ca20ea331c5b01158be4529d71d2d3b0b0bd0af648f981d7ac6273da3cf7a5517a60c989c3749e4d9d289737840503793fee99ea23e0fa
6
+ metadata.gz: 1ebf8d64e386e393c0dd8f0f4b0595a4fbb5ee43bf2e524f7f45bacf2aeca5dff2d84855315e59d754c81cd857d0fcb1af54fec25e2882d28890e9031f5828ad
7
+ data.tar.gz: bc049451a81fa7911daf608f447bbe9bbdeb99f5c72647d5129e0da3a736de1329e6c511d1634bdc34bd72b7e797c9046236fec0f4ac8eaf2847e63ee31c2b6d
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Technologic
4
4
  # This constant is managed by spicerack
5
- VERSION = "0.4.3"
5
+ VERSION = "0.5.0"
6
6
  end
data/lib/technologic.rb CHANGED
@@ -66,9 +66,24 @@ module Technologic
66
66
  end
67
67
 
68
68
  EXCEPTION_SEVERITIES.each do |severity|
69
- define_method("#{severity}!") do |error_class = StandardError, message = nil, **data, &block|
70
- instrument severity, error_class.name.demodulize, **data, &block
71
- raise error_class, message
69
+ define_method("#{severity}!") do |exception = StandardError, message = nil, **data, &block|
70
+ if exception.is_a?(Exception)
71
+ instrument(
72
+ severity,
73
+ exception.class.name.demodulize,
74
+ **{
75
+ message: exception.message,
76
+ additional_message: message,
77
+ }.compact,
78
+ **data,
79
+ &block
80
+ )
81
+
82
+ raise exception
83
+ else
84
+ instrument severity, exception.name.demodulize, message: message, **data, &block
85
+ raise exception, message
86
+ end
72
87
  end
73
88
  end
74
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: technologic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-10 00:00:00.000000000 Z
11
+ date: 2018-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.4.3
47
+ version: 0.5.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.4.3
54
+ version: 0.5.0
55
55
  description: An opinionated philosophy on logging for Ruby on Rails applications.
56
56
  email:
57
57
  - garside@gmail.com