pheme 5.3.4 → 6.0.1
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 +4 -4
- data/.github/workflows/guardrails.yaml +15 -0
- data/.github/workflows/stale.yml +1 -1
- data/.rubocop_todo.yml +3 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +82 -73
- data/README.md +7 -0
- data/lib/pheme/configuration.rb +7 -2
- data/lib/pheme/error_reporting.rb +7 -0
- data/lib/pheme/queue_poller.rb +1 -1
- data/lib/pheme/version.rb +1 -1
- data/lib/pheme.rb +1 -1
- data/pheme.gemspec +1 -0
- data/spec/configuration_spec.rb +20 -0
- data/spec/error_reporting_spec.rb +22 -0
- metadata +19 -4
- data/lib/pheme/rollbar.rb +0 -7
- data/spec/rollbar_spec.rb +0 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 02e5305726664194fc17af6ce32ea478b8352ec579ab7964de35e296b89ecc4e
|
|
4
|
+
data.tar.gz: 5b1404acf1ce1d35d5857dc504ce6fac5f90c9dbcc0821b0ce18f85cc38b96bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e133f4596ac54129c7fc3102ce140d364c87f784f9742f5640cd3bc313fa2710c4d37592a800f607081e499bf5a3c350755cbd137b832cc6b5cf54750c2a2cab
|
|
7
|
+
data.tar.gz: 3b5b6c6809222a38bd5552f5c143d43ac2c0eb66457cb3984a5ed74071c095bff605808165d1de32e9297f851a03c0a040f37325f880ebf887b93d6802e2b0e7
|
data/.github/workflows/stale.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2024-
|
|
3
|
+
# on 2024-07-04 21:40:31 UTC using RuboCop version 1.64.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -19,20 +19,19 @@ RSpec/NoExpectationExample:
|
|
|
19
19
|
- 'spec/logger_spec.rb'
|
|
20
20
|
- 'spec/queue_poller_spec.rb'
|
|
21
21
|
|
|
22
|
-
# Offense count:
|
|
22
|
+
# Offense count: 8
|
|
23
23
|
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
|
24
24
|
# Include: **/*_spec.rb
|
|
25
25
|
RSpec/SpecFilePathFormat:
|
|
26
26
|
Exclude:
|
|
27
27
|
- 'spec/configuration_spec.rb'
|
|
28
|
+
- 'spec/error_reporting_spec.rb'
|
|
28
29
|
- 'spec/logger_spec.rb'
|
|
29
30
|
- 'spec/message_handler_spec.rb'
|
|
30
31
|
- 'spec/message_type/aws_event_spec.rb'
|
|
31
32
|
- 'spec/message_type/sns_message_spec.rb'
|
|
32
33
|
- 'spec/queue_poller_spec.rb'
|
|
33
|
-
- 'spec/rollbar_spec.rb'
|
|
34
34
|
- 'spec/topic_publisher_spec.rb'
|
|
35
|
-
- 'spec/version_spec.rb'
|
|
36
35
|
|
|
37
36
|
# Offense count: 2
|
|
38
37
|
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## 6.0.1 - 2025-02-13
|
|
10
|
+
### Changed
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- Added rexml as explicit dependency
|
|
13
|
+
|
|
14
|
+
## 6.0.0 - 2024-07-04
|
|
15
|
+
### Changed
|
|
16
|
+
- **breaking changes** Removed support for Rollbar configuration. `config.rollbar` is no longer supported.
|
|
17
|
+
- Added support for passing `error_reporting_func` as a config option.
|
|
18
|
+
|
|
9
19
|
## 5.3.4 - 2024-06-14
|
|
10
20
|
### Changed
|
|
11
21
|
- Updated dependencies
|
data/Gemfile.lock
CHANGED
|
@@ -1,163 +1,170 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
pheme (
|
|
4
|
+
pheme (6.0.1)
|
|
5
5
|
activesupport (>= 4)
|
|
6
6
|
aws-sdk-sns (~> 1.1)
|
|
7
7
|
aws-sdk-sqs (~> 1.3)
|
|
8
8
|
resource-struct (~> 0.4)
|
|
9
|
+
rexml (~> 3.4)
|
|
9
10
|
smarter_csv (~> 1)
|
|
10
11
|
|
|
11
12
|
GEM
|
|
12
13
|
remote: https://rubygems.org/
|
|
13
14
|
specs:
|
|
14
|
-
activesupport (
|
|
15
|
+
activesupport (8.0.1)
|
|
15
16
|
base64
|
|
17
|
+
benchmark (>= 0.3)
|
|
16
18
|
bigdecimal
|
|
17
|
-
concurrent-ruby (~> 1.0, >= 1.
|
|
19
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
18
20
|
connection_pool (>= 2.2.5)
|
|
19
21
|
drb
|
|
20
22
|
i18n (>= 1.6, < 2)
|
|
23
|
+
logger (>= 1.4.2)
|
|
21
24
|
minitest (>= 5.1)
|
|
22
|
-
|
|
23
|
-
tzinfo (~> 2.0)
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
securerandom (>= 0.3)
|
|
26
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
27
|
+
uri (>= 0.13.1)
|
|
28
|
+
addressable (2.8.7)
|
|
29
|
+
public_suffix (>= 2.0.2, < 7.0)
|
|
26
30
|
ast (2.4.2)
|
|
27
31
|
aws-eventstream (1.3.0)
|
|
28
|
-
aws-partitions (1.
|
|
29
|
-
aws-sdk-core (3.
|
|
32
|
+
aws-partitions (1.1050.0)
|
|
33
|
+
aws-sdk-core (3.218.1)
|
|
30
34
|
aws-eventstream (~> 1, >= 1.3.0)
|
|
31
|
-
aws-partitions (~> 1, >= 1.
|
|
32
|
-
aws-sigv4 (~> 1.
|
|
35
|
+
aws-partitions (~> 1, >= 1.992.0)
|
|
36
|
+
aws-sigv4 (~> 1.9)
|
|
37
|
+
base64
|
|
33
38
|
jmespath (~> 1, >= 1.6.1)
|
|
34
|
-
aws-sdk-sns (1.
|
|
35
|
-
aws-sdk-core (~> 3, >= 3.
|
|
36
|
-
aws-sigv4 (~> 1.
|
|
37
|
-
aws-sdk-sqs (1.
|
|
38
|
-
aws-sdk-core (~> 3, >= 3.
|
|
39
|
-
aws-sigv4 (~> 1.
|
|
40
|
-
aws-sigv4 (1.
|
|
39
|
+
aws-sdk-sns (1.95.0)
|
|
40
|
+
aws-sdk-core (~> 3, >= 3.216.0)
|
|
41
|
+
aws-sigv4 (~> 1.5)
|
|
42
|
+
aws-sdk-sqs (1.92.0)
|
|
43
|
+
aws-sdk-core (~> 3, >= 3.216.0)
|
|
44
|
+
aws-sigv4 (~> 1.5)
|
|
45
|
+
aws-sigv4 (1.11.0)
|
|
41
46
|
aws-eventstream (~> 1, >= 1.0.2)
|
|
42
47
|
base64 (0.2.0)
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
benchmark (0.4.0)
|
|
49
|
+
bigdecimal (3.1.9)
|
|
50
|
+
bundler-audit (0.9.2)
|
|
45
51
|
bundler (>= 1.2.0, < 3)
|
|
46
52
|
thor (~> 1.0)
|
|
47
|
-
concurrent-ruby (1.3.
|
|
48
|
-
connection_pool (2.
|
|
53
|
+
concurrent-ruby (1.3.5)
|
|
54
|
+
connection_pool (2.5.0)
|
|
49
55
|
diff-lcs (1.5.1)
|
|
50
|
-
docile (1.4.
|
|
56
|
+
docile (1.4.1)
|
|
51
57
|
drb (2.2.1)
|
|
52
|
-
git (2.
|
|
58
|
+
git (2.3.3)
|
|
53
59
|
activesupport (>= 5.0)
|
|
54
60
|
addressable (~> 2.8)
|
|
55
61
|
process_executer (~> 1.1)
|
|
56
62
|
rchardet (~> 1.8)
|
|
57
|
-
i18n (1.14.
|
|
63
|
+
i18n (1.14.7)
|
|
58
64
|
concurrent-ruby (~> 1.0)
|
|
59
65
|
jmespath (1.6.2)
|
|
60
|
-
json (2.
|
|
61
|
-
language_server-protocol (3.17.0.
|
|
66
|
+
json (2.10.1)
|
|
67
|
+
language_server-protocol (3.17.0.4)
|
|
62
68
|
lint_roller (1.1.0)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
parallel (1.
|
|
66
|
-
parse_a_changelog (1.3.
|
|
69
|
+
logger (1.6.5)
|
|
70
|
+
minitest (5.25.4)
|
|
71
|
+
parallel (1.26.3)
|
|
72
|
+
parse_a_changelog (1.3.3)
|
|
67
73
|
treetop (~> 1.6)
|
|
68
|
-
parser (3.3.
|
|
74
|
+
parser (3.3.7.1)
|
|
69
75
|
ast (~> 2.4.1)
|
|
70
76
|
racc
|
|
71
77
|
polyglot (0.3.5)
|
|
72
|
-
process_executer (1.
|
|
73
|
-
public_suffix (
|
|
74
|
-
racc (1.8.
|
|
75
|
-
rack (3.1.
|
|
78
|
+
process_executer (1.2.0)
|
|
79
|
+
public_suffix (6.0.1)
|
|
80
|
+
racc (1.8.1)
|
|
81
|
+
rack (3.1.10)
|
|
76
82
|
rainbow (3.1.1)
|
|
77
83
|
rake (13.2.1)
|
|
78
|
-
rchardet (1.
|
|
79
|
-
regexp_parser (2.
|
|
84
|
+
rchardet (1.9.0)
|
|
85
|
+
regexp_parser (2.10.0)
|
|
80
86
|
resource-struct (0.4.0)
|
|
81
|
-
rexml (3.
|
|
82
|
-
strscan
|
|
87
|
+
rexml (3.4.0)
|
|
83
88
|
rspec (3.13.0)
|
|
84
89
|
rspec-core (~> 3.13.0)
|
|
85
90
|
rspec-expectations (~> 3.13.0)
|
|
86
91
|
rspec-mocks (~> 3.13.0)
|
|
87
92
|
rspec-collection_matchers (1.2.1)
|
|
88
93
|
rspec-expectations (>= 2.99.0.beta1)
|
|
89
|
-
rspec-core (3.13.
|
|
94
|
+
rspec-core (3.13.3)
|
|
90
95
|
rspec-support (~> 3.13.0)
|
|
91
|
-
rspec-expectations (3.13.
|
|
96
|
+
rspec-expectations (3.13.3)
|
|
92
97
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
93
98
|
rspec-support (~> 3.13.0)
|
|
94
|
-
rspec-its (
|
|
95
|
-
rspec-core (>= 3.
|
|
96
|
-
rspec-expectations (>= 3.
|
|
97
|
-
rspec-mocks (3.13.
|
|
99
|
+
rspec-its (2.0.0)
|
|
100
|
+
rspec-core (>= 3.13.0)
|
|
101
|
+
rspec-expectations (>= 3.13.0)
|
|
102
|
+
rspec-mocks (3.13.2)
|
|
98
103
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
99
104
|
rspec-support (~> 3.13.0)
|
|
100
|
-
rspec-support (3.13.
|
|
105
|
+
rspec-support (3.13.2)
|
|
101
106
|
rspec_junit_formatter (0.6.0)
|
|
102
107
|
rspec-core (>= 2, < 4, != 2.12.0)
|
|
103
|
-
rubocop (1.
|
|
108
|
+
rubocop (1.71.2)
|
|
104
109
|
json (~> 2.3)
|
|
105
110
|
language_server-protocol (>= 3.17.0)
|
|
106
111
|
parallel (~> 1.10)
|
|
107
112
|
parser (>= 3.3.0.2)
|
|
108
113
|
rainbow (>= 2.2.2, < 4.0)
|
|
109
|
-
regexp_parser (>=
|
|
110
|
-
|
|
111
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
|
114
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
115
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
|
112
116
|
ruby-progressbar (~> 1.7)
|
|
113
|
-
unicode-display_width (>= 2.4.0, <
|
|
114
|
-
rubocop-ast (1.
|
|
117
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
118
|
+
rubocop-ast (1.38.0)
|
|
115
119
|
parser (>= 3.3.1.0)
|
|
116
120
|
rubocop-factory_bot (2.26.1)
|
|
117
121
|
rubocop (~> 1.61)
|
|
118
|
-
rubocop-performance (1.
|
|
122
|
+
rubocop-performance (1.23.1)
|
|
119
123
|
rubocop (>= 1.48.1, < 2.0)
|
|
120
124
|
rubocop-ast (>= 1.31.1, < 2.0)
|
|
121
|
-
rubocop-rails (2.
|
|
125
|
+
rubocop-rails (2.26.2)
|
|
122
126
|
activesupport (>= 4.2.0)
|
|
123
127
|
rack (>= 1.1)
|
|
124
|
-
rubocop (>= 1.
|
|
125
|
-
rubocop-ast (>= 1.
|
|
126
|
-
rubocop-rspec (3.0
|
|
128
|
+
rubocop (>= 1.52.0, < 2.0)
|
|
129
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
|
130
|
+
rubocop-rspec (3.4.0)
|
|
127
131
|
rubocop (~> 1.61)
|
|
128
|
-
rubocop-vendor (0.13.
|
|
132
|
+
rubocop-vendor (0.13.2)
|
|
129
133
|
rubocop
|
|
130
134
|
ruby-progressbar (1.13.0)
|
|
135
|
+
securerandom (0.4.1)
|
|
131
136
|
simplecov (0.22.0)
|
|
132
137
|
docile (~> 1.1)
|
|
133
138
|
simplecov-html (~> 0.11)
|
|
134
139
|
simplecov_json_formatter (~> 0.1)
|
|
135
|
-
simplecov-html (0.
|
|
140
|
+
simplecov-html (0.13.1)
|
|
136
141
|
simplecov_json_formatter (0.1.4)
|
|
137
|
-
smarter_csv (1.
|
|
138
|
-
standard (1.
|
|
142
|
+
smarter_csv (1.13.1)
|
|
143
|
+
standard (1.45.0)
|
|
139
144
|
language_server-protocol (~> 3.17.0.2)
|
|
140
145
|
lint_roller (~> 1.0)
|
|
141
|
-
rubocop (~> 1.
|
|
146
|
+
rubocop (~> 1.71.0)
|
|
142
147
|
standard-custom (~> 1.0.0)
|
|
143
|
-
standard-performance (~> 1.
|
|
148
|
+
standard-performance (~> 1.6)
|
|
144
149
|
standard-custom (1.0.2)
|
|
145
150
|
lint_roller (~> 1.0)
|
|
146
151
|
rubocop (~> 1.50)
|
|
147
|
-
standard-performance (1.
|
|
152
|
+
standard-performance (1.6.0)
|
|
148
153
|
lint_roller (~> 1.1)
|
|
149
|
-
rubocop-performance (~> 1.
|
|
150
|
-
standard-rails (1.0
|
|
154
|
+
rubocop-performance (~> 1.23.0)
|
|
155
|
+
standard-rails (1.2.0)
|
|
151
156
|
lint_roller (~> 1.0)
|
|
152
|
-
rubocop-rails (~> 2.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
treetop (1.6.12)
|
|
157
|
+
rubocop-rails (~> 2.26.0)
|
|
158
|
+
thor (1.3.2)
|
|
159
|
+
treetop (1.6.14)
|
|
156
160
|
polyglot (~> 0.3)
|
|
157
161
|
tzinfo (2.0.6)
|
|
158
162
|
concurrent-ruby (~> 1.0)
|
|
159
|
-
unicode-display_width (
|
|
160
|
-
|
|
163
|
+
unicode-display_width (3.1.4)
|
|
164
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
165
|
+
unicode-emoji (4.0.4)
|
|
166
|
+
uri (1.0.2)
|
|
167
|
+
ws-style (7.6.1)
|
|
161
168
|
rubocop-factory_bot (>= 2.26.0)
|
|
162
169
|
rubocop-rspec (>= 3.0.0)
|
|
163
170
|
rubocop-vendor (>= 0.11)
|
|
@@ -166,7 +173,9 @@ GEM
|
|
|
166
173
|
standard-rails (>= 0.1.0)
|
|
167
174
|
|
|
168
175
|
PLATFORMS
|
|
176
|
+
arm64-darwin-23
|
|
169
177
|
ruby
|
|
178
|
+
x86_64-linux
|
|
170
179
|
|
|
171
180
|
DEPENDENCIES
|
|
172
181
|
bundler
|
data/README.md
CHANGED
|
@@ -34,6 +34,13 @@ Pheme.configure do |config|
|
|
|
34
34
|
config.sqs_client = AWS_SQS_CLIENT
|
|
35
35
|
config.sns_client = AWS_SNS_CLIENT
|
|
36
36
|
config.logger = Logger.new(STDOUT) # Optionally replace with your app logger, e.g. `Rails.logger`
|
|
37
|
+
|
|
38
|
+
# Internal wealthsimple error handler
|
|
39
|
+
config.error_reporting_func = Ws::Railway::ErrorReporting.capture_exception
|
|
40
|
+
# Sentry
|
|
41
|
+
config.error_reporting_func = Sentry.capture_exception
|
|
42
|
+
# Rollbar
|
|
43
|
+
config.error_reporting_func = Rollbar.error
|
|
37
44
|
end
|
|
38
45
|
```
|
|
39
46
|
|
data/lib/pheme/configuration.rb
CHANGED
|
@@ -17,9 +17,10 @@ module Pheme
|
|
|
17
17
|
|
|
18
18
|
class Configuration
|
|
19
19
|
ATTRIBUTES = %i[sns_client sqs_client logger].freeze
|
|
20
|
-
OPTIONAL_ATTRIBUTES = %i[
|
|
20
|
+
OPTIONAL_ATTRIBUTES = %i[error_reporting_func].freeze
|
|
21
|
+
DEPRECATED_ATTRIBUTES = %i[rollbar].freeze
|
|
21
22
|
|
|
22
|
-
attr_accessor(*ATTRIBUTES, *OPTIONAL_ATTRIBUTES)
|
|
23
|
+
attr_accessor(*ATTRIBUTES, *OPTIONAL_ATTRIBUTES, *DEPRECATED_ATTRIBUTES)
|
|
23
24
|
|
|
24
25
|
def initialize
|
|
25
26
|
@logger ||= Logger.new($stdout) # rubocop:disable Lint/DisjunctiveAssignmentInConstructor
|
|
@@ -32,6 +33,10 @@ module Pheme
|
|
|
32
33
|
end
|
|
33
34
|
raise "sns_client must be a Aws::SNS::Client" unless sns_client.is_a?(Aws::SNS::Client)
|
|
34
35
|
raise "sns_client must be a Aws::SQS::Client" unless sqs_client.is_a?(Aws::SQS::Client)
|
|
36
|
+
|
|
37
|
+
if respond_to?(:rollbar)
|
|
38
|
+
@logger.warn("config.rollbar is deprecated. Please use config.error_reporting_func instead.")
|
|
39
|
+
end
|
|
35
40
|
end
|
|
36
41
|
end
|
|
37
42
|
end
|
data/lib/pheme/queue_poller.rb
CHANGED
|
@@ -69,7 +69,7 @@ module Pheme
|
|
|
69
69
|
throw :stop_polling
|
|
70
70
|
rescue StandardError => e
|
|
71
71
|
Pheme.logger.error(e)
|
|
72
|
-
Pheme.
|
|
72
|
+
Pheme.capture_exception(e, "#{self.class} failed to process message", { message: content })
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
75
|
log_polling_end(time_start)
|
data/lib/pheme/version.rb
CHANGED
data/lib/pheme.rb
CHANGED
|
@@ -8,7 +8,7 @@ require 'smarter_csv'
|
|
|
8
8
|
require 'pheme/version'
|
|
9
9
|
require 'pheme/configuration'
|
|
10
10
|
require 'pheme/logger'
|
|
11
|
-
require 'pheme/
|
|
11
|
+
require 'pheme/error_reporting'
|
|
12
12
|
require 'pheme/topic_publisher'
|
|
13
13
|
require 'pheme/message_handler'
|
|
14
14
|
require 'pheme/queue_poller'
|
data/pheme.gemspec
CHANGED
|
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
|
|
|
26
26
|
s.add_dependency 'aws-sdk-sns', '~> 1.1'
|
|
27
27
|
s.add_dependency 'aws-sdk-sqs', '~> 1.3'
|
|
28
28
|
s.add_dependency 'resource-struct', '~> 0.4'
|
|
29
|
+
s.add_dependency 'rexml', '~> 3.4'
|
|
29
30
|
s.add_dependency 'smarter_csv', '~> 1'
|
|
30
31
|
|
|
31
32
|
s.add_development_dependency 'bundler'
|
data/spec/configuration_spec.rb
CHANGED
|
@@ -49,6 +49,26 @@ describe Pheme do
|
|
|
49
49
|
expect { subject }.not_to raise_error
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
|
+
|
|
53
|
+
context 'deprecated attributes' do
|
|
54
|
+
let(:sns_client) { instance_double(Aws::SNS::Client) }
|
|
55
|
+
let(:sqs_client) { instance_double(Aws::SQS::Client) }
|
|
56
|
+
|
|
57
|
+
before do
|
|
58
|
+
allow(sns_client).to receive(:is_a?).with(Aws::SNS::Client).and_return(true)
|
|
59
|
+
allow(sqs_client).to receive(:is_a?).with(Aws::SQS::Client).and_return(true)
|
|
60
|
+
|
|
61
|
+
configuration.sns_client = sns_client
|
|
62
|
+
configuration.sqs_client = sqs_client
|
|
63
|
+
configuration.rollbar = double
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it "warns if passed a deprecated config attribute" do
|
|
67
|
+
expect(configuration.logger).to receive(:warn).with("config.rollbar is deprecated. Please use config.error_reporting_func instead.")
|
|
68
|
+
|
|
69
|
+
expect { subject }.not_to raise_error
|
|
70
|
+
end
|
|
71
|
+
end
|
|
52
72
|
end
|
|
53
73
|
end
|
|
54
74
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
RSpec.describe Pheme do
|
|
2
|
+
let(:error_reporting_func) { double }
|
|
3
|
+
|
|
4
|
+
describe '.capture_exception' do
|
|
5
|
+
subject { described_class.capture_exception(exception, message, data) }
|
|
6
|
+
|
|
7
|
+
let(:exception) { StandardError }
|
|
8
|
+
let(:message) { 'Unable to poll for messages' }
|
|
9
|
+
let(:data) { { sqs_url: 'arn::foo::bar' } }
|
|
10
|
+
|
|
11
|
+
before do
|
|
12
|
+
described_class.configure do |config|
|
|
13
|
+
config.error_reporting_func = error_reporting_func
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'sends error message to configured error_reporter' do
|
|
18
|
+
expect(error_reporting_func).to receive(:call).with(exception, message, data)
|
|
19
|
+
subject
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pheme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 6.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Graham
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0.4'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rexml
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '3.4'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '3.4'
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: smarter_csv
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -230,6 +244,7 @@ files:
|
|
|
230
244
|
- ".github/CODEOWNERS"
|
|
231
245
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
232
246
|
- ".github/workflows/default.yaml"
|
|
247
|
+
- ".github/workflows/guardrails.yaml"
|
|
233
248
|
- ".github/workflows/stale.yml"
|
|
234
249
|
- ".gitignore"
|
|
235
250
|
- ".rspec"
|
|
@@ -247,23 +262,23 @@ files:
|
|
|
247
262
|
- lib/pheme.rb
|
|
248
263
|
- lib/pheme/compression.rb
|
|
249
264
|
- lib/pheme/configuration.rb
|
|
265
|
+
- lib/pheme/error_reporting.rb
|
|
250
266
|
- lib/pheme/logger.rb
|
|
251
267
|
- lib/pheme/message_handler.rb
|
|
252
268
|
- lib/pheme/message_type/aws_event.rb
|
|
253
269
|
- lib/pheme/message_type/sns_message.rb
|
|
254
270
|
- lib/pheme/queue_poller.rb
|
|
255
|
-
- lib/pheme/rollbar.rb
|
|
256
271
|
- lib/pheme/topic_publisher.rb
|
|
257
272
|
- lib/pheme/version.rb
|
|
258
273
|
- pheme.gemspec
|
|
259
274
|
- sonar-project.properties
|
|
260
275
|
- spec/configuration_spec.rb
|
|
276
|
+
- spec/error_reporting_spec.rb
|
|
261
277
|
- spec/logger_spec.rb
|
|
262
278
|
- spec/message_handler_spec.rb
|
|
263
279
|
- spec/message_type/aws_event_spec.rb
|
|
264
280
|
- spec/message_type/sns_message_spec.rb
|
|
265
281
|
- spec/queue_poller_spec.rb
|
|
266
|
-
- spec/rollbar_spec.rb
|
|
267
282
|
- spec/spec_helper.rb
|
|
268
283
|
- spec/support/example_aws_event_queue_poller.rb
|
|
269
284
|
- spec/support/example_message_handler.rb
|
data/lib/pheme/rollbar.rb
DELETED
data/spec/rollbar_spec.rb
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
RSpec.describe Pheme do
|
|
2
|
-
let(:rollbar) { double }
|
|
3
|
-
|
|
4
|
-
describe '.rollbar' do
|
|
5
|
-
subject { described_class.rollbar(exception, message, data) }
|
|
6
|
-
|
|
7
|
-
let(:exception) { StandardError }
|
|
8
|
-
let(:message) { 'Unable to poll for messages' }
|
|
9
|
-
let(:data) { { sqs_url: 'arn::foo::bar' } }
|
|
10
|
-
|
|
11
|
-
before do
|
|
12
|
-
described_class.configure do |config|
|
|
13
|
-
config.rollbar = rollbar
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it 'sends error message to rollbar' do
|
|
18
|
-
expect(rollbar).to receive(:error).with(exception, message, data)
|
|
19
|
-
subject
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|