outbox-rails 1.0.0 → 1.1.0
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/.rubocop.yml +12 -10
- data/Appraisals +2 -0
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/config.ru +2 -0
- data/gemfiles/rails_5.0.gemfile.lock +12 -9
- data/gemfiles/rails_5.1.gemfile.lock +12 -9
- data/gemfiles/rails_5.2.gemfile.lock +12 -9
- data/gemfiles/rails_6.0.gemfile.lock +12 -9
- data/lib/generators/erb/notifier/notifier_generator.rb +3 -1
- data/lib/generators/outbox/notifier/notifier_generator.rb +3 -1
- data/lib/generators/rspec/notifier/notifier_generator.rb +3 -1
- data/lib/generators/test_unit/notifier/notifier_generator.rb +3 -1
- data/lib/outbox-rails.rb +2 -1
- data/lib/outbox/notifier.rb +20 -6
- data/lib/outbox/notifier_types.rb +2 -0
- data/lib/outbox/rails.rb +2 -0
- data/lib/outbox/rails/railtie.rb +2 -0
- data/lib/outbox/rails/version.rb +3 -1
- data/outbox-rails.gemspec +3 -3
- data/spec/internal/app/notifiers/base_notifier.rb +3 -3
- data/spec/internal/app/notifiers/customized_notifier.rb +3 -1
- data/spec/internal/config/routes.rb +2 -1
- data/spec/internal/db/schema.rb +2 -1
- data/spec/outbox/notifier_spec.rb +6 -1
- data/spec/outbox/rails/railtie_spec.rb +2 -0
- data/spec/outbox/rails_spec.rb +2 -0
- data/spec/spec_helper.rb +4 -2
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bef27790295cecc443c8033e15c8ee115d2d53046294e0d73d0b2a41104116a5
|
|
4
|
+
data.tar.gz: 2cc95dd43778dd20a711fb88613f3761d86700a5e321e22f7dfd2cd5945a3199
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20b174a486df85b5ad6cd72f3cc73b85dd30fa25bc82abedacb70bf483e4fbd03c20b2c28daba5b55fc0dd01ac864c3328b8b4ece244f505ea5b1a978866677d
|
|
7
|
+
data.tar.gz: f5d6846935fac03be5550f48ccef6b88d69986227da4b22fbe4129c19e2db068f2165c8eeba23edca7653bbb2dfb790014b3d4c330eaedecddf884abc665eeea
|
data/.rubocop.yml
CHANGED
|
@@ -5,6 +5,13 @@ AllCops:
|
|
|
5
5
|
- 'lib/generators/*/notifier/templates/*'
|
|
6
6
|
DisplayCopNames: true
|
|
7
7
|
DisplayStyleGuide: true
|
|
8
|
+
NewCops: enable
|
|
9
|
+
|
|
10
|
+
Layout/LineLength:
|
|
11
|
+
Exclude:
|
|
12
|
+
- 'outbox-rails.gemspec'
|
|
13
|
+
IgnoreCopDirectives: true
|
|
14
|
+
Max: 100
|
|
8
15
|
|
|
9
16
|
Metrics/BlockLength:
|
|
10
17
|
Exclude:
|
|
@@ -13,18 +20,13 @@ Metrics/BlockLength:
|
|
|
13
20
|
Metrics/ClassLength:
|
|
14
21
|
Max: 150
|
|
15
22
|
|
|
16
|
-
Metrics/LineLength:
|
|
17
|
-
Exclude:
|
|
18
|
-
- 'outbox-rails.gemspec'
|
|
19
|
-
IgnoreCopDirectives: true
|
|
20
|
-
Max: 100
|
|
21
|
-
|
|
22
23
|
Metrics/MethodLength:
|
|
23
24
|
Max: 15
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
Enabled: false
|
|
27
|
-
|
|
28
|
-
Style/FileName:
|
|
26
|
+
Naming/FileName:
|
|
29
27
|
Exclude:
|
|
30
28
|
- 'Appraisals'
|
|
29
|
+
- 'lib/outbox-rails.rb'
|
|
30
|
+
|
|
31
|
+
Style/Documentation:
|
|
32
|
+
Enabled: false
|
data/Appraisals
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/config.ru
CHANGED
|
@@ -64,6 +64,7 @@ GEM
|
|
|
64
64
|
activesupport (>= 4.2.0)
|
|
65
65
|
i18n (1.8.3)
|
|
66
66
|
concurrent-ruby (~> 1.0)
|
|
67
|
+
jaro_winkler (1.5.4)
|
|
67
68
|
loofah (2.6.0)
|
|
68
69
|
crass (~> 1.0.2)
|
|
69
70
|
nokogiri (>= 1.5.9)
|
|
@@ -78,9 +79,9 @@ GEM
|
|
|
78
79
|
mini_portile2 (~> 2.4.0)
|
|
79
80
|
outbox (0.2.1)
|
|
80
81
|
mail (~> 2.6)
|
|
82
|
+
parallel (1.19.2)
|
|
81
83
|
parser (2.7.1.4)
|
|
82
84
|
ast (~> 2.4.1)
|
|
83
|
-
powerpack (0.1.2)
|
|
84
85
|
rack (2.2.3)
|
|
85
86
|
rack-test (0.6.3)
|
|
86
87
|
rack (>= 1.0)
|
|
@@ -107,9 +108,9 @@ GEM
|
|
|
107
108
|
method_source
|
|
108
109
|
rake (>= 0.8.7)
|
|
109
110
|
thor (>= 0.18.1, < 2.0)
|
|
110
|
-
rainbow (
|
|
111
|
-
rake
|
|
111
|
+
rainbow (3.0.0)
|
|
112
112
|
rake (13.0.1)
|
|
113
|
+
rexml (3.2.4)
|
|
113
114
|
rspec (3.5.0)
|
|
114
115
|
rspec-core (~> 3.5.0)
|
|
115
116
|
rspec-expectations (~> 3.5.0)
|
|
@@ -131,12 +132,14 @@ GEM
|
|
|
131
132
|
rspec-mocks (~> 3.5.0)
|
|
132
133
|
rspec-support (~> 3.5.0)
|
|
133
134
|
rspec-support (3.5.0)
|
|
134
|
-
rubocop (0.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
rubocop (0.82.0)
|
|
136
|
+
jaro_winkler (~> 1.5.1)
|
|
137
|
+
parallel (~> 1.10)
|
|
138
|
+
parser (>= 2.7.0.1)
|
|
139
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
140
|
+
rexml
|
|
138
141
|
ruby-progressbar (~> 1.7)
|
|
139
|
-
unicode-display_width (
|
|
142
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
140
143
|
ruby-progressbar (1.10.1)
|
|
141
144
|
sprockets (4.0.2)
|
|
142
145
|
concurrent-ruby (~> 1.0)
|
|
@@ -166,7 +169,7 @@ DEPENDENCIES
|
|
|
166
169
|
rake (>= 12.3.3)
|
|
167
170
|
rspec (~> 3.5.0)
|
|
168
171
|
rspec-rails (~> 3.5.2)
|
|
169
|
-
rubocop (~> 0.
|
|
172
|
+
rubocop (~> 0.82.0)
|
|
170
173
|
sqlite3
|
|
171
174
|
|
|
172
175
|
BUNDLED WITH
|
|
@@ -64,6 +64,7 @@ GEM
|
|
|
64
64
|
activesupport (>= 4.2.0)
|
|
65
65
|
i18n (1.8.3)
|
|
66
66
|
concurrent-ruby (~> 1.0)
|
|
67
|
+
jaro_winkler (1.5.4)
|
|
67
68
|
loofah (2.6.0)
|
|
68
69
|
crass (~> 1.0.2)
|
|
69
70
|
nokogiri (>= 1.5.9)
|
|
@@ -78,9 +79,9 @@ GEM
|
|
|
78
79
|
mini_portile2 (~> 2.4.0)
|
|
79
80
|
outbox (0.2.1)
|
|
80
81
|
mail (~> 2.6)
|
|
82
|
+
parallel (1.19.2)
|
|
81
83
|
parser (2.7.1.4)
|
|
82
84
|
ast (~> 2.4.1)
|
|
83
|
-
powerpack (0.1.2)
|
|
84
85
|
rack (2.2.3)
|
|
85
86
|
rack-test (1.1.0)
|
|
86
87
|
rack (>= 1.0, < 3)
|
|
@@ -107,9 +108,9 @@ GEM
|
|
|
107
108
|
method_source
|
|
108
109
|
rake (>= 0.8.7)
|
|
109
110
|
thor (>= 0.18.1, < 2.0)
|
|
110
|
-
rainbow (
|
|
111
|
-
rake
|
|
111
|
+
rainbow (3.0.0)
|
|
112
112
|
rake (13.0.1)
|
|
113
|
+
rexml (3.2.4)
|
|
113
114
|
rspec (3.5.0)
|
|
114
115
|
rspec-core (~> 3.5.0)
|
|
115
116
|
rspec-expectations (~> 3.5.0)
|
|
@@ -131,12 +132,14 @@ GEM
|
|
|
131
132
|
rspec-mocks (~> 3.5.0)
|
|
132
133
|
rspec-support (~> 3.5.0)
|
|
133
134
|
rspec-support (3.5.0)
|
|
134
|
-
rubocop (0.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
rubocop (0.82.0)
|
|
136
|
+
jaro_winkler (~> 1.5.1)
|
|
137
|
+
parallel (~> 1.10)
|
|
138
|
+
parser (>= 2.7.0.1)
|
|
139
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
140
|
+
rexml
|
|
138
141
|
ruby-progressbar (~> 1.7)
|
|
139
|
-
unicode-display_width (
|
|
142
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
140
143
|
ruby-progressbar (1.10.1)
|
|
141
144
|
sprockets (4.0.2)
|
|
142
145
|
concurrent-ruby (~> 1.0)
|
|
@@ -166,7 +169,7 @@ DEPENDENCIES
|
|
|
166
169
|
rake (>= 12.3.3)
|
|
167
170
|
rspec (~> 3.5.0)
|
|
168
171
|
rspec-rails (~> 3.5.2)
|
|
169
|
-
rubocop (~> 0.
|
|
172
|
+
rubocop (~> 0.82.0)
|
|
170
173
|
sqlite3
|
|
171
174
|
|
|
172
175
|
BUNDLED WITH
|
|
@@ -68,6 +68,7 @@ GEM
|
|
|
68
68
|
activesupport (>= 4.2.0)
|
|
69
69
|
i18n (1.8.3)
|
|
70
70
|
concurrent-ruby (~> 1.0)
|
|
71
|
+
jaro_winkler (1.5.4)
|
|
71
72
|
loofah (2.6.0)
|
|
72
73
|
crass (~> 1.0.2)
|
|
73
74
|
nokogiri (>= 1.5.9)
|
|
@@ -85,9 +86,9 @@ GEM
|
|
|
85
86
|
mini_portile2 (~> 2.4.0)
|
|
86
87
|
outbox (0.2.1)
|
|
87
88
|
mail (~> 2.6)
|
|
89
|
+
parallel (1.19.2)
|
|
88
90
|
parser (2.7.1.4)
|
|
89
91
|
ast (~> 2.4.1)
|
|
90
|
-
powerpack (0.1.2)
|
|
91
92
|
rack (2.2.3)
|
|
92
93
|
rack-test (1.1.0)
|
|
93
94
|
rack (>= 1.0, < 3)
|
|
@@ -115,9 +116,9 @@ GEM
|
|
|
115
116
|
method_source
|
|
116
117
|
rake (>= 0.8.7)
|
|
117
118
|
thor (>= 0.19.0, < 2.0)
|
|
118
|
-
rainbow (
|
|
119
|
-
rake
|
|
119
|
+
rainbow (3.0.0)
|
|
120
120
|
rake (13.0.1)
|
|
121
|
+
rexml (3.2.4)
|
|
121
122
|
rspec (3.5.0)
|
|
122
123
|
rspec-core (~> 3.5.0)
|
|
123
124
|
rspec-expectations (~> 3.5.0)
|
|
@@ -139,12 +140,14 @@ GEM
|
|
|
139
140
|
rspec-mocks (~> 3.5.0)
|
|
140
141
|
rspec-support (~> 3.5.0)
|
|
141
142
|
rspec-support (3.5.0)
|
|
142
|
-
rubocop (0.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
rubocop (0.82.0)
|
|
144
|
+
jaro_winkler (~> 1.5.1)
|
|
145
|
+
parallel (~> 1.10)
|
|
146
|
+
parser (>= 2.7.0.1)
|
|
147
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
148
|
+
rexml
|
|
146
149
|
ruby-progressbar (~> 1.7)
|
|
147
|
-
unicode-display_width (
|
|
150
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
148
151
|
ruby-progressbar (1.10.1)
|
|
149
152
|
sprockets (4.0.2)
|
|
150
153
|
concurrent-ruby (~> 1.0)
|
|
@@ -174,7 +177,7 @@ DEPENDENCIES
|
|
|
174
177
|
rake (>= 12.3.3)
|
|
175
178
|
rspec (~> 3.5.0)
|
|
176
179
|
rspec-rails (~> 3.5.2)
|
|
177
|
-
rubocop (~> 0.
|
|
180
|
+
rubocop (~> 0.82.0)
|
|
178
181
|
sqlite3
|
|
179
182
|
|
|
180
183
|
BUNDLED WITH
|
|
@@ -81,6 +81,7 @@ GEM
|
|
|
81
81
|
activesupport (>= 4.2.0)
|
|
82
82
|
i18n (1.8.3)
|
|
83
83
|
concurrent-ruby (~> 1.0)
|
|
84
|
+
jaro_winkler (1.5.4)
|
|
84
85
|
loofah (2.6.0)
|
|
85
86
|
crass (~> 1.0.2)
|
|
86
87
|
nokogiri (>= 1.5.9)
|
|
@@ -98,9 +99,9 @@ GEM
|
|
|
98
99
|
mini_portile2 (~> 2.4.0)
|
|
99
100
|
outbox (0.2.1)
|
|
100
101
|
mail (~> 2.6)
|
|
102
|
+
parallel (1.19.2)
|
|
101
103
|
parser (2.7.1.4)
|
|
102
104
|
ast (~> 2.4.1)
|
|
103
|
-
powerpack (0.1.2)
|
|
104
105
|
rack (2.2.3)
|
|
105
106
|
rack-test (1.1.0)
|
|
106
107
|
rack (>= 1.0, < 3)
|
|
@@ -130,9 +131,9 @@ GEM
|
|
|
130
131
|
method_source
|
|
131
132
|
rake (>= 0.8.7)
|
|
132
133
|
thor (>= 0.20.3, < 2.0)
|
|
133
|
-
rainbow (
|
|
134
|
-
rake
|
|
134
|
+
rainbow (3.0.0)
|
|
135
135
|
rake (13.0.1)
|
|
136
|
+
rexml (3.2.4)
|
|
136
137
|
rspec (3.5.0)
|
|
137
138
|
rspec-core (~> 3.5.0)
|
|
138
139
|
rspec-expectations (~> 3.5.0)
|
|
@@ -154,12 +155,14 @@ GEM
|
|
|
154
155
|
rspec-mocks (~> 3.5.0)
|
|
155
156
|
rspec-support (~> 3.5.0)
|
|
156
157
|
rspec-support (3.5.0)
|
|
157
|
-
rubocop (0.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
rubocop (0.82.0)
|
|
159
|
+
jaro_winkler (~> 1.5.1)
|
|
160
|
+
parallel (~> 1.10)
|
|
161
|
+
parser (>= 2.7.0.1)
|
|
162
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
163
|
+
rexml
|
|
161
164
|
ruby-progressbar (~> 1.7)
|
|
162
|
-
unicode-display_width (
|
|
165
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
163
166
|
ruby-progressbar (1.10.1)
|
|
164
167
|
sprockets (4.0.2)
|
|
165
168
|
concurrent-ruby (~> 1.0)
|
|
@@ -190,7 +193,7 @@ DEPENDENCIES
|
|
|
190
193
|
rake (>= 12.3.3)
|
|
191
194
|
rspec (~> 3.5.0)
|
|
192
195
|
rspec-rails (~> 3.5.2)
|
|
193
|
-
rubocop (~> 0.
|
|
196
|
+
rubocop (~> 0.82.0)
|
|
194
197
|
sqlite3
|
|
195
198
|
|
|
196
199
|
BUNDLED WITH
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rails/generators/erb/controller/controller_generator'
|
|
2
4
|
|
|
3
5
|
module Erb # :nodoc:
|
|
4
6
|
module Generators # :nodoc:
|
|
5
7
|
class NotifierGenerator < ControllerGenerator # :nodoc:
|
|
6
|
-
source_root File.expand_path('
|
|
8
|
+
source_root File.expand_path('templates', __dir__)
|
|
7
9
|
|
|
8
10
|
protected
|
|
9
11
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Outbox
|
|
2
4
|
module Generators
|
|
3
5
|
class NotifierGenerator < ::Rails::Generators::NamedBase
|
|
4
|
-
source_root File.expand_path('
|
|
6
|
+
source_root File.expand_path('templates', __dir__)
|
|
5
7
|
|
|
6
8
|
argument :actions, type: :array, default: [], banner: 'method method'
|
|
7
9
|
check_class_collision
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Rspec
|
|
2
4
|
module Generators
|
|
3
5
|
class NotifierGenerator < ::Rails::Generators::NamedBase
|
|
4
|
-
source_root File.expand_path('
|
|
6
|
+
source_root File.expand_path('templates', __dir__)
|
|
5
7
|
|
|
6
8
|
argument :actions, type: :array, default: [], banner: 'method method'
|
|
7
9
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module TestUnit
|
|
2
4
|
module Generators
|
|
3
5
|
class NotifierGenerator < ::Rails::Generators::NamedBase
|
|
4
|
-
source_root File.expand_path('
|
|
6
|
+
source_root File.expand_path('templates', __dir__)
|
|
5
7
|
check_class_collision suffix: 'Test'
|
|
6
8
|
|
|
7
9
|
argument :actions, type: :array, default: [], banner: 'method method'
|
data/lib/outbox-rails.rb
CHANGED
data/lib/outbox/notifier.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'action_mailer'
|
|
2
4
|
|
|
3
5
|
module Outbox
|
|
@@ -10,8 +12,21 @@ module Outbox
|
|
|
10
12
|
alias _render_email mail
|
|
11
13
|
undef :mail
|
|
12
14
|
|
|
15
|
+
class_attribute :default_message_options
|
|
16
|
+
self.default_message_options = {}
|
|
17
|
+
|
|
13
18
|
class << self
|
|
14
|
-
|
|
19
|
+
# Sets the default options for a message for this Notifier and its descendants.
|
|
20
|
+
# This is similar to ActionMailer's `default` method, but allows you to
|
|
21
|
+
# set options for multiple message types at once:
|
|
22
|
+
#
|
|
23
|
+
# class UsersNotifier < OutboxNotifier
|
|
24
|
+
# defaults email: { from: 'noreply@myapp.com' }, sms: { from: '+12255551234' }
|
|
25
|
+
# end
|
|
26
|
+
def defaults(value = nil)
|
|
27
|
+
self.default_message_options = default_message_options.merge(value).freeze if value
|
|
28
|
+
default_message_options
|
|
29
|
+
end
|
|
15
30
|
|
|
16
31
|
# Returns the name of current notifier. This method is also being used
|
|
17
32
|
# as a path for a view lookup. If this is an anonymous notifier,
|
|
@@ -27,7 +42,7 @@ module Outbox
|
|
|
27
42
|
|
|
28
43
|
protected
|
|
29
44
|
|
|
30
|
-
# rubocop:disable Style/
|
|
45
|
+
# rubocop:disable Style/MissingRespondToMissing
|
|
31
46
|
def method_missing(method_name, *args) # :nodoc:
|
|
32
47
|
if respond_to?(method_name)
|
|
33
48
|
new(method_name, *args).message
|
|
@@ -35,6 +50,7 @@ module Outbox
|
|
|
35
50
|
super
|
|
36
51
|
end
|
|
37
52
|
end
|
|
53
|
+
# rubocop:enable Style/MissingRespondToMissing
|
|
38
54
|
end
|
|
39
55
|
|
|
40
56
|
def initialize(method_name = nil, *args) # :nodoc:
|
|
@@ -96,7 +112,7 @@ module Outbox
|
|
|
96
112
|
end
|
|
97
113
|
|
|
98
114
|
def build_message
|
|
99
|
-
message = Outbox::Message.new(self.class.
|
|
115
|
+
message = Outbox::Message.new(self.class.default_message_options.dup)
|
|
100
116
|
Outbox::Message.message_types.each_key do |message_type|
|
|
101
117
|
message.public_send(message_type, {})
|
|
102
118
|
end
|
|
@@ -149,9 +165,7 @@ module Outbox
|
|
|
149
165
|
message_types_without_email
|
|
150
166
|
end
|
|
151
167
|
@_message.each_message_type do |message_type, message|
|
|
152
|
-
if message && message.body.nil? && message_type.in?(only_message_types)
|
|
153
|
-
message.body = body
|
|
154
|
-
end
|
|
168
|
+
message.body = body if message && message.body.nil? && message_type.in?(only_message_types)
|
|
155
169
|
end
|
|
156
170
|
end
|
|
157
171
|
|
data/lib/outbox/rails.rb
CHANGED
data/lib/outbox/rails/railtie.rb
CHANGED
data/lib/outbox/rails/version.rb
CHANGED
data/outbox-rails.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
lib = File.expand_path('
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'outbox/rails/version'
|
|
6
6
|
|
|
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
|
|
|
26
26
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
|
27
27
|
spec.add_development_dependency 'rspec', '~> 3.5.0'
|
|
28
28
|
spec.add_development_dependency 'rspec-rails', '~> 3.5.2'
|
|
29
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 0.82.0'
|
|
30
30
|
spec.add_development_dependency 'sqlite3'
|
|
31
31
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class BaseNotifier < Outbox::Notifier
|
|
2
4
|
layout :set_layout
|
|
3
5
|
|
|
@@ -6,9 +8,7 @@ class BaseNotifier < Outbox::Notifier
|
|
|
6
8
|
end
|
|
7
9
|
|
|
8
10
|
def implicit_multipart(hash = {})
|
|
9
|
-
if hash.delete(:attachments)
|
|
10
|
-
attachments['invoice.pdf'] = 'This is test File content'
|
|
11
|
-
end
|
|
11
|
+
attachments['invoice.pdf'] = 'This is test File content' if hash.delete(:attachments)
|
|
12
12
|
render_message(hash)
|
|
13
13
|
end
|
|
14
14
|
|
data/spec/internal/db/schema.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'spec_helper'
|
|
2
4
|
|
|
3
5
|
describe Outbox::Notifier do
|
|
@@ -21,6 +23,9 @@ describe Outbox::Notifier do
|
|
|
21
23
|
it 'sets the default values' do
|
|
22
24
|
message = CustomizedNotifier.with_defaults
|
|
23
25
|
expect(message.email.from).to eq(['noreply@myapp.com'])
|
|
26
|
+
expect(message.sms.from).to eq('+12255551234')
|
|
27
|
+
expect(message.email['email']).to be_nil
|
|
28
|
+
expect(message.email['sms']).to be_nil
|
|
24
29
|
end
|
|
25
30
|
end
|
|
26
31
|
|
|
@@ -110,7 +115,7 @@ describe Outbox::Notifier do
|
|
|
110
115
|
expect(message.sms.body.strip).to eql('SMS Layout: SMS Variant')
|
|
111
116
|
end
|
|
112
117
|
|
|
113
|
-
it 'only renders the SMS template once'
|
|
118
|
+
it 'only renders the SMS template once' do
|
|
114
119
|
notifier = BaseNotifier.new(:only_sms_template)
|
|
115
120
|
expect(notifier).to receive(:render).once.and_return('Only SMS')
|
|
116
121
|
message = notifier.message
|
data/spec/outbox/rails_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
|
|
2
4
|
|
|
3
5
|
require 'combustion'
|
|
4
6
|
|
|
5
|
-
Combustion.initialize!(:action_mailer) do
|
|
7
|
+
::Combustion.initialize!(:action_mailer) do
|
|
6
8
|
config.outbox.use_test_client = true
|
|
7
9
|
config.outbox.default_email_client_settings = { option_1: true }
|
|
8
10
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: outbox-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pete Browne
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-09-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: outbox
|
|
@@ -120,14 +120,14 @@ dependencies:
|
|
|
120
120
|
requirements:
|
|
121
121
|
- - "~>"
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: 0.
|
|
123
|
+
version: 0.82.0
|
|
124
124
|
type: :development
|
|
125
125
|
prerelease: false
|
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
|
128
128
|
- - "~>"
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: 0.
|
|
130
|
+
version: 0.82.0
|
|
131
131
|
- !ruby/object:Gem::Dependency
|
|
132
132
|
name: sqlite3
|
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -211,7 +211,7 @@ homepage: https://github.com/localmed/outbox-rails
|
|
|
211
211
|
licenses:
|
|
212
212
|
- MIT
|
|
213
213
|
metadata: {}
|
|
214
|
-
post_install_message:
|
|
214
|
+
post_install_message:
|
|
215
215
|
rdoc_options: []
|
|
216
216
|
require_paths:
|
|
217
217
|
- lib
|
|
@@ -226,8 +226,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
226
226
|
- !ruby/object:Gem::Version
|
|
227
227
|
version: '0'
|
|
228
228
|
requirements: []
|
|
229
|
-
rubygems_version: 3.
|
|
230
|
-
signing_key:
|
|
229
|
+
rubygems_version: 3.0.3
|
|
230
|
+
signing_key:
|
|
231
231
|
specification_version: 4
|
|
232
232
|
summary: Rails Railtie for sending email, SMS, and push notifications using the Outbox
|
|
233
233
|
gem.
|