cloudenvoy 0.5.rc1 → 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: 4caf2ea67d821c6523a55d6a0d3049216977a51f7e7660be453e70bdf33a92a6
4
- data.tar.gz: 194c131bb03da874172331f3787ff76edd874eb704e802f13ef24396ad7bab30
3
+ metadata.gz: bf662a5a379a166bfada0d2e6763f2e295fabc49c650645dde38d31e7a8f2a7a
4
+ data.tar.gz: f5158fa17c16de28513c734467e87ee7b4287a29934eb7b1ea1cda7178ea3dda
5
5
  SHA512:
6
- metadata.gz: 57cb75713b8e617724e9424b0781e9e40853bdd1e6b2687b2361acca406740edb739f8552aa62581832983f0f5685de05d72e03d52991a902975f20cd43ff55d
7
- data.tar.gz: 67034935f6b83ee47b8afaaf8bbf7199d2466b929eee885834bf7d5c9fe5f3021d5767b21632852dabdd27a7b86105c7d8617459732da7084c3ea46d41407568
6
+ metadata.gz: 9a8ab145fdd8c596ee9ad44bb69714424afc27c067fcfed0ea3ca167270faa6d9d25bb24be1328e95dbb25ca6e70a886cd2e14dc1f35b449633f02015c99cbbc
7
+ data.tar.gz: c6591198e2302c3c6b5e7858fd71ccf0d4cc176ff9bfd642b39e59af19549d7be51225001dfb3a022878bdf1448834a4b97e14a4e1bb7f3310228df445454c54
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  /doc/
6
6
  /examples/rails/log/*.log
7
7
  /examples/rails/tmp/
8
+ /gemfiles/*.gemfile.lock
8
9
  /pkg/
9
10
  /spec/reports/
10
11
  /tmp/
data/.rubocop.yml CHANGED
@@ -1,14 +1,13 @@
1
1
  require: rubocop-rspec
2
2
 
3
3
  AllCops:
4
+ NewCops: enable
4
5
  Exclude:
5
6
  - 'gemfiles/**/*'
6
7
  - 'vendor/**/*'
7
8
 
8
- # Ruby 3.0: curly braces around last argument has meaning
9
- # See: https://github.com/rubocop/rubocop/issues/7641
10
- Style/BracesAroundHashParameters:
11
- Enabled: false
9
+ Layout/LineLength:
10
+ Max: 160
12
11
 
13
12
  Metrics/ClassLength:
14
13
  Max: 150
@@ -17,14 +16,20 @@ Metrics/ModuleLength:
17
16
  Max: 150
18
17
 
19
18
  Metrics/AbcSize:
20
- Max: 20
21
-
22
- Metrics/LineLength:
23
- Max: 120
19
+ Max: 30
24
20
 
25
21
  Metrics/MethodLength:
26
22
  Max: 20
27
23
 
24
+ Metrics/BlockLength:
25
+ Exclude:
26
+ - cloudenvoy.gemspec
27
+ - lib/tasks/**/*
28
+ - 'spec/**/*'
29
+
30
+ Metrics/ParameterLists:
31
+ CountKeywordArgs: false
32
+
28
33
  RSpec/ExpectInHook:
29
34
  Enabled: false
30
35
 
@@ -34,19 +39,10 @@ RSpec/EmptyLineAfterHook:
34
39
  RSpec/ScatteredSetup:
35
40
  Enabled: false
36
41
 
37
- Metrics/BlockLength:
38
- Exclude:
39
- - cloudenvoy.gemspec
40
- - lib/tasks/**/*
41
- - 'spec/**/*'
42
+ RSpec/MessageSpies:
43
+ Enabled: false
42
44
 
43
45
  Style/Documentation:
44
46
  Exclude:
45
47
  - 'examples/**/*'
46
- - 'spec/**/*'
47
-
48
- Metrics/ParameterLists:
49
- CountKeywordArgs: false
50
-
51
- RSpec/MessageSpies:
52
- Enabled: false
48
+ - 'spec/**/*'
data/CHANGELOG.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## [v0.5.rc1](https://github.com/keypup-io/cloudenvoy/tree/v0.5.rc1) (2022-01-05)
3
+ ## [v0.6.0](https://github.com/keypup-io/cloudenvoy/tree/v0.6.0) (2022-07-21)
4
4
 
5
- [Full Changelog](https://github.com/keypup-io/cloudenvoy/compare/v0.4.2...v0.5.rc1)
5
+ [Full Changelog](https://github.com/keypup-io/cloudenvoy/compare/v0.5.0...v0.6.0)
6
+
7
+ **Improvements:**
8
+ - Pub/sub: Add `publish_all` method to publish multiple messages in one batch
9
+ - Ruby: Drop support for Ruby `2.3`
10
+ - Style: Upgrade rubocop to `0.93.0`
11
+
12
+ ## [v0.5.0](https://github.com/keypup-io/cloudenvoy/tree/v0.5.0) (2022-03-11)
13
+
14
+ [Full Changelog](https://github.com/keypup-io/cloudenvoy/compare/v0.4.2...v0.5.0)
6
15
 
7
16
  **Improvements:**
8
17
  - Ruby 3: Rework method arguments to be compatible with Ruby 3
data/README.md CHANGED
@@ -10,8 +10,6 @@ Pub/Sub solves that event distribution problem by allowing developers to define
10
10
 
11
11
  Cloudenvoy works with the local pub/sub emulator as well, meaning that you can work offline without access to GCP.
12
12
 
13
- **Maturity**: The gem is relatively young but is production-friendly. We at Keypup have already processed hundreds of thousands of pub/sub messages through Cloudenvoy. If you spot any bug, feel free to report it! we're aiming at a `v1.0.0` around Q1 2022.
14
-
15
13
  ## Summary
16
14
 
17
15
  1. [Installation](#installation)
@@ -133,7 +131,12 @@ rails s -p 3000
133
131
 
134
132
  Open a Rails console and send a message
135
133
  ```ruby
134
+ # One message at a time
136
135
  DummyPublisher.publish('Hello pub/sub')
136
+
137
+ # Publish multiple messages in one batch
138
+ # Only available since v0.6.rc1
139
+ DummyPublisher.publish_all(['Hello pub/sub', 'Hello again!', 'Hello again and again!'])
137
140
  ```
138
141
 
139
142
  Your Rails logs should display the following:
@@ -249,10 +252,21 @@ DummySubscriber.setup
249
252
  ## Publishing messages
250
253
 
251
254
  ### Sending messages
255
+ **Note**: The `publish_all` method is only available since `v0.6.rc1`
252
256
 
253
257
  Cloudenvoy provides a helper method to publish arbitrary messages to any topic.
254
258
  ```ruby
259
+ # Publish a single message
255
260
  Cloudenvoy.publish('my-topic', { 'some' => 'payload' }, { 'optional' => 'message attribute' })
261
+
262
+ # Publish multiple messages in one batch
263
+ # Only available since v0.6.rc1
264
+ Cloudenvoy.publish_all('my-topic', [
265
+ # Message 1
266
+ [{ 'some' => 'msg1 payload' }, { 'optional' => 'msg1 attribute' }],
267
+ # Message 2
268
+ [{ 'some' => 'msg2 payload' }, { 'optional' => 'msg2 attribute' }]
269
+ ])
256
270
  ```
257
271
 
258
272
  This helper is useful for sending basic messages however it is not the preferred way of sending messages as you will quickly clutter your application with message formatting logic over time.
@@ -289,8 +303,21 @@ Then in your user model you can do the following:
289
303
  class User < ApplicationRecord
290
304
  after_create :publish_user
291
305
 
306
+ # Example: publish multiple messages in one batch
307
+ # Only available since v0.6.rc1
308
+ #
309
+ #
310
+ # Set user status to 'active' without involving callbacks
311
+ # then manually publish the new state of users in one batch
312
+ def self.enable_all_users
313
+ User.update_all(status: 'active', updated_at: Time.current)
314
+ UserPublisher.publish_all(User.all)
315
+ end
316
+
292
317
  private
293
318
 
319
+ # Example: publish one message at a time
320
+ #
294
321
  # Publish users after they have been created
295
322
  def publish_user
296
323
  UserPublisher.publish(self)
@@ -601,9 +628,17 @@ end
601
628
 
602
629
  ## Development
603
630
 
604
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
631
+ After checking out the repo, run `bin/setup` to install dependencies.
632
+
633
+ For tests, run `rake` to run the tests. Note that Rails is not in context by default, which means Rails-specific test will not run.
634
+ For tests including Rails-specific tests, run `bundle exec appraisal rails-7.0 rake`
635
+ For all context-specific tests (incl. Rails), run the [appraisal tests](Appraisals) using `bundle exec appraisal rake`.
636
+
637
+ You can run `bin/console` for an interactive prompt that will allow you to experiment.
638
+
639
+ To install this gem onto your local machine, run `bundle exec rake install`.
605
640
 
606
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
641
+ To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
607
642
 
608
643
  ## Contributing
609
644
 
data/cloudenvoy.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'Cross-application messaging using GCP Pub/Sub (alpha)'
13
13
  spec.homepage = 'https://github.com/keypup-io/cloudenvoy'
14
14
  spec.license = 'MIT'
15
- spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
16
16
 
17
17
  spec.metadata['homepage_uri'] = spec.homepage
18
18
  spec.metadata['source_code_uri'] = 'https://github.com/keypup-io/cloudenvoy'
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'appraisal'
36
36
  spec.add_development_dependency 'rake', '>= 12.3.3'
37
37
  spec.add_development_dependency 'rspec', '~> 3.0'
38
- spec.add_development_dependency 'rubocop', '0.76.0'
38
+ spec.add_development_dependency 'rubocop', '0.93.0'
39
39
  spec.add_development_dependency 'rubocop-rspec', '1.37.0'
40
40
  spec.add_development_dependency 'semantic_logger'
41
41
  spec.add_development_dependency 'timecop'
@@ -9,7 +9,7 @@ ruby '3.0.0'
9
9
  gem 'rails', '~> 6.0.2'
10
10
 
11
11
  # Server
12
- gem 'puma', '~> 5.5.2'
12
+ gem 'puma', '~> 5.6.4'
13
13
 
14
14
  # Messaging via GCP Pub/Sub
15
15
  gem 'cloudenvoy', path: '../../'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- cloudenvoy (0.4.2)
4
+ cloudenvoy (0.5.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -10,56 +10,56 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actioncable (6.0.4.4)
14
- actionpack (= 6.0.4.4)
13
+ actioncable (6.0.4.7)
14
+ actionpack (= 6.0.4.7)
15
15
  nio4r (~> 2.0)
16
16
  websocket-driver (>= 0.6.1)
17
- actionmailbox (6.0.4.4)
18
- actionpack (= 6.0.4.4)
19
- activejob (= 6.0.4.4)
20
- activerecord (= 6.0.4.4)
21
- activestorage (= 6.0.4.4)
22
- activesupport (= 6.0.4.4)
17
+ actionmailbox (6.0.4.7)
18
+ actionpack (= 6.0.4.7)
19
+ activejob (= 6.0.4.7)
20
+ activerecord (= 6.0.4.7)
21
+ activestorage (= 6.0.4.7)
22
+ activesupport (= 6.0.4.7)
23
23
  mail (>= 2.7.1)
24
- actionmailer (6.0.4.4)
25
- actionpack (= 6.0.4.4)
26
- actionview (= 6.0.4.4)
27
- activejob (= 6.0.4.4)
24
+ actionmailer (6.0.4.7)
25
+ actionpack (= 6.0.4.7)
26
+ actionview (= 6.0.4.7)
27
+ activejob (= 6.0.4.7)
28
28
  mail (~> 2.5, >= 2.5.4)
29
29
  rails-dom-testing (~> 2.0)
30
- actionpack (6.0.4.4)
31
- actionview (= 6.0.4.4)
32
- activesupport (= 6.0.4.4)
30
+ actionpack (6.0.4.7)
31
+ actionview (= 6.0.4.7)
32
+ activesupport (= 6.0.4.7)
33
33
  rack (~> 2.0, >= 2.0.8)
34
34
  rack-test (>= 0.6.3)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.0.4.4)
38
- actionpack (= 6.0.4.4)
39
- activerecord (= 6.0.4.4)
40
- activestorage (= 6.0.4.4)
41
- activesupport (= 6.0.4.4)
37
+ actiontext (6.0.4.7)
38
+ actionpack (= 6.0.4.7)
39
+ activerecord (= 6.0.4.7)
40
+ activestorage (= 6.0.4.7)
41
+ activesupport (= 6.0.4.7)
42
42
  nokogiri (>= 1.8.5)
43
- actionview (6.0.4.4)
44
- activesupport (= 6.0.4.4)
43
+ actionview (6.0.4.7)
44
+ activesupport (= 6.0.4.7)
45
45
  builder (~> 3.1)
46
46
  erubi (~> 1.4)
47
47
  rails-dom-testing (~> 2.0)
48
48
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.0.4.4)
50
- activesupport (= 6.0.4.4)
49
+ activejob (6.0.4.7)
50
+ activesupport (= 6.0.4.7)
51
51
  globalid (>= 0.3.6)
52
- activemodel (6.0.4.4)
53
- activesupport (= 6.0.4.4)
54
- activerecord (6.0.4.4)
55
- activemodel (= 6.0.4.4)
56
- activesupport (= 6.0.4.4)
57
- activestorage (6.0.4.4)
58
- actionpack (= 6.0.4.4)
59
- activejob (= 6.0.4.4)
60
- activerecord (= 6.0.4.4)
52
+ activemodel (6.0.4.7)
53
+ activesupport (= 6.0.4.7)
54
+ activerecord (6.0.4.7)
55
+ activemodel (= 6.0.4.7)
56
+ activesupport (= 6.0.4.7)
57
+ activestorage (6.0.4.7)
58
+ actionpack (= 6.0.4.7)
59
+ activejob (= 6.0.4.7)
60
+ activerecord (= 6.0.4.7)
61
61
  marcel (~> 1.0.0)
62
- activesupport (6.0.4.4)
62
+ activesupport (6.0.4.7)
63
63
  concurrent-ruby (~> 1.0, >= 1.0.2)
64
64
  i18n (>= 0.7, < 2)
65
65
  minitest (~> 5.1)
@@ -71,26 +71,30 @@ GEM
71
71
  concurrent-ruby (1.1.9)
72
72
  crass (1.0.6)
73
73
  erubi (1.10.0)
74
- faraday (1.8.0)
74
+ faraday (1.10.0)
75
75
  faraday-em_http (~> 1.0)
76
76
  faraday-em_synchrony (~> 1.0)
77
77
  faraday-excon (~> 1.1)
78
- faraday-httpclient (~> 1.0.1)
78
+ faraday-httpclient (~> 1.0)
79
+ faraday-multipart (~> 1.0)
79
80
  faraday-net_http (~> 1.0)
80
- faraday-net_http_persistent (~> 1.1)
81
+ faraday-net_http_persistent (~> 1.0)
81
82
  faraday-patron (~> 1.0)
82
83
  faraday-rack (~> 1.0)
83
- multipart-post (>= 1.2, < 3)
84
+ faraday-retry (~> 1.0)
84
85
  ruby2_keywords (>= 0.0.4)
85
86
  faraday-em_http (1.0.0)
86
87
  faraday-em_synchrony (1.0.0)
87
88
  faraday-excon (1.1.0)
88
89
  faraday-httpclient (1.0.1)
90
+ faraday-multipart (1.0.3)
91
+ multipart-post (>= 1.2, < 3)
89
92
  faraday-net_http (1.0.1)
90
93
  faraday-net_http_persistent (1.2.0)
91
94
  faraday-patron (1.0.0)
92
95
  faraday-rack (1.0.0)
93
- gapic-common (0.7.0)
96
+ faraday-retry (1.0.3)
97
+ gapic-common (0.8.0)
94
98
  faraday (~> 1.3)
95
99
  google-protobuf (~> 3.14)
96
100
  googleapis-common-protos (>= 1.3.11, < 2.a)
@@ -105,39 +109,39 @@ GEM
105
109
  google-cloud-env (1.5.0)
106
110
  faraday (>= 0.17.3, < 2.0)
107
111
  google-cloud-errors (1.2.0)
108
- google-cloud-pubsub (2.9.0)
112
+ google-cloud-pubsub (2.9.1)
109
113
  concurrent-ruby (~> 1.1)
110
114
  google-cloud-core (~> 1.5)
111
115
  google-cloud-pubsub-v1 (~> 0.0)
112
- google-cloud-pubsub-v1 (0.6.1)
116
+ google-cloud-pubsub-v1 (0.7.1)
113
117
  gapic-common (>= 0.7, < 2.a)
114
118
  google-cloud-errors (~> 1.0)
115
119
  grpc-google-iam-v1 (>= 0.6.10, < 2.a)
116
- google-protobuf (3.19.1)
120
+ google-protobuf (3.19.4)
117
121
  googleapis-common-protos (1.3.12)
118
122
  google-protobuf (~> 3.14)
119
123
  googleapis-common-protos-types (~> 1.2)
120
124
  grpc (~> 1.27)
121
125
  googleapis-common-protos-types (1.3.0)
122
126
  google-protobuf (~> 3.14)
123
- googleauth (1.1.0)
124
- faraday (>= 0.17.3, < 2.0)
127
+ googleauth (1.1.2)
128
+ faraday (>= 0.17.3, < 3.a)
125
129
  jwt (>= 1.4, < 3.0)
126
130
  memoist (~> 0.16)
127
131
  multi_json (~> 1.11)
128
132
  os (>= 0.9, < 2.0)
129
133
  signet (>= 0.16, < 2.a)
130
- grpc (1.40.0)
131
- google-protobuf (~> 3.15)
134
+ grpc (1.43.1)
135
+ google-protobuf (~> 3.18)
132
136
  googleapis-common-protos-types (~> 1.0)
133
137
  grpc-google-iam-v1 (1.0.0)
134
138
  google-protobuf (~> 3.14)
135
139
  googleapis-common-protos (>= 1.3.12, < 2.0)
136
140
  grpc (~> 1.27)
137
- i18n (1.8.11)
141
+ i18n (1.10.0)
138
142
  concurrent-ruby (~> 1.0)
139
143
  jwt (2.3.0)
140
- loofah (2.13.0)
144
+ loofah (2.18.0)
141
145
  crass (~> 1.0.2)
142
146
  nokogiri (>= 1.5.9)
143
147
  mail (2.7.1)
@@ -146,57 +150,57 @@ GEM
146
150
  memoist (0.16.2)
147
151
  method_source (1.0.0)
148
152
  mini_mime (1.1.2)
149
- mini_portile2 (2.6.1)
153
+ mini_portile2 (2.8.0)
150
154
  minitest (5.15.0)
151
155
  multi_json (1.15.0)
152
156
  multipart-post (2.1.1)
153
157
  nio4r (2.5.8)
154
- nokogiri (1.12.5)
155
- mini_portile2 (~> 2.6.1)
158
+ nokogiri (1.13.6)
159
+ mini_portile2 (~> 2.8.0)
156
160
  racc (~> 1.4)
157
161
  os (1.1.4)
158
162
  public_suffix (4.0.6)
159
- puma (5.5.2)
163
+ puma (5.6.4)
160
164
  nio4r (~> 2.0)
161
165
  racc (1.6.0)
162
- rack (2.2.3)
166
+ rack (2.2.4)
163
167
  rack-test (1.1.0)
164
168
  rack (>= 1.0, < 3)
165
- rails (6.0.4.4)
166
- actioncable (= 6.0.4.4)
167
- actionmailbox (= 6.0.4.4)
168
- actionmailer (= 6.0.4.4)
169
- actionpack (= 6.0.4.4)
170
- actiontext (= 6.0.4.4)
171
- actionview (= 6.0.4.4)
172
- activejob (= 6.0.4.4)
173
- activemodel (= 6.0.4.4)
174
- activerecord (= 6.0.4.4)
175
- activestorage (= 6.0.4.4)
176
- activesupport (= 6.0.4.4)
169
+ rails (6.0.4.7)
170
+ actioncable (= 6.0.4.7)
171
+ actionmailbox (= 6.0.4.7)
172
+ actionmailer (= 6.0.4.7)
173
+ actionpack (= 6.0.4.7)
174
+ actiontext (= 6.0.4.7)
175
+ actionview (= 6.0.4.7)
176
+ activejob (= 6.0.4.7)
177
+ activemodel (= 6.0.4.7)
178
+ activerecord (= 6.0.4.7)
179
+ activestorage (= 6.0.4.7)
180
+ activesupport (= 6.0.4.7)
177
181
  bundler (>= 1.3.0)
178
- railties (= 6.0.4.4)
182
+ railties (= 6.0.4.7)
179
183
  sprockets-rails (>= 2.0.0)
180
184
  rails-dom-testing (2.0.3)
181
185
  activesupport (>= 4.2.0)
182
186
  nokogiri (>= 1.6)
183
- rails-html-sanitizer (1.4.2)
187
+ rails-html-sanitizer (1.4.3)
184
188
  loofah (~> 2.3)
185
- railties (6.0.4.4)
186
- actionpack (= 6.0.4.4)
187
- activesupport (= 6.0.4.4)
189
+ railties (6.0.4.7)
190
+ actionpack (= 6.0.4.7)
191
+ activesupport (= 6.0.4.7)
188
192
  method_source
189
193
  rake (>= 0.8.7)
190
194
  thor (>= 0.20.3, < 2.0)
191
195
  rake (13.0.6)
192
196
  retriable (3.1.2)
193
197
  ruby2_keywords (0.0.5)
194
- signet (0.16.0)
198
+ signet (0.16.1)
195
199
  addressable (~> 2.8)
196
- faraday (>= 0.17.3, < 2.0)
200
+ faraday (>= 0.17.5, < 3.0)
197
201
  jwt (>= 1.5, < 3.0)
198
202
  multi_json (~> 1.10)
199
- sprockets (4.0.2)
203
+ sprockets (4.0.3)
200
204
  concurrent-ruby (~> 1.0)
201
205
  rack (> 1, < 3)
202
206
  sprockets-rails (3.4.2)
@@ -211,14 +215,14 @@ GEM
211
215
  websocket-driver (0.7.5)
212
216
  websocket-extensions (>= 0.1.0)
213
217
  websocket-extensions (0.1.5)
214
- zeitwerk (2.5.3)
218
+ zeitwerk (2.5.4)
215
219
 
216
220
  PLATFORMS
217
221
  ruby
218
222
 
219
223
  DEPENDENCIES
220
224
  cloudenvoy!
221
- puma (~> 5.5.2)
225
+ puma (~> 5.6.4)
222
226
  rails (~> 6.0.2)
223
227
  sqlite3
224
228
 
@@ -12,6 +12,10 @@
12
12
  HelloPublisher.publish('Some message')
13
13
  ```
14
14
  7. Tail the logs to see how message get processed by `HelloSubscriber`
15
+ 8. Try sending multiple messages at once:
16
+ ```ruby
17
+ HelloPublisher.publish_all(['message1', 'message2', 'message3'])
18
+ ```
15
19
 
16
20
  ## Run using GCP Pub/Sub
17
21
 
@@ -11,6 +11,6 @@ class HelloSubscriber
11
11
  # @param [Cloudenvoy::Message] message The message to process.
12
12
  #
13
13
  def process(message)
14
- logger.info("Received message #{message.payload.dig('content')}")
14
+ logger.info("Received message #{message.payload['content']}")
15
15
  end
16
16
  end
@@ -83,7 +83,7 @@ Rails.application.configure do
83
83
  # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
84
84
 
85
85
  if ENV['RAILS_LOG_TO_STDOUT'].present?
86
- logger = ActiveSupport::Logger.new(STDOUT)
86
+ logger = ActiveSupport::Logger.new($stdout)
87
87
  logger.formatter = config.log_formatter
88
88
  config.logger = ActiveSupport::TaggedLogging.new(logger)
89
89
  end
@@ -6,17 +6,17 @@
6
6
  # the maximum value specified for Puma. Default is set to 5 threads for minimum
7
7
  # and maximum; this matches the default thread size of Active Record.
8
8
  #
9
- max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
9
+ max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5)
10
10
  min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
11
11
  threads min_threads_count, max_threads_count
12
12
 
13
13
  # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
14
14
  #
15
- port ENV.fetch('PORT') { 3000 }
15
+ port ENV.fetch('PORT', 3000)
16
16
 
17
17
  # Specifies the `environment` that Puma will run in.
18
18
  #
19
- environment ENV.fetch('RAILS_ENV') { 'development' }
19
+ environment ENV.fetch('RAILS_ENV', 'development')
20
20
 
21
21
  # Specifies the number of `workers` to boot in clustered mode.
22
22
  # Workers are forked web server processes. If using threads and workers together
@@ -9,7 +9,7 @@ ruby '3.0.0'
9
9
  gem 'sinatra'
10
10
 
11
11
  # Server
12
- gem 'puma', '~> 5.5.2'
12
+ gem 'puma', '~> 5.6.4'
13
13
 
14
14
  # Support rake tasks
15
15
  gem 'rake'