actionmailer 0.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionmailer might be problematic. Click here for more details.

Files changed (34) hide show
  1. data/CHANGELOG +3 -0
  2. data/MIT-LICENSE +21 -0
  3. data/README +102 -0
  4. data/install.rb +61 -0
  5. data/lib/action_mailer.rb +44 -0
  6. data/lib/action_mailer/base.rb +111 -0
  7. data/lib/action_mailer/mail_helper.rb +17 -0
  8. data/lib/action_mailer/vendor/text/format.rb +1447 -0
  9. data/lib/action_mailer/vendor/tmail.rb +4 -0
  10. data/lib/action_mailer/vendor/tmail/address.rb +223 -0
  11. data/lib/action_mailer/vendor/tmail/base64.rb +52 -0
  12. data/lib/action_mailer/vendor/tmail/config.rb +50 -0
  13. data/lib/action_mailer/vendor/tmail/encode.rb +447 -0
  14. data/lib/action_mailer/vendor/tmail/facade.rb +531 -0
  15. data/lib/action_mailer/vendor/tmail/header.rb +893 -0
  16. data/lib/action_mailer/vendor/tmail/info.rb +16 -0
  17. data/lib/action_mailer/vendor/tmail/loader.rb +1 -0
  18. data/lib/action_mailer/vendor/tmail/mail.rb +420 -0
  19. data/lib/action_mailer/vendor/tmail/mailbox.rb +414 -0
  20. data/lib/action_mailer/vendor/tmail/mbox.rb +1 -0
  21. data/lib/action_mailer/vendor/tmail/net.rb +261 -0
  22. data/lib/action_mailer/vendor/tmail/obsolete.rb +116 -0
  23. data/lib/action_mailer/vendor/tmail/parser.rb +1503 -0
  24. data/lib/action_mailer/vendor/tmail/port.rb +358 -0
  25. data/lib/action_mailer/vendor/tmail/scanner.rb +22 -0
  26. data/lib/action_mailer/vendor/tmail/scanner_r.rb +244 -0
  27. data/lib/action_mailer/vendor/tmail/stringio.rb +260 -0
  28. data/lib/action_mailer/vendor/tmail/tmail.rb +1 -0
  29. data/lib/action_mailer/vendor/tmail/utils.rb +215 -0
  30. data/rakefile +99 -0
  31. data/test/fixtures/templates/signed_up.rhtml +3 -0
  32. data/test/fixtures/test_mailer/signed_up.rhtml +3 -0
  33. data/test/mail_service_test.rb +53 -0
  34. metadata +86 -0
