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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eceec3189f8004a8e9728100dd43265fb209f18f
4
- data.tar.gz: 7036c123d5bfdd85443acb520d08203078fd90ab
3
+ metadata.gz: 5d47ed2e12f0d6f3f445990ae1c7a91b1cb2c31a
4
+ data.tar.gz: ff619f0020f765892a3b9b746bbb334faa28a6d6
5
5
  SHA512:
6
- metadata.gz: 160928851f2b7d303ec99f612e6a89cda8c872225c4ed3d582f71f0291617102a63a3790eb9fe6ff1491f3e253df1a4e015b3d9e11544bc75291cc54ecc40b2e
7
- data.tar.gz: d38b209ffad1228f25568a55b77a1785641794f90f1f2c6bf952642265c76d3eac70a73c1ef3c919feb75b15d4366272559604b147069c68402a45ad00f7564e
6
+ metadata.gz: cb4603db03b75639a21d463c54e9633c45eb8f58b30b737ef2b041e26416e2337ebd9dfba1e4ad0227d4ad293eb6d4eae2fec0dbd90c8e5a0a607b49b844062f
7
+ data.tar.gz: a0ccc712a2ceac94304b251b37887af2059f7c9be26bfeaf7f8956bb6cc465126ff09b1f77cc4740e8776ec478dc007f9ffbfa10ff9f4d5de6f346eadb369ff4
@@ -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
@@ -0,0 +1,10 @@
1
+ sudo: false
2
+ cache: bundler
3
+ language: ruby
4
+ rvm:
5
+ - 2.2.6
6
+ - 2.3.3
7
+ - 2.4.1
8
+ script:
9
+ - bundle exec rubocop
10
+ - bundle exec rspec
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -1 +1,2 @@
1
+ # rubocop:disable Style/FileName
1
2
  require 'outbox/rails'
@@ -7,11 +7,11 @@ module Outbox
7
7
 
8
8
  abstract!
9
9
 
10
- alias_method :_render_email, :mail
10
+ alias _render_email mail
11
11
  undef :mail
12
12
 
13
13
  class << self
14
- alias_method :defaults, :default
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
- alias_method :notifier_name=, :notifier_name
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
- only_message_types = only_message_types.map(&:to_sym)
148
- else
149
- only_message_types = message_types_without_email
150
- end
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
@@ -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
- Outbox::Message.public_send(option_setter, value) if Outbox::Message.respond_to?(option_setter)
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
@@ -1,5 +1,5 @@
1
1
  module Outbox
2
2
  module Rails
3
- VERSION = '0.4.2'
3
+ VERSION = '0.5.0'.freeze
4
4
  end
5
5
  end
@@ -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 = 'outbox-rails'
8
- spec.version = Outbox::Rails::VERSION
9
- spec.authors = ['Pete Browne']
10
- spec.email = ['pete.browne@localmed.com']
11
- spec.description = %q{Rails Railtie for sending email, SMS, and push notifications using the Outbox gem.}
12
- spec.summary = %q{Rails Railtie for sending email, SMS, and push notifications using the Outbox gem.}
13
- spec.homepage = 'https://github.com/localmed/outbox-rails'
14
- spec.license = 'MIT'
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 = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
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', '< 5']
23
+ spec.add_runtime_dependency 'rails', ['>= 4.0', '< 6']
23
24
  spec.add_development_dependency 'bundler', '~> 1.3'
24
- spec.add_development_dependency 'rake'
25
- spec.add_development_dependency 'rspec'
26
- spec.add_development_dependency 'rspec-rails'
27
- spec.add_development_dependency 'rspec_junit_formatter'
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
@@ -1,6 +1,5 @@
1
1
  class CustomizedNotifier < Outbox::Notifier
2
2
  defaults email: { from: 'noreply@myapp.com' }
3
3
 
4
- def with_defaults
5
- end
4
+ def with_defaults; end
6
5
  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
- part_1 = message.email.parts[0]
63
- part_2 = message.email.parts[1]
64
- expect(part_1.mime_type).to eq('text/plain')
65
- expect(part_1.body.encoded.strip).to eq('TEXT Implicit Multipart')
66
- expect(part_2.mime_type).to eq('text/html')
67
- expect(part_2.body.encoded.strip).to eq('HTML Implicit Multipart')
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
- }.to raise_error(ActionView::MissingTemplate)
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.2
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: 2016-11-01 00:00:00.000000000 Z
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: '5'
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: '5'
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: rake
62
+ name: combustion
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ">="
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0'
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: '0'
74
+ version: 0.6.0
75
75
  - !ruby/object:Gem::Dependency
76
- name: rspec
76
+ name: rake
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0'
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: '0'
88
+ version: 12.0.0
89
89
  - !ruby/object:Gem::Dependency
90
- name: rspec-rails
90
+ name: rspec
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0'
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: '0'
102
+ version: 3.5.0
103
103
  - !ruby/object:Gem::Dependency
104
- name: rspec_junit_formatter
104
+ name: rspec-rails
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">="
107
+ - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '0'
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: '0'
116
+ version: 3.5.2
117
117
  - !ruby/object:Gem::Dependency
118
- name: sqlite3
118
+ name: rubocop
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - ">="
121
+ - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '0'
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: '0'
130
+ version: 0.48.1
131
131
  - !ruby/object:Gem::Dependency
132
- name: combustion
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.1
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