laserlemon-email_override 0.1.0

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) 2009 Steve Richert
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/Manifest ADDED
@@ -0,0 +1,8 @@
1
+ init.rb
2
+ lib/email_override.rb
3
+ MIT-LICENSE
4
+ Rakefile
5
+ README.rdoc
6
+ test/email_override_test.rb
7
+ test/test_helper.rb
8
+ Manifest
data/README.rdoc ADDED
@@ -0,0 +1,13 @@
1
+ = email_override
2
+
3
+ == Installation
4
+
5
+ script/plugin install git://github.com/laserlemon/email_override.git
6
+
7
+ == Example
8
+
9
+ Coming soon...
10
+
11
+ == Tips
12
+
13
+ Coming soon...
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('email_override', '0.1.0') do |g|
6
+ g.description = %( Intercept ActionMailer email deliveries in non-production environments)
7
+ g.url = 'http://github.com/laserlemon/email_override'
8
+ g.author = 'Steve Richert'
9
+ g.email = 'steve@laserlemon.com'
10
+ g.ignore_pattern = %w(tmp/* script/*)
11
+ g.development_dependencies = []
12
+ end
13
+
14
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each{|t| load t }
@@ -0,0 +1,31 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{email_override}
5
+ s.version = "0.1.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Steve Richert"]
9
+ s.date = %q{2009-06-11}
10
+ s.description = %q{ Intercept ActionMailer email deliveries in non-production environments}
11
+ s.email = %q{steve@laserlemon.com}
12
+ s.extra_rdoc_files = ["lib/email_override.rb", "README.rdoc"]
13
+ s.files = ["init.rb", "lib/email_override.rb", "MIT-LICENSE", "Rakefile", "README.rdoc", "test/email_override_test.rb", "test/test_helper.rb", "Manifest", "email_override.gemspec"]
14
+ s.homepage = %q{http://github.com/laserlemon/email_override}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Email_override", "--main", "README.rdoc"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{email_override}
18
+ s.rubygems_version = %q{1.3.4}
19
+ s.summary = %q{Intercept ActionMailer email deliveries in non-production environments}
20
+ s.test_files = ["test/email_override_test.rb", "test/test_helper.rb"]
21
+
22
+ if s.respond_to? :specification_version then
23
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
24
+ s.specification_version = 3
25
+
26
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
27
+ else
28
+ end
29
+ else
30
+ end
31
+ end
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'email_override'
@@ -0,0 +1,53 @@
1
+ module LaserLemon
2
+ module EmailOverride
3
+ def self.included(base)
4
+
5
+ base.cattr_accessor :local_environments
6
+ base.local_environments = %w(development test)
7
+
8
+ base.cattr_accessor :public_environments
9
+ base.public_environments = %w(production)
10
+
11
+ base.cattr_accessor :override_recipients
12
+ base.override_recipients = []
13
+
14
+ base.cattr_accessor :override_cc
15
+ base.override_cc = []
16
+
17
+ base.cattr_accessor :override_bcc
18
+ base.override_bcc = []
19
+
20
+ base.extend ClassMethods
21
+ end
22
+
23
+ module ClassMethods
24
+ def local?
25
+ local_environments.include?(Rails.env)
26
+ end
27
+
28
+ def public?
29
+ public_environments.include?(Rails.env)
30
+ end
31
+
32
+ def recipients_with_override(*args)
33
+ local? ? override_recipients : recipients_without_override(*args)
34
+ end
35
+
36
+ alias_method_chain :recipients, :override
37
+
38
+ def cc_with_override(*args)
39
+ local? ? override_cc : cc_without_override(*args)
40
+ end
41
+
42
+ alias_method_chain :cc, :override
43
+
44
+ def bcc_with_override(*args)
45
+ local? ? override_bcc : bcc_without_override(*args)
46
+ end
47
+
48
+ alias_method_chain :bcc, :override
49
+ end
50
+ end
51
+ end
52
+
53
+ ActionMailer::Base.send(:include, LaserLemon::EmailOverride)
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class EmailOverrideTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ test "the truth" do
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'active_support'
3
+ require 'active_support/test_case'
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: laserlemon-email_override
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Steve Richert
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-06-11 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Intercept ActionMailer email deliveries in non-production environments
17
+ email: steve@laserlemon.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - lib/email_override.rb
24
+ - README.rdoc
25
+ files:
26
+ - init.rb
27
+ - lib/email_override.rb
28
+ - MIT-LICENSE
29
+ - Rakefile
30
+ - README.rdoc
31
+ - test/email_override_test.rb
32
+ - test/test_helper.rb
33
+ - Manifest
34
+ - email_override.gemspec
35
+ has_rdoc: false
36
+ homepage: http://github.com/laserlemon/email_override
37
+ post_install_message:
38
+ rdoc_options:
39
+ - --line-numbers
40
+ - --inline-source
41
+ - --title
42
+ - Email_override
43
+ - --main
44
+ - README.rdoc
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ version:
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "1.2"
58
+ version:
59
+ requirements: []
60
+
61
+ rubyforge_project: email_override
62
+ rubygems_version: 1.2.0
63
+ signing_key:
64
+ specification_version: 3
65
+ summary: Intercept ActionMailer email deliveries in non-production environments
66
+ test_files:
67
+ - test/email_override_test.rb
68
+ - test/test_helper.rb