@@ -0,0 +1,99 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/testtask'
4
+ require 'rake/rdoctask'
5
+ require 'rake/packagetask'
6
+ require 'rake/gempackagetask'
7
+ require 'rake/contrib/rubyforgepublisher'
8
+
9
+ PKG_VERSION = "0.3.0"
10
+
11
+ desc "Default Task"
12
+ task :default => [ :test ]
13
+
14
+ # Run the unit tests
15
+
16
+ Rake::TestTask.new { |t|
17
+ t.libs << "test"
18
+ t.pattern = 'test/*_test.rb'
19
+ t.verbose = true
20
+ }
21
+
22
+
23
+ # Genereate the RDoc documentation
24
+
25
+ Rake::RDocTask.new { |rdoc|
26
+ rdoc.rdoc_dir = 'doc'
27
+ rdoc.title = "Action Mailer -- Easy email delivery and testing"
28
+ rdoc.options << '--line-numbers --inline-source --main README'
29
+ rdoc.rdoc_files.include('README', 'CHANGELOG')
30
+ rdoc.rdoc_files.include('lib/action_mailer.rb')
31
+ rdoc.rdoc_files.include('lib/action_mailer/*.rb')
32
+ }
33
+
34
+
35
+ # Create compressed packages
36
+
37
+
38
+ spec = Gem::Specification.new do |s|
39
+ s.platform = Gem::Platform::RUBY
40
+ s.name = 'actionmailer'
41
+ s.summary = "Service layer for easy email delivery and testing."
42
+ s.description = %q{Makes it trivial to test and deliver emails sent from a single service layer.}
43
+ s.version = PKG_VERSION
44
+
45
+ s.author = "David Heinemeier Hansson"
46
+ s.email = "david@loudthinking.com"
47
+ s.rubyforge_project = "actionmailer"
48
+ s.homepage = "http://actionmailer.rubyonrails.org"
49
+
50
+ s.add_dependency('actionpack', '>= 0.9.0')
51
+
52
+ s.has_rdoc = true
53
+ s.requirements << 'none'
54
+ s.require_path = 'lib'
55
+ s.autorequire = 'action_mailer'
56
+
57
+ s.files = [ "rakefile", "install.rb", "README", "CHANGELOG", "MIT-LICENSE" ]
58
+ s.files = s.files + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "CVS" ) }
59
+ s.files = s.files + Dir.glob( "test/**/*" ).delete_if { |item| item.include?( "CVS" ) }
60
+ end
61
+
62
+ Rake::GemPackageTask.new(spec) do |p|
63
+ p.gem_spec = spec
64
+ p.need_tar = true
65
+ p.need_zip = true
66
+ end
67
+
68
+
69
+
70
+ # Publish documentation
71
+ desc "Publish the API documentation"
72
+ task :pdoc => [:rdoc] do
73
+ Rake::SshDirPublisher.new("davidhh@one.textdrive.com", "domains/rubyonrails.org/am", "doc").upload
74
+ end
75
+
76
+ desc "Publish to RubyForge"
77
+ task :rubyforge do
78
+ Rake::RubyForgePublisher.new('actionmailer', 'webster132').upload
79
+ end
80
+
81
+
82
+ desc "Count lines in the main rake file"
83
+ task :lines do
84
+ lines = 0
85
+ codelines = 0
86
+ Dir.foreach("lib/action_controller") { |file_name|
87
+ next unless file_name =~ /.*rb/
88
+
89
+ f = File.open("lib/action_controller/" + file_name)
90
+
91
+ while line = f.gets
92
+ lines += 1
93
+ next if line =~ /^\s*$/
94
+ next if line =~ /^\s*#/
95
+ codelines += 1
96
+ end
97
+ }
98
+ puts "Lines #{lines}, LOC #{codelines}"
99
+ end
@@ -0,0 +1,3 @@
1
+ Hello there,
2
+
3
+ Mr. <%= @recipient %>
@@ -0,0 +1,3 @@
1
+ Hello there,
2
+
3
+ Mr. <%= @recipient %>
@@ -0,0 +1,53 @@
1
+ $:.unshift(File.dirname(__FILE__) + "/../lib/")
2
+
3
+ require 'test/unit'
4
+ require 'action_mailer'
5
+
6
+ class TestMailer < ActionMailer::Base
7
+ def signed_up(recipient)
8
+ @recipients = recipient
9
+ @subject = "[Signed up] Welcome #{recipient}"
10
+ @from = "system@loudthinking.com"
11
+ @sent_on = Time.local(2004, 12, 12)
12
+ @body["recipient"] = recipient
13
+ end
14
+
15
+ def cancelled_account(recipient)
16
+ @recipients = recipient
17
+ @subject = "[Cancelled] Goodbye #{recipient}"
18
+ @from = "system@loudthinking.com"
19
+ @sent_on = Time.local(2004, 12, 12)
20
+ @body = "Goodbye, Mr. #{recipient}"
21
+ end
22
+ end
23
+
24
+ TestMailer.template_root = File.dirname(__FILE__) + "/fixtures"
25
+
26
+ class ActionMailerTest < Test::Unit::TestCase
27
+ def test_signed_up
28
+ expected = TMail::Mail.new
29
+ expected.to = "david@loudthinking.com"
30
+ expected.subject = "[Signed up] Welcome david@loudthinking.com"
31
+ expected.body = "Hello there, \n\nMr. david@loudthinking.com"
32
+ expected.from = "system@loudthinking.com"
33
+ expected.date = Time.local(2004, 12, 12)
34
+
35
+ assert_equal expected.encoded, TestMailer.create_signed_up("david@loudthinking.com").encoded
36
+ end
37
+
38
+ def test_cancelled_account
39
+ expected = TMail::Mail.new
40
+ expected.to = "david@loudthinking.com"
41
+ expected.subject = "[Cancelled] Goodbye david@loudthinking.com"
42
+ expected.body = "Goodbye, Mr. david@loudthinking.com"
43
+ expected.from = "system@loudthinking.com"
44
+ expected.date = Time.local(2004, 12, 12)
45
+
46
+ assert_equal expected.encoded, TestMailer.create_cancelled_account("david@loudthinking.com").encoded
47
+ end
48
+
49
+ def test_instances_are_nil
50
+ assert_nil ActionMailer::Base.new
51
+ assert_nil TestMailer.new
52
+ end
53
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.1
3
+ specification_version: 1
4
+ name: actionmailer
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.3.0
7
+ date: 2004-10-25
8
+ summary: Service layer for easy email delivery and testing.
9
+ require_paths:
10
+ - lib
11
+ author: David Heinemeier Hansson
12
+ email: david@loudthinking.com
13
+ homepage: http://actionmailer.rubyonrails.org
14
+ rubyforge_project: actionmailer
15
+ description: Makes it trivial to test and deliver emails sent from a single service layer.
16
+ autorequire: action_mailer
17
+ default_executable:
18
+ bindir: bin
19
+ has_rdoc: true
20
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
21
+ requirements:
22
+ -
23
+ - ">"
24
+ - !ruby/object:Gem::Version
25
+ version: 0.0.0
26
+ version:
27
+ platform: ruby
28
+ files:
29
+ - rakefile
30
+ - install.rb
31
+ - README
32
+ - CHANGELOG
33
+ - MIT-LICENSE
34
+ - lib/action_mailer
35
+ - lib/action_mailer.rb
36
+ - lib/action_mailer/base.rb
37
+ - lib/action_mailer/mail_helper.rb
38
+ - lib/action_mailer/vendor
39
+ - lib/action_mailer/vendor/text
40
+ - lib/action_mailer/vendor/tmail
41
+ - lib/action_mailer/vendor/tmail.rb
42
+ - lib/action_mailer/vendor/text/format.rb
43
+ - lib/action_mailer/vendor/tmail/address.rb
44
+ - lib/action_mailer/vendor/tmail/base64.rb
45
+ - lib/action_mailer/vendor/tmail/config.rb
46
+ - lib/action_mailer/vendor/tmail/encode.rb
47
+ - lib/action_mailer/vendor/tmail/facade.rb
48
+ - lib/action_mailer/vendor/tmail/header.rb
49
+ - lib/action_mailer/vendor/tmail/info.rb
50
+ - lib/action_mailer/vendor/tmail/loader.rb
51
+ - lib/action_mailer/vendor/tmail/mail.rb
52
+ - lib/action_mailer/vendor/tmail/mailbox.rb
53
+ - lib/action_mailer/vendor/tmail/mbox.rb
54
+ - lib/action_mailer/vendor/tmail/net.rb
55
+ - lib/action_mailer/vendor/tmail/obsolete.rb
56
+ - lib/action_mailer/vendor/tmail/parser.rb
57
+ - lib/action_mailer/vendor/tmail/port.rb
58
+ - lib/action_mailer/vendor/tmail/scanner.rb
59
+ - lib/action_mailer/vendor/tmail/scanner_r.rb
60
+ - lib/action_mailer/vendor/tmail/stringio.rb
61
+ - lib/action_mailer/vendor/tmail/tmail.rb
62
+ - lib/action_mailer/vendor/tmail/utils.rb
63
+ - test/fixtures
64
+ - test/mail_service_test.rb
65
+ - test/fixtures/templates
66
+ - test/fixtures/test_mailer
67
+ - test/fixtures/templates/signed_up.rhtml
68
+ - test/fixtures/test_mailer/signed_up.rhtml
69
+ test_files: []
70
+ rdoc_options: []
71
+ extra_rdoc_files: []
72
+ executables: []
73
+ extensions: []
74
+ requirements:
75
+ - none
76
+ dependencies:
77
+ - !ruby/object:Gem::Dependency
78
+ name: actionpack
79
+ version_requirement:
80
+ version_requirements: !ruby/object:Gem::Version::Requirement
81
+ requirements:
82
+ -
83
+ - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: 0.9.0
86
+ version: