rollday 0.5.1 → 0.6.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: 1dcbfc77cb4787f580d9c4b6cde2f8b85949686c33c38cfe8cc5e7f111774785
4
- data.tar.gz: b3b50b20c3261233417a8b2e890773a6ed64567a7c06a8d050ed8c367b907faa
3
+ metadata.gz: 836fb01c93ad7c663511d41a10b61ba4ecb7947f8e7fe06973267178181581d7
4
+ data.tar.gz: dc92f28700124355c7c505ff73e39556c7c7d18c3517335a8818390d8d02eb36
5
5
  SHA512:
6
- metadata.gz: '029ad6bf6bf727a915a3db8e6dc3d9c89650eb5603af6f5b1d774df6fd90ab57777a81eb723d9f7aa7cc2498e712cd4dec6bc08e7a38d9e4103909501c9c0f3f'
7
- data.tar.gz: 78cf9981e07d0dde0197749416e086e7499d27d459e5edf40d7b99b9ba97a26b08fa4d84a5262e7722878d4c287c70baa04d15d53a5666ffe77d2990642dc934
6
+ metadata.gz: 1feeea482c3827de3f1d2c918aecde8aa9d897c41651b0e0f812edfae52f78cb8b4d2a140b749aca586a7453364b50f40edba73643dd975ea60e86b62fd00926
7
+ data.tar.gz: f39c7a03087faf86c11e3470be983a1addc265caa62ba29824187ef144a08ff690c9196f2f1dcecffa3190d977b2373702f26ade02007e1eb8a842e7d2b1d163
@@ -25,6 +25,8 @@ module Rollday
25
25
  value.is_a?(Proc) || ROLLBAR_LEVELS.include?(value)
26
26
  end
27
27
 
28
+ EXCEPTION_CLASS_DEFAULT = -> (status, phrase, body, path, domain) { Rollday::Faraday }
29
+
28
30
  add_composer :message, allowed: [Proc, String], default: DEFAULT_MESSAGE_PROC
29
31
  add_composer :params_query_sanitizer, allowed: Array, default: []
30
32
  add_composer :params_scope_sanitizer, allowed: Array, default: []
@@ -35,7 +37,7 @@ module Rollday
35
37
  add_composer :use_params_scope, allowed: [TrueClass, FalseClass], default: true
36
38
  add_composer :use_person_scope, allowed: [TrueClass, FalseClass], default: true
37
39
  add_composer :use_query_scope, allowed: [TrueClass, FalseClass], default: true
38
- add_composer :exception_class, allowed: Class, default: Rollday::Faraday
40
+ add_composer :exception_class, allowed: Proc, default: EXCEPTION_CLASS_DEFAULT
39
41
  add_composer :allow_client_middleware, allowed: [TrueClass, FalseClass], default: true
40
42
 
41
43
  def person_scope
@@ -11,10 +11,12 @@ module Rollday
11
11
  end
12
12
 
13
13
  def rollbar_message(result)
14
- message = Rollday.config.message.(result.status, result.reason_phrase, result.body, URI(result.env.url).path, URI(result.env.url).host)
14
+ params = [result.status, result.reason_phrase, result.body, URI(result.env.url).path, URI(result.env.url).host]
15
+ message = Rollday.config.message.(*params)
15
16
  return message unless Rollday.config.use_message_exception
16
17
 
17
- Rollday.config.exception_class.new(message)
18
+ error_klass = Rollday.config.exception_class.(*params)
19
+ error_klass.new(message)
18
20
  end
19
21
 
20
22
  def rollbar_scope(result)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rollday
4
- VERSION = "0.5.1"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Taylor