outbox-rails 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +25 -0
- data/.travis.yml +10 -0
- data/Rakefile +1 -1
- data/lib/outbox-rails.rb +1 -0
- data/lib/outbox/notifier.rb +9 -8
- data/lib/outbox/rails/railtie.rb +4 -3
- data/lib/outbox/rails/version.rb +1 -1
- data/outbox-rails.gemspec +18 -17
- data/spec/internal/app/notifiers/customized_notifier.rb +1 -2
- data/spec/outbox/notifier_spec.rb +9 -9
- metadata +33 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d47ed2e12f0d6f3f445990ae1c7a91b1cb2c31a
|
4
|
+
data.tar.gz: ff619f0020f765892a3b9b746bbb334faa28a6d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb4603db03b75639a21d463c54e9633c45eb8f58b30b737ef2b041e26416e2337ebd9dfba1e4ad0227d4ad293eb6d4eae2fec0dbd90c8e5a0a607b49b844062f
|
7
|
+
data.tar.gz: a0ccc712a2ceac94304b251b37887af2059f7c9be26bfeaf7f8956bb6cc465126ff09b1f77cc4740e8776ec478dc007f9ffbfa10ff9f4d5de6f346eadb369ff4
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- "vendor/**/*"
|
4
|
+
- "lib/generators/*/notifier/templates/*"
|
5
|
+
DisplayCopNames: true
|
6
|
+
DisplayStyleGuide: true
|
7
|
+
|
8
|
+
Style/Documentation:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Metrics/BlockLength:
|
12
|
+
Exclude:
|
13
|
+
- "spec/**/*"
|
14
|
+
|
15
|
+
Metrics/ClassLength:
|
16
|
+
Max: 150
|
17
|
+
|
18
|
+
Metrics/LineLength:
|
19
|
+
Exclude:
|
20
|
+
- "outbox-rails.gemspec"
|
21
|
+
IgnoreCopDirectives: true
|
22
|
+
Max: 100
|
23
|
+
|
24
|
+
Metrics/MethodLength:
|
25
|
+
Max: 15
|
data/.travis.yml
ADDED
data/Rakefile
CHANGED
data/lib/outbox-rails.rb
CHANGED
data/lib/outbox/notifier.rb
CHANGED
@@ -7,11 +7,11 @@ module Outbox
|
|
7
7
|
|
8
8
|
abstract!
|
9
9
|
|
10
|
-
|
10
|
+
alias _render_email mail
|
11
11
|
undef :mail
|
12
12
|
|
13
13
|
class << self
|
14
|
-
|
14
|
+
alias defaults default
|
15
15
|
|
16
16
|
# Returns the name of current notifier. This method is also being used
|
17
17
|
# as a path for a view lookup. If this is an anonymous notifier,
|
@@ -23,10 +23,11 @@ module Outbox
|
|
23
23
|
self.mailer_name = value
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
26
|
+
alias notifier_name= notifier_name
|
27
27
|
|
28
28
|
protected
|
29
29
|
|
30
|
+
# rubocop:disable Style/MethodMissing
|
30
31
|
def method_missing(method_name, *args) # :nodoc:
|
31
32
|
if respond_to?(method_name)
|
32
33
|
new(method_name, *args).message
|
@@ -143,11 +144,11 @@ module Outbox
|
|
143
144
|
end
|
144
145
|
|
145
146
|
def assign_body(body, only_message_types = nil)
|
146
|
-
if only_message_types
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
147
|
+
only_message_types = if only_message_types
|
148
|
+
only_message_types.map(&:to_sym)
|
149
|
+
else
|
150
|
+
message_types_without_email
|
151
|
+
end
|
151
152
|
@_message.each_message_type do |message_type, message|
|
152
153
|
if message && message.body.nil? && message_type.in?(only_message_types)
|
153
154
|
message.body = body
|
data/lib/outbox/rails/railtie.rb
CHANGED
@@ -13,14 +13,15 @@ module Outbox
|
|
13
13
|
|
14
14
|
initializer 'outbox.config' do |app|
|
15
15
|
options = app.config.outbox
|
16
|
-
use_test_client = !!options.delete(:use_test_client)
|
17
16
|
|
18
17
|
ActiveSupport.on_load(:outbox) do
|
19
|
-
Outbox::Message.use_test_client if use_test_client
|
18
|
+
Outbox::Message.use_test_client if options.delete(:use_test_client)
|
20
19
|
|
21
20
|
options.each do |key, value|
|
22
21
|
option_setter = "#{key}="
|
23
|
-
|
22
|
+
if Outbox::Message.respond_to?(option_setter)
|
23
|
+
Outbox::Message.public_send(option_setter, value)
|
24
|
+
end
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
data/lib/outbox/rails/version.rb
CHANGED
data/outbox-rails.gemspec
CHANGED
@@ -1,30 +1,31 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'outbox/rails/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
11
|
-
spec.description
|
12
|
-
spec.summary
|
13
|
-
spec.homepage
|
14
|
-
spec.license
|
8
|
+
spec.name = 'outbox-rails'
|
9
|
+
spec.version = Outbox::Rails::VERSION
|
10
|
+
spec.authors = ['Pete Browne']
|
11
|
+
spec.email = ['pete.browne@localmed.com']
|
12
|
+
spec.description = 'Rails Railtie for sending email, SMS, and push notifications using the Outbox gem.'
|
13
|
+
spec.summary = 'Rails Railtie for sending email, SMS, and push notifications using the Outbox gem.'
|
14
|
+
spec.homepage = 'https://github.com/localmed/outbox-rails'
|
15
|
+
spec.license = 'MIT'
|
15
16
|
|
16
|
-
spec.files
|
17
|
-
spec.executables
|
18
|
-
spec.test_files
|
17
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
20
|
spec.require_paths = ['lib']
|
20
21
|
|
21
22
|
spec.add_runtime_dependency 'outbox', '~> 0.2.0'
|
22
|
-
spec.add_runtime_dependency 'rails', ['>= 4.0', '<
|
23
|
+
spec.add_runtime_dependency 'rails', ['>= 4.0', '< 6']
|
23
24
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
24
|
-
spec.add_development_dependency '
|
25
|
-
spec.add_development_dependency '
|
26
|
-
spec.add_development_dependency 'rspec
|
27
|
-
spec.add_development_dependency '
|
25
|
+
spec.add_development_dependency 'combustion', '~> 0.6.0'
|
26
|
+
spec.add_development_dependency 'rake', '~> 12.0.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.5.0'
|
28
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.5.2'
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 0.48.1'
|
28
30
|
spec.add_development_dependency 'sqlite3'
|
29
|
-
spec.add_development_dependency 'combustion'
|
30
31
|
end
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Outbox::Notifier do
|
4
4
|
describe 'calling actions' do
|
5
5
|
it 'does not raise error' do
|
6
|
-
expect{BaseNotifier.welcome}.not_to raise_error
|
6
|
+
expect { BaseNotifier.welcome }.not_to raise_error
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'returns an Outbox Message' do
|
@@ -59,12 +59,12 @@ describe Outbox::Notifier do
|
|
59
59
|
it 'handles multipart templates' do
|
60
60
|
message = BaseNotifier.implicit_multipart
|
61
61
|
expect(message.email.parts.size).to eq(2)
|
62
|
-
|
63
|
-
|
64
|
-
expect(
|
65
|
-
expect(
|
66
|
-
expect(
|
67
|
-
expect(
|
62
|
+
part1 = message.email.parts[0]
|
63
|
+
part2 = message.email.parts[1]
|
64
|
+
expect(part1.mime_type).to eq('text/plain')
|
65
|
+
expect(part1.body.encoded.strip).to eq('TEXT Implicit Multipart')
|
66
|
+
expect(part2.mime_type).to eq('text/html')
|
67
|
+
expect(part2.body.encoded.strip).to eq('HTML Implicit Multipart')
|
68
68
|
end
|
69
69
|
|
70
70
|
it 'handles attachments' do
|
@@ -93,9 +93,9 @@ describe Outbox::Notifier do
|
|
93
93
|
end
|
94
94
|
|
95
95
|
it 'raises template errors when sending emails' do
|
96
|
-
expect
|
96
|
+
expect do
|
97
97
|
BaseNotifier.explicit_sms_message
|
98
|
-
|
98
|
+
end.to raise_error(ActionView::MissingTemplate)
|
99
99
|
end
|
100
100
|
|
101
101
|
if Rails.version >= '4.1'
|
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: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Browne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: outbox
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '4.0'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '6'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '4.0'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '6'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,77 +59,77 @@ dependencies:
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '1.3'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: combustion
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 0.6.0
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - "
|
72
|
+
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: 0.6.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: rake
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - "
|
79
|
+
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 12.0.0
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- - "
|
86
|
+
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 12.0.0
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
-
name: rspec
|
90
|
+
name: rspec
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- - "
|
93
|
+
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version:
|
95
|
+
version: 3.5.0
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- - "
|
100
|
+
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
102
|
+
version: 3.5.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
|
-
name:
|
104
|
+
name: rspec-rails
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- - "
|
107
|
+
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: 3.5.2
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- - "
|
114
|
+
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
116
|
+
version: 3.5.2
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
|
-
name:
|
118
|
+
name: rubocop
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- - "
|
121
|
+
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
123
|
+
version: 0.48.1
|
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:
|
130
|
+
version: 0.48.1
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
|
-
name:
|
132
|
+
name: sqlite3
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - ">="
|
@@ -152,6 +152,8 @@ extra_rdoc_files: []
|
|
152
152
|
files:
|
153
153
|
- ".gitignore"
|
154
154
|
- ".rspec"
|
155
|
+
- ".rubocop.yml"
|
156
|
+
- ".travis.yml"
|
155
157
|
- Gemfile
|
156
158
|
- LICENSE.txt
|
157
159
|
- README.md
|
@@ -215,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
217
|
version: '0'
|
216
218
|
requirements: []
|
217
219
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.4.5.
|
220
|
+
rubygems_version: 2.4.5.2
|
219
221
|
signing_key:
|
220
222
|
specification_version: 4
|
221
223
|
summary: Rails Railtie for sending email, SMS, and push notifications using the Outbox
|