roadie-rails 1.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.travis.yml +15 -0
  4. data/Changelog.md +9 -0
  5. data/Gemfile +17 -0
  6. data/Guardfile +16 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +317 -0
  9. data/Rakefile +14 -0
  10. data/Upgrading.md +70 -0
  11. data/lib/roadie-rails.rb +1 -0
  12. data/lib/roadie/rails.rb +21 -0
  13. data/lib/roadie/rails/asset_pipeline_provider.rb +24 -0
  14. data/lib/roadie/rails/automatic.rb +16 -0
  15. data/lib/roadie/rails/document_builder.rb +18 -0
  16. data/lib/roadie/rails/inline_on_delivery.rb +17 -0
  17. data/lib/roadie/rails/mail_inliner.rb +26 -0
  18. data/lib/roadie/rails/mailer.rb +14 -0
  19. data/lib/roadie/rails/options.rb +101 -0
  20. data/lib/roadie/rails/railtie.rb +22 -0
  21. data/lib/roadie/rails/version.rb +5 -0
  22. data/roadie-rails.gemspec +29 -0
  23. data/setup.sh +62 -0
  24. data/spec/integration_spec.rb +119 -0
  25. data/spec/lib/roadie/rails/asset_pipeline_provider_spec.rb +47 -0
  26. data/spec/lib/roadie/rails/automatic_spec.rb +44 -0
  27. data/spec/lib/roadie/rails/document_builder_spec.rb +20 -0
  28. data/spec/lib/roadie/rails/mail_inliner_spec.rb +57 -0
  29. data/spec/lib/roadie/rails/mailer_spec.rb +57 -0
  30. data/spec/lib/roadie/rails/options_spec.rb +136 -0
  31. data/spec/lib/roadie/rails/railtie_spec.rb +48 -0
  32. data/spec/railsapps/README.md +69 -0
  33. data/spec/railsapps/rails_30/.gitignore +2 -0
  34. data/spec/railsapps/rails_30/Gemfile +7 -0
  35. data/spec/railsapps/rails_30/app/mailers/auto_mailer.rb +17 -0
  36. data/spec/railsapps/rails_30/app/mailers/mailer.rb +17 -0
  37. data/spec/railsapps/rails_30/app/views/auto_mailer/normal_email.html.erb +11 -0
  38. data/spec/railsapps/rails_30/app/views/auto_mailer/normal_email.text +1 -0
  39. data/spec/railsapps/rails_30/app/views/mailer/normal_email.html.erb +11 -0
  40. data/spec/railsapps/rails_30/app/views/mailer/normal_email.text +1 -0
  41. data/spec/railsapps/rails_30/config/application.rb +19 -0
  42. data/spec/railsapps/rails_30/config/boot.rb +6 -0
  43. data/spec/railsapps/rails_30/config/environment.rb +5 -0
  44. data/spec/railsapps/rails_30/config/environments/development.rb +10 -0
  45. data/spec/railsapps/rails_30/config/initializers/secret_token.rb +1 -0
  46. data/spec/railsapps/rails_30/config/initializers/session_store.rb +1 -0
  47. data/spec/railsapps/rails_30/config/routes.rb +2 -0
  48. data/spec/railsapps/rails_30/public/images/rails.png +0 -0
  49. data/spec/railsapps/rails_30/public/stylesheets/email.css +2 -0
  50. data/spec/railsapps/rails_30/script/rails +6 -0
  51. data/spec/railsapps/rails_31/.gitignore +2 -0
  52. data/spec/railsapps/rails_31/Gemfile +11 -0
  53. data/spec/railsapps/rails_31/app/assets/images/rails.png +0 -0
  54. data/spec/railsapps/rails_31/app/assets/stylesheets/email.css.scss +2 -0
  55. data/spec/railsapps/rails_31/app/mailers/auto_mailer.rb +17 -0
  56. data/spec/railsapps/rails_31/app/mailers/mailer.rb +17 -0
  57. data/spec/railsapps/rails_31/app/views/auto_mailer/normal_email.html.erb +11 -0
  58. data/spec/railsapps/rails_31/app/views/auto_mailer/normal_email.text +1 -0
  59. data/spec/railsapps/rails_31/app/views/mailer/normal_email.html.erb +11 -0
  60. data/spec/railsapps/rails_31/app/views/mailer/normal_email.text +1 -0
  61. data/spec/railsapps/rails_31/config/application.rb +22 -0
  62. data/spec/railsapps/rails_31/config/boot.rb +6 -0
  63. data/spec/railsapps/rails_31/config/environment.rb +5 -0
  64. data/spec/railsapps/rails_31/config/environments/development.rb +11 -0
  65. data/spec/railsapps/rails_31/config/initializers/secret_token.rb +1 -0
  66. data/spec/railsapps/rails_31/config/initializers/session_store.rb +1 -0
  67. data/spec/railsapps/rails_31/config/initializers/wrap_parameters.rb +4 -0
  68. data/spec/railsapps/rails_31/config/routes.rb +2 -0
  69. data/spec/railsapps/rails_31/script/rails +6 -0
  70. data/spec/railsapps/rails_32/.gitignore +2 -0
  71. data/spec/railsapps/rails_32/Gemfile +11 -0
  72. data/spec/railsapps/rails_32/app/assets/images/rails.png +0 -0
  73. data/spec/railsapps/rails_32/app/assets/stylesheets/email.css.scss +2 -0
  74. data/spec/railsapps/rails_32/app/mailers/auto_mailer.rb +17 -0
  75. data/spec/railsapps/rails_32/app/mailers/mailer.rb +17 -0
  76. data/spec/railsapps/rails_32/app/views/auto_mailer/normal_email.html.erb +11 -0
  77. data/spec/railsapps/rails_32/app/views/auto_mailer/normal_email.text +1 -0
  78. data/spec/railsapps/rails_32/app/views/mailer/normal_email.html.erb +11 -0
  79. data/spec/railsapps/rails_32/app/views/mailer/normal_email.text +1 -0
  80. data/spec/railsapps/rails_32/config/application.rb +22 -0
  81. data/spec/railsapps/rails_32/config/boot.rb +6 -0
  82. data/spec/railsapps/rails_32/config/environment.rb +5 -0
  83. data/spec/railsapps/rails_32/config/environments/development.rb +11 -0
  84. data/spec/railsapps/rails_32/config/initializers/secret_token.rb +1 -0
  85. data/spec/railsapps/rails_32/config/initializers/session_store.rb +1 -0
  86. data/spec/railsapps/rails_32/config/initializers/wrap_parameters.rb +4 -0
  87. data/spec/railsapps/rails_32/config/routes.rb +2 -0
  88. data/spec/railsapps/rails_32/script/rails +6 -0
  89. data/spec/railsapps/rails_40/Gemfile +9 -0
  90. data/spec/railsapps/rails_40/app/assets/images/rails.png +0 -0
  91. data/spec/railsapps/rails_40/app/assets/stylesheets/email.css.scss +2 -0
  92. data/spec/railsapps/rails_40/app/mailers/auto_mailer.rb +17 -0
  93. data/spec/railsapps/rails_40/app/mailers/mailer.rb +17 -0
  94. data/spec/railsapps/rails_40/app/views/auto_mailer/normal_email.html.erb +11 -0
  95. data/spec/railsapps/rails_40/app/views/auto_mailer/normal_email.text +1 -0
  96. data/spec/railsapps/rails_40/app/views/mailer/normal_email.html.erb +11 -0
  97. data/spec/railsapps/rails_40/app/views/mailer/normal_email.text +1 -0
  98. data/spec/railsapps/rails_40/bin/rails +4 -0
  99. data/spec/railsapps/rails_40/config/application.rb +18 -0
  100. data/spec/railsapps/rails_40/config/boot.rb +4 -0
  101. data/spec/railsapps/rails_40/config/environment.rb +5 -0
  102. data/spec/railsapps/rails_40/config/environments/development.rb +9 -0
  103. data/spec/railsapps/rails_40/config/initializers/secret_token.rb +1 -0
  104. data/spec/railsapps/rails_40/config/initializers/session_store.rb +1 -0
  105. data/spec/railsapps/rails_40/config/routes.rb +2 -0
  106. data/spec/railsapps/rails_40_no_pipeline/Gemfile +9 -0
  107. data/spec/railsapps/rails_40_no_pipeline/app/mailers/auto_mailer.rb +17 -0
  108. data/spec/railsapps/rails_40_no_pipeline/app/mailers/mailer.rb +17 -0
  109. data/spec/railsapps/rails_40_no_pipeline/app/views/auto_mailer/normal_email.html.erb +11 -0
  110. data/spec/railsapps/rails_40_no_pipeline/app/views/auto_mailer/normal_email.text +1 -0
  111. data/spec/railsapps/rails_40_no_pipeline/app/views/mailer/normal_email.html.erb +11 -0
  112. data/spec/railsapps/rails_40_no_pipeline/app/views/mailer/normal_email.text +1 -0
  113. data/spec/railsapps/rails_40_no_pipeline/bin/rails +4 -0
  114. data/spec/railsapps/rails_40_no_pipeline/config/application.rb +19 -0
  115. data/spec/railsapps/rails_40_no_pipeline/config/boot.rb +4 -0
  116. data/spec/railsapps/rails_40_no_pipeline/config/environment.rb +5 -0
  117. data/spec/railsapps/rails_40_no_pipeline/config/environments/development.rb +9 -0
  118. data/spec/railsapps/rails_40_no_pipeline/config/initializers/secret_token.rb +1 -0
  119. data/spec/railsapps/rails_40_no_pipeline/config/initializers/session_store.rb +1 -0
  120. data/spec/railsapps/rails_40_no_pipeline/config/routes.rb +2 -0
  121. data/spec/railsapps/rails_40_no_pipeline/log/dee +0 -0
  122. data/spec/railsapps/rails_40_no_pipeline/public/images/rails.png +0 -0
  123. data/spec/railsapps/rails_40_no_pipeline/public/stylesheets/email.css +2 -0
  124. data/spec/railsapps/rails_40_precompiled/Gemfile +9 -0
  125. data/spec/railsapps/rails_40_precompiled/Rakefile +6 -0
  126. data/spec/railsapps/rails_40_precompiled/app/assets/images/rails.png +0 -0
  127. data/spec/railsapps/rails_40_precompiled/app/assets/stylesheets/email.css.scss +2 -0
  128. data/spec/railsapps/rails_40_precompiled/app/mailers/mailer.rb +17 -0
  129. data/spec/railsapps/rails_40_precompiled/app/views/mailer/normal_email.html.erb +11 -0
  130. data/spec/railsapps/rails_40_precompiled/app/views/mailer/normal_email.text +1 -0
  131. data/spec/railsapps/rails_40_precompiled/bin/rails +4 -0
  132. data/spec/railsapps/rails_40_precompiled/config/application.rb +18 -0
  133. data/spec/railsapps/rails_40_precompiled/config/boot.rb +4 -0
  134. data/spec/railsapps/rails_40_precompiled/config/environment.rb +5 -0
  135. data/spec/railsapps/rails_40_precompiled/config/environments/development.rb +14 -0
  136. data/spec/railsapps/rails_40_precompiled/config/initializers/secret_token.rb +1 -0
  137. data/spec/railsapps/rails_40_precompiled/config/initializers/session_store.rb +1 -0
  138. data/spec/railsapps/rails_40_precompiled/config/routes.rb +2 -0
  139. data/spec/railsapps/rails_40_precompiled/public/assets/email-fad0c62b8f82e2835c1d0bdc19894257.css +5 -0
  140. data/spec/railsapps/rails_40_precompiled/public/assets/email-fad0c62b8f82e2835c1d0bdc19894257.css.gz +0 -0
  141. data/spec/railsapps/rails_40_precompiled/public/assets/manifest-8a3d16aeb2a40fe5057dd998c3edab10.json +1 -0
  142. data/spec/railsapps/rails_40_precompiled/public/assets/rails-231a680f23887d9dd70710ea5efd3c62.png +0 -0
  143. data/spec/railsapps/rails_41/.gitignore +16 -0
  144. data/spec/railsapps/rails_41/Gemfile +8 -0
  145. data/spec/railsapps/rails_41/app/assets/images/rails.png +0 -0
  146. data/spec/railsapps/rails_41/app/assets/stylesheets/email.css.scss +2 -0
  147. data/spec/railsapps/rails_41/app/mailers/auto_mailer.rb +17 -0
  148. data/spec/railsapps/rails_41/app/mailers/mailer.rb +17 -0
  149. data/spec/railsapps/rails_41/app/views/auto_mailer/normal_email.html.erb +11 -0
  150. data/spec/railsapps/rails_41/app/views/auto_mailer/normal_email.text +1 -0
  151. data/spec/railsapps/rails_41/app/views/mailer/normal_email.html.erb +11 -0
  152. data/spec/railsapps/rails_41/app/views/mailer/normal_email.text +1 -0
  153. data/spec/railsapps/rails_41/bin/rails +4 -0
  154. data/spec/railsapps/rails_41/config.ru +4 -0
  155. data/spec/railsapps/rails_41/config/application.rb +13 -0
  156. data/spec/railsapps/rails_41/config/boot.rb +4 -0
  157. data/spec/railsapps/rails_41/config/environment.rb +5 -0
  158. data/spec/railsapps/rails_41/config/environments/development.rb +9 -0
  159. data/spec/railsapps/rails_41/config/initializers/secret_token.rb +1 -0
  160. data/spec/railsapps/rails_41/config/initializers/session_store.rb +1 -0
  161. data/spec/railsapps/rails_41/config/routes.rb +2 -0
  162. data/spec/spec_helper.rb +14 -0
  163. data/spec/support/have_selector_matcher.rb +3 -0
  164. data/spec/support/have_styling_matcher.rb +63 -0
  165. data/spec/support/rails_app.rb +70 -0
  166. metadata +443 -0
