sanitize_email 1.1.4 → 1.1.5

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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NWFiN2NjNmYwNjk0YjNkNjkxZjg5ZDI1NDI0ZmMwY2M4MWI3MWZjZg==
5
- data.tar.gz: !binary |-
6
- MjljOGVmM2UxZTE3MjY4OTM5ODQ4ZTk5OGEzN2JkNTYyNTNkYmRkMQ==
2
+ SHA1:
3
+ metadata.gz: 1fdeb24b19f1398c5541c1ac64d76181662ff475
4
+ data.tar.gz: 9f08881fb0027324fc4487f2f9cca2044df2a3bb
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MGIxNjYyNzY4NGFkMDg3NTc0OGNlNjIxNDFhNjcyY2Q2YzM1YTM1MmFhYjM1
10
- OGU2M2EyNzU3Njc3ZDdiZTczZDFkZmYxNjE1YTIwYjg1OWM5ZTI3MWQ2YzY3
11
- YWIwZTk2MGU5ZmRiMTliNGUwMWZjM2NkOTc3OTEzYmI0OGIzNDU=
12
- data.tar.gz: !binary |-
13
- ODA0YTM4YzczMDY2ZjBkYTVkODY1N2U2ZDIwNjIyY2FlNGE1MzNmZTgyYjA3
14
- NzdmODIzNTBmMTRmOWZlMmQ3ODkwMzVkYWZkMWFlYTQzNjgwMDE2MTU0NzA1
15
- MjEzYjAxYzliMjgzMjcxNmQ3NDFhNTYxOGQ4ZWUyNjM4NzQzNGI=
6
+ metadata.gz: caf6b42229c732c67b5372cc2862e089e4abaa23f6fe25c8e46719ba4f1538a7ac67f220d637b28f235e25b6b38b18934a4dba6fe4e3e72d33acfad72e7caaf8
7
+ data.tar.gz: 450f79a5192e17f271f28adabca2cdac943cdddd5699bb380e3e3292294865c4a8eb21ba8021e4abf2e27b34c32f53c21f7f5ce92af6288b625039684917d4d9
data/.travis.yml CHANGED
@@ -1,8 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
5
+ - 2.1.0
6
+ - 2.1.5
6
7
  - jruby-19mode
7
8
  # - rbx-19mode
8
9
  # - ruby-head
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ Version 1.1.5 - MAR.10.2015
2
+ * Refactored `prepend_subject_array` by Scott Rocher
3
+ * Specs for prepending to subject by Scott Rocher
4
+ * Fix spec examples by Peter Boling
5
+ * Update Readme by Theo Bittencourt
6
+
1
7
  Version 1.1.4 - JAN.06.2014
2
8
  * Another attempt at not breaking when subject is nil by Peter Boling
3
9
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008-2013 Peter H. Boling of RailsBling.com
1
+ Copyright (c) 2008-2014 Peter H. Boling of RailsBling.com
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -10,6 +10,7 @@ This gem allows you to override your mail delivery settings, globally or in a lo
10
10
  | version | [![Gem Version](https://badge.fury.io/rb/sanitize_email.png)](http://badge.fury.io/rb/sanitize_email) |
11
11
  | dependencies | [![Dependency Status](https://gemnasium.com/pboling/sanitize_email.png)](https://gemnasium.com/pboling/sanitize_email) |
12
12
  | code quality | [![Code Climate](https://codeclimate.com/github/pboling/sanitize_email.png)](https://codeclimate.com/github/pboling/sanitize_email) |
13
+ | inline documenation | [![Inline docs](http://inch-ci.org/github/pboling/sanitize_email.png)](http://inch-ci.org/github/pboling/sanitize_email) |
13
14
  | continuous integration | [![Build Status](https://secure.travis-ci.org/pboling/sanitize_email.png?branch=master)](https://travis-ci.org/pboling/sanitize_email) |
14
15
  | test coverage | [![Coverage Status](https://coveralls.io/repos/pboling/sanitize_email/badge.png)](https://coveralls.io/r/pboling/sanitize_email) |
15
16
  | homepage | [https://github.com/pboling/sanitize_email][homepage] |
@@ -57,7 +58,7 @@ SanitizeEmail comes with some lightweight RspecMatchers covering most of what em
57
58
 
58
59
  In Gemfile:
59
60
 
60
- gem 'flag_shih_tzu'
61
+ gem 'sanitize_email'
61
62
 
62
63
  Then:
63
64
 
@@ -192,7 +193,7 @@ In your `spec_helper.rb`:
192
193
  end
193
194
 
194
195
  context "an email test" do
195
- subject { Mail.new(@message_hash) }
196
+ subject { Mail.deliver(@message_hash) }
196
197
  it { should have_to "sanitize_email@example.org" }
197
198
  end
198
199
 
@@ -205,7 +206,7 @@ These will look for an email address in any of the following
205
206
  Example:
206
207
 
207
208
  context "the subject line must have the email address sanitize_email@example.org" do
208
- subject { Mail.new(@message_hash) }
209
+ subject { Mail.deliver(@message_hash) }
209
210
  it { should have_subject "sanitize_email@example.org" }
210
211
  end
211
212
 
@@ -218,7 +219,7 @@ These will look for a matching string in any of the following
218
219
  Example:
219
220
 
220
221
  context "the subject line must have the string 'foobarbaz'" do
221
- subject { Mail.new(@message_hash) }
222
+ subject { Mail.deliver(@message_hash) }
222
223
  it { should be_subject "foobarbaz" }
223
224
  end
224
225
 
@@ -231,7 +232,7 @@ The `username` in the `:to` field is when the `:to` field is formatted like this
231
232
  Example:
232
233
 
233
234
  context "the to field must have the username 'Peter Boling'" do
234
- subject { Mail.new(@message_hash) }
235
+ subject { Mail.deliver(@message_hash) }
235
236
  it { should have_to_username "Peter Boling" }
236
237
  end
237
238
 
@@ -334,7 +335,7 @@ For example:
334
335
  ## Legal
335
336
 
336
337
  * MIT License - See LICENSE file in this project
337
- * Copyright (c) 2008-2013 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
338
+ * Copyright (c) 2008-2014 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
338
339
  * Copyright (c) 2009 [John Trupiano](http://smartlogicsolutions.com/wiki/John_Trupiano) of [SmartLogic Solutions, LLC](http://www.smartlogicsolutions.com)
339
340
 
340
341
  [semver]: http://semver.org/
data/Rakefile CHANGED
@@ -34,9 +34,10 @@ namespace :test do
34
34
  end
35
35
  end
36
36
 
37
- require 'rdoc/task'
38
37
  require File.expand_path('../lib/sanitize_email/version', __FILE__)
39
- Rake::RDocTask.new do |rdoc|
38
+ require 'rdoc'
39
+ require 'rdoc/task'
40
+ RDoc::Task.new do |rdoc|
40
41
  rdoc.rdoc_dir = 'rdoc'
41
42
  rdoc.title = "SanitizeEmail #{SanitizeEmail::VERSION}"
42
43
  rdoc.options << '--line-numbers'
@@ -29,7 +29,7 @@ module SanitizeEmail
29
29
  if mailer.respond_to?(:register_interceptor)
30
30
  mailer.register_interceptor(SanitizeEmail::Bleach.new)
31
31
  else
32
- warn "SanitizeEmail was unable to detect a compatible Mail class to register and interceptor on."
32
+ warn "SanitizeEmail was unable to detect a compatible Mail class to register an interceptor on."
33
33
  end
34
34
  end
35
35
 
@@ -7,9 +7,14 @@ module SanitizeEmail
7
7
  prepend = []
8
8
  prepend << SanitizeEmail::MailHeaderTools.prepend_email_to_subject(Array(message.to)) if SanitizeEmail.use_actual_email_prepended_to_subject
9
9
  prepend << SanitizeEmail::MailHeaderTools.prepend_environment_to_subject if SanitizeEmail.use_actual_environment_prepended_to_subject
10
+ prepend << "" unless prepend.empty? # this will force later joins to add an extra space
10
11
  prepend
11
12
  end
12
13
 
14
+ def self.custom_subject(message)
15
+ prepend_subject_array(message).join(" ")
16
+ end
17
+
13
18
  def self.prepend_environment_to_subject
14
19
  SanitizeEmail::Config.config[:environment]
15
20
  end
@@ -31,11 +36,8 @@ module SanitizeEmail
31
36
  end
32
37
 
33
38
  def self.prepend_custom_subject(message)
34
- if message.subject
35
- message.subject.insert(0, SanitizeEmail::MailHeaderTools.prepend_subject_array(message).join(' ') + ' ')
36
- else
37
- message.subject = SanitizeEmail::MailHeaderTools.prepend_subject_array(message).join(' ')
38
- end
39
+ message.subject = "" unless message.subject
40
+ message.subject.prepend(SanitizeEmail::MailHeaderTools.custom_subject(message))
39
41
  end
40
42
 
41
43
  # According to https://github.com/mikel/mail this is the correct way to update headers.
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
2
2
  # Released under the MIT license
3
3
  module SanitizeEmail
4
- VERSION = '1.1.4'
4
+ VERSION = '1.1.5'
5
5
  end
@@ -448,6 +448,7 @@ describe SanitizeEmail do
448
448
  end
449
449
  it "original to is not prepended" do
450
450
  @email_message.should_not have_subject("[test] original subject")
451
+ @email_message.subject.should eq("original subject")
451
452
  end
452
453
  it "should not alter non-sanitized attributes" do
453
454
  @email_message.should have_from('from@example.org')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanitize_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
@@ -10,163 +10,163 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-06 00:00:00.000000000 Z
13
+ date: 2015-03-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ! '>='
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
21
  version: '3.0'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ! '>='
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: '3.0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: actionmailer
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ! '>='
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '3.0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ! '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '3.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: letter_opener
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ! '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ! '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: launchy
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ! '>='
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ! '>='
68
+ - - ">="
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rspec
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ! '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: '2.11'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ! '>='
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: '2.11'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: mail
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ! '>='
89
+ - - ">="
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ! '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: rdoc
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ! '>='
103
+ - - ">="
104
104
  - !ruby/object:Gem::Version
105
105
  version: '3.12'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ! '>='
110
+ - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: '3.12'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: reek
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ! '>='
117
+ - - ">="
118
118
  - !ruby/object:Gem::Version
119
119
  version: 1.2.8
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - ! '>='
124
+ - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: 1.2.8
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: roodi
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ! '>='
131
+ - - ">="
132
132
  - !ruby/object:Gem::Version
133
133
  version: 2.1.0
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ! '>='
138
+ - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: 2.1.0
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: rake
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ! '>='
145
+ - - ">="
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  type: :development
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - ! '>='
152
+ - - ">="
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: coveralls
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
- - - ! '>='
159
+ - - ">="
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  type: :development
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - ! '>='
166
+ - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
- description: ! 'In Rails, Sinatra, or simply the mail gem: Aids in development, testing,
169
+ description: 'In Rails, Sinatra, or simply the mail gem: Aids in development, testing,
170
170
  qa, and production troubleshooting of email issues without worrying that emails
171
171
  will get sent to actual live addresses.'
172
172
  email: peter.boling@gmail.com
@@ -177,12 +177,12 @@ extra_rdoc_files:
177
177
  - LICENSE
178
178
  - README.md
179
179
  files:
180
- - .coveralls.yml
181
- - .gitignore
182
- - .rspec
183
- - .ruby-gemset
184
- - .ruby-version
185
- - .travis.yml
180
+ - ".coveralls.yml"
181
+ - ".gitignore"
182
+ - ".rspec"
183
+ - ".ruby-gemset"
184
+ - ".ruby-version"
185
+ - ".travis.yml"
186
186
  - CHANGELOG.md
187
187
  - Gemfile
188
188
  - LICENSE
@@ -219,21 +219,22 @@ require_paths:
219
219
  - lib
220
220
  required_ruby_version: !ruby/object:Gem::Requirement
221
221
  requirements:
222
- - - ! '>='
222
+ - - ">="
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
225
  required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ! '>='
227
+ - - ">="
228
228
  - !ruby/object:Gem::Version
229
229
  version: '0'
230
230
  requirements: []
231
231
  rubyforge_project:
232
- rubygems_version: 2.2.0
232
+ rubygems_version: 2.4.2
233
233
  signing_key:
234
234
  specification_version: 4
235
- summary: ! 'Rails/Sinatra/Mail gem: Test email abilities without ever sending a message
235
+ summary: 'Rails/Sinatra/Mail gem: Test email abilities without ever sending a message
236
236
  to actual live addresses'
237
237
  test_files:
238
238
  - spec/sanitize_email_spec.rb
239
239
  - spec/spec_helper.rb
240
+ has_rdoc: