mailhopper 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +69 -0
  3. data/Rakefile +39 -0
  4. data/app/mailers/mailhopper/mailer.rb +4 -0
  5. data/app/models/mailhopper/email.rb +17 -0
  6. data/config/routes.rb +2 -0
  7. data/lib/generators/mailhopper/mailhopper_generator.rb +36 -0
  8. data/lib/generators/mailhopper/templates/README +28 -0
  9. data/lib/generators/mailhopper/templates/initializer.rb +3 -0
  10. data/lib/generators/mailhopper/templates/migrations/create_emails.rb +21 -0
  11. data/lib/mailhopper.rb +13 -0
  12. data/lib/mailhopper/base.rb +19 -0
  13. data/lib/mailhopper/engine.rb +4 -0
  14. data/lib/mailhopper/queue.rb +18 -0
  15. data/lib/mailhopper/version.rb +3 -0
  16. data/lib/tasks/mailhopper_tasks.rake +4 -0
  17. data/test/dummy/Rakefile +7 -0
  18. data/test/dummy/app/assets/javascripts/application.js +9 -0
  19. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  20. data/test/dummy/app/controllers/application_controller.rb +3 -0
  21. data/test/dummy/app/helpers/application_helper.rb +2 -0
  22. data/test/dummy/app/mailers/sample_mailer.rb +8 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/test/dummy/app/views/sample_mailer/hello.text.erb +1 -0
  25. data/test/dummy/config.ru +4 -0
  26. data/test/dummy/config/application.rb +42 -0
  27. data/test/dummy/config/boot.rb +10 -0
  28. data/test/dummy/config/database.yml +25 -0
  29. data/test/dummy/config/environment.rb +5 -0
  30. data/test/dummy/config/environments/development.rb +27 -0
  31. data/test/dummy/config/environments/production.rb +51 -0
  32. data/test/dummy/config/environments/test.rb +39 -0
  33. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  34. data/test/dummy/config/initializers/inflections.rb +10 -0
  35. data/test/dummy/config/initializers/mailhopper.rb +3 -0
  36. data/test/dummy/config/initializers/mime_types.rb +5 -0
  37. data/test/dummy/config/initializers/secret_token.rb +7 -0
  38. data/test/dummy/config/initializers/session_store.rb +8 -0
  39. data/test/dummy/config/initializers/wrap_parameters.rb +12 -0
  40. data/test/dummy/config/locales/en.yml +5 -0
  41. data/test/dummy/config/routes.rb +58 -0
  42. data/test/dummy/db/development.sqlite3 +0 -0
  43. data/test/dummy/db/migrate/20110801151741_create_emails.rb +21 -0
  44. data/test/dummy/db/schema.rb +28 -0
  45. data/test/dummy/db/test.sqlite3 +0 -0
  46. data/test/dummy/log/development.log +50 -0
  47. data/test/dummy/log/test.log +398 -0
  48. data/test/dummy/public/404.html +26 -0
  49. data/test/dummy/public/422.html +26 -0
  50. data/test/dummy/public/500.html +26 -0
  51. data/test/dummy/public/favicon.ico +0 -0
  52. data/test/dummy/script/rails +6 -0
  53. data/test/integration/navigation_test.rb +10 -0
  54. data/test/mailhopper_test.rb +7 -0
  55. data/test/test_helper.rb +14 -0
  56. data/test/unit/email_test.rb +50 -0
  57. metadata +207 -0
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ fixtures :all
5
+
6
+ test "truth" do
7
+ assert_kind_of Dummy::Application, Rails.application
8
+ end
9
+ end
10
+
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class MailhopperTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Mailhopper
6
+ end
7
+ end
@@ -0,0 +1,14 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+ require "shoulda/rails"
7
+
8
+ Rails.backtrace_cleaner.remove_silencers!
9
+
10
+ # Load support files
11
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
12
+
13
+ # Run any available migration
14
+ ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
@@ -0,0 +1,50 @@
1
+ require 'test_helper'
2
+
3
+ class EmailTest < ActiveSupport::TestCase
4
+ context "An email" do
5
+ setup do
6
+ @email = Mailhopper::Email.new
7
+ end
8
+
9
+ should "require a from address" do
10
+ assert !@email.valid?
11
+ @email.from_address = 'user@example.com'
12
+ assert @email.valid?
13
+ end
14
+
15
+ should "be generated when mail is sent" do
16
+ headers = {
17
+ :from => 'from@example.com',
18
+ :to => 'to@example.com',
19
+ :cc => 'cc@example.com',
20
+ :bcc => 'bcc@example.com',
21
+ :reply_to => 'reply_to@example.com',
22
+ :subject => 'Hiya!'
23
+ }
24
+ content = 'Papaya'
25
+
26
+ assert_equal Mailhopper::Email.count, 0
27
+ SampleMailer.hello(headers, content).deliver
28
+ assert_equal Mailhopper::Email.count, 1
29
+
30
+ email = Mailhopper::Email.first
31
+ assert_equal email.from_address, headers[:from]
32
+ assert_equal email.to_address, headers[:to]
33
+ assert_equal email.cc_address, headers[:cc]
34
+ assert_equal email.bcc_address, headers[:bcc]
35
+ assert_equal email.reply_to_address, headers[:reply_to]
36
+ assert_equal email.subject, headers[:subject]
37
+
38
+ # Email content will include headers as well as content
39
+ assert email.content.include?(content)
40
+
41
+ assert email.sent_at.nil?
42
+ end
43
+
44
+ context "with a from address" do
45
+ setup do
46
+ @email.from_address = 'user@example.com'
47
+ end
48
+ end
49
+ end
50
+ end
metadata ADDED
@@ -0,0 +1,207 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mailhopper
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Dan Gebhardt
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-08-04 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rails
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 15424111
30
+ segments:
31
+ - 3
32
+ - 1
33
+ - 0
34
+ - rc
35
+ - 5
36
+ version: 3.1.0.rc5
37
+ type: :runtime
38
+ version_requirements: *id001
39
+ - !ruby/object:Gem::Dependency
40
+ name: sqlite3
41
+ prerelease: false
42
+ requirement: &id002 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ hash: 3
48
+ segments:
49
+ - 0
50
+ version: "0"
51
+ type: :development
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: shoulda
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ type: :development
66
+ version_requirements: *id003
67
+ description: Mailhopper stores your application's emails in a queue for delayed delivery.
68
+ email:
69
+ - support@cerebris.com
70
+ executables: []
71
+
72
+ extensions: []
73
+
74
+ extra_rdoc_files: []
75
+
76
+ files:
77
+ - app/mailers/mailhopper/mailer.rb
78
+ - app/models/mailhopper/email.rb
79
+ - config/routes.rb
80
+ - lib/generators/mailhopper/mailhopper_generator.rb
81
+ - lib/generators/mailhopper/templates/initializer.rb
82
+ - lib/generators/mailhopper/templates/migrations/create_emails.rb
83
+ - lib/generators/mailhopper/templates/README
84
+ - lib/mailhopper/base.rb
85
+ - lib/mailhopper/engine.rb
86
+ - lib/mailhopper/queue.rb
87
+ - lib/mailhopper/version.rb
88
+ - lib/mailhopper.rb
89
+ - lib/tasks/mailhopper_tasks.rake
90
+ - MIT-LICENSE
91
+ - Rakefile
92
+ - README.rdoc
93
+ - test/dummy/app/assets/javascripts/application.js
94
+ - test/dummy/app/assets/stylesheets/application.css
95
+ - test/dummy/app/controllers/application_controller.rb
96
+ - test/dummy/app/helpers/application_helper.rb
97
+ - test/dummy/app/mailers/sample_mailer.rb
98
+ - test/dummy/app/views/layouts/application.html.erb
99
+ - test/dummy/app/views/sample_mailer/hello.text.erb
100
+ - test/dummy/config/application.rb
101
+ - test/dummy/config/boot.rb
102
+ - test/dummy/config/database.yml
103
+ - test/dummy/config/environment.rb
104
+ - test/dummy/config/environments/development.rb
105
+ - test/dummy/config/environments/production.rb
106
+ - test/dummy/config/environments/test.rb
107
+ - test/dummy/config/initializers/backtrace_silencers.rb
108
+ - test/dummy/config/initializers/inflections.rb
109
+ - test/dummy/config/initializers/mailhopper.rb
110
+ - test/dummy/config/initializers/mime_types.rb
111
+ - test/dummy/config/initializers/secret_token.rb
112
+ - test/dummy/config/initializers/session_store.rb
113
+ - test/dummy/config/initializers/wrap_parameters.rb
114
+ - test/dummy/config/locales/en.yml
115
+ - test/dummy/config/routes.rb
116
+ - test/dummy/config.ru
117
+ - test/dummy/db/development.sqlite3
118
+ - test/dummy/db/migrate/20110801151741_create_emails.rb
119
+ - test/dummy/db/schema.rb
120
+ - test/dummy/db/test.sqlite3
121
+ - test/dummy/log/development.log
122
+ - test/dummy/log/test.log
123
+ - test/dummy/public/404.html
124
+ - test/dummy/public/422.html
125
+ - test/dummy/public/500.html
126
+ - test/dummy/public/favicon.ico
127
+ - test/dummy/Rakefile
128
+ - test/dummy/script/rails
129
+ - test/integration/navigation_test.rb
130
+ - test/mailhopper_test.rb
131
+ - test/test_helper.rb
132
+ - test/unit/email_test.rb
133
+ has_rdoc: true
134
+ homepage: https://github.com/cerebris/mailhopper
135
+ licenses: []
136
+
137
+ post_install_message:
138
+ rdoc_options: []
139
+
140
+ require_paths:
141
+ - lib
142
+ required_ruby_version: !ruby/object:Gem::Requirement
143
+ none: false
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ hash: 3
148
+ segments:
149
+ - 0
150
+ version: "0"
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ hash: 3
157
+ segments:
158
+ - 0
159
+ version: "0"
160
+ requirements: []
161
+
162
+ rubyforge_project:
163
+ rubygems_version: 1.4.2
164
+ signing_key:
165
+ specification_version: 3
166
+ summary: An ActiveRecord based queue for email storage and delivery.
167
+ test_files:
168
+ - test/dummy/app/assets/javascripts/application.js
169
+ - test/dummy/app/assets/stylesheets/application.css
170
+ - test/dummy/app/controllers/application_controller.rb
171
+ - test/dummy/app/helpers/application_helper.rb
172
+ - test/dummy/app/mailers/sample_mailer.rb
173
+ - test/dummy/app/views/layouts/application.html.erb
174
+ - test/dummy/app/views/sample_mailer/hello.text.erb
175
+ - test/dummy/config/application.rb
176
+ - test/dummy/config/boot.rb
177
+ - test/dummy/config/database.yml
178
+ - test/dummy/config/environment.rb
179
+ - test/dummy/config/environments/development.rb
180
+ - test/dummy/config/environments/production.rb
181
+ - test/dummy/config/environments/test.rb
182
+ - test/dummy/config/initializers/backtrace_silencers.rb
183
+ - test/dummy/config/initializers/inflections.rb
184
+ - test/dummy/config/initializers/mailhopper.rb
185
+ - test/dummy/config/initializers/mime_types.rb
186
+ - test/dummy/config/initializers/secret_token.rb
187
+ - test/dummy/config/initializers/session_store.rb
188
+ - test/dummy/config/initializers/wrap_parameters.rb
189
+ - test/dummy/config/locales/en.yml
190
+ - test/dummy/config/routes.rb
191
+ - test/dummy/config.ru
192
+ - test/dummy/db/development.sqlite3
193
+ - test/dummy/db/migrate/20110801151741_create_emails.rb
194
+ - test/dummy/db/schema.rb
195
+ - test/dummy/db/test.sqlite3
196
+ - test/dummy/log/development.log
197
+ - test/dummy/log/test.log
198
+ - test/dummy/public/404.html
199
+ - test/dummy/public/422.html
200
+ - test/dummy/public/500.html
201
+ - test/dummy/public/favicon.ico
202
+ - test/dummy/Rakefile
203
+ - test/dummy/script/rails
204
+ - test/integration/navigation_test.rb
205
+ - test/mailhopper_test.rb
206
+ - test/test_helper.rb
207
+ - test/unit/email_test.rb