sanitize_email 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ Version 1.0.7 - AUG.06.2012
2
+
3
+ * \[Bug Fix\] Stripping the message headers before appending new headers.
4
+ - In a scenario where there is a trailing space, adding the newline before we append results in a blank header which throws an error as illegal by Eric Musgrove
5
+ * Minor updates to Gemspec by Peter Boling
6
+
1
7
  Version 1.0.6 - JAN.25.2013
2
8
 
3
9
  * \[New Feature\] use_actual_environment_prepended_to_subject by [altonymous](https://github.com/Altonymous)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sanitize_email (1.0.5)
4
+ sanitize_email (1.0.6)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -43,22 +43,26 @@ If you install this gem on a production server (which I don't always do), you ca
43
43
 
44
44
  ## Install Like a Boss
45
45
 
46
- [sudo] gem install sanitize_email
46
+ ```
47
+ [sudo] gem install sanitize_email
48
+ ```
47
49
 
48
50
  ## Setup With An Axe
49
51
 
50
52
  Customize and add to an initializer:
51
53
 
52
- SanitizeEmail::Config.configure do |config|
53
- config[:sanitized_to] = 'to@sanitize_email.org'
54
- config[:sanitized_cc] = 'cc@sanitize_email.org'
55
- config[:sanitized_bcc] = 'bcc@sanitize_email.org'
56
- # run/call whatever logic should turn sanitize_email on and off in this Proc:
57
- config[:activation_proc] = Proc.new { %w(development test).include?(Rails.env) }
58
- config[:use_actual_email_prepended_to_subject] = true # or false
59
- config[:use_actual_environment_prepended_to_subject] = true # or false
60
- config[:use_actual_email_as_sanitized_user_name] = true # or false
61
- end
54
+ ```
55
+ SanitizeEmail::Config.configure do |config|
56
+ config[:sanitized_to] = 'to@sanitize_email.org'
57
+ config[:sanitized_cc] = 'cc@sanitize_email.org'
58
+ config[:sanitized_bcc] = 'bcc@sanitize_email.org'
59
+ # run/call whatever logic should turn sanitize_email on and off in this Proc:
60
+ config[:activation_proc] = Proc.new { %w(development test).include?(Rails.env) }
61
+ config[:use_actual_email_prepended_to_subject] = true # or false
62
+ config[:use_actual_environment_prepended_to_subject] = true # or false
63
+ config[:use_actual_email_as_sanitized_user_name] = true # or false
64
+ end
65
+ ```
62
66
 
63
67
  Keep in mind, this is ruby (and possibly rails), so you can add conditionals or utilize different environment.rb files to customize these settings on a per-environment basis.
64
68
 
@@ -66,14 +70,17 @@ But wait there's more:
66
70
 
67
71
  Let's say you have a method in your model that you can call to test the signup email. You want to be able to test sending it to any user at any time... but you don't want the user to ACTUALLY get the email, even in production. A dilemma, yes? Not anymore!
68
72
 
69
- To override the environment based switch use force_sanitize, which is normally nil, and ignored by default. When set to true or false it will turn sanitization on or off:
73
+ To override the environment based switch use `force_sanitize`, which is normally `nil`, and ignored by default. When set to `true` or `false` it will turn sanitization on or off:
70
74
 
75
+ ```
71
76
  SanitizeEmail.force_sanitize = true
77
+ ```
72
78
 
73
79
  There are also two methods that take a block and turn SanitizeEmail on or off:
74
80
 
75
81
  Regardless of the Config settings of SanitizeEmail you can do a local override to force unsanitary email in any environment.
76
82
 
83
+ ```
77
84
  SanitizeEmail.unsanitary do
78
85
  Mail.deliver do
79
86
  from 'from@example.org'
@@ -82,11 +89,13 @@ Regardless of the Config settings of SanitizeEmail you can do a local override t
82
89
  subject 'subject'
83
90
  end
84
91
  end
92
+ ```
85
93
 
86
94
  Regardless of the Config settings of SanitizeEmail you can do a local override to send sanitary email in any environment.
87
95
  You have access to all the same configuration options in the parameter hash as you can set in the actual
88
96
  SanitizeEmail.configure block.
89
97
 
98
+ ```
90
99
  SanitizeEmail.sanitary({:sanitized_to => 'boo@example.com'}) do # these config options are merged with the globals
91
100
  Mail.deliver do
92
101
  from 'from@example.org'
@@ -95,12 +104,15 @@ SanitizeEmail.configure block.
95
104
  subject 'subject'
96
105
  end
97
106
  end
107
+ ```
98
108
 
99
109
  ## Deprecations
100
110
 
101
111
  Sometimes things get deprecated (meaning they still work, but are noisy about it). If this happens to you, and you like your head in the sand, call this number:
102
112
 
113
+ ```
103
114
  SanitizeEmail::Deprecation.deprecate_in_silence = true
115
+ ```
104
116
 
105
117
  ## Authors
106
118
 
@@ -56,7 +56,7 @@ module SanitizeEmail
56
56
  # For each type of address line
57
57
  v.each { |a|
58
58
  # For each address
59
- message.header = message.header.to_s + "\n#{k}: #{a}"
59
+ message.header = message.header.to_s.strip + "\n#{k}: #{a}"
60
60
  } if v
61
61
  }
62
62
  end
@@ -1,5 +1,5 @@
1
1
  #Copyright (c) 2008-12 Peter H. Boling of 9thBit LLC
2
2
  #Released under the MIT license
3
3
  module SanitizeEmail
4
- VERSION = '1.0.6'
4
+ VERSION = '1.0.7'
5
5
  end
@@ -5,7 +5,6 @@ Gem::Specification.new do |s|
5
5
  s.name = "sanitize_email"
6
6
  s.version = SanitizeEmail::VERSION
7
7
 
8
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
9
8
  s.authors = ["Peter Boling", "John Trupiano", "George Anderson"]
10
9
  s.summary = "Rails/Sinatra/Mail gem: Test email abilities without ever sending a message to actual live addresses"
11
10
  s.description = "In Rails, Sinatra, or simply the mail gem: Aids in development, testing, qa, and production troubleshooting of email issues without worrying that emails will get sent to actual live addresses."
@@ -20,8 +19,9 @@ Gem::Specification.new do |s|
20
19
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
21
20
  s.homepage = "http://github.com/pboling/sanitize_email"
22
21
  s.licenses = ["MIT"]
22
+ s.email = 'peter.boling@gmail.com'
23
23
  s.require_paths = ["lib"]
24
- s.rubygems_version = "1.8.24"
24
+ s.platform = Gem::Platform::RUBY
25
25
 
26
26
  # Runtime Dependencies
27
27
  # to replace the cattr_accessor method we lost when removing rails from run time dependencies
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.0.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-01-25 00:00:00.000000000 Z
14
+ date: 2013-08-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -192,10 +192,7 @@ dependencies:
192
192
  description: ! 'In Rails, Sinatra, or simply the mail gem: Aids in development, testing,
193
193
  qa, and production troubleshooting of email issues without worrying that emails
194
194
  will get sent to actual live addresses.'
195
- email:
196
- - peter.boling@gmail.com
197
- - jtrupiano@gmail.com
198
- - george@benevolentcode.com
195
+ email: peter.boling@gmail.com
199
196
  executables: []
200
197
  extensions: []
201
198
  extra_rdoc_files:
@@ -242,12 +239,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
239
  required_rubygems_version: !ruby/object:Gem::Requirement
243
240
  none: false
244
241
  requirements:
245
- - - ! '>'
242
+ - - ! '>='
246
243
  - !ruby/object:Gem::Version
247
- version: 1.3.1
244
+ version: '0'
248
245
  requirements: []
249
246
  rubyforge_project:
250
- rubygems_version: 1.8.24
247
+ rubygems_version: 1.8.25
251
248
  signing_key:
252
249
  specification_version: 3
253
250
  summary: ! 'Rails/Sinatra/Mail gem: Test email abilities without ever sending a message