@@ -0,0 +1,48 @@
1
+ # encoding: UTF-8
2
+ require 'spec_helper'
3
+
4
+ module Roadie
5
+ module Rails
6
+ describe Railtie do
7
+ let(:rails_application) { double "Application", config: ::Rails::Railtie::Configuration.new }
8
+
9
+ before do
10
+ allow(::Rails).to receive(:root).and_return Pathname.new("rails-root")
11
+ allow(::Rails).to receive(:application).and_return rails_application
12
+ end
13
+
14
+ def run_initializer
15
+ # Hack to make the Railtie able to be initialized again
16
+ # Railties are global state, after all, stored on the classes.
17
+ Railtie.instance_variable_set('@instance', nil) # Embrace me, Cthulhu!
18
+ Railtie.instance_variable_set('@ran', nil)
19
+ Railtie.run_initializers :default, rails_application
20
+ end
21
+
22
+ describe "asset providers" do
23
+ it "has filesystem providers to common asset paths" do
24
+ run_initializer
25
+ providers = Railtie.config.roadie.asset_providers.to_a
26
+ expect(providers).to have(1).item
27
+
28
+ expect(providers[0]).to be_instance_of(FilesystemProvider)
29
+ expect(providers[0].path).to eq("rails-root/public")
30
+ end
31
+
32
+ it "also gets a AssetPipelineProvider if assets are enabled" do
33
+ rails_application.config.assets = ActiveSupport::OrderedOptions.new(enabled: true)
34
+
35
+ asset_pipeline = double "The asset pipeline"
36
+ allow(rails_application).to receive(:assets).and_return asset_pipeline
37
+ run_initializer
38
+
39
+ providers = Railtie.config.roadie.asset_providers.to_a
40
+ expect(providers).to have(2).items
41
+ expect(providers[0]).to be_instance_of(FilesystemProvider)
42
+ expect(providers[1]).to be_instance_of(AssetPipelineProvider)
43
+ expect(providers[1].pipeline).to eq(asset_pipeline)
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,69 @@
1
+ # How to add another Rails app
2
+
3
+ You need to follow certain steps in order to construct a proper integration with a new version of Rails. First, a quick summary:
4
+
5
+ 1. Install the correct version of the `rails` gem
6
+ 2. Using that version of `rails`, generate a new app
7
+ 3. Strip out things we don't need from the app
8
+ 4. Copy the mailers and templates to the app
9
+ 5. Apply Roadie options and add Roadie to the Gemfile
10
+ 6. Add it to `integration_spec.rb`
11
+
12
+ ## Installing Rails
13
+
14
+ ```bash
15
+ gem install rails -v x.y.z
16
+ ```
17
+
18
+ ## Generate Rails app
19
+
20
+ ```bash
21
+ rails _x.y.z._ new rails_x_y --skip-javascript --skip-keeps --skip-active-record --skip-test-unit
22
+ ```
23
+
24
+ ## Clean up the app
25
+
26
+ ```bash
27
+ cd rails_x_y
28
+ ```
29
+
30
+ The next step is of course specific to each Rails version. One of the easiest methods is to just start by deleting directories you know you have no use for, like `tmp`, `log` and `README.md`.
31
+
32
+ ```
33
+ rm -rf README.* tmp log db app/controllers app/helpers app/views/layouts public doc
34
+ ```
35
+
36
+ You should also go through the initializers under `config` and remove the ones that don't apply; only keep the `development` environment. You should also strip away documentation comments and similar from all the files under `config`. Make them compact and only keep what is needed.
37
+
38
+ After doing this, run `git add .` and inspect the list of added files. If there's any file there you didn't intend to add, just remove it with `git rm -f`.
39
+
40
+ ## Copy mailer and templates
41
+
42
+ ```
43
+ cd ..
44
+ cp -r rails_40/app/mailers rails_x_y/app
45
+ cp -r rails_40/app/views/*mailer rails_x_y/app/views
46
+ cp -r rails_40/app/assets/* rails_x_y/app/assets
47
+ ```
48
+
49
+ ## Apply options and add gem
50
+
51
+ Open up `config/application.rb` and add the following options:
52
+
53
+ ```ruby
54
+ config.roadie.url_options = {host: 'example.app.org'}
55
+ ```
56
+
57
+ Then open up the `Gemfile` and add:
58
+
59
+ ```ruby
60
+ gem 'roadie-rails', :path => '../../..'
61
+
62
+ # Use git version of `roadie` until a full release have been made
63
+ gem 'roadie', git: 'git://github.com/Mange/roadie.git', branch: 'master'
64
+ ```
65
+
66
+ ## Add to integration_spec.rb
67
+
68
+ Add the information needed in `spec/integration_spec.rb` and run `setup.sh` before finally running the tests themselves. When everything's good, `git add` everything and commit.
69
+
@@ -0,0 +1,2 @@
1
+ log
2
+ tmp
@@ -0,0 +1,7 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '~> 3.0.17'
4
+ gem 'roadie-rails', path: '../../../'
5
+
6
+ # Use git version of `roadie` until a full release have been made
7
+ gem 'roadie', git: 'git://github.com/Mange/roadie.git', branch: 'master'
@@ -0,0 +1,17 @@
1
+ class AutoMailer < ActionMailer::Base
2
+ include Roadie::Rails::Automatic
3
+
4
+ default from: 'john@example.com'
5
+
6
+ def normal_email
7
+ mail(to: 'example@example.org', subject: "Notification for you") do |format|
8
+ format.html
9
+ format.text
10
+ end
11
+ end
12
+
13
+ private
14
+ def roadie_options
15
+ super.combine(url_options: {protocol: "https"})
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ class Mailer < ActionMailer::Base
2
+ include Roadie::Rails::Mailer
3
+
4
+ default from: 'john@example.com'
5
+
6
+ def normal_email
7
+ roadie_mail(to: 'example@example.org', subject: "Notification for you") do |format|
8
+ format.html
9
+ format.text
10
+ end
11
+ end
12
+
13
+ private
14
+ def roadie_options
15
+ super.combine(url_options: {protocol: "https"})
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+ <%= stylesheet_link_tag "email" %>
6
+ </head>
7
+ <body>
8
+ <h1>Normal email</h1>
9
+ <div class="image"></div>
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+ <%= stylesheet_link_tag "email" %>
6
+ </head>
7
+ <body>
8
+ <h1>Normal email</h1>
9
+ <div class="image"></div>
10
+ </body>
11
+ </html>
@@ -0,0 +1,19 @@
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 "rails/test_unit/railtie"
9
+
10
+ # If you have a Gemfile, require the gems listed there, including any gems
11
+ # you've limited to :test, :development, or :production.
12
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
13
+
14
+ module Rails30
15
+ class Application < Rails::Application
16
+ config.encoding = "utf-8"
17
+ config.roadie.url_options = {host: 'example.app.org'}
18
+ end
19
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Rails30::Application.initialize!
@@ -0,0 +1,10 @@
1
+ Rails30::Application.configure do
2
+ config.cache_classes = false
3
+ config.whiny_nils = true
4
+ config.consider_all_requests_local = true
5
+ config.action_controller.perform_caching = false
6
+ config.action_mailer.raise_delivery_errors = false
7
+ config.active_support.deprecation = :log
8
+ config.action_dispatch.best_standards_support = :builtin
9
+ end
10
+
@@ -0,0 +1 @@
1
+ Rails30::Application.config.secret_token = '8087604e8a128679494a9271966613b91c3ae5b57cea4089e0ffc6c92cd4ad36c3a3033865c3595d8436985b7d812cfe18e2aa0f06b3c7ebaaec66885a4927b2'
@@ -0,0 +1 @@
1
+ Rails30::Application.config.session_store :cookie_store, :key => '_rails_30_session'
@@ -0,0 +1,2 @@
1
+ Rails30::Application.routes.draw do
2
+ end
@@ -0,0 +1,2 @@
1
+ body { background-color: green; }
2
+ .image { background: url(/images/rails.png); }
@@ -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,2 @@
1
+ log
2
+ tmp
@@ -0,0 +1,11 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.1.11'
4
+ gem 'roadie-rails', path: '../../../'
5
+
6
+ group :assets do
7
+ gem 'sass-rails', '~> 3.1.5'
8
+ end
9
+
10
+ # Use git version of `roadie` until a full release have been made
11
+ gem 'roadie', git: 'git://github.com/Mange/roadie.git', branch: 'master'
@@ -0,0 +1,2 @@
1
+ body { background-color: green; }
2
+ .image { background: image-url("rails.png"); }
@@ -0,0 +1,17 @@
1
+ class AutoMailer < ActionMailer::Base
2
+ include Roadie::Rails::Automatic
3
+
4
+ default from: 'john@example.com'
5
+
6
+ def normal_email
7
+ mail(to: 'example@example.org', subject: "Notification for you") do |format|
8
+ format.html
9
+ format.text
10
+ end
11
+ end
12
+
13
+ private
14
+ def roadie_options
15
+ super.combine(url_options: {protocol: "https"})
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ class Mailer < ActionMailer::Base
2
+ include Roadie::Rails::Mailer
3
+
4
+ default from: 'john@example.com'
5
+
6
+ def normal_email
7
+ roadie_mail(to: 'example@example.org', subject: "Notification for you") do |format|
8
+ format.html
9
+ format.text
10
+ end
11
+ end
12
+
13
+ private
14
+ def roadie_options
15
+ super.combine(url_options: {protocol: "https"})
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+ <%= stylesheet_link_tag "email" %>
6
+ </head>
7
+ <body>
8
+ <h1>Normal email</h1>
9
+ <div class="image"></div>
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+ <%= stylesheet_link_tag "email" %>
6
+ </head>
7
+ <body>
8
+ <h1>Normal email</h1>
9
+ <div class="image"></div>
10
+ </body>
11
+ </html>
@@ -0,0 +1,22 @@
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
+ if defined?(Bundler)
12
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
13
+ end
14
+
15
+ module Rails31
16
+ class Application < Rails::Application
17
+ config.encoding = "utf-8"
18
+ config.assets.enabled = true
19
+ config.assets.version = '1.0'
20
+ config.roadie.url_options = {host: 'example.app.org'}
21
+ end
22
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Rails31::Application.initialize!
@@ -0,0 +1,11 @@
1
+ Rails31::Application.configure do
2
+ config.cache_classes = false
3
+ config.whiny_nils = true
4
+ config.consider_all_requests_local = true
5
+ config.action_controller.perform_caching = false
6
+ config.action_mailer.raise_delivery_errors = false
7
+ config.active_support.deprecation = :log
8
+ config.action_dispatch.best_standards_support = :builtin
9
+ config.assets.compress = false
10
+ config.assets.debug = true
11
+ end
@@ -0,0 +1 @@
1
+ Rails31::Application.config.secret_token = '94649fdde8d6da7fcc8e89203530b68af61db0fe238180a0d3c191661f6cf9bba8ef3d4716a434ed4d2c37abdbe7b71cea0af8da1079e5359be295e5e75dcfa5'
@@ -0,0 +1 @@
1
+ Rails31::Application.config.session_store :cookie_store, key: '_rails_31_session'
@@ -0,0 +1,4 @@
1
+ ActiveSupport.on_load(:action_controller) do
2
+ wrap_parameters format: [:json]
3
+ end
4
+
@@ -0,0 +1,2 @@
1
+ Rails31::Application.routes.draw do
2
+ end
@@ -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,2 @@
1
+ log
2
+ tmp
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '3.2.12'
4
+ gem 'roadie-rails', path: '../../../'
5
+
6
+ group :assets do
7
+ gem 'sass-rails', '~> 3.2.3'
8
+ end
9
+
10
+ # Use git version of `roadie` until a full release have been made
11
+ gem 'roadie', git: 'git://github.com/Mange/roadie.git', branch: 'master'