pheme 4.0.13 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +25 -2
- data/.ruby-version +1 -1
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +28 -30
- data/lib/pheme/message_type/aws_event.rb +2 -0
- data/lib/pheme/queue_poller.rb +4 -0
- data/lib/pheme/version.rb +1 -1
- data/spec/message_handler_spec.rb +3 -1
- data/spec/queue_poller_spec.rb +6 -0
- data/spec/version_spec.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff68537e797de06e1b5ee79eeaa3b6f64c4783c571febadbb19779511b0eb426
|
4
|
+
data.tar.gz: 9e49021b2cc77aa556de089c21b23397d9a6b03b98f03a5838310db04fac8b43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e31aa40b21e8aff4d26c2869baae883b14c62aff3c7dc9073ff3ab2020b80a74093b731056a552d4148e1bc463a49073b9d715193373f401eb34f7593241605
|
7
|
+
data.tar.gz: bd46da56fef237e5f952c428fd80247f77d7df3470da501195aa4712d1597ac2eb021a999d10002f20e3a505d0d549519213eb9ae519e3a6fa194430fb52a9dd
|
data/.github/workflows/main.yml
CHANGED
@@ -2,23 +2,46 @@
|
|
2
2
|
name: Pipeline
|
3
3
|
on:
|
4
4
|
push:
|
5
|
+
concurrency:
|
6
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
7
|
+
cancel-in-progress: true
|
8
|
+
|
5
9
|
jobs:
|
6
10
|
build:
|
7
11
|
name: Build
|
8
12
|
runs-on: ubuntu-20.04
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby-version: [2.7.5, 3.0.3, 3.1.0]
|
9
16
|
steps:
|
10
17
|
- uses: actions/checkout@v2
|
11
18
|
with:
|
12
19
|
fetch-depth: 0
|
13
|
-
-
|
20
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
21
|
+
uses: ruby/setup-ruby@v1
|
14
22
|
with:
|
15
23
|
bundler-cache: true
|
24
|
+
ruby-version: ${{ matrix.ruby-version }}
|
16
25
|
- name: Lint
|
17
26
|
run: bundle exec rubocop
|
18
27
|
- name: Test
|
19
28
|
run: bundle exec rspec
|
29
|
+
|
30
|
+
# Separate `release` job from `build`, as we only want release to be run once
|
31
|
+
# and not run for each ruby version in the matrix:
|
32
|
+
release:
|
33
|
+
name: Release
|
34
|
+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
|
35
|
+
needs: build
|
36
|
+
runs-on: ubuntu-20.04
|
37
|
+
steps:
|
38
|
+
- uses: actions/checkout@v2
|
39
|
+
with:
|
40
|
+
fetch-depth: 0
|
41
|
+
- uses: ruby/setup-ruby@v1
|
42
|
+
with:
|
43
|
+
bundler-cache: true
|
20
44
|
- name: Release the gem
|
21
|
-
if: ${{ github.ref == 'refs/heads/main' }}
|
22
45
|
run: |
|
23
46
|
mkdir -p ~/.gem
|
24
47
|
cat << EOF > ~/.gem/credentials
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.7.
|
1
|
+
2.7.5
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 4.1.1 - 2022-01-04
|
8
|
+
### Changed
|
9
|
+
- Updated dependencies
|
10
|
+
|
11
|
+
## 4.1.0 - 2021-12-31
|
12
|
+
### Changed
|
13
|
+
- Add Ruby 3 support
|
14
|
+
|
15
|
+
## 4.0.15 - 2021-12-03
|
16
|
+
### Changed
|
17
|
+
- Updated dependencies
|
18
|
+
|
19
|
+
## 4.0.14 - 2021-11-05
|
20
|
+
### Changed
|
21
|
+
- Update dependencies
|
7
22
|
|
8
23
|
## 4.0.13 - 2021-10-12
|
9
24
|
### Changed
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pheme (4.
|
4
|
+
pheme (4.1.1)
|
5
5
|
activesupport (>= 4)
|
6
6
|
aws-sdk-sns (~> 1.1)
|
7
7
|
aws-sdk-sqs (~> 1.3)
|
@@ -11,25 +11,24 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (
|
14
|
+
activesupport (7.0.0)
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
16
|
i18n (>= 1.6, < 2)
|
17
17
|
minitest (>= 5.1)
|
18
18
|
tzinfo (~> 2.0)
|
19
|
-
zeitwerk (~> 2.3)
|
20
19
|
ast (2.4.2)
|
21
20
|
aws-eventstream (1.2.0)
|
22
|
-
aws-partitions (1.
|
23
|
-
aws-sdk-core (3.
|
21
|
+
aws-partitions (1.544.0)
|
22
|
+
aws-sdk-core (3.125.0)
|
24
23
|
aws-eventstream (~> 1, >= 1.0.2)
|
25
|
-
aws-partitions (~> 1, >= 1.
|
24
|
+
aws-partitions (~> 1, >= 1.525.0)
|
26
25
|
aws-sigv4 (~> 1.1)
|
27
26
|
jmespath (~> 1.0)
|
28
|
-
aws-sdk-sns (1.
|
29
|
-
aws-sdk-core (~> 3, >= 3.
|
27
|
+
aws-sdk-sns (1.50.0)
|
28
|
+
aws-sdk-core (~> 3, >= 3.125.0)
|
30
29
|
aws-sigv4 (~> 1.1)
|
31
|
-
aws-sdk-sqs (1.
|
32
|
-
aws-sdk-core (~> 3, >= 3.
|
30
|
+
aws-sdk-sqs (1.49.0)
|
31
|
+
aws-sdk-core (~> 3, >= 3.125.0)
|
33
32
|
aws-sigv4 (~> 1.1)
|
34
33
|
aws-sigv4 (1.4.0)
|
35
34
|
aws-eventstream (~> 1, >= 1.0.2)
|
@@ -37,23 +36,23 @@ GEM
|
|
37
36
|
bundler (>= 1.2.0, < 3)
|
38
37
|
thor (~> 1.0)
|
39
38
|
concurrent-ruby (1.1.9)
|
40
|
-
diff-lcs (1.
|
39
|
+
diff-lcs (1.5.0)
|
41
40
|
docile (1.4.0)
|
42
|
-
git (1.
|
41
|
+
git (1.10.1)
|
43
42
|
rchardet (~> 1.8)
|
44
|
-
i18n (1.8.
|
43
|
+
i18n (1.8.11)
|
45
44
|
concurrent-ruby (~> 1.0)
|
46
45
|
jmespath (1.4.0)
|
47
|
-
minitest (5.
|
46
|
+
minitest (5.15.0)
|
48
47
|
parallel (1.21.0)
|
49
|
-
parser (3.0.
|
48
|
+
parser (3.1.0.0)
|
50
49
|
ast (~> 2.4.1)
|
51
50
|
rack (2.2.3)
|
52
51
|
rainbow (3.0.0)
|
53
52
|
rake (13.0.6)
|
54
53
|
rchardet (1.8.0)
|
55
54
|
recursive-open-struct (1.1.3)
|
56
|
-
regexp_parser (2.
|
55
|
+
regexp_parser (2.2.0)
|
57
56
|
rexml (3.2.5)
|
58
57
|
rspec (3.10.0)
|
59
58
|
rspec-core (~> 3.10.0)
|
@@ -72,30 +71,30 @@ GEM
|
|
72
71
|
rspec-mocks (3.10.2)
|
73
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
74
73
|
rspec-support (~> 3.10.0)
|
75
|
-
rspec-support (3.10.
|
76
|
-
rspec_junit_formatter (0.
|
74
|
+
rspec-support (3.10.3)
|
75
|
+
rspec_junit_formatter (0.5.0)
|
77
76
|
rspec-core (>= 2, < 4, != 2.12.0)
|
78
|
-
rubocop (1.
|
77
|
+
rubocop (1.24.1)
|
79
78
|
parallel (~> 1.10)
|
80
79
|
parser (>= 3.0.0.0)
|
81
80
|
rainbow (>= 2.2.2, < 4.0)
|
82
81
|
regexp_parser (>= 1.8, < 3.0)
|
83
82
|
rexml
|
84
|
-
rubocop-ast (>= 1.
|
83
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
85
84
|
ruby-progressbar (~> 1.7)
|
86
85
|
unicode-display_width (>= 1.4.0, < 3.0)
|
87
|
-
rubocop-ast (1.
|
86
|
+
rubocop-ast (1.15.1)
|
88
87
|
parser (>= 3.0.1.1)
|
89
|
-
rubocop-performance (1.
|
88
|
+
rubocop-performance (1.13.1)
|
90
89
|
rubocop (>= 1.7.0, < 2.0)
|
91
90
|
rubocop-ast (>= 0.4.0)
|
92
|
-
rubocop-rails (2.
|
91
|
+
rubocop-rails (2.13.0)
|
93
92
|
activesupport (>= 4.2.0)
|
94
93
|
rack (>= 1.1)
|
95
94
|
rubocop (>= 1.7.0, < 2.0)
|
96
|
-
rubocop-rspec (2.
|
95
|
+
rubocop-rspec (2.7.0)
|
97
96
|
rubocop (~> 1.19)
|
98
|
-
rubocop-vendor (0.
|
97
|
+
rubocop-vendor (0.8.0)
|
99
98
|
rubocop (>= 0.53.0)
|
100
99
|
ruby-progressbar (1.11.0)
|
101
100
|
simplecov (0.21.2)
|
@@ -104,18 +103,17 @@ GEM
|
|
104
103
|
simplecov_json_formatter (~> 0.1)
|
105
104
|
simplecov-html (0.12.3)
|
106
105
|
simplecov_json_formatter (0.1.3)
|
107
|
-
smarter_csv (1.2.
|
106
|
+
smarter_csv (1.2.9)
|
108
107
|
thor (1.1.0)
|
109
108
|
tzinfo (2.0.4)
|
110
109
|
concurrent-ruby (~> 1.0)
|
111
110
|
unicode-display_width (2.1.0)
|
112
|
-
ws-style (6.
|
113
|
-
rubocop (>= 1.
|
111
|
+
ws-style (6.12.3)
|
112
|
+
rubocop (>= 1.23)
|
114
113
|
rubocop-performance (>= 1.10.2)
|
115
114
|
rubocop-rails (>= 2.9.1)
|
116
115
|
rubocop-rspec (>= 2.2.0)
|
117
116
|
rubocop-vendor (>= 0.6.0)
|
118
|
-
zeitwerk (2.4.2)
|
119
117
|
|
120
118
|
PLATFORMS
|
121
119
|
ruby
|
@@ -134,4 +132,4 @@ DEPENDENCIES
|
|
134
132
|
ws-style
|
135
133
|
|
136
134
|
BUNDLED WITH
|
137
|
-
2.2.
|
135
|
+
2.2.32
|
@@ -19,7 +19,9 @@ module Pheme
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def parse_aws_event(message_contents)
|
22
|
+
# rubocop:disable Vendor/RecursiveOpenStructUse
|
22
23
|
RecursiveOpenStruct.new({ wrapper: message_contents }, recurse_over_arrays: true).wrapper
|
24
|
+
# rubocop:enable Vendor/RecursiveOpenStructUse
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
data/lib/pheme/queue_poller.rb
CHANGED
@@ -127,12 +127,16 @@ module Pheme
|
|
127
127
|
|
128
128
|
def parse_csv(message_contents)
|
129
129
|
parsed_body = SmarterCSV.process(StringIO.new(message_contents))
|
130
|
+
# rubocop:disable Vendor/RecursiveOpenStructUse
|
130
131
|
parsed_body.map { |item| RecursiveOpenStruct.new(item, recurse_over_arrays: true) }
|
132
|
+
# rubocop:enable Vendor/RecursiveOpenStructUse
|
131
133
|
end
|
132
134
|
|
133
135
|
def parse_json(message_contents)
|
134
136
|
parsed_body = JSON.parse(message_contents)
|
137
|
+
# rubocop:disable Vendor/RecursiveOpenStructUse
|
135
138
|
RecursiveOpenStruct.new({ wrapper: parsed_body }, recurse_over_arrays: true).wrapper
|
139
|
+
# rubocop:enable Vendor/RecursiveOpenStructUse
|
136
140
|
end
|
137
141
|
|
138
142
|
def handle(message, metadata, message_attributes)
|
data/lib/pheme/version.rb
CHANGED
@@ -3,7 +3,9 @@ describe Pheme::MessageHandler do
|
|
3
3
|
|
4
4
|
before { use_default_configuration! }
|
5
5
|
|
6
|
-
|
6
|
+
# rubocop:disable RSpec/VerifiedDoubles
|
7
|
+
let(:message) { double(status: status) }
|
8
|
+
# rubocop:enable RSpec/VerifiedDoubles
|
7
9
|
let(:timestamp) { '2018-04-17T21:45:05.915Z' }
|
8
10
|
|
9
11
|
describe "#handle" do
|
data/spec/queue_poller_spec.rb
CHANGED
@@ -222,7 +222,9 @@ describe Pheme::QueuePoller do
|
|
222
222
|
end
|
223
223
|
|
224
224
|
it { is_expected.to have(2).items }
|
225
|
+
# rubocop:disable Vendor/RecursiveOpenStructUse
|
225
226
|
it { is_expected.to eq(RecursiveOpenStruct.new({ wrapper: expected_message }, recurse_over_arrays: true).wrapper) }
|
227
|
+
# rubocop:enable Vendor/RecursiveOpenStructUse
|
226
228
|
end
|
227
229
|
|
228
230
|
context "with unknown message format" do
|
@@ -240,7 +242,9 @@ describe Pheme::QueuePoller do
|
|
240
242
|
|
241
243
|
it { is_expected.to be_a(Array) }
|
242
244
|
its(:first) { is_expected.to be_a(Array) }
|
245
|
+
# rubocop:disable Vendor/RecursiveOpenStructUse
|
243
246
|
its('first.first') { is_expected.to be_a(RecursiveOpenStruct) }
|
247
|
+
# rubocop:enable Vendor/RecursiveOpenStructUse
|
244
248
|
|
245
249
|
it "parses the nested object" do
|
246
250
|
expect(subject.first.first.test).to eq('test')
|
@@ -361,7 +365,9 @@ describe Pheme::QueuePoller do
|
|
361
365
|
|
362
366
|
it "handles the message" do
|
363
367
|
expect(ExampleMessageHandler).to receive(:new).with(
|
368
|
+
# rubocop:disable Vendor/RecursiveOpenStructUse
|
364
369
|
message: RecursiveOpenStruct.new(message),
|
370
|
+
# rubocop:enable Vendor/RecursiveOpenStructUse
|
365
371
|
metadata: { timestamp: timestamp, topic_arn: topic_arn },
|
366
372
|
message_attributes: {},
|
367
373
|
)
|
data/spec/version_spec.rb
CHANGED
@@ -4,8 +4,7 @@ describe Pheme do
|
|
4
4
|
def get_version(git, branch = 'HEAD')
|
5
5
|
git.grep('VERSION = ', 'lib/*/version.rb', { object: branch }).
|
6
6
|
map { |_sha, matches| matches.first[1] }.
|
7
|
-
|
8
|
-
reject(&:nil?).
|
7
|
+
filter_map { |version_string| parse_version(version_string) }.
|
9
8
|
first
|
10
9
|
end
|
11
10
|
|
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.
|
4
|
+
version: 4.1.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: 2022-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|