mail_manager 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. checksums.yaml +15 -0
  2. data/.DS_Store +0 -0
  3. data/.gitignore +20 -0
  4. data/.rspec +1 -0
  5. data/.ruby-gemset +1 -0
  6. data/.ruby-version +1 -0
  7. data/Gemfile +27 -0
  8. data/Guardfile +24 -0
  9. data/LICENSE.txt +22 -0
  10. data/MIT-LICENSE +20 -0
  11. data/Manifest.txt +141 -0
  12. data/Procfile +4 -0
  13. data/README +243 -0
  14. data/README.md +29 -0
  15. data/README.rdoc +3 -0
  16. data/Rakefile +33 -0
  17. data/app/.DS_Store +0 -0
  18. data/app/assets/javascripts/mail_manager/application.js +15 -0
  19. data/app/assets/stylesheets/mail_manager/application.css +13 -0
  20. data/app/controllers/mail_manager/application_controller.rb +4 -0
  21. data/app/controllers/mail_manager/base_controller.rb +22 -0
  22. data/app/controllers/mail_manager/bounces_controller.rb +32 -0
  23. data/app/controllers/mail_manager/contacts_controller.rb +75 -0
  24. data/app/controllers/mail_manager/mailing_lists_controller.rb +49 -0
  25. data/app/controllers/mail_manager/mailings_controller.rb +102 -0
  26. data/app/controllers/mail_manager/messages_controller.rb +30 -0
  27. data/app/controllers/mail_manager/subscriptions_controller.rb +104 -0
  28. data/app/helpers/mail_manager/application_helper.rb +4 -0
  29. data/app/helpers/mail_manager/subscriptions_helper.rb +8 -0
  30. data/app/models/.DS_Store +0 -0
  31. data/app/models/mail_manager.rb +12 -0
  32. data/app/models/mail_manager/bounce.rb +133 -0
  33. data/app/models/mail_manager/contact.rb +91 -0
  34. data/app/models/mail_manager/contactable_registry.rb +190 -0
  35. data/app/models/mail_manager/mailable_registry.rb +127 -0
  36. data/app/models/mail_manager/mailer.rb +267 -0
  37. data/app/models/mail_manager/mailing.rb +266 -0
  38. data/app/models/mail_manager/mailing_list.rb +36 -0
  39. data/app/models/mail_manager/message.rb +127 -0
  40. data/app/models/mail_manager/subscription.rb +126 -0
  41. data/app/models/mail_manager/test_message.rb +175 -0
  42. data/app/models/status_history.rb +60 -0
  43. data/app/views/layouts/mail_manager/application.html.erb +14 -0
  44. data/app/views/mail_manager/bounces/_email_parts.html.erb +30 -0
  45. data/app/views/mail_manager/bounces/index.html.erb +32 -0
  46. data/app/views/mail_manager/bounces/show.html.erb +38 -0
  47. data/app/views/mail_manager/contacts/_form.html.erb +27 -0
  48. data/app/views/mail_manager/contacts/double_opt_in.html.erb +1 -0
  49. data/app/views/mail_manager/contacts/edit.html.erb +12 -0
  50. data/app/views/mail_manager/contacts/index.html.erb +86 -0
  51. data/app/views/mail_manager/contacts/new.html.erb +9 -0
  52. data/app/views/mail_manager/contacts/show.html.erb +22 -0
  53. data/app/views/mail_manager/contacts/subscribe.html.erb +2 -0
  54. data/app/views/mail_manager/contacts/thank_you.html.erb +12 -0
  55. data/app/views/mail_manager/help/_available_email_substitutions.html.erb +5 -0
  56. data/app/views/mail_manager/mailer/double_opt_in.erb +6 -0
  57. data/app/views/mail_manager/mailer/unsubscribed.erb +5 -0
  58. data/app/views/mail_manager/mailer/unsubscribed.html.erb +5 -0
  59. data/app/views/mail_manager/mailing_lists/_form.html.erb +20 -0
  60. data/app/views/mail_manager/mailing_lists/edit.html.erb +13 -0
  61. data/app/views/mail_manager/mailing_lists/index.html.erb +39 -0
  62. data/app/views/mail_manager/mailing_lists/new.html.erb +9 -0
  63. data/app/views/mail_manager/mailing_lists/show.html.erb +13 -0
  64. data/app/views/mail_manager/mailings/_form.html.erb +81 -0
  65. data/app/views/mail_manager/mailings/edit.html.erb +12 -0
  66. data/app/views/mail_manager/mailings/index.html.erb +52 -0
  67. data/app/views/mail_manager/mailings/new.html.erb +9 -0
  68. data/app/views/mail_manager/mailings/show.html.erb +28 -0
  69. data/app/views/mail_manager/mailings/test.html.erb +12 -0
  70. data/app/views/mail_manager/messages/index.html.erb +37 -0
  71. data/app/views/mail_manager/subscriptions/_form.html.erb +37 -0
  72. data/app/views/mail_manager/subscriptions/_subscriptions.html.erb +13 -0
  73. data/app/views/mail_manager/subscriptions/edit.html.erb +11 -0
  74. data/app/views/mail_manager/subscriptions/index.html.erb +32 -0
  75. data/app/views/mail_manager/subscriptions/new.html.erb +9 -0
  76. data/app/views/mail_manager/subscriptions/show.html.erb +8 -0
  77. data/app/views/mail_manager/subscriptions/unsubscribe.html.erb +2 -0
  78. data/app/views/mail_manager/subscriptions/unsubscribe_by_email_address.html.erb +13 -0
  79. data/config/daemons.yml +5 -0
  80. data/config/routes.rb +43 -0
  81. data/db/migrate/001_mail_mgr_initial.rb +84 -0
  82. data/db/migrate/002_mail_mgr_create_contact.rb +60 -0
  83. data/db/migrate/003_mail_mgr_test_message.rb +23 -0
  84. data/db/migrate/004_add_deleted_at_to_mailing_lists.rb +15 -0
  85. data/db/migrate/005_contacts_deleted_at.rb +15 -0
  86. data/db/migrate/006_mail_mgr_mailing_list_add_defaults_to_active.rb +15 -0
  87. data/db/migrate/007_mail_mgr_message_add_from_email_address.rb +15 -0
  88. data/db/mlm_migrate/001_mlm_initial.rb +67 -0
  89. data/db/mlm_migrate/002_mailable_as_polymorphic.rb +27 -0
  90. data/db/mlm_migrate/003_contact_as_polymorphic.rb +64 -0
  91. data/db/mlm_migrate/004_bounce_mlm_mailing_id.rb +26 -0
  92. data/db/mlm_migrate/005_mlm_to_mail_mgr_scoped.rb +29 -0
  93. data/engine_plan.rb +13 -0
  94. data/features/bounce_management.feature +0 -0
  95. data/features/contact_management.feature +24 -0
  96. data/features/mailable.feature +23 -0
  97. data/features/mailing_management.feature +78 -0
  98. data/features/message.feature +11 -0
  99. data/features/step_definitions/email_steps.rb +50 -0
  100. data/features/step_definitions/mlm_steps.rb +11 -0
  101. data/features/step_definitions/pickle_steps.rb +41 -0
  102. data/features/step_definitions/webrat_steps.rb +115 -0
  103. data/features/subscription_management.feature +17 -0
  104. data/features/support/env.rb +31 -0
  105. data/features/support/paths.rb +44 -0
  106. data/lib/daemons/mail_manager.rb +38 -0
  107. data/lib/daemons/mail_manager_ctl +15 -0
  108. data/lib/deleteable.rb +50 -0
  109. data/lib/lock.rb +36 -0
  110. data/lib/mail_manager.rb +5 -0
  111. data/lib/mail_manager/config.rb +50 -0
  112. data/lib/mail_manager/engine.rb +43 -0
  113. data/lib/mail_manager/version.rb +3 -0
  114. data/lib/tasks/mail_manager.rake +143 -0
  115. data/lib/tasks/mail_manager_tasks.rake +4 -0
  116. data/lib/tasks/rspec.rake +165 -0
  117. data/lib/workers/mail_manager/bounce_job.rb +52 -0
  118. data/lib/workers/mail_manager/mailing_job.rb +30 -0
  119. data/lib/workers/mail_manager/message_job.rb +38 -0
  120. data/lib/workers/mail_manager/test_message_job.rb +37 -0
  121. data/mail_manager.gemspec +29 -0
  122. data/script/rails +8 -0
  123. data/spec/rcov.opts +2 -0
  124. data/spec/spec.opts +4 -0
  125. data/spec/spec_helper.rb +47 -0
  126. data/spec/test_app/README.rdoc +261 -0
  127. data/spec/test_app/Rakefile +7 -0
  128. data/spec/test_app/app/assets/javascripts/application.js +15 -0
  129. data/spec/test_app/app/assets/javascripts/users.js +2 -0
  130. data/spec/test_app/app/assets/stylesheets/application.css +13 -0
  131. data/spec/test_app/app/assets/stylesheets/scaffold.css +56 -0
  132. data/spec/test_app/app/assets/stylesheets/users.css +4 -0
  133. data/spec/test_app/app/controllers/application_controller.rb +3 -0
  134. data/spec/test_app/app/controllers/users_controller.rb +83 -0
  135. data/spec/test_app/app/helpers/application_helper.rb +2 -0
  136. data/spec/test_app/app/helpers/users_helper.rb +2 -0
  137. data/spec/test_app/app/models/user.rb +13 -0
  138. data/spec/test_app/app/views/layouts/application.html.erb +14 -0
  139. data/spec/test_app/app/views/users/_form.html.erb +33 -0
  140. data/spec/test_app/app/views/users/edit.html.erb +6 -0
  141. data/spec/test_app/app/views/users/index.html.erb +29 -0
  142. data/spec/test_app/app/views/users/new.html.erb +5 -0
  143. data/spec/test_app/app/views/users/show.html.erb +25 -0
  144. data/spec/test_app/config.ru +4 -0
  145. data/spec/test_app/config/application.rb +65 -0
  146. data/spec/test_app/config/boot.rb +10 -0
  147. data/spec/test_app/config/database.yml +25 -0
  148. data/spec/test_app/config/environment.rb +14 -0
  149. data/spec/test_app/config/environments/development.rb +37 -0
  150. data/spec/test_app/config/environments/production.rb +67 -0
  151. data/spec/test_app/config/environments/test.rb +37 -0
  152. data/spec/test_app/config/initializers/backtrace_silencers.rb +7 -0
  153. data/spec/test_app/config/initializers/inflections.rb +15 -0
  154. data/spec/test_app/config/initializers/mime_types.rb +5 -0
  155. data/spec/test_app/config/initializers/secret_token.rb +7 -0
  156. data/spec/test_app/config/initializers/session_store.rb +8 -0
  157. data/spec/test_app/config/initializers/wrap_parameters.rb +14 -0
  158. data/spec/test_app/config/locales/en.yml +5 -0
  159. data/spec/test_app/config/lockable.yml +3 -0
  160. data/spec/test_app/config/mail_manager.yml +21 -0
  161. data/spec/test_app/config/routes.rb +7 -0
  162. data/spec/test_app/db/migrate/20131217101010_create_users.rb +13 -0
  163. data/spec/test_app/db/migrate/20131221064151_mail_mgr_initial.rb +84 -0
  164. data/spec/test_app/db/migrate/20131221064152_mail_mgr_create_contact.rb +60 -0
  165. data/spec/test_app/db/migrate/20131221064153_mail_mgr_test_message.rb +23 -0
  166. data/spec/test_app/db/migrate/20131221064154_add_deleted_at_to_mailing_lists.rb +15 -0
  167. data/spec/test_app/db/migrate/20131221064155_contacts_deleted_at.rb +15 -0
  168. data/spec/test_app/db/migrate/20131221064156_mail_mgr_mailing_list_add_defaults_to_active.rb +15 -0
  169. data/spec/test_app/db/migrate/20131221064157_mail_mgr_message_add_from_email_address.rb +15 -0
  170. data/spec/test_app/db/migrate/20131221072600_create_delayed_jobs.rb +22 -0
  171. data/spec/test_app/db/schema.rb +131 -0
  172. data/spec/test_app/db/structure.sql +31 -0
  173. data/spec/test_app/public/404.html +26 -0
  174. data/spec/test_app/public/422.html +26 -0
  175. data/spec/test_app/public/500.html +25 -0
  176. data/spec/test_app/public/favicon.ico +0 -0
  177. data/spec/test_app/script/delayed_job +5 -0
  178. data/spec/test_app/script/lockable +36 -0
  179. data/spec/test_app/script/rails +6 -0
  180. data/spec/test_app/spec/controllers/users_controller_spec.rb +160 -0
  181. data/spec/test_app/spec/factories/mailing_lists.rb +7 -0
  182. data/spec/test_app/spec/factories/mailings.rb +6 -0
  183. data/spec/test_app/spec/factories/original_factories.rb.txt +107 -0
  184. data/spec/test_app/spec/factories/users.rb +10 -0
  185. data/spec/test_app/spec/models/mail_manager/bounce_spec.rb +17 -0
  186. data/spec/test_app/spec/models/mail_manager/mailing_list_spec.rb +15 -0
  187. data/spec/test_app/spec/models/user_spec.rb +37 -0
  188. data/spec/test_app/spec/requests/users_spec.rb +11 -0
  189. data/spec/test_app/spec/routing/users_routing_spec.rb +35 -0
  190. data/spec/test_app/spec/support/database_cleaner.rb +23 -0
  191. data/spec/test_app/spec/support/files/bad_utf8_chars.eml +32 -0
  192. data/spec/test_app/spec/views/users/edit.html.erb_spec.rb +24 -0
  193. data/spec/test_app/spec/views/users/index.html.erb_spec.rb +29 -0
  194. data/spec/test_app/spec/views/users/new.html.erb_spec.rb +24 -0
  195. data/spec/test_app/spec/views/users/show.html.erb_spec.rb +21 -0
  196. data/zeus.json +22 -0
  197. metadata +424 -0
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ TestApp::Application.load_tasks
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,83 @@
1
+ class UsersController < ApplicationController
2
+ # GET /users
3
+ # GET /users.json
4
+ def index
5
+ @users = User.all
6
+
7
+ respond_to do |format|
8
+ format.html # index.html.erb
9
+ format.json { render json: @users }
10
+ end
11
+ end
12
+
13
+ # GET /users/1
14
+ # GET /users/1.json
15
+ def show
16
+ @user = User.find(params[:id])
17
+
18
+ respond_to do |format|
19
+ format.html # show.html.erb
20
+ format.json { render json: @user }
21
+ end
22
+ end
23
+
24
+ # GET /users/new
25
+ # GET /users/new.json
26
+ def new
27
+ @user = User.new
28
+
29
+ respond_to do |format|
30
+ format.html # new.html.erb
31
+ format.json { render json: @user }
32
+ end
33
+ end
34
+
35
+ # GET /users/1/edit
36
+ def edit
37
+ @user = User.find(params[:id])
38
+ end
39
+
40
+ # POST /users
41
+ # POST /users.json
42
+ def create
43
+ @user = User.new(params[:user])
44
+
45
+ respond_to do |format|
46
+ if @user.save
47
+ format.html { redirect_to @user, notice: 'User was successfully created.' }
48
+ format.json { render json: @user, status: :created, location: @user }
49
+ else
50
+ format.html { render action: "new" }
51
+ format.json { render json: @user.errors, status: :unprocessable_entity }
52
+ end
53
+ end
54
+ end
55
+
56
+ # PUT /users/1
57
+ # PUT /users/1.json
58
+ def update
59
+ @user = User.find(params[:id])
60
+
61
+ respond_to do |format|
62
+ if @user.update_attributes(params[:user])
63
+ format.html { redirect_to @user, notice: 'User was successfully updated.' }
64
+ format.json { head :no_content }
65
+ else
66
+ format.html { render action: "edit" }
67
+ format.json { render json: @user.errors, status: :unprocessable_entity }
68
+ end
69
+ end
70
+ end
71
+
72
+ # DELETE /users/1
73
+ # DELETE /users/1.json
74
+ def destroy
75
+ @user = User.find(params[:id])
76
+ @user.destroy
77
+
78
+ respond_to do |format|
79
+ format.html { redirect_to users_url }
80
+ format.json { head :no_content }
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module UsersHelper
2
+ end
@@ -0,0 +1,13 @@
1
+ class User < ActiveRecord::Base
2
+ attr_accessible :email, :first_name, :last_name, :phone
3
+
4
+ validates :email, uniqueness: true, presence: true
5
+
6
+ include MailManager::ContactableRegistry::Contactable
7
+ end
8
+
9
+ MailManager::ContactableRegistry.register_contactable("User",{
10
+ first_name: :first_name,
11
+ last_name: :last_name,
12
+ email_address: :email
13
+ })
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>TestApp</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,33 @@
1
+ <%= form_for(@user) do |f| %>
2
+ <% if @user.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @user.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :first_name %><br />
16
+ <%= f.text_field :first_name %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :last_name %><br />
20
+ <%= f.text_field :last_name %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :email %><br />
24
+ <%= f.text_field :email %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :phone %><br />
28
+ <%= f.number_field :phone %>
29
+ </div>
30
+ <div class="actions">
31
+ <%= f.submit %>
32
+ </div>
33
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @user %> |
6
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,29 @@
1
+ <h1>Listing users</h1>
2
+
3
+ <table>
4
+ <tr>
5
+ <th>First name</th>
6
+ <th>Last name</th>
7
+ <th>Email</th>
8
+ <th>Phone</th>
9
+ <th></th>
10
+ <th></th>
11
+ <th></th>
12
+ </tr>
13
+
14
+ <% @users.each do |user| %>
15
+ <tr>
16
+ <td><%= user.first_name %></td>
17
+ <td><%= user.last_name %></td>
18
+ <td><%= user.email %></td>
19
+ <td><%= user.phone %></td>
20
+ <td><%= link_to 'Show', user %></td>
21
+ <td><%= link_to 'Edit', edit_user_path(user) %></td>
22
+ <td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td>
23
+ </tr>
24
+ <% end %>
25
+ </table>
26
+
27
+ <br />
28
+
29
+ <%= link_to 'New User', new_user_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,25 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>First name:</b>
5
+ <%= @user.first_name %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Last name:</b>
10
+ <%= @user.last_name %>
11
+ </p>
12
+
13
+ <p>
14
+ <b>Email:</b>
15
+ <%= @user.email %>
16
+ </p>
17
+
18
+ <p>
19
+ <b>Phone:</b>
20
+ <%= @user.phone %>
21
+ </p>
22
+
23
+
24
+ <%= link_to 'Edit', edit_user_path(@user) %> |
25
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run TestApp::Application
@@ -0,0 +1,65 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "active_resource/railtie"
8
+ require "sprockets/railtie"
9
+ # require "rails/test_unit/railtie"
10
+
11
+ Bundler.require(*Rails.groups)
12
+ require "mail_manager"
13
+
14
+ module TestApp
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Custom directories with classes and modules you want to be autoloadable.
21
+ # config.autoload_paths += %W(#{config.root}/extras)
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named.
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Activate observers that should always be running.
28
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
+
30
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
+ # config.time_zone = 'Central Time (US & Canada)'
33
+
34
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
+ # config.i18n.default_locale = :de
37
+
38
+ # Configure the default encoding used in templates for Ruby 1.9.
39
+ config.encoding = "utf-8"
40
+
41
+ # Configure sensitive parameters which will be filtered from the log file.
42
+ config.filter_parameters += [:password]
43
+
44
+ # Enable escaping HTML in JSON.
45
+ config.active_support.escape_html_entities_in_json = true
46
+
47
+ # Use SQL instead of Active Record's schema dumper when creating the database.
48
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
49
+ # like if you have constraints or database-specific column types
50
+ # config.active_record.schema_format = :sql
51
+
52
+ # Enforce whitelist mode for mass assignment.
53
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
54
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
55
+ # parameters by using an attr_accessible or attr_protected declaration.
56
+ config.active_record.whitelist_attributes = true
57
+
58
+ # Enable the asset pipeline
59
+ config.assets.enabled = true
60
+
61
+ # Version of your assets, change this if you want to expire all your assets
62
+ config.assets.version = '1.0'
63
+ end
64
+ end
65
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ # production:
22
+ # adapter: sqlite3
23
+ # database: db/production.sqlite3
24
+ # pool: 5
25
+ # timeout: 5000