sanitize_email 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Peter H. Boling of 9thBit LLC
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,116 @@
1
+ = sanitize_email
2
+
3
+ This gem allows you to globally override your mail delivery settings. It's particularly helpful when you want to omit the delivery of email (e.g. in development/test environments) or alter the to/cc/bcc (e.g. in staging or demo environments) of all email generated from your application.
4
+
5
+ It is a "configure it and forget it" type gem that requires very little setup. It includes some very innocuous monkey patching of ActionMailer::Base to work its magic.
6
+
7
+ Peter Boling wrote the plugin that this gem is derived from. It currently solves three common problems in ruby web applications that use ActionMailer:
8
+
9
+ === Working Locally with Production Data
10
+
11
+ Peter described this common problem in his original plugin implementation as such:
12
+
13
+ * I have a production site with live data.
14
+ * I dump the live data and securely transfer it to another machine (rync -e ssh), and import it using scripts that I will soon open source.
15
+ * On this separate machine (staging, or development) I run tests, and test various features.
16
+ * I usually want the emails to get sent from these non-production environments so I can verify what they look like when sent, but I don't ever want to risk them getting sent to addresses that are not mine.
17
+
18
+ === Re-routing Email on a Staging or QA Server
19
+
20
+ Another very important use case for me is to transparently re-route email generated from a staging or QA server to an appropriate person. For example, it's common for us to set up a staging server for a client to use to view our progress and test out new features. It's important for any email that is generated from our web application be delivered to the client's inbox so that they can review the content and ensure that it's acceptable. Similarly, we set up QA instances for our own QA team and we use {rails-caddy}[http://github.com/jtrupiano/rails-caddy] to allow each QA person to configure it specifically for them.
21
+
22
+ === Testing Email from a Hot Production Server
23
+
24
+ If you install this gem on a production server (which I don't always do), you can load up script/console and override the to/cc/bcc on all emails for the duration of your console session. This allows you to poke and prod a live production instance, and route all email to your own inbox for inspection. The best part is that this can all be accomplished without changing a single line of your application code.
25
+
26
+ == Install
27
+
28
+ gem sources -a http://gems.github.com/
29
+ gem install pboling-sanitize_email
30
+
31
+ == Setup
32
+
33
+ It only requires a few lines of configuration:
34
+
35
+ * Rails 1.x: Add to bottom of environment.rb
36
+
37
+ * Rails 2.x: Use an initializer, stick it in any initializer file, or create a new one for sanitize_email
38
+
39
+ Add this bit and customize for your app:
40
+
41
+ # Settings for sanitize_email gem. These can be overridden in individual config/%env%/environment.rb files.
42
+
43
+ require 'sanitize_email'
44
+ ActionMailer::Base.sanitized_recipients = "jtrupiano@gmail.com"
45
+ ActionMailer::Base.sanitized_bcc = nil
46
+ ActionMailer::Base.sanitized_cc = nil
47
+
48
+ # optionally, you can configure sanitize_email to to include the "real" email address as the 'user name' of the
49
+ # "sanitized" email (e.g. "real@address.com <sanitized@email.com>")
50
+ ActionMailer::Base.use_actual_email_as_sanitized_user_name = true # defaults to false
51
+
52
+ # These are the environments whose outgoing email BCC, CC and recipients fields will be overridden!
53
+ # All environments not listed will be treated as normal.
54
+ ActionMailer::Base.local_environments = %w( development test staging )
55
+
56
+ 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.
57
+
58
+ But wait there's more:
59
+
60
+ Let's say you have a method in your model that you can call to test the signup email.
61
+ You want to be able to test sending it to any user at any time... but you don't want
62
+ the user to ACTUALLY get the email, even in production. A dilemma, yes? Not anymore!
63
+
64
+ All your mailers get a force_sanitize class method which takes precedence over the environment override.
65
+
66
+ When force_sanitize is nil it will not be used by sanitize_email to determine if it should override the recipients, bcc, and cc.
67
+
68
+
69
+ == Example
70
+
71
+ So here's how you can use force_sanitize to override the override.
72
+
73
+ Even if you set:
74
+
75
+ ActionMailer::Base.local_environments = %w( development )
76
+
77
+ and are in the development environment, you can override the override anywhere in your code.
78
+
79
+ class User < ActiveRecord::Base
80
+ def test_signup_email_me_only
81
+ UserMailer.force_sanitize = true
82
+ UserMailer.deliver_signup_notification(self)
83
+ UserMailer.force_sanitize = nil
84
+ end
85
+
86
+ def test_signup_email_user_only
87
+ UserMailer.force_sanitize = false
88
+ UserMailer.deliver_signup_notification(self)
89
+ UserMailer.force_sanitize = nil
90
+ end
91
+
92
+ # this third method would conditionally use the overridden recipients based on current Rails environment
93
+ def test_signup_email_environment
94
+ UserMailer.deliver_signup_notification(self)
95
+ end
96
+ end
97
+
98
+ Load the console with ruby script/console and regardless of what environment you are in:
99
+
100
+ > User.find(4).test_signup_email_me_only
101
+
102
+ and the email will have it's recipients, bcc, and cc overridden to be whatever you set the sanitized values to be.
103
+ Then if you want to send it to the actual user, instead of yourself
104
+
105
+ > User.find(4).test_signup_email_user_only
106
+
107
+ == References
108
+ * {RDoc}[http://johntrupiano.rubyforge.org/sanitize_email]
109
+ * {Source Code}[http://github.com/pboling/sanitize_email]
110
+ * {Gem Release Announcement}[http://blog.smartlogicsolutions.com/2009/04/25/reintroducing-sanitize_email-work-with-production-email-without-fear/]
111
+ * {Peter's Original Writeup}[http://galtzo.blogspot.com/2008/11/sanitize-email-never-worry-about.html]
112
+ * {Using sanitize_email to Preview HTML Emails Locally}[http://blog.smartlogicsolutions.com/2009/04/30/using-sanitize-email-to-preview-html-emails-locally/]
113
+
114
+ Copyright (c) 2009 {John Trupiano}[http://smartlogicsolutions.com/wiki/John_Trupiano] of {SmartLogic Solutions, LLC}[http://www.smartlogicsolutions.com]
115
+ Copyright (c) 2008 {Peter H. Boling}[http://www.peterboling.com/about.html] of {9thBit LLC}[http://www.peterboling.com/]
116
+ Released under the MIT license
data/Rakefile ADDED
@@ -0,0 +1,78 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+
5
+ begin
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gemspec|
8
+ gemspec.name = "sanitize_email"
9
+ #gemspec.rubyforge_project = "johntrupiano"
10
+ gemspec.summary = "Tool to aid in development, testing, qa, and production troubleshooting of email issues without worrying that emails will get sent to actual live addresses."
11
+ gemspec.description = %q{Test an application's email abilities without ever sending a message to actual live addresses}
12
+ gemspec.email = ['peter.boling@gmail.com', 'jtrupiano@gmail.com', 'george@benevolentcode.com']
13
+ gemspec.homepage = "http://github.com/pboling/capistrano_mailer"
14
+ gemspec.authors = ["Peter Boling", "John Trupiano", "George Anderson"]
15
+ gemspec.add_dependency 'actionmailer'
16
+ gemspec.files = ["lib/sanitize_email/custom_environments.rb",
17
+ "lib/sanitize_email/sanitize_email.rb",
18
+ "lib/sanitize_email.rb",
19
+ "init.rb",
20
+ "MIT-LICENSE",
21
+ "Rakefile",
22
+ "README.rdoc",
23
+ "sanitize_email.gemspec",
24
+ "VERSION.yml",
25
+ "test/sample_mailer.rb",
26
+ "test/sanitize_email_test.rb"]
27
+ end
28
+ Jeweler::GemcutterTasks.new
29
+ rescue LoadError
30
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
31
+ end
32
+
33
+ desc 'Default: run unit tests.'
34
+ task :default => :test
35
+
36
+ desc 'Test the sanitize_email plugin.'
37
+ Rake::TestTask.new(:test) do |t|
38
+ t.libs << 'lib'
39
+ t.pattern = 'test/**/*_test.rb'
40
+ t.verbose = true
41
+ end
42
+
43
+ desc 'Generate documentation for the sanitize_email plugin.'
44
+ Rake::RDocTask.new do |rdoc|
45
+ config = YAML.load(File.read('VERSION.yml'))
46
+ rdoc.rdoc_dir = 'rdoc'
47
+ rdoc.title = "sanitize_email #{config[:major]}.#{config[:minor]}.#{config[:patch]}"
48
+ rdoc.options << '--line-numbers' << '--inline-source'
49
+ rdoc.rdoc_files.include('README*')
50
+ rdoc.rdoc_files.include('lib/**/*.rb')
51
+ end
52
+
53
+ # Rubyforge documentation task
54
+ begin
55
+ require 'rake/contrib/sshpublisher'
56
+ namespace :rubyforge do
57
+
58
+ desc "Release gem and RDoc documentation to RubyForge"
59
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
60
+
61
+ namespace :release do
62
+ desc "Publish RDoc to RubyForge."
63
+ task :docs => [:rdoc] do
64
+ config = YAML.load(
65
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
66
+ )
67
+
68
+ host = "#{config['username']}@rubyforge.org"
69
+ remote_dir = "/var/www/gforge-projects/johntrupiano/sanitize_email/"
70
+ local_dir = 'rdoc'
71
+
72
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
73
+ end
74
+ end
75
+ end
76
+ rescue LoadError
77
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
78
+ end
data/VERSION.yml ADDED
@@ -0,0 +1,5 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 3
4
+ :build:
5
+ :patch: 5
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'sanitize_email'
@@ -0,0 +1,6 @@
1
+ require 'action_mailer'
2
+ require 'sanitize_email/sanitize_email'
3
+ require 'sanitize_email/custom_environments'
4
+
5
+ ActionMailer::Base.send :include, NinthBit::CustomEnvironments
6
+ ActionMailer::Base.send :include, NinthBit::SanitizeEmail
@@ -0,0 +1,21 @@
1
+ #Copyright (c) 2008-9 Peter H. Boling of 9thBit LLC
2
+ #Released under the MIT license
3
+
4
+ module NinthBit
5
+ module CustomEnvironments
6
+
7
+ def self.included(base)
8
+ base.extend(ClassMethods)
9
+
10
+ base.cattr_accessor :local_environments
11
+ base.local_environments = %w( development test )
12
+ end
13
+
14
+ module ClassMethods
15
+ def consider_local?
16
+ local_environments.include?(defined?(Rails) ? Rails.env : RAILS_ENV)
17
+ end
18
+ end
19
+
20
+ end
21
+ end
@@ -0,0 +1,108 @@
1
+ #Copyright (c) 2008-9 Peter H. Boling of 9thBit LLC
2
+ #Released under the MIT license
3
+
4
+ module NinthBit
5
+ module SanitizeEmail
6
+
7
+ def self.included(base)
8
+
9
+ # Adds the following class attributes to the classes that include NinthBit::SanitizeEmail
10
+ base.cattr_accessor :force_sanitize
11
+ base.force_sanitize = nil
12
+
13
+ # Specify the BCC addresses for the messages that go out in 'local' environments
14
+ base.cattr_accessor :sanitized_bcc
15
+ base.sanitized_bcc = nil
16
+
17
+ # Specify the CC addresses for the messages that go out in 'local' environments
18
+ base.cattr_accessor :sanitized_cc
19
+ base.sanitized_cc = nil
20
+
21
+ # The recipient addresses for the messages, either as a string (for a single
22
+ # address) or an array (for multiple addresses) that go out in 'local' environments
23
+ base.cattr_accessor :sanitized_recipients
24
+ base.sanitized_recipients = nil
25
+
26
+ # Use the 'real' email address as the username for the sanitized email address
27
+ # e.g. "real@example.com <sanitized@example.com>"
28
+ base.cattr_accessor :use_actual_email_as_sanitized_user_name
29
+ base.use_actual_email_as_sanitized_user_name = false
30
+
31
+ # Prepend the 'real' email address onto the Subject line of the message
32
+ # e.g. "real@example.com rest of subject"
33
+ base.cattr_accessor :use_actual_email_prepended_to_subject
34
+ base.use_actual_email_prepended_to_subject = false
35
+
36
+ base.class_eval do
37
+ # We need to alias these methods so that our new methods get used instead
38
+ alias :real_bcc :bcc
39
+ alias :real_cc :cc
40
+ alias :real_recipients :recipients
41
+ alias :real_subject :subject
42
+
43
+ def localish?
44
+ # consider_local is a method in sanitize_email/lib/custom_environments.rb
45
+ # it is included in ActionMailer in sanitize_email/init.rb
46
+ !self.class.force_sanitize.nil? ? self.class.force_sanitize : self.class.consider_local?
47
+ end
48
+
49
+ def subject(*lines)
50
+ real_subject(*lines)
51
+ localish? ? override_subject : real_subject
52
+ end
53
+
54
+ def recipients(*addresses)
55
+ real_recipients(*addresses)
56
+ if localish?
57
+ puts "sanitize_email error: sanitized_recipients is not set" if self.class.sanitized_recipients.nil?
58
+ override_email(:recipients)
59
+ else
60
+ real_recipients
61
+ end
62
+ end
63
+
64
+ def cc(*addresses)
65
+ real_cc(*addresses)
66
+ localish? ? override_email(:cc) : real_cc
67
+ end
68
+
69
+ def bcc(*addresses)
70
+ real_bcc(*addresses)
71
+ localish? ? override_email(:bcc) : real_bcc
72
+ end
73
+
74
+ #######
75
+ private
76
+ #######
77
+
78
+ def override_subject
79
+ real_recipients.nil? ? real_subject : "(#{real_recipients}) #{real_subject}"
80
+ end
81
+
82
+ def override_email(type)
83
+ real_addresses, sanitized_addresses =
84
+ case type
85
+ when :recipients
86
+ [real_recipients, self.class.sanitized_recipients]
87
+ when :cc
88
+ [real_cc, self.class.sanitized_cc]
89
+ when :bcc
90
+ [real_bcc, self.class.sanitized_bcc]
91
+ else raise "sanitize_email error: unknown email override"
92
+ end
93
+
94
+ # If there were no original recipients, then we DO NOT override the nil with the sanitized recipients
95
+ return nil if real_addresses.nil?
96
+ return sanitized_addresses if sanitized_addresses.nil? || !self.class.use_actual_email_as_sanitized_user_name
97
+
98
+ out = real_addresses.inject([]) do |result, real_recipient|
99
+ result << sanitized_addresses.map{|sanitized| "#{real_recipient} <#{sanitized}>"}
100
+ result
101
+ end.flatten
102
+ return out
103
+ end
104
+
105
+ end
106
+ end
107
+ end # end Module SanitizeEmail
108
+ end # end Module NinthBit
@@ -0,0 +1,55 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{sanitize_email}
8
+ s.version = "0.3.5"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Peter Boling", "John Trupiano", "George Anderson"]
12
+ s.date = %q{2009-11-10}
13
+ s.description = %q{Test an application's email abilities without ever sending a message to actual live addresses}
14
+ s.email = ["peter.boling@gmail.com", "jtrupiano@gmail.com", "george@benevolentcode.com"]
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ "MIT-LICENSE",
20
+ "README.rdoc",
21
+ "Rakefile",
22
+ "VERSION.yml",
23
+ "init.rb",
24
+ "lib/sanitize_email.rb",
25
+ "lib/sanitize_email/custom_environments.rb",
26
+ "lib/sanitize_email/sanitize_email.rb",
27
+ "sanitize_email.gemspec",
28
+ "test/sample_mailer.rb",
29
+ "test/sanitize_email_test.rb"
30
+ ]
31
+ s.homepage = %q{http://github.com/pboling/capistrano_mailer}
32
+ s.rdoc_options = ["--charset=UTF-8"]
33
+ s.require_paths = ["lib"]
34
+ s.rubygems_version = %q{1.3.5}
35
+ s.summary = %q{Tool to aid in development, testing, qa, and production troubleshooting of email issues without worrying that emails will get sent to actual live addresses.}
36
+ s.test_files = [
37
+ "test/sample_mailer.rb",
38
+ "test/sanitize_email_test.rb",
39
+ "test/test_helper.rb"
40
+ ]
41
+
42
+ if s.respond_to? :specification_version then
43
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
47
+ s.add_runtime_dependency(%q<actionmailer>, [">= 0"])
48
+ else
49
+ s.add_dependency(%q<actionmailer>, [">= 0"])
50
+ end
51
+ else
52
+ s.add_dependency(%q<actionmailer>, [">= 0"])
53
+ end
54
+ end
55
+
@@ -0,0 +1,24 @@
1
+ class SampleMailer < ActionMailer::Base
2
+
3
+ def gmail_override
4
+ @recipients = "to_real@email.com"
5
+ @cc = "cc_real@email.com"
6
+ @bcc = "bcc_real@email.com"
7
+
8
+ @subject = "Hello there"
9
+
10
+ part :content_type => "text/html", :body => "Hello there"
11
+ end
12
+
13
+ def gmail_override_multiple_recipient
14
+ @recipients = ["to_0_real@email.com", "to_1_real@email.com"]
15
+ @cc = "cc_real@email.com"
16
+ @bcc = "bcc_real@email.com"
17
+
18
+ @subject = "Hello there, multiple"
19
+
20
+ part :content_type => "text/html", :body => "Hello there, multiple."
21
+
22
+ end
23
+
24
+ end
@@ -0,0 +1,76 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/test_helper')
2
+
3
+ class SanitizeEmailTest < Test::Unit::TestCase
4
+ def setup
5
+ ENV['RAILS_ENV'] = 'test'
6
+ end
7
+
8
+ def prepare_sanitizations(to = nil, cc = nil, bcc = nil, use_actual_email_as_sanitized_user_name = false)
9
+ ActionMailer::Base.sanitized_recipients = to
10
+ ActionMailer::Base.sanitized_cc = cc
11
+ ActionMailer::Base.sanitized_bcc = bcc
12
+ ActionMailer::Base.local_environments = %w( test )
13
+ ActionMailer::Base.use_actual_email_as_sanitized_user_name = use_actual_email_as_sanitized_user_name
14
+ end
15
+
16
+ def test_send_can_override_recips_cc_bcc_all_independently
17
+ prepare_sanitizations("to_sanitized@email.com", "cc_sanitized@email.com")
18
+
19
+ tmail = SampleMailer.create_gmail_override
20
+ assert_equal ["to_sanitized@email.com"], tmail.to
21
+ assert_equal ["cc_sanitized@email.com"], tmail.cc
22
+ assert_equal nil, tmail.bcc
23
+ end
24
+
25
+ def test_to_with_override
26
+ prepare_sanitizations("to_sanitized@email.com", nil, nil, :override_username)
27
+ tmail = SampleMailer.create_gmail_override
28
+ assert_equal "to_real@email.com", tmail.to_addrs[0].name
29
+ assert_equal "to_sanitized@email.com", tmail.to_addrs[0].address
30
+ end
31
+
32
+ def test_tcc_with_override
33
+ prepare_sanitizations("to_sanitized@email.com", "cc_sanitized@email.com", nil, :override_username)
34
+ tmail = SampleMailer.create_gmail_override
35
+ assert_equal "cc_real@email.com", tmail.cc_addrs[0].name
36
+ assert_equal "cc_sanitized@email.com", tmail.cc_addrs[0].address
37
+ end
38
+
39
+ def test_bcc_with_override
40
+ prepare_sanitizations("to_sanitized@email.com", nil, "bcc_sanitized@email.com", :override_username)
41
+ tmail = SampleMailer.create_gmail_override
42
+ assert_equal "bcc_real@email.com", tmail.bcc_addrs[0].name
43
+ assert_equal "bcc_sanitized@email.com", tmail.bcc_addrs[0].address
44
+ end
45
+
46
+ def test_override_with_multiple_santiized_emails
47
+ prepare_sanitizations(["to_0_sanitized@email.com", "to_1_sanitized@email.com"], nil, nil, :override_username)
48
+ tmail = SampleMailer.create_gmail_override
49
+ tmail.to_addrs.each_with_index do |mail, idx|
50
+ assert_equal "to_real@email.com", mail.name
51
+ assert_equal "to_#{idx}_sanitized@email.com", mail.address
52
+ end
53
+ end
54
+
55
+ def test_overriding_multiple_real_addresses
56
+ prepare_sanitizations("to_sanitized@email.com", nil, nil, :override_username)
57
+ tmail = SampleMailer.create_gmail_override_multiple_recipient
58
+ tmail.to_addrs.each_with_index do |mail, idx|
59
+ assert_equal "to_#{idx}_real@email.com", mail.name
60
+ assert_equal "to_sanitized@email.com", mail.address
61
+ end
62
+ end
63
+
64
+ def test_overriding_multiple_real_addresses_with_multiple_sanitized_emails
65
+ prepare_sanitizations(["to_0_sanitized@email.com", "to_1_sanitized@email.com"], nil, nil, :override_username)
66
+ tmail = SampleMailer.create_gmail_override_multiple_recipient
67
+
68
+ assert tmail.to_addrs.map(&:name).include?("to_0_real@email.com")
69
+ assert tmail.to_addrs.map(&:name).include?("to_1_real@email.com")
70
+
71
+ assert tmail.to_addrs.map(&:address).include?("to_0_sanitized@email.com")
72
+ assert tmail.to_addrs.map(&:address).include?("to_1_sanitized@email.com")
73
+ end
74
+
75
+
76
+ end
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+
3
+ require 'test/unit'
4
+
5
+ RAILS_ROOT = '.' unless defined?(RAILS_ROOT)
6
+ RAILS_ENV = 'test'
7
+
8
+ require File.join(File.dirname(__FILE__), "..", "init")
9
+
10
+ # configure ActionMailer
11
+ ActionMailer::Base.template_root = File.join(File.dirname(__FILE__), "test")
12
+ ActionMailer::Base.sanitized_recipients = "test@example.com"
13
+ ActionMailer::Base.sanitized_bcc = nil
14
+ ActionMailer::Base.sanitized_cc = nil
15
+
16
+ require 'test/sample_mailer'
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sanitize_email
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.5
5
+ platform: ruby
6
+ authors:
7
+ - Peter Boling
8
+ - John Trupiano
9
+ - George Anderson
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2009-11-10 00:00:00 -05:00
15
+ default_executable:
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: actionmailer
19
+ type: :runtime
20
+ version_requirement:
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: "0"
26
+ version:
27
+ description: Test an application's email abilities without ever sending a message to actual live addresses
28
+ email:
29
+ - peter.boling@gmail.com
30
+ - jtrupiano@gmail.com
31
+ - george@benevolentcode.com
32
+ executables: []
33
+
34
+ extensions: []
35
+
36
+ extra_rdoc_files:
37
+ - README.rdoc
38
+ files:
39
+ - MIT-LICENSE
40
+ - README.rdoc
41
+ - Rakefile
42
+ - VERSION.yml
43
+ - init.rb
44
+ - lib/sanitize_email.rb
45
+ - lib/sanitize_email/custom_environments.rb
46
+ - lib/sanitize_email/sanitize_email.rb
47
+ - sanitize_email.gemspec
48
+ - test/sample_mailer.rb
49
+ - test/sanitize_email_test.rb
50
+ has_rdoc: true
51
+ homepage: http://github.com/pboling/capistrano_mailer
52
+ licenses: []
53
+
54
+ post_install_message:
55
+ rdoc_options:
56
+ - --charset=UTF-8
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ version:
71
+ requirements: []
72
+
73
+ rubyforge_project:
74
+ rubygems_version: 1.3.5
75
+ signing_key:
76
+ specification_version: 3
77
+ summary: Tool to aid in development, testing, qa, and production troubleshooting of email issues without worrying that emails will get sent to actual live addresses.
78
+ test_files:
79
+ - test/sample_mailer.rb
80
+ - test/sanitize_email_test.rb
81
+ - test/test_helper.rb