cloudenvoy 0.3.0 → 0.4.2
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/test.yml +4 -0
- data/.gitignore +3 -0
- data/Appraisals +16 -0
- data/CHANGELOG.md +29 -0
- data/README.md +4 -4
- data/app/controllers/cloudenvoy/subscriber_controller.rb +6 -5
- data/cloudenvoy.gemspec +1 -0
- data/examples/rails/Gemfile.lock +125 -106
- data/examples/sinatra/Gemfile +15 -0
- data/examples/sinatra/Gemfile.lock +127 -0
- data/examples/sinatra/Procfile +1 -0
- data/examples/sinatra/README.md +41 -0
- data/examples/sinatra/app/publishers/hello_publisher.rb +34 -0
- data/examples/sinatra/app/subscribers/hello_subscriber.rb +16 -0
- data/examples/sinatra/app.rb +40 -0
- data/examples/sinatra/bin/console +8 -0
- data/examples/sinatra/config/initializers/cloudenvoy.rb +30 -0
- data/gemfiles/rails_5.2.gemfile.lock +89 -73
- data/gemfiles/rails_6.0.gemfile.lock +90 -74
- data/gemfiles/semantic_logger_3.4.gemfile +7 -0
- data/gemfiles/semantic_logger_3.4.gemfile.lock +279 -0
- data/gemfiles/semantic_logger_4.6.gemfile +7 -0
- data/gemfiles/semantic_logger_4.6.gemfile.lock +279 -0
- data/gemfiles/semantic_logger_4.7.0.gemfile +7 -0
- data/gemfiles/semantic_logger_4.7.0.gemfile.lock +279 -0
- data/gemfiles/semantic_logger_4.7.2.gemfile +7 -0
- data/gemfiles/semantic_logger_4.7.2.gemfile.lock +279 -0
- data/lib/cloudenvoy/backend/google_pub_sub.rb +16 -1
- data/lib/cloudenvoy/logger_wrapper.rb +1 -1
- data/lib/cloudenvoy/message.rb +2 -2
- data/lib/cloudenvoy/publisher.rb +1 -0
- data/lib/cloudenvoy/subscriber.rb +3 -2
- data/lib/cloudenvoy/version.rb +1 -1
- data/lib/generators/cloudenvoy/publisher_generator.rb +46 -0
- data/lib/generators/cloudenvoy/subscriber_generator.rb +46 -0
- data/lib/generators/cloudenvoy/templates/publisher.rb.erb +11 -0
- data/lib/generators/cloudenvoy/templates/publisher_spec.rb.erb +6 -0
- data/lib/generators/cloudenvoy/templates/subscriber.rb.erb +11 -0
- data/lib/generators/cloudenvoy/templates/subscriber_spec.rb.erb +6 -0
- data/lib/tasks/cloudenvoy.rake +4 -4
- metadata +42 -7
- data/Gemfile.lock +0 -264
- data/app/controllers/cloudenvoy/application_controller.rb +0 -8
@@ -0,0 +1,279 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
cloudenvoy (0.4.1)
|
5
|
+
activesupport
|
6
|
+
google-cloud-pubsub (~> 2.0)
|
7
|
+
jwt
|
8
|
+
retriable
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
actioncable (6.1.3.1)
|
14
|
+
actionpack (= 6.1.3.1)
|
15
|
+
activesupport (= 6.1.3.1)
|
16
|
+
nio4r (~> 2.0)
|
17
|
+
websocket-driver (>= 0.6.1)
|
18
|
+
actionmailbox (6.1.3.1)
|
19
|
+
actionpack (= 6.1.3.1)
|
20
|
+
activejob (= 6.1.3.1)
|
21
|
+
activerecord (= 6.1.3.1)
|
22
|
+
activestorage (= 6.1.3.1)
|
23
|
+
activesupport (= 6.1.3.1)
|
24
|
+
mail (>= 2.7.1)
|
25
|
+
actionmailer (6.1.3.1)
|
26
|
+
actionpack (= 6.1.3.1)
|
27
|
+
actionview (= 6.1.3.1)
|
28
|
+
activejob (= 6.1.3.1)
|
29
|
+
activesupport (= 6.1.3.1)
|
30
|
+
mail (~> 2.5, >= 2.5.4)
|
31
|
+
rails-dom-testing (~> 2.0)
|
32
|
+
actionpack (6.1.3.1)
|
33
|
+
actionview (= 6.1.3.1)
|
34
|
+
activesupport (= 6.1.3.1)
|
35
|
+
rack (~> 2.0, >= 2.0.9)
|
36
|
+
rack-test (>= 0.6.3)
|
37
|
+
rails-dom-testing (~> 2.0)
|
38
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
39
|
+
actiontext (6.1.3.1)
|
40
|
+
actionpack (= 6.1.3.1)
|
41
|
+
activerecord (= 6.1.3.1)
|
42
|
+
activestorage (= 6.1.3.1)
|
43
|
+
activesupport (= 6.1.3.1)
|
44
|
+
nokogiri (>= 1.8.5)
|
45
|
+
actionview (6.1.3.1)
|
46
|
+
activesupport (= 6.1.3.1)
|
47
|
+
builder (~> 3.1)
|
48
|
+
erubi (~> 1.4)
|
49
|
+
rails-dom-testing (~> 2.0)
|
50
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
51
|
+
activejob (6.1.3.1)
|
52
|
+
activesupport (= 6.1.3.1)
|
53
|
+
globalid (>= 0.3.6)
|
54
|
+
activemodel (6.1.3.1)
|
55
|
+
activesupport (= 6.1.3.1)
|
56
|
+
activerecord (6.1.3.1)
|
57
|
+
activemodel (= 6.1.3.1)
|
58
|
+
activesupport (= 6.1.3.1)
|
59
|
+
activestorage (6.1.3.1)
|
60
|
+
actionpack (= 6.1.3.1)
|
61
|
+
activejob (= 6.1.3.1)
|
62
|
+
activerecord (= 6.1.3.1)
|
63
|
+
activesupport (= 6.1.3.1)
|
64
|
+
marcel (~> 1.0.0)
|
65
|
+
mini_mime (~> 1.0.2)
|
66
|
+
activesupport (6.1.3.1)
|
67
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
68
|
+
i18n (>= 1.6, < 2)
|
69
|
+
minitest (>= 5.1)
|
70
|
+
tzinfo (~> 2.0)
|
71
|
+
zeitwerk (~> 2.3)
|
72
|
+
addressable (2.7.0)
|
73
|
+
public_suffix (>= 2.0.2, < 5.0)
|
74
|
+
appraisal (2.4.0)
|
75
|
+
bundler
|
76
|
+
rake
|
77
|
+
thor (>= 0.14.0)
|
78
|
+
ast (2.4.2)
|
79
|
+
builder (3.2.4)
|
80
|
+
concurrent-ruby (1.1.8)
|
81
|
+
crack (0.4.5)
|
82
|
+
rexml
|
83
|
+
crass (1.0.6)
|
84
|
+
diff-lcs (1.4.4)
|
85
|
+
erubi (1.10.0)
|
86
|
+
faraday (1.4.1)
|
87
|
+
faraday-excon (~> 1.1)
|
88
|
+
faraday-net_http (~> 1.0)
|
89
|
+
faraday-net_http_persistent (~> 1.1)
|
90
|
+
multipart-post (>= 1.2, < 3)
|
91
|
+
ruby2_keywords (>= 0.0.4)
|
92
|
+
faraday-excon (1.1.0)
|
93
|
+
faraday-net_http (1.0.1)
|
94
|
+
faraday-net_http_persistent (1.1.0)
|
95
|
+
gapic-common (0.4.1)
|
96
|
+
faraday (~> 1.3)
|
97
|
+
google-protobuf (~> 3.15, >= 3.15.2)
|
98
|
+
googleapis-common-protos (>= 1.3.11, < 2.0)
|
99
|
+
googleapis-common-protos-types (>= 1.0.6, < 2.0)
|
100
|
+
googleauth (~> 0.15, >= 0.15.1)
|
101
|
+
grpc (~> 1.36)
|
102
|
+
globalid (0.4.2)
|
103
|
+
activesupport (>= 4.2.0)
|
104
|
+
google-cloud-core (1.6.0)
|
105
|
+
google-cloud-env (~> 1.0)
|
106
|
+
google-cloud-errors (~> 1.0)
|
107
|
+
google-cloud-env (1.5.0)
|
108
|
+
faraday (>= 0.17.3, < 2.0)
|
109
|
+
google-cloud-errors (1.1.0)
|
110
|
+
google-cloud-pubsub (2.5.0)
|
111
|
+
concurrent-ruby (~> 1.1)
|
112
|
+
google-cloud-core (~> 1.5)
|
113
|
+
google-cloud-pubsub-v1 (~> 0.0)
|
114
|
+
google-cloud-pubsub-v1 (0.4.0)
|
115
|
+
gapic-common (~> 0.3)
|
116
|
+
google-cloud-errors (~> 1.0)
|
117
|
+
grpc-google-iam-v1 (>= 0.6.10, < 2.0)
|
118
|
+
google-protobuf (3.15.8)
|
119
|
+
googleapis-common-protos (1.3.11)
|
120
|
+
google-protobuf (~> 3.14)
|
121
|
+
googleapis-common-protos-types (>= 1.0.6, < 2.0)
|
122
|
+
grpc (~> 1.27)
|
123
|
+
googleapis-common-protos-types (1.0.6)
|
124
|
+
google-protobuf (~> 3.14)
|
125
|
+
googleauth (0.16.1)
|
126
|
+
faraday (>= 0.17.3, < 2.0)
|
127
|
+
jwt (>= 1.4, < 3.0)
|
128
|
+
memoist (~> 0.16)
|
129
|
+
multi_json (~> 1.11)
|
130
|
+
os (>= 0.9, < 2.0)
|
131
|
+
signet (~> 0.14)
|
132
|
+
grpc (1.37.0)
|
133
|
+
google-protobuf (~> 3.15)
|
134
|
+
googleapis-common-protos-types (~> 1.0)
|
135
|
+
grpc-google-iam-v1 (0.6.11)
|
136
|
+
google-protobuf (~> 3.14)
|
137
|
+
googleapis-common-protos (>= 1.3.11, < 2.0)
|
138
|
+
grpc (~> 1.27)
|
139
|
+
hashdiff (1.0.1)
|
140
|
+
i18n (1.8.10)
|
141
|
+
concurrent-ruby (~> 1.0)
|
142
|
+
jaro_winkler (1.5.4)
|
143
|
+
jwt (2.2.2)
|
144
|
+
loofah (2.9.1)
|
145
|
+
crass (~> 1.0.2)
|
146
|
+
nokogiri (>= 1.5.9)
|
147
|
+
mail (2.7.1)
|
148
|
+
mini_mime (>= 0.1.1)
|
149
|
+
marcel (1.0.1)
|
150
|
+
memoist (0.16.2)
|
151
|
+
method_source (1.0.0)
|
152
|
+
mini_mime (1.0.3)
|
153
|
+
mini_portile2 (2.5.0)
|
154
|
+
minitest (5.14.4)
|
155
|
+
multi_json (1.15.0)
|
156
|
+
multipart-post (2.1.1)
|
157
|
+
nio4r (2.5.7)
|
158
|
+
nokogiri (1.11.3)
|
159
|
+
mini_portile2 (~> 2.5.0)
|
160
|
+
racc (~> 1.4)
|
161
|
+
os (1.1.1)
|
162
|
+
parallel (1.20.1)
|
163
|
+
parser (3.0.1.0)
|
164
|
+
ast (~> 2.4.1)
|
165
|
+
public_suffix (4.0.6)
|
166
|
+
racc (1.5.2)
|
167
|
+
rack (2.2.3)
|
168
|
+
rack-test (1.1.0)
|
169
|
+
rack (>= 1.0, < 3)
|
170
|
+
rails (6.1.3.1)
|
171
|
+
actioncable (= 6.1.3.1)
|
172
|
+
actionmailbox (= 6.1.3.1)
|
173
|
+
actionmailer (= 6.1.3.1)
|
174
|
+
actionpack (= 6.1.3.1)
|
175
|
+
actiontext (= 6.1.3.1)
|
176
|
+
actionview (= 6.1.3.1)
|
177
|
+
activejob (= 6.1.3.1)
|
178
|
+
activemodel (= 6.1.3.1)
|
179
|
+
activerecord (= 6.1.3.1)
|
180
|
+
activestorage (= 6.1.3.1)
|
181
|
+
activesupport (= 6.1.3.1)
|
182
|
+
bundler (>= 1.15.0)
|
183
|
+
railties (= 6.1.3.1)
|
184
|
+
sprockets-rails (>= 2.0.0)
|
185
|
+
rails-dom-testing (2.0.3)
|
186
|
+
activesupport (>= 4.2.0)
|
187
|
+
nokogiri (>= 1.6)
|
188
|
+
rails-html-sanitizer (1.3.0)
|
189
|
+
loofah (~> 2.3)
|
190
|
+
railties (6.1.3.1)
|
191
|
+
actionpack (= 6.1.3.1)
|
192
|
+
activesupport (= 6.1.3.1)
|
193
|
+
method_source
|
194
|
+
rake (>= 0.8.7)
|
195
|
+
thor (~> 1.0)
|
196
|
+
rainbow (3.0.0)
|
197
|
+
rake (13.0.3)
|
198
|
+
retriable (3.1.2)
|
199
|
+
rexml (3.2.5)
|
200
|
+
rspec (3.10.0)
|
201
|
+
rspec-core (~> 3.10.0)
|
202
|
+
rspec-expectations (~> 3.10.0)
|
203
|
+
rspec-mocks (~> 3.10.0)
|
204
|
+
rspec-core (3.10.1)
|
205
|
+
rspec-support (~> 3.10.0)
|
206
|
+
rspec-expectations (3.10.1)
|
207
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
208
|
+
rspec-support (~> 3.10.0)
|
209
|
+
rspec-mocks (3.10.2)
|
210
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
211
|
+
rspec-support (~> 3.10.0)
|
212
|
+
rspec-rails (5.0.1)
|
213
|
+
actionpack (>= 5.2)
|
214
|
+
activesupport (>= 5.2)
|
215
|
+
railties (>= 5.2)
|
216
|
+
rspec-core (~> 3.10)
|
217
|
+
rspec-expectations (~> 3.10)
|
218
|
+
rspec-mocks (~> 3.10)
|
219
|
+
rspec-support (~> 3.10)
|
220
|
+
rspec-support (3.10.2)
|
221
|
+
rubocop (0.76.0)
|
222
|
+
jaro_winkler (~> 1.5.1)
|
223
|
+
parallel (~> 1.10)
|
224
|
+
parser (>= 2.6)
|
225
|
+
rainbow (>= 2.2.2, < 4.0)
|
226
|
+
ruby-progressbar (~> 1.7)
|
227
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
228
|
+
rubocop-rspec (1.37.0)
|
229
|
+
rubocop (>= 0.68.1)
|
230
|
+
ruby-progressbar (1.11.0)
|
231
|
+
ruby2_keywords (0.0.4)
|
232
|
+
semantic_logger (4.7.2)
|
233
|
+
concurrent-ruby (~> 1.0)
|
234
|
+
signet (0.15.0)
|
235
|
+
addressable (~> 2.3)
|
236
|
+
faraday (>= 0.17.3, < 2.0)
|
237
|
+
jwt (>= 1.5, < 3.0)
|
238
|
+
multi_json (~> 1.10)
|
239
|
+
sprockets (4.0.2)
|
240
|
+
concurrent-ruby (~> 1.0)
|
241
|
+
rack (> 1, < 3)
|
242
|
+
sprockets-rails (3.2.2)
|
243
|
+
actionpack (>= 4.0)
|
244
|
+
activesupport (>= 4.0)
|
245
|
+
sprockets (>= 3.0.0)
|
246
|
+
sqlite3 (1.4.2)
|
247
|
+
thor (1.1.0)
|
248
|
+
timecop (0.9.4)
|
249
|
+
tzinfo (2.0.4)
|
250
|
+
concurrent-ruby (~> 1.0)
|
251
|
+
unicode-display_width (1.6.1)
|
252
|
+
webmock (3.12.2)
|
253
|
+
addressable (>= 2.3.6)
|
254
|
+
crack (>= 0.3.2)
|
255
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
256
|
+
websocket-driver (0.7.3)
|
257
|
+
websocket-extensions (>= 0.1.0)
|
258
|
+
websocket-extensions (0.1.5)
|
259
|
+
zeitwerk (2.4.2)
|
260
|
+
|
261
|
+
PLATFORMS
|
262
|
+
ruby
|
263
|
+
|
264
|
+
DEPENDENCIES
|
265
|
+
appraisal
|
266
|
+
cloudenvoy!
|
267
|
+
rails
|
268
|
+
rake (>= 12.3.3)
|
269
|
+
rspec (~> 3.0)
|
270
|
+
rspec-rails
|
271
|
+
rubocop (= 0.76.0)
|
272
|
+
rubocop-rspec (= 1.37.0)
|
273
|
+
semantic_logger (= 4.7.2)
|
274
|
+
sqlite3
|
275
|
+
timecop
|
276
|
+
webmock
|
277
|
+
|
278
|
+
BUNDLED WITH
|
279
|
+
2.2.9
|
@@ -17,6 +17,15 @@ module Cloudenvoy
|
|
17
17
|
Cloudenvoy.config
|
18
18
|
end
|
19
19
|
|
20
|
+
#
|
21
|
+
# Return true if the current config mode is development.
|
22
|
+
#
|
23
|
+
# @return [Boolean] True if Cloudenvoy is run in development mode.
|
24
|
+
#
|
25
|
+
def development?
|
26
|
+
config.mode == :development
|
27
|
+
end
|
28
|
+
|
20
29
|
#
|
21
30
|
# Return the backend to use for sending messages.
|
22
31
|
#
|
@@ -25,7 +34,7 @@ module Cloudenvoy
|
|
25
34
|
def backend
|
26
35
|
@backend ||= Google::Cloud::PubSub.new({
|
27
36
|
project_id: config.gcp_project_id,
|
28
|
-
emulator_host:
|
37
|
+
emulator_host: development? ? Cloudenvoy::Config::EMULATOR_HOST : nil
|
29
38
|
}.compact)
|
30
39
|
end
|
31
40
|
|
@@ -88,6 +97,12 @@ module Cloudenvoy
|
|
88
97
|
def upsert_subscription(topic, name, opts = {})
|
89
98
|
sub_config = opts.to_h.merge(endpoint: webhook_url)
|
90
99
|
|
100
|
+
# Auto-create topic in development. In non-development environments
|
101
|
+
# the create subscription action raises an error if the topic does
|
102
|
+
# not exist
|
103
|
+
upsert_topic(topic) if development?
|
104
|
+
|
105
|
+
# Create subscription
|
91
106
|
ps_sub =
|
92
107
|
begin
|
93
108
|
# Retrieve the topic
|
@@ -153,7 +153,7 @@ module Cloudenvoy
|
|
153
153
|
#
|
154
154
|
def log_message(level, msg, &block)
|
155
155
|
# Merge log-specific context into object-specific context
|
156
|
-
payload_block = -> { log_block.call.merge(block&.call || {}) }
|
156
|
+
payload_block = ->(*_args) { log_block.call.merge(block&.call || {}) }
|
157
157
|
|
158
158
|
# ActiveSupport::Logger does not support passing a payload through a block on top
|
159
159
|
# of a message.
|
data/lib/cloudenvoy/message.rb
CHANGED
data/lib/cloudenvoy/publisher.rb
CHANGED
@@ -53,7 +53,7 @@ module Cloudenvoy
|
|
53
53
|
# @return [Array<String,String>] A tuple [subscriber_name, topic ]
|
54
54
|
#
|
55
55
|
def self.parse_sub_uri(sub_uri)
|
56
|
-
sub_uri.split('/').last.split('.').last(2)
|
56
|
+
sub_uri.split('/').last.split('.', 2).last.split('.', 2)
|
57
57
|
end
|
58
58
|
|
59
59
|
#
|
@@ -211,8 +211,9 @@ module Cloudenvoy
|
|
211
211
|
begin
|
212
212
|
process(message)
|
213
213
|
rescue StandardError => e
|
214
|
+
logger.error([e, e.backtrace.join("\n")].join("\n"))
|
214
215
|
try(:on_error, e)
|
215
|
-
|
216
|
+
raise(e)
|
216
217
|
end
|
217
218
|
end
|
218
219
|
ensure
|
data/lib/cloudenvoy/version.rb
CHANGED
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/named_base'
|
4
|
+
|
5
|
+
module Cloudenvoy
|
6
|
+
module Generators # :nodoc:
|
7
|
+
class PublisherGenerator < ::Rails::Generators::NamedBase # :nodoc:
|
8
|
+
desc 'This generator creates a CloudEnvoy in app/publishers and a corresponding test'
|
9
|
+
|
10
|
+
check_class_collision suffix: 'Publisher'
|
11
|
+
|
12
|
+
def self.default_generator_root
|
13
|
+
File.dirname(__FILE__)
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_publisher_file
|
17
|
+
template 'publisher.rb.erb', File.join('app/publishers', class_path, "#{file_name}_publisher.rb")
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_test_file
|
21
|
+
return unless test_framework
|
22
|
+
|
23
|
+
create_publisher_spec if test_framework == :rspec
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def create_publisher_spec
|
29
|
+
template_file = File.join(
|
30
|
+
'spec/publishers',
|
31
|
+
class_path,
|
32
|
+
"#{file_name}_publisher_spec.rb"
|
33
|
+
)
|
34
|
+
template 'publisher_spec.rb.erb', template_file
|
35
|
+
end
|
36
|
+
|
37
|
+
def file_name
|
38
|
+
@file_name ||= super.sub(/_?publisher\z/i, '')
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_framework
|
42
|
+
::Rails.application.config.generators.options[:rails][:test_framework]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/named_base'
|
4
|
+
|
5
|
+
module Cloudenvoy
|
6
|
+
module Generators # :nodoc:
|
7
|
+
class SubscriberGenerator < ::Rails::Generators::NamedBase # :nodoc:
|
8
|
+
desc 'This generator creates a CloudEnvoy in app/subscribers and a corresponding test'
|
9
|
+
|
10
|
+
check_class_collision suffix: 'Subscriber'
|
11
|
+
|
12
|
+
def self.default_generator_root
|
13
|
+
File.dirname(__FILE__)
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_subscriber_file
|
17
|
+
template 'subscriber.rb.erb', File.join('app/subscribers', class_path, "#{file_name}_subscriber.rb")
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_test_file
|
21
|
+
return unless test_framework
|
22
|
+
|
23
|
+
create_subscriber_spec if test_framework == :rspec
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def create_subscriber_spec
|
29
|
+
template_file = File.join(
|
30
|
+
'spec/subscribers',
|
31
|
+
class_path,
|
32
|
+
"#{file_name}_subscriber_spec.rb"
|
33
|
+
)
|
34
|
+
template 'subscriber_spec.rb.erb', template_file
|
35
|
+
end
|
36
|
+
|
37
|
+
def file_name
|
38
|
+
@file_name ||= super.sub(/_?subscriber\z/i, '')
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_framework
|
42
|
+
::Rails.application.config.generators.options[:rails][:test_framework]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/tasks/cloudenvoy.rake
CHANGED
@@ -23,8 +23,8 @@ namespace :cloudenvoy do
|
|
23
23
|
|
24
24
|
# Notify user when no suscribers
|
25
25
|
if list.empty?
|
26
|
-
puts '
|
27
|
-
|
26
|
+
puts 'Skipping subscribers (none defined)'
|
27
|
+
next
|
28
28
|
end
|
29
29
|
|
30
30
|
puts 'The following subscribers are configured:'
|
@@ -47,8 +47,8 @@ namespace :cloudenvoy do
|
|
47
47
|
|
48
48
|
# Notify user when no topics
|
49
49
|
if list.empty?
|
50
|
-
puts '
|
51
|
-
|
50
|
+
puts 'Skipping publishers (none defined)'
|
51
|
+
next
|
52
52
|
end
|
53
53
|
|
54
54
|
puts 'The following topics are configured:'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudenvoy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnaud Lachaume
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 1.37.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: semantic_logger
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: timecop
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -221,11 +235,9 @@ files:
|
|
221
235
|
- CHANGELOG.md
|
222
236
|
- CODE_OF_CONDUCT.md
|
223
237
|
- Gemfile
|
224
|
-
- Gemfile.lock
|
225
238
|
- LICENSE.txt
|
226
239
|
- README.md
|
227
240
|
- Rakefile
|
228
|
-
- app/controllers/cloudenvoy/application_controller.rb
|
229
241
|
- app/controllers/cloudenvoy/subscriber_controller.rb
|
230
242
|
- bin/console
|
231
243
|
- bin/setup
|
@@ -297,10 +309,27 @@ files:
|
|
297
309
|
- examples/rails/storage/.keep
|
298
310
|
- examples/rails/tmp/.keep
|
299
311
|
- examples/rails/tmp/development_secret.txt
|
312
|
+
- examples/sinatra/Gemfile
|
313
|
+
- examples/sinatra/Gemfile.lock
|
314
|
+
- examples/sinatra/Procfile
|
315
|
+
- examples/sinatra/README.md
|
316
|
+
- examples/sinatra/app.rb
|
317
|
+
- examples/sinatra/app/publishers/hello_publisher.rb
|
318
|
+
- examples/sinatra/app/subscribers/hello_subscriber.rb
|
319
|
+
- examples/sinatra/bin/console
|
320
|
+
- examples/sinatra/config/initializers/cloudenvoy.rb
|
300
321
|
- gemfiles/rails_5.2.gemfile
|
301
322
|
- gemfiles/rails_5.2.gemfile.lock
|
302
323
|
- gemfiles/rails_6.0.gemfile
|
303
324
|
- gemfiles/rails_6.0.gemfile.lock
|
325
|
+
- gemfiles/semantic_logger_3.4.gemfile
|
326
|
+
- gemfiles/semantic_logger_3.4.gemfile.lock
|
327
|
+
- gemfiles/semantic_logger_4.6.gemfile
|
328
|
+
- gemfiles/semantic_logger_4.6.gemfile.lock
|
329
|
+
- gemfiles/semantic_logger_4.7.0.gemfile
|
330
|
+
- gemfiles/semantic_logger_4.7.0.gemfile.lock
|
331
|
+
- gemfiles/semantic_logger_4.7.2.gemfile
|
332
|
+
- gemfiles/semantic_logger_4.7.2.gemfile.lock
|
304
333
|
- lib/cloudenvoy.rb
|
305
334
|
- lib/cloudenvoy/authentication_error.rb
|
306
335
|
- lib/cloudenvoy/authenticator.rb
|
@@ -321,6 +350,12 @@ files:
|
|
321
350
|
- lib/cloudenvoy/testing.rb
|
322
351
|
- lib/cloudenvoy/topic.rb
|
323
352
|
- lib/cloudenvoy/version.rb
|
353
|
+
- lib/generators/cloudenvoy/publisher_generator.rb
|
354
|
+
- lib/generators/cloudenvoy/subscriber_generator.rb
|
355
|
+
- lib/generators/cloudenvoy/templates/publisher.rb.erb
|
356
|
+
- lib/generators/cloudenvoy/templates/publisher_spec.rb.erb
|
357
|
+
- lib/generators/cloudenvoy/templates/subscriber.rb.erb
|
358
|
+
- lib/generators/cloudenvoy/templates/subscriber_spec.rb.erb
|
324
359
|
- lib/tasks/cloudenvoy.rake
|
325
360
|
homepage: https://github.com/keypup-io/cloudenvoy
|
326
361
|
licenses:
|
@@ -329,7 +364,7 @@ metadata:
|
|
329
364
|
homepage_uri: https://github.com/keypup-io/cloudenvoy
|
330
365
|
source_code_uri: https://github.com/keypup-io/cloudenvoy
|
331
366
|
changelog_uri: https://github.com/keypup-io/cloudenvoy/master/tree/CHANGELOG.md
|
332
|
-
post_install_message:
|
367
|
+
post_install_message:
|
333
368
|
rdoc_options: []
|
334
369
|
require_paths:
|
335
370
|
- lib
|
@@ -345,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
345
380
|
version: '0'
|
346
381
|
requirements: []
|
347
382
|
rubygems_version: 3.0.0
|
348
|
-
signing_key:
|
383
|
+
signing_key:
|
349
384
|
specification_version: 4
|
350
385
|
summary: Cross-application messaging using GCP Pub/Sub (alpha)
|
351
386
|
test_files: []
|