mail_sleuth 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +47 -0
  3. data/Rakefile +38 -0
  4. data/app/models/message_log.rb +30 -0
  5. data/db/migrate/20120319221013_create_message_logs.rb +22 -0
  6. data/lib/mail_sleuth/engine.rb +12 -0
  7. data/lib/mail_sleuth/observer.rb +23 -0
  8. data/lib/mail_sleuth/version.rb +3 -0
  9. data/lib/mail_sleuth.rb +7 -0
  10. data/lib/tasks/mail_sleuth_tasks.rake +4 -0
  11. data/test/dummy/README.rdoc +261 -0
  12. data/test/dummy/Rakefile +7 -0
  13. data/test/dummy/app/assets/javascripts/application.js +15 -0
  14. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  15. data/test/dummy/app/controllers/application_controller.rb +3 -0
  16. data/test/dummy/app/helpers/application_helper.rb +2 -0
  17. data/test/dummy/app/mailers/notifier.rb +13 -0
  18. data/test/dummy/app/models/user.rb +2 -0
  19. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  20. data/test/dummy/app/views/notifier/welcome.html.erb +2 -0
  21. data/test/dummy/config/application.rb +61 -0
  22. data/test/dummy/config/boot.rb +10 -0
  23. data/test/dummy/config/database.yml +25 -0
  24. data/test/dummy/config/environment.rb +5 -0
  25. data/test/dummy/config/environments/development.rb +37 -0
  26. data/test/dummy/config/environments/production.rb +67 -0
  27. data/test/dummy/config/environments/test.rb +37 -0
  28. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  29. data/test/dummy/config/initializers/inflections.rb +15 -0
  30. data/test/dummy/config/initializers/mime_types.rb +5 -0
  31. data/test/dummy/config/initializers/secret_token.rb +7 -0
  32. data/test/dummy/config/initializers/session_store.rb +8 -0
  33. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  34. data/test/dummy/config/locales/en.yml +5 -0
  35. data/test/dummy/config/routes.rb +58 -0
  36. data/test/dummy/config.ru +4 -0
  37. data/test/dummy/db/development.sqlite3 +0 -0
  38. data/test/dummy/db/migrate/20120319190548_create_users.rb +8 -0
  39. data/test/dummy/db/migrate/20120320154306_create_message_logs.mail_sleuth.rb +23 -0
  40. data/test/dummy/db/schema.rb +40 -0
  41. data/test/dummy/db/test.sqlite3 +0 -0
  42. data/test/dummy/log/development.log +233 -0
  43. data/test/dummy/log/test.log +932 -0
  44. data/test/dummy/public/404.html +26 -0
  45. data/test/dummy/public/422.html +26 -0
  46. data/test/dummy/public/500.html +25 -0
  47. data/test/dummy/public/favicon.ico +0 -0
  48. data/test/dummy/script/rails +6 -0
  49. data/test/dummy/test/fixtures/users.yml +3 -0
  50. data/test/mail_sleuth_observer_test.rb +33 -0
  51. data/test/test_helper.rb +10 -0
  52. metadata +185 -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,25 @@
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
+ </div>
24
+ </body>
25
+ </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,3 @@
1
+ joe:
2
+ name: Joe Foo
3
+ email: joe@example.com
@@ -0,0 +1,33 @@
1
+ require 'test_helper'
2
+
3
+ class MailSleuthObserverTest < ActionMailer::TestCase
4
+
5
+ fixtures :users
6
+
7
+ def teardown
8
+ ActionMailer::Base.deliveries.clear
9
+ end
10
+
11
+ def test_sending_welcome_message
12
+ joe = users(:joe)
13
+
14
+ Notifier.welcome(joe.id).deliver!
15
+ assert !ActionMailer::Base.deliveries.empty?
16
+
17
+ log = MessageLog.last
18
+
19
+ expected_attr = {
20
+ 'content_type' => 'text/html; charset=UTF-8',
21
+ 'from' => ['test@example.com'],
22
+ 'to' => ['joe@example.com'],
23
+ 'subject' => 'Welcome Joe Foo',
24
+ 'perform_deliveries' => true,
25
+ 'charset' => 'UTF-8'
26
+ }
27
+
28
+ assert_equal expected_attr, log.attributes.slice(*expected_attr.keys)
29
+ assert_equal Notifier, log.delivery_handler
30
+ assert log.errors.empty?
31
+ end
32
+
33
+ end
@@ -0,0 +1,10 @@
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
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mail_sleuth
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Nicolas Buduroi
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-03-20 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ hash: 13
28
+ segments:
29
+ - 3
30
+ - 2
31
+ - 1
32
+ version: 3.2.1
33
+ type: :runtime
34
+ name: rails
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :development
48
+ name: sqlite3
49
+ version_requirements: *id002
50
+ description: See README.md file.
51
+ email:
52
+ - nbuduroi@gmail.com
53
+ executables: []
54
+
55
+ extensions: []
56
+
57
+ extra_rdoc_files: []
58
+
59
+ files:
60
+ - app/models/message_log.rb
61
+ - db/migrate/20120319221013_create_message_logs.rb
62
+ - lib/tasks/mail_sleuth_tasks.rake
63
+ - lib/mail_sleuth.rb
64
+ - lib/mail_sleuth/version.rb
65
+ - lib/mail_sleuth/observer.rb
66
+ - lib/mail_sleuth/engine.rb
67
+ - MIT-LICENSE
68
+ - Rakefile
69
+ - README.md
70
+ - test/dummy/log/test.log
71
+ - test/dummy/log/development.log
72
+ - test/dummy/README.rdoc
73
+ - test/dummy/config/environments/production.rb
74
+ - test/dummy/config/environments/test.rb
75
+ - test/dummy/config/environments/development.rb
76
+ - test/dummy/config/locales/en.yml
77
+ - test/dummy/config/boot.rb
78
+ - test/dummy/config/application.rb
79
+ - test/dummy/config/routes.rb
80
+ - test/dummy/config/environment.rb
81
+ - test/dummy/config/database.yml
82
+ - test/dummy/config/initializers/session_store.rb
83
+ - test/dummy/config/initializers/mime_types.rb
84
+ - test/dummy/config/initializers/backtrace_silencers.rb
85
+ - test/dummy/config/initializers/wrap_parameters.rb
86
+ - test/dummy/config/initializers/inflections.rb
87
+ - test/dummy/config/initializers/secret_token.rb
88
+ - test/dummy/test/fixtures/users.yml
89
+ - test/dummy/public/404.html
90
+ - test/dummy/public/500.html
91
+ - test/dummy/public/422.html
92
+ - test/dummy/public/favicon.ico
93
+ - test/dummy/Rakefile
94
+ - test/dummy/script/rails
95
+ - test/dummy/config.ru
96
+ - test/dummy/db/development.sqlite3
97
+ - test/dummy/db/schema.rb
98
+ - test/dummy/db/test.sqlite3
99
+ - test/dummy/db/migrate/20120320154306_create_message_logs.mail_sleuth.rb
100
+ - test/dummy/db/migrate/20120319190548_create_users.rb
101
+ - test/dummy/app/models/user.rb
102
+ - test/dummy/app/helpers/application_helper.rb
103
+ - test/dummy/app/assets/stylesheets/application.css
104
+ - test/dummy/app/assets/javascripts/application.js
105
+ - test/dummy/app/views/layouts/application.html.erb
106
+ - test/dummy/app/views/notifier/welcome.html.erb
107
+ - test/dummy/app/mailers/notifier.rb
108
+ - test/dummy/app/controllers/application_controller.rb
109
+ - test/mail_sleuth_observer_test.rb
110
+ - test/test_helper.rb
111
+ homepage: https://github.com/codegenome/MailSleuth
112
+ licenses: []
113
+
114
+ post_install_message:
115
+ rdoc_options: []
116
+
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ none: false
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ hash: 3
125
+ segments:
126
+ - 0
127
+ version: "0"
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 3
134
+ segments:
135
+ - 0
136
+ version: "0"
137
+ requirements: []
138
+
139
+ rubyforge_project:
140
+ rubygems_version: 1.8.15
141
+ signing_key:
142
+ specification_version: 3
143
+ summary: This plugin provide a configurable observer for ActionMailer.
144
+ test_files:
145
+ - test/dummy/log/test.log
146
+ - test/dummy/log/development.log
147
+ - test/dummy/README.rdoc
148
+ - test/dummy/config/environments/production.rb
149
+ - test/dummy/config/environments/test.rb
150
+ - test/dummy/config/environments/development.rb
151
+ - test/dummy/config/locales/en.yml
152
+ - test/dummy/config/boot.rb
153
+ - test/dummy/config/application.rb
154
+ - test/dummy/config/routes.rb
155
+ - test/dummy/config/environment.rb
156
+ - test/dummy/config/database.yml
157
+ - test/dummy/config/initializers/session_store.rb
158
+ - test/dummy/config/initializers/mime_types.rb
159
+ - test/dummy/config/initializers/backtrace_silencers.rb
160
+ - test/dummy/config/initializers/wrap_parameters.rb
161
+ - test/dummy/config/initializers/inflections.rb
162
+ - test/dummy/config/initializers/secret_token.rb
163
+ - test/dummy/test/fixtures/users.yml
164
+ - test/dummy/public/404.html
165
+ - test/dummy/public/500.html
166
+ - test/dummy/public/422.html
167
+ - test/dummy/public/favicon.ico
168
+ - test/dummy/Rakefile
169
+ - test/dummy/script/rails
170
+ - test/dummy/config.ru
171
+ - test/dummy/db/development.sqlite3
172
+ - test/dummy/db/schema.rb
173
+ - test/dummy/db/test.sqlite3
174
+ - test/dummy/db/migrate/20120320154306_create_message_logs.mail_sleuth.rb
175
+ - test/dummy/db/migrate/20120319190548_create_users.rb
176
+ - test/dummy/app/models/user.rb
177
+ - test/dummy/app/helpers/application_helper.rb
178
+ - test/dummy/app/assets/stylesheets/application.css
179
+ - test/dummy/app/assets/javascripts/application.js
180
+ - test/dummy/app/views/layouts/application.html.erb
181
+ - test/dummy/app/views/notifier/welcome.html.erb
182
+ - test/dummy/app/mailers/notifier.rb
183
+ - test/dummy/app/controllers/application_controller.rb
184
+ - test/mail_sleuth_observer_test.rb
185
+ - test/test_helper.rb