roadie-rails 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +9 -1
  3. data/codecov.yml +3 -0
  4. data/lib/roadie/rails/version.rb +1 -1
  5. data/roadie-rails.gemspec +3 -1
  6. metadata +5 -200
  7. data/spec/integration_spec.rb +0 -91
  8. data/spec/lib/roadie/rails/asset_pipeline_provider_spec.rb +0 -77
  9. data/spec/lib/roadie/rails/automatic_spec.rb +0 -54
  10. data/spec/lib/roadie/rails/document_builder_spec.rb +0 -20
  11. data/spec/lib/roadie/rails/mail_inliner_spec.rb +0 -92
  12. data/spec/lib/roadie/rails/mailer_spec.rb +0 -57
  13. data/spec/lib/roadie/rails/options_spec.rb +0 -172
  14. data/spec/lib/roadie/rails/railtie_spec.rb +0 -61
  15. data/spec/railsapps/README.md +0 -66
  16. data/spec/railsapps/rails_42/.gitignore +0 -16
  17. data/spec/railsapps/rails_42/Gemfile +0 -5
  18. data/spec/railsapps/rails_42/app/assets +0 -1
  19. data/spec/railsapps/rails_42/app/mailers +0 -1
  20. data/spec/railsapps/rails_42/app/views +0 -1
  21. data/spec/railsapps/rails_42/bin/rails +0 -4
  22. data/spec/railsapps/rails_42/config.ru +0 -4
  23. data/spec/railsapps/rails_42/config/application.rb +0 -16
  24. data/spec/railsapps/rails_42/config/boot.rb +0 -4
  25. data/spec/railsapps/rails_42/config/environment.rb +0 -5
  26. data/spec/railsapps/rails_42/config/environments/development.rb +0 -9
  27. data/spec/railsapps/rails_42/config/initializers/secret_token.rb +0 -1
  28. data/spec/railsapps/rails_42/config/initializers/session_store.rb +0 -1
  29. data/spec/railsapps/rails_42/config/routes.rb +0 -2
  30. data/spec/railsapps/rails_42_sprockets_rails_3/.gitignore +0 -16
  31. data/spec/railsapps/rails_42_sprockets_rails_3/Gemfile +0 -6
  32. data/spec/railsapps/rails_42_sprockets_rails_3/app/assets +0 -1
  33. data/spec/railsapps/rails_42_sprockets_rails_3/app/mailers +0 -1
  34. data/spec/railsapps/rails_42_sprockets_rails_3/app/views +0 -1
  35. data/spec/railsapps/rails_42_sprockets_rails_3/bin/rails +0 -4
  36. data/spec/railsapps/rails_42_sprockets_rails_3/config.ru +0 -4
  37. data/spec/railsapps/rails_42_sprockets_rails_3/config/application.rb +0 -13
  38. data/spec/railsapps/rails_42_sprockets_rails_3/config/boot.rb +0 -4
  39. data/spec/railsapps/rails_42_sprockets_rails_3/config/environment.rb +0 -5
  40. data/spec/railsapps/rails_42_sprockets_rails_3/config/environments/development.rb +0 -9
  41. data/spec/railsapps/rails_42_sprockets_rails_3/config/initializers/assets.rb +0 -1
  42. data/spec/railsapps/rails_42_sprockets_rails_3/config/initializers/secret_token.rb +0 -1
  43. data/spec/railsapps/rails_42_sprockets_rails_3/config/initializers/session_store.rb +0 -1
  44. data/spec/railsapps/rails_42_sprockets_rails_3/config/routes.rb +0 -2
  45. data/spec/railsapps/rails_50/.gitignore +0 -21
  46. data/spec/railsapps/rails_50/Gemfile +0 -7
  47. data/spec/railsapps/rails_50/app/assets +0 -1
  48. data/spec/railsapps/rails_50/app/mailers/auto_mailer.rb +0 -27
  49. data/spec/railsapps/rails_50/app/mailers/mailer.rb +0 -17
  50. data/spec/railsapps/rails_50/app/views +0 -1
  51. data/spec/railsapps/rails_50/bin/rails +0 -4
  52. data/spec/railsapps/rails_50/config.ru +0 -9
  53. data/spec/railsapps/rails_50/config/application.rb +0 -16
  54. data/spec/railsapps/rails_50/config/boot.rb +0 -3
  55. data/spec/railsapps/rails_50/config/environment.rb +0 -5
  56. data/spec/railsapps/rails_50/config/environments/development.rb +0 -12
  57. data/spec/railsapps/rails_50/config/initializers/assets.rb +0 -11
  58. data/spec/railsapps/rails_50/config/initializers/cookies_serializer.rb +0 -4
  59. data/spec/railsapps/rails_50/config/initializers/request_forgery_protection.rb +0 -4
  60. data/spec/railsapps/rails_50/config/initializers/session_store.rb +0 -3
  61. data/spec/railsapps/rails_50/config/routes.rb +0 -6
  62. data/spec/railsapps/rails_51/.gitignore +0 -17
  63. data/spec/railsapps/rails_51/Gemfile +0 -8
  64. data/spec/railsapps/rails_51/app/assets/images/rails.png +0 -0
  65. data/spec/railsapps/rails_51/app/assets/stylesheets/email.css.scss +0 -2
  66. data/spec/railsapps/rails_51/app/mailers/auto_mailer.rb +0 -27
  67. data/spec/railsapps/rails_51/app/mailers/mailer.rb +0 -17
  68. data/spec/railsapps/rails_51/app/views/auto_mailer/normal_email.html.erb +0 -11
  69. data/spec/railsapps/rails_51/app/views/auto_mailer/normal_email.text +0 -1
  70. data/spec/railsapps/rails_51/app/views/mailer/normal_email.html.erb +0 -11
  71. data/spec/railsapps/rails_51/app/views/mailer/normal_email.text +0 -1
  72. data/spec/railsapps/rails_51/bin/rails +0 -4
  73. data/spec/railsapps/rails_51/config.ru +0 -5
  74. data/spec/railsapps/rails_51/config/application.rb +0 -16
  75. data/spec/railsapps/rails_51/config/boot.rb +0 -3
  76. data/spec/railsapps/rails_51/config/environment.rb +0 -5
  77. data/spec/railsapps/rails_51/config/environments/development.rb +0 -51
  78. data/spec/railsapps/rails_51/config/environments/production.rb +0 -83
  79. data/spec/railsapps/rails_51/config/environments/test.rb +0 -42
  80. data/spec/railsapps/rails_51/config/initializers/application_controller_renderer.rb +0 -6
  81. data/spec/railsapps/rails_51/config/initializers/assets.rb +0 -11
  82. data/spec/railsapps/rails_51/config/initializers/backtrace_silencers.rb +0 -7
  83. data/spec/railsapps/rails_51/config/initializers/cookies_serializer.rb +0 -5
  84. data/spec/railsapps/rails_51/config/initializers/filter_parameter_logging.rb +0 -4
  85. data/spec/railsapps/rails_51/config/initializers/inflections.rb +0 -16
  86. data/spec/railsapps/rails_51/config/initializers/mime_types.rb +0 -4
  87. data/spec/railsapps/rails_51/config/initializers/new_framework_defaults.rb +0 -21
  88. data/spec/railsapps/rails_51/config/initializers/session_store.rb +0 -3
  89. data/spec/railsapps/rails_51/config/initializers/wrap_parameters.rb +0 -9
  90. data/spec/railsapps/rails_51/config/locales/en.yml +0 -23
  91. data/spec/railsapps/rails_51/config/routes.rb +0 -3
  92. data/spec/railsapps/rails_51/log/.keep +0 -0
  93. data/spec/railsapps/shared/all/app/mailers/auto_mailer.rb +0 -27
  94. data/spec/railsapps/shared/all/app/mailers/mailer.rb +0 -17
  95. data/spec/railsapps/shared/all/app/views/auto_mailer +0 -1
  96. data/spec/railsapps/shared/all/app/views/mailer/normal_email.html.erb +0 -11
  97. data/spec/railsapps/shared/all/app/views/mailer/normal_email.text +0 -1
  98. data/spec/railsapps/shared/pipeline/app/assets/images/rails.png +0 -0
  99. data/spec/railsapps/shared/pipeline/app/assets/stylesheets/email.css.scss +0 -2
  100. data/spec/spec_helper.rb +0 -18
  101. data/spec/support/have_no_styling_matcher.rb +0 -25
  102. data/spec/support/have_selector_matcher.rb +0 -3
  103. data/spec/support/have_styling_matcher.rb +0 -63
  104. data/spec/support/rails_app.rb +0 -78
@@ -1,66 +0,0 @@
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
- ```bash
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
- ```bash
43
- cd ..
44
- rm -rf rails_x_y/app/assets rails_x_y/app/views
45
- ln -s ../../shared/pipeline/app/assets rails_x_y/app/assets
46
- ln -s ../../shared/all/app/mailers rails_x_y/app/mailers
47
- ln -s ../../shared/all/app/views rails_x_y/app/views
48
- ```
49
-
50
- ## Apply options and add gem
51
-
52
- Open up `config/application.rb` and add the following options:
53
-
54
- ```ruby
55
- config.roadie.url_options = {host: 'example.app.org'}
56
- ```
57
-
58
- Then open up the `Gemfile` and add:
59
-
60
- ```ruby
61
- gem 'roadie-rails', :path => '../../..'
62
- ```
63
-
64
- ## Add to integration_spec.rb
65
-
66
- 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.
@@ -1,16 +0,0 @@
1
- # See http://help.github.com/ignore-files/ for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile '~/.gitignore_global'
6
-
7
- # Ignore bundler config.
8
- /.bundle
9
-
10
- # Ignore the default SQLite database.
11
- /db/*.sqlite3
12
- /db/*.sqlite3-journal
13
-
14
- # Ignore all logfiles and tempfiles.
15
- /log/*.log
16
- /tmp
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
- gem 'rails', '~> 4.2.8'
3
- gem 'sass-rails'
4
-
5
- gem 'roadie-rails', :path => '../../..'
@@ -1 +0,0 @@
1
- spec/railsapps/rails_42/app/../../shared/pipeline/app/assets
@@ -1 +0,0 @@
1
- spec/railsapps/rails_42/app/../../shared/all/app/mailers
@@ -1 +0,0 @@
1
- spec/railsapps/rails_42/app/../../shared/all/app/views
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
@@ -1,16 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require "action_controller/railtie"
4
- require "action_mailer/railtie"
5
- require "sprockets/railtie"
6
-
7
- Bundler.require(:default, Rails.env)
8
-
9
- module Rails42
10
- class Application < Rails::Application
11
- config.assets.digest = false
12
- config.assets.precompile += %w( email.css )
13
-
14
- config.roadie.url_options = {host: 'example.app.org'}
15
- end
16
- end
@@ -1,4 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the Rails application.
5
- Rails42::Application.initialize!
@@ -1,9 +0,0 @@
1
- Rails42::Application.configure do
2
- config.cache_classes = false
3
- config.eager_load = false
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.assets.debug = true
9
- end
@@ -1 +0,0 @@
1
- Rails42::Application.config.secret_key_base = '4fc45a45fecece06ff370f3271d9c2f29cdd0b029bde255d77318418e5066681d42c706f5e504b9298f2b5ccbd2c013c39d474e6521ef4c4f056b1368ce22c8f'
@@ -1 +0,0 @@
1
- Rails42::Application.config.session_store :cookie_store, key: '_rails_42_session'
@@ -1,2 +0,0 @@
1
- Rails42::Application.routes.draw do
2
- end
@@ -1,16 +0,0 @@
1
- # See http://help.github.com/ignore-files/ for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile '~/.gitignore_global'
6
-
7
- # Ignore bundler config.
8
- /.bundle
9
-
10
- # Ignore the default SQLite database.
11
- /db/*.sqlite3
12
- /db/*.sqlite3-journal
13
-
14
- # Ignore all logfiles and tempfiles.
15
- /log/*.log
16
- /tmp
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
- gem 'rails', '~> 4.2.8'
3
- gem 'sass-rails'
4
- gem 'sprockets-rails', '~> 3.2.0'
5
-
6
- gem 'roadie-rails', :path => '../../..'
@@ -1 +0,0 @@
1
- spec/railsapps/rails_42_sprockets_rails_3/app/../../shared/pipeline/app/assets
@@ -1 +0,0 @@
1
- spec/railsapps/rails_42_sprockets_rails_3/app/../../shared/all/app/mailers
@@ -1 +0,0 @@
1
- spec/railsapps/rails_42_sprockets_rails_3/app/../../shared/all/app/views
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
@@ -1,13 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require "action_controller/railtie"
4
- require "action_mailer/railtie"
5
- require "sprockets/railtie"
6
-
7
- Bundler.require(:default, Rails.env)
8
-
9
- module Rails42
10
- class Application < Rails::Application
11
- config.roadie.url_options = {host: 'example.app.org'}
12
- end
13
- end
@@ -1,4 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the Rails application.
5
- Rails42::Application.initialize!
@@ -1,9 +0,0 @@
1
- Rails42::Application.configure do
2
- config.cache_classes = false
3
- config.eager_load = false
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.assets.debug = true
9
- end
@@ -1 +0,0 @@
1
- Rails.application.config.assets.precompile += %w( email.css )
@@ -1 +0,0 @@
1
- Rails42::Application.config.secret_key_base = '4fc45a45fecece06ff370f3271d9c2f29cdd0b029bde255d77318418e5066681d42c706f5e504b9298f2b5ccbd2c013c39d474e6521ef4c4f056b1368ce22c8f'
@@ -1 +0,0 @@
1
- Rails42::Application.config.session_store :cookie_store, key: '_rails_42_session'
@@ -1,2 +0,0 @@
1
- Rails42::Application.routes.draw do
2
- end
@@ -1,21 +0,0 @@
1
- # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile '~/.gitignore_global'
6
-
7
- # Ignore bundler config.
8
- /.bundle
9
-
10
- # Ignore the default SQLite database.
11
- /db/*.sqlite3
12
- /db/*.sqlite3-journal
13
-
14
- # Ignore all logfiles and tempfiles.
15
- /log/*
16
- /tmp/*
17
- !/log/.keep
18
- !/tmp/.keep
19
-
20
- # Ignore Byebug command history file.
21
- .byebug_history
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 5.0.2'
4
- gem 'sass-rails'
5
- gem 'sprockets-rails'
6
-
7
- gem 'roadie-rails', path: '../../..'
@@ -1 +0,0 @@
1
- spec/railsapps/rails_50/app/../../shared/pipeline/app/assets
@@ -1,27 +0,0 @@
1
- class AutoMailer < ActionMailer::Base
2
- include Roadie::Rails::Automatic
3
-
4
- default from: 'john@example.com'
5
-
6
- def normal_email
7
- generate_email
8
- end
9
-
10
- def disabled_email
11
- generate_email
12
- end
13
-
14
- private
15
- def roadie_options
16
- unless action_name =~ /disabled/
17
- super.combine(url_options: {protocol: "https"})
18
- end
19
- end
20
-
21
- def generate_email
22
- mail(to: 'example@example.org', subject: "Notification for you") do |format|
23
- format.html { render :normal_email }
24
- format.text { render :normal_email }
25
- end
26
- end
27
- end
@@ -1,17 +0,0 @@
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
@@ -1 +0,0 @@
1
- spec/railsapps/rails_50/app/../../shared/all/app/views
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,9 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
-
5
- # Action Cable uses EventMachine which requires that all classes are loaded in advance
6
- Rails.application.eager_load!
7
- require 'action_cable/process/logging'
8
-
9
- run Rails.application
@@ -1,16 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'action_controller/railtie'
4
- require 'action_mailer/railtie'
5
- require 'action_view/railtie'
6
- require 'sprockets/railtie'
7
-
8
- # Require the gems listed in Gemfile, including any gems
9
- # you've limited to :test, :development, or :production.
10
- Bundler.require(*Rails.groups)
11
-
12
- module Rails50
13
- class Application < Rails::Application
14
- config.roadie.url_options = { host: 'example.app.org' }
15
- end
16
- end
@@ -1,3 +0,0 @@
1
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
-
3
- require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the Rails application.
5
- Rails.application.initialize!
@@ -1,12 +0,0 @@
1
- Rails.application.configure do
2
- config.cache_classes = false
3
- config.eager_load = false
4
- config.consider_all_requests_local = true
5
- config.action_controller.perform_caching = false
6
- config.cache_store = :null_store
7
- config.action_mailer.raise_delivery_errors = false
8
- config.active_support.deprecation = :log
9
- config.assets.debug = true
10
- config.assets.digest = true
11
- config.assets.raise_runtime_errors = true
12
- end
@@ -1,11 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Version of your assets, change this if you want to expire all your assets.
4
- Rails.application.config.assets.version = '1.0'
5
-
6
- # Add additional assets to the asset load path
7
- # Rails.application.config.assets.paths << Emoji.images_path
8
-
9
- # Precompile additional assets.
10
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
- Rails.application.config.assets.precompile += %w( email.css )
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # This is a new Rails 5.0 default, so introduced as a config to ensure apps made with earlier versions of Rails aren't affected when upgrading.
4
- Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Enable origin-checking CSRF mitigation.
4
- Rails.application.config.action_controller.forgery_protection_origin_check = true
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.session_store :cookie_store, key: '_rails_50_session'
@@ -1,6 +0,0 @@
1
- Rails.application.routes.draw do
2
- # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
3
-
4
- # Serve websocket cable requests in-process
5
- # mount ActionCable.server => '/cable'
6
- end
@@ -1,17 +0,0 @@
1
- # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile '~/.gitignore_global'
6
-
7
- # Ignore bundler config.
8
- /.bundle
9
-
10
- # Ignore all logfiles and tempfiles.
11
- /log/*
12
- /tmp/*
13
- !/log/.keep
14
- !/tmp/.keep
15
-
16
- # Ignore Byebug command history file.
17
- .byebug_history