action_mailer_kafka 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +158 -0
  3. data/.gitignore +18 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +64 -0
  6. data/Appraisals +21 -0
  7. data/CHANGELOG.md +6 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE.md +23 -0
  10. data/README.md +138 -0
  11. data/Rakefile +6 -0
  12. data/action_mailer_kafka.gemspec +52 -0
  13. data/bin/console +14 -0
  14. data/bin/setup +8 -0
  15. data/example/.gitignore +21 -0
  16. data/example/Gemfile +39 -0
  17. data/example/README.rdoc +10 -0
  18. data/example/Rakefile +6 -0
  19. data/example/app/assets/images/.keep +0 -0
  20. data/example/app/assets/javascripts/application.js +16 -0
  21. data/example/app/assets/javascripts/users.js.coffee +3 -0
  22. data/example/app/assets/stylesheets/application.css +15 -0
  23. data/example/app/assets/stylesheets/scaffolds.css.scss +69 -0
  24. data/example/app/assets/stylesheets/users.css.scss +3 -0
  25. data/example/app/controllers/application_controller.rb +5 -0
  26. data/example/app/controllers/concerns/.keep +0 -0
  27. data/example/app/controllers/users_controller.rb +82 -0
  28. data/example/app/helpers/application_helper.rb +2 -0
  29. data/example/app/helpers/users_helper.rb +2 -0
  30. data/example/app/jobs/send_email_job.rb +8 -0
  31. data/example/app/mailers/.keep +0 -0
  32. data/example/app/mailers/example_mailer.rb +6 -0
  33. data/example/app/models/.keep +0 -0
  34. data/example/app/models/concerns/.keep +0 -0
  35. data/example/app/models/user.rb +2 -0
  36. data/example/app/views/example_mailer/sample_email.html.erb +398 -0
  37. data/example/app/views/example_mailer/sample_email.text.erb +2 -0
  38. data/example/app/views/layouts/application.html.erb +14 -0
  39. data/example/app/views/users/_form.html.erb +25 -0
  40. data/example/app/views/users/edit.html.erb +6 -0
  41. data/example/app/views/users/index.html.erb +27 -0
  42. data/example/app/views/users/index.json.jbuilder +4 -0
  43. data/example/app/views/users/new.html.erb +5 -0
  44. data/example/app/views/users/show.html.erb +14 -0
  45. data/example/app/views/users/show.json.jbuilder +1 -0
  46. data/example/config/application.rb +23 -0
  47. data/example/config/boot.rb +4 -0
  48. data/example/config/database.yml +11 -0
  49. data/example/config/environment.rb +5 -0
  50. data/example/config/environments/development.rb +43 -0
  51. data/example/config/environments/production.rb +105 -0
  52. data/example/config/environments/test.rb +39 -0
  53. data/example/config/initializers/backtrace_silencers.rb +7 -0
  54. data/example/config/initializers/cookies_serializer.rb +3 -0
  55. data/example/config/initializers/filter_parameter_logging.rb +4 -0
  56. data/example/config/initializers/inflections.rb +16 -0
  57. data/example/config/initializers/mime_types.rb +4 -0
  58. data/example/config/initializers/session_store.rb +3 -0
  59. data/example/config/initializers/wrap_parameters.rb +14 -0
  60. data/example/config/locales/en.yml +23 -0
  61. data/example/config/routes.rb +4 -0
  62. data/example/config/secrets.yml +22 -0
  63. data/example/config.ru +4 -0
  64. data/example/db/migrate/20141111080045_create_users.rb +10 -0
  65. data/example/db/migrate/20141115060216_create_delayed_jobs.rb +22 -0
  66. data/example/db/schema.rb +40 -0
  67. data/example/db/seeds.rb +7 -0
  68. data/example/public/404.html +67 -0
  69. data/example/public/422.html +67 -0
  70. data/example/public/500.html +66 -0
  71. data/example/public/favicon.ico +0 -0
  72. data/example/public/robots.txt +5 -0
  73. data/example/vendor/assets/javascripts/.keep +0 -0
  74. data/example/vendor/assets/stylesheets/.keep +0 -0
  75. data/gemfiles/.bundle/config +2 -0
  76. data/gemfiles/mail_2_5.gemfile +7 -0
  77. data/gemfiles/mail_2_6.gemfile +7 -0
  78. data/gemfiles/mail_2_7.gemfile +7 -0
  79. data/gemfiles/rails_4.gemfile +7 -0
  80. data/gemfiles/rails_5.gemfile +7 -0
  81. data/lib/action_mailer_kafka/delivery_method.rb +139 -0
  82. data/lib/action_mailer_kafka/error.rb +22 -0
  83. data/lib/action_mailer_kafka/railtie.rb +7 -0
  84. data/lib/action_mailer_kafka/version.rb +3 -0
  85. data/lib/action_mailer_kafka.rb +10 -0
  86. data/logo.png +0 -0
  87. metadata +328 -0
@@ -0,0 +1,22 @@
1
+ module ActionMailerKafka
2
+ class Error < StandardError
3
+ end
4
+
5
+ class RequiredParamsError < Error
6
+ def initialize(settings_params, msg)
7
+ super("Some required settings are missing: #{msg}. Original config: #{settings_params}")
8
+ end
9
+ end
10
+
11
+ class KafkaOperationError < Error
12
+ def initialize(msg)
13
+ super(msg)
14
+ end
15
+ end
16
+
17
+ class ParsingOperationError < Error
18
+ def initialize(msg)
19
+ super(msg)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,7 @@
1
+ module ActionMailerKafka
2
+ class Railtie < Rails::Railtie
3
+ initializer 'action_mailer_kafka.add_delivery_method', before: 'action_mailer.set_configs' do
4
+ ActionMailer::Base.add_delivery_method :action_mailer_kafka, ActionMailerKafka::DeliveryMethod
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module ActionMailerKafka
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -0,0 +1,10 @@
1
+ require 'json'
2
+ require 'kafka'
3
+ require 'mail'
4
+ require 'action_mailer_kafka/error'
5
+ require 'action_mailer_kafka/railtie' if defined? Rails
6
+ require 'action_mailer_kafka/delivery_method'
7
+ require 'action_mailer_kafka/version'
8
+
9
+ module ActionMailerKafka
10
+ end
data/logo.png ADDED
Binary file
metadata ADDED
@@ -0,0 +1,328 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: action_mailer_kafka
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Luong Vo
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-06-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mail
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby-kafka
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.7.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: appraisal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: faraday
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rspec-json_expectations
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'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubycritic
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: simplecov
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ description: |-
210
+ This gem defines a way for Rails service or other backends to \
211
+ define a mailer that sends email to our employemt hero mail service.
212
+ email:
213
+ - vo.tran.thanh.luong@gmail.com
214
+ executables: []
215
+ extensions: []
216
+ extra_rdoc_files: []
217
+ files:
218
+ - ".circleci/config.yml"
219
+ - ".gitignore"
220
+ - ".rspec"
221
+ - ".rubocop.yml"
222
+ - Appraisals
223
+ - CHANGELOG.md
224
+ - Gemfile
225
+ - LICENSE.md
226
+ - README.md
227
+ - Rakefile
228
+ - action_mailer_kafka.gemspec
229
+ - bin/console
230
+ - bin/setup
231
+ - example/.gitignore
232
+ - example/Gemfile
233
+ - example/README.rdoc
234
+ - example/Rakefile
235
+ - example/app/assets/images/.keep
236
+ - example/app/assets/javascripts/application.js
237
+ - example/app/assets/javascripts/users.js.coffee
238
+ - example/app/assets/stylesheets/application.css
239
+ - example/app/assets/stylesheets/scaffolds.css.scss
240
+ - example/app/assets/stylesheets/users.css.scss
241
+ - example/app/controllers/application_controller.rb
242
+ - example/app/controllers/concerns/.keep
243
+ - example/app/controllers/users_controller.rb
244
+ - example/app/helpers/application_helper.rb
245
+ - example/app/helpers/users_helper.rb
246
+ - example/app/jobs/send_email_job.rb
247
+ - example/app/mailers/.keep
248
+ - example/app/mailers/example_mailer.rb
249
+ - example/app/models/.keep
250
+ - example/app/models/concerns/.keep
251
+ - example/app/models/user.rb
252
+ - example/app/views/example_mailer/sample_email.html.erb
253
+ - example/app/views/example_mailer/sample_email.text.erb
254
+ - example/app/views/layouts/application.html.erb
255
+ - example/app/views/users/_form.html.erb
256
+ - example/app/views/users/edit.html.erb
257
+ - example/app/views/users/index.html.erb
258
+ - example/app/views/users/index.json.jbuilder
259
+ - example/app/views/users/new.html.erb
260
+ - example/app/views/users/show.html.erb
261
+ - example/app/views/users/show.json.jbuilder
262
+ - example/config.ru
263
+ - example/config/application.rb
264
+ - example/config/boot.rb
265
+ - example/config/database.yml
266
+ - example/config/environment.rb
267
+ - example/config/environments/development.rb
268
+ - example/config/environments/production.rb
269
+ - example/config/environments/test.rb
270
+ - example/config/initializers/backtrace_silencers.rb
271
+ - example/config/initializers/cookies_serializer.rb
272
+ - example/config/initializers/filter_parameter_logging.rb
273
+ - example/config/initializers/inflections.rb
274
+ - example/config/initializers/mime_types.rb
275
+ - example/config/initializers/session_store.rb
276
+ - example/config/initializers/wrap_parameters.rb
277
+ - example/config/locales/en.yml
278
+ - example/config/routes.rb
279
+ - example/config/secrets.yml
280
+ - example/db/migrate/20141111080045_create_users.rb
281
+ - example/db/migrate/20141115060216_create_delayed_jobs.rb
282
+ - example/db/schema.rb
283
+ - example/db/seeds.rb
284
+ - example/public/404.html
285
+ - example/public/422.html
286
+ - example/public/500.html
287
+ - example/public/favicon.ico
288
+ - example/public/robots.txt
289
+ - example/vendor/assets/javascripts/.keep
290
+ - example/vendor/assets/stylesheets/.keep
291
+ - gemfiles/.bundle/config
292
+ - gemfiles/mail_2_5.gemfile
293
+ - gemfiles/mail_2_6.gemfile
294
+ - gemfiles/mail_2_7.gemfile
295
+ - gemfiles/rails_4.gemfile
296
+ - gemfiles/rails_5.gemfile
297
+ - lib/action_mailer_kafka.rb
298
+ - lib/action_mailer_kafka/delivery_method.rb
299
+ - lib/action_mailer_kafka/error.rb
300
+ - lib/action_mailer_kafka/railtie.rb
301
+ - lib/action_mailer_kafka/version.rb
302
+ - logo.png
303
+ homepage: https://github.com/luong-komorebi/action-mailer-kafka/
304
+ licenses:
305
+ - MIT
306
+ metadata:
307
+ homepage_uri: https://github.com/luong-komorebi/action-mailer-kafka/
308
+ post_install_message:
309
+ rdoc_options: []
310
+ require_paths:
311
+ - lib
312
+ required_ruby_version: !ruby/object:Gem::Requirement
313
+ requirements:
314
+ - - ">="
315
+ - !ruby/object:Gem::Version
316
+ version: '0'
317
+ required_rubygems_version: !ruby/object:Gem::Requirement
318
+ requirements:
319
+ - - ">="
320
+ - !ruby/object:Gem::Version
321
+ version: '0'
322
+ requirements: []
323
+ rubyforge_project:
324
+ rubygems_version: 2.6.14.4
325
+ signing_key:
326
+ specification_version: 4
327
+ summary: Custom action mailer to send mails to Kafka message queue.
328
+ test_files: []