coaster 0.0.3 → 0.0.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: 1c0875c0a591628d41eb57139f27f95434d8a007
4
- data.tar.gz: f1d04dde597d9b223940aedef18d435ba0c7f5e6
3
+ metadata.gz: 32b23a2909ad8272fbc40463ac69d93e0fe68d3e
4
+ data.tar.gz: 4f1d17431110b258ed5dee3cf5925a0030591b4d
5
5
  SHA512:
6
- metadata.gz: e8c6027c675c4df5964f6693762f684fe65d0049862b9851fdd0387bde053b8198899f64e0c428cb39d62c07dc68498e2f813c6aae636259608de2c9bd2e28dd
7
- data.tar.gz: 5c1125644b1a374a1d13ff5f4f5c9e4d5025b9e463d3955a9b5f364c2686fdcfa36755124ee7a4116e756f0ecd0df1563aa1198702150f2007723710f5c7b64b
6
+ metadata.gz: 913f1472509e3dbb06c1fbd906270685d6b4c398c3a27e7e48c429b82ca7d3e64ff2debb6f19c34ae4293f59e02f79adb7cfeeed560329833d7146750d728e38
7
+ data.tar.gz: 6d51304c28f7195d8a8fe5cd9cdef924ca7e4533568ef96943a3bf76185fb9bbbf2c6a73e7d20a473d7325235ddd2fe02e672fc6de55cfefd9f40a6345d1cffb
@@ -76,6 +76,10 @@ class StandardError
76
76
  attributes[:http_status] || self.class.http_status
77
77
  end
78
78
 
79
+ def code
80
+ attributes[:code] || http_status
81
+ end
82
+
79
83
  def description
80
84
  attributes[:description] || attributes[:desc] || message
81
85
  end
@@ -4,14 +4,32 @@ class StandardError
4
4
  alias_method :initialize_original, :initialize
5
5
  def initialize(message = nil, cause = $!)
6
6
  initialize_original(message, cause)
7
- @raven = attributes.delete(:raven) || {}
7
+ @raven = (attributes.delete(:raven) || {}).with_indifferent_access
8
+ @raven[:fingerprint] ||= attributes[:fingerprint] || [:default]
9
+ end
10
+
11
+ def fingerprint=(*fp)
12
+ raven[:fingerprint] = fp
13
+ end
14
+
15
+ def fingerprint
16
+ raven[:fingerprint]
8
17
  end
9
18
 
10
19
  def capture(options = {})
11
20
  notes = raven.merge(options || {})
12
21
 
13
- self.tags += Array(notes[:fingerprint])
14
- notes[:fingerprint] = self.tags
22
+ notes[:fingerprint] = notes[:fingerprint].flatten.map do |fp|
23
+ if fp == true || fp == :class
24
+ self.class.name
25
+ elsif fp == :default
26
+ '{{ default }}'
27
+ else
28
+ fp
29
+ end
30
+ end
31
+ notes[:tags] ||= {}
32
+ notes[:tags] = notes[:tags].merge(environment: Rails.env) if defined?(Rails)
15
33
  notes[:level] ||= self.level
16
34
  notes[:extra] = (notes[:extra] || {}).merge(attributes)
17
35
 
@@ -1,3 +1,3 @@
1
1
  module Coaster
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzz jung