roadie-rails 1.1.0.rc2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcb900b0ff648dc35539039d535cd4b1ab7a67d9
4
- data.tar.gz: 8ef1f9b9bfae0fc65f6e7d383a6147f68afad7ec
3
+ metadata.gz: 65ec310d7987a54efad5de41cb80afdade9f53bd
4
+ data.tar.gz: b47b19fb46061806845b24b8a807302d23a97184
5
5
  SHA512:
6
- metadata.gz: 2f208d03f3541bbd090e849b95807dc73fcd572063dbec96b99e78262ccc11232126fa17f672ed30752d97d80e330fdff1535df7fc3444d8baad344f4617dd93
7
- data.tar.gz: f84b45b790fddbae358a14049b8ee34008b175c949d2f5ca405659f5353f24c5b51176a7c8150af4a8ffbb0cd8ab8c6e6e5f25c093189b0e7cbeb7d17f7d1ace
6
+ metadata.gz: bfbed57e1c9f8efd5cc758538e95021c921e435c89427a4ab1f68c89ae90d12b6ea15f441b792a0f5b345b07f1b855bcba5d4d4b12ed090dda4fe84933e96699
7
+ data.tar.gz: ab96f1282ee2d333cd4f5d251c70e5d5ff984cc951c709094fa3fdad77bef3afc8f27761a5316ca96e9d70d61e7962d0739aab22e313fb30769cbc62ce0ab3d2
@@ -1,8 +1,18 @@
1
1
  ### development version
2
2
 
3
- [full changelog](https://github.com/Mange/roadie-rails/compare/v1.1.0.rc2...master)
3
+ [full changelog](https://github.com/Mange/roadie-rails/compare/v1.1.0...master)
4
4
 
5
- ### development version
5
+ * Nothing yet.
6
+
7
+ ### 1.1.0
8
+
9
+ [full changelog](https://github.com/Mange/roadie-rails/compare/v1.1.0.rc2...v1.1.0)
10
+
11
+ * Bug fixes:
12
+ * Support for sprockets-rails 3 (#46) — [Rafael Mendonça França (rafaelfranca)](https://github.com/rafaelfranca)
13
+ * Support `Mailer#deliver!` in `AutomaticMailer` (#47) — [Julien Vanier (monkbroc)](https://github.com/monkbroc)
14
+
15
+ ### 1.1.0.rc2
6
16
 
7
17
  [full changelog](https://github.com/Mange/roadie-rails/compare/v1.1.0.rc1...v1.1.0.rc2)
8
18
 
@@ -7,10 +7,21 @@ module Roadie
7
7
  attr_accessor :roadie_options
8
8
 
9
9
  def deliver
10
+ inline_styles
11
+ super
12
+ end
13
+
14
+ def deliver!
15
+ inline_styles
16
+ super
17
+ end
18
+
19
+ private
20
+
21
+ def inline_styles
10
22
  if (options = roadie_options)
11
23
  MailInliner.new(self, options).execute
12
24
  end
13
- super
14
25
  end
15
26
  end
16
27
  end
@@ -13,8 +13,14 @@ module Roadie
13
13
  # Saying config.assets.enabled here does not work in Rails 3.1-3.2, but
14
14
  # APP.config.assets work. There is a difference between "config" and
15
15
  # "app.config" on those versions.
16
- if app.config.respond_to?(:assets) && app.config.assets.enabled != false && app.assets
17
- config.roadie.asset_providers << AssetPipelineProvider.new(app.assets)
16
+ if app.config.respond_to?(:assets) && app.config.assets.enabled != false
17
+ if app.assets
18
+ config.roadie.asset_providers << AssetPipelineProvider.new(app.assets)
19
+ else
20
+ app.config.assets.configure do |env|
21
+ config.roadie.asset_providers << AssetPipelineProvider.new(env)
22
+ end
23
+ end
18
24
  end
19
25
  end
20
26
  end
@@ -1,5 +1,5 @@
1
1
  module Roadie
2
2
  module Rails
3
- VERSION = "1.1.0.rc2"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.extra_rdoc_files = %w[README.md Changelog.md LICENSE.txt]
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency "roadie", ">= 3.1.0.rc1", "< 4.0"
22
+ spec.add_dependency "roadie", "~> 3.1"
23
23
  spec.add_dependency "railties", ">= 3.0", "< 4.3"
24
24
 
25
25
  spec.add_development_dependency "rails", ">= 3.0", "< 4.3"
@@ -8,21 +8,21 @@ describe "Integrations" do
8
8
  end
9
9
 
10
10
  [
11
- RailsApp.new("Rails 3.0.x", 'rails_30', runner: :script, asset_pipeline: false),
11
+ RailsApp.new("Rails 3.0.x", 'rails_30', runner: :script, asset_pipeline: false, digests: false),
12
12
  ## We do not yet support live-compilation through asset pipeline
13
- RailsApp.new("Rails 3.1.x", 'rails_31', runner: :script, asset_pipeline: true),
14
- RailsApp.new("Rails 3.2.x", 'rails_32', runner: :script, asset_pipeline: true),
15
- RailsApp.new("Rails 4.0.x", 'rails_40', runner: :bin, asset_pipeline: true),
16
- RailsApp.new("Rails 4.0.x (without asset pipeline)", 'rails_40_no_pipeline', runner: :bin, asset_pipeline: false),
17
- RailsApp.new("Rails 4.1.x", 'rails_41', runner: :bin, asset_pipeline: true),
18
- RailsApp.new("Rails 4.2.x", 'rails_42', runner: :bin, asset_pipeline: true),
13
+ RailsApp.new("Rails 3.1.x", 'rails_31', runner: :script, asset_pipeline: true, digests: false),
14
+ RailsApp.new("Rails 3.2.x", 'rails_32', runner: :script, asset_pipeline: true, digests: false),
15
+ RailsApp.new("Rails 4.0.x", 'rails_40', runner: :bin, asset_pipeline: true, digests: false),
16
+ RailsApp.new("Rails 4.0.x (without asset pipeline)", 'rails_40_no_pipeline', runner: :bin, asset_pipeline: false, digests: false),
17
+ RailsApp.new("Rails 4.0.x (precompiled)", 'rails_40_precompiled', runner: :bin, asset_pipeline: true, digests: true),
18
+ RailsApp.new("Rails 4.1.x", 'rails_41', runner: :bin, asset_pipeline: true, digests: false),
19
+ RailsApp.new("Rails 4.2.x", 'rails_42', runner: :bin, asset_pipeline: true, digests: false),
20
+ RailsApp.new("Rails 4.2.x (with sprockets-rails 3)", 'rails_42_sprockets_rails_3', runner: :bin, asset_pipeline: true, digests: true, sprockets3: true),
19
21
  ].each do |app|
20
22
  describe "with #{app}" do
21
23
  before { app.reset }
22
24
 
23
- it "inlines styles for multipart emails" do
24
- email = app.read_email(:normal_email)
25
-
25
+ def validate_email(app, email)
26
26
  expect(email.to).to eq(['example@example.org'])
27
27
  expect(email.from).to eq(['john@example.com'])
28
28
  expect(email).to have(2).parts
@@ -36,7 +36,13 @@ describe "Integrations" do
36
36
  document = parse_html_in_email(email)
37
37
  expect(document).to have_selector('body h1')
38
38
 
39
- if app.using_asset_pipeline?
39
+ if app.digested?
40
+ if app.sprockets3?
41
+ expected_image_url = 'https://example.app.org/assets/rails-322506f9917889126e81df2833a6eecdf2e394658d53dad347e9882dd4dbf28e.png'
42
+ else
43
+ expected_image_url = 'https://example.app.org/assets/rails-231a680f23887d9dd70710ea5efd3c62.png'
44
+ end
45
+ elsif app.using_asset_pipeline?
40
46
  expected_image_url = 'https://example.app.org/assets/rails.png'
41
47
  else
42
48
  expected_image_url = 'https://example.app.org/images/rails.png'
@@ -48,32 +54,16 @@ describe "Integrations" do
48
54
  email.deliver
49
55
  end
50
56
 
51
- it "automatically inlines styles with automatic mailer" do
52
- email = app.read_delivered_email(:normal_email)
53
-
54
- expect(email.to).to eq(['example@example.org'])
55
- expect(email.from).to eq(['john@example.com'])
56
- expect(email).to have(2).parts
57
-
58
- expect(email.text_part.body.decoded).not_to match(/<.*>/)
59
-
60
- html = email.html_part.body.decoded
61
- expect(html).to include '<!DOCTYPE'
62
- expect(html).to include '<head'
63
-
64
- document = parse_html_in_email(email)
65
- expect(document).to have_selector('body h1')
57
+ it "inlines styles for multipart emails" do
58
+ validate_email app, app.read_email(:normal_email)
59
+ end
66
60
 
67
- if app.using_asset_pipeline?
68
- expected_image_url = 'https://example.app.org/assets/rails.png'
69
- else
70
- expected_image_url = 'https://example.app.org/images/rails.png'
71
- end
72
- expect(document).to have_styling('background' => "url(#{expected_image_url})").at_selector('.image')
61
+ it "automatically inlines styles with automatic mailer" do
62
+ validate_email app, app.read_delivered_email(:normal_email)
63
+ end
73
64
 
74
- # If we deliver mails we can catch weird problems with headers being invalid
75
- email.delivery_method :test
76
- email.deliver
65
+ it "automatically inlines styles with automatic mailer and forced delivery" do
66
+ validate_email app, app.read_delivered_email(:normal_email, force_delivery: true)
77
67
  end
78
68
 
79
69
  it "inlines no styles when roadie_options are nil" do
@@ -91,7 +81,7 @@ describe "Integrations" do
91
81
  email.deliver
92
82
  end
93
83
 
94
- if app.using_asset_pipeline?
84
+ if app.using_asset_pipeline? || app.digested?
95
85
  it "has a AssetPipelineProvider together with a FilesystemProvider" do
96
86
  expect(app.read_providers).to eq(%w[Roadie::FilesystemProvider Roadie::Rails::AssetPipelineProvider])
97
87
  end
@@ -102,34 +92,4 @@ describe "Integrations" do
102
92
  end
103
93
  end
104
94
  end
105
-
106
- describe "with precompiled assets" do
107
- let(:app) {
108
- RailsApp.new("Rails 4.0.x (precompiled)", 'rails_40_precompiled', runner: :bin, asset_pipeline: false)
109
- }
110
-
111
- before { app.reset }
112
-
113
- let(:document) do
114
- parse_html_in_email app.read_email(:normal_email)
115
- end
116
-
117
- # It still has an AssetPipelineProvider in case some asset isn't
118
- # precompiled, or the user want to combine. As long as the user is using
119
- # the correct asset helpers a precompiled asset will be picked up by the
120
- # FilesystemProvider.
121
- it "has a AssetPipelineProvider together with a FilesystemProvider" do
122
- expect(app.read_providers).to eq(%w[Roadie::FilesystemProvider Roadie::Rails::AssetPipelineProvider])
123
- end
124
-
125
- it "inlines the precompiled stylesheet" do
126
- # Precompiled version has green color; the file in app/assets have red
127
- expect(document).to have_styling('background-color' => 'green').at_selector('body')
128
- end
129
-
130
- it "inlines images with digests" do
131
- image_url = "https://example.app.org/assets/rails-231a680f23887d9dd70710ea5efd3c62.png"
132
- expect(document).to have_styling('background' => "url(#{image_url})").at_selector('.image')
133
- end
134
- end
135
95
  end
@@ -0,0 +1,16 @@
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
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+ gem 'rails', '4.2.0'
3
+ gem 'sass-rails'
4
+ gem 'sprockets-rails', '3.0.0.beta2'
5
+
6
+ gem 'roadie-rails', :path => '../../..'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -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 Rails.application
@@ -0,0 +1,13 @@
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
@@ -0,0 +1,4 @@
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'])
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails42::Application.initialize!
@@ -0,0 +1,9 @@
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
@@ -0,0 +1 @@
1
+ Rails.application.config.assets.precompile += %w( email.css )
@@ -0,0 +1 @@
1
+ Rails42::Application.config.secret_key_base = '4fc45a45fecece06ff370f3271d9c2f29cdd0b029bde255d77318418e5066681d42c706f5e504b9298f2b5ccbd2c013c39d474e6521ef4c4f056b1368ce22c8f'
@@ -0,0 +1 @@
1
+ Rails42::Application.config.session_store :cookie_store, key: '_rails_42_session'
@@ -0,0 +1,2 @@
1
+ Rails42::Application.routes.draw do
2
+ end
@@ -4,11 +4,15 @@ class RailsApp
4
4
  @path = File.expand_path("../../railsapps/#{path}", __FILE__)
5
5
  @runner = options.fetch(:runner)
6
6
  @using_asset_pipeline = options.fetch(:asset_pipeline)
7
+ @digests = options.fetch(:digests)
8
+ @sprockets3 = options[:sprockets3]
7
9
  reset
8
10
  end
9
11
 
10
12
  def to_s() @name end
11
13
  def using_asset_pipeline?() @using_asset_pipeline end
14
+ def digested?() @digests end
15
+ def sprockets3?() @sprockets3 end
12
16
 
13
17
  def read_email(mail_name)
14
18
  result = run("puts Mailer.#{mail_name}.to_s")
@@ -16,8 +20,9 @@ class RailsApp
16
20
  Mail.read_from_string(result)
17
21
  end
18
22
 
19
- def read_delivered_email(mail_name)
20
- result = run("mail = AutoMailer.#{mail_name}; mail.delivery_method(:test); mail.deliver; puts mail.to_s")
23
+ def read_delivered_email(mail_name, options = {})
24
+ deliver = options[:force_delivery] ? "deliver!" : "deliver"
25
+ result = run("mail = AutoMailer.#{mail_name}; mail.delivery_method(:test); mail.#{deliver}; puts mail.to_s")
21
26
  raise "No email returned. Did the rails application crash?" if result.strip.empty?
22
27
  Mail.read_from_string(result)
23
28
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadie-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.rc2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Bergmark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-14 00:00:00.000000000 Z
11
+ date: 2015-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roadie
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 3.1.0.rc1
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '4.0'
19
+ version: '3.1'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 3.1.0.rc1
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: '4.0'
26
+ version: '3.1'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: railties
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -258,6 +252,18 @@ files:
258
252
  - spec/railsapps/rails_42/config/initializers/secret_token.rb
259
253
  - spec/railsapps/rails_42/config/initializers/session_store.rb
260
254
  - spec/railsapps/rails_42/config/routes.rb
255
+ - spec/railsapps/rails_42_sprockets_rails_3/.gitignore
256
+ - spec/railsapps/rails_42_sprockets_rails_3/Gemfile
257
+ - spec/railsapps/rails_42_sprockets_rails_3/bin/rails
258
+ - spec/railsapps/rails_42_sprockets_rails_3/config.ru
259
+ - spec/railsapps/rails_42_sprockets_rails_3/config/application.rb
260
+ - spec/railsapps/rails_42_sprockets_rails_3/config/boot.rb
261
+ - spec/railsapps/rails_42_sprockets_rails_3/config/environment.rb
262
+ - spec/railsapps/rails_42_sprockets_rails_3/config/environments/development.rb
263
+ - spec/railsapps/rails_42_sprockets_rails_3/config/initializers/assets.rb
264
+ - spec/railsapps/rails_42_sprockets_rails_3/config/initializers/secret_token.rb
265
+ - spec/railsapps/rails_42_sprockets_rails_3/config/initializers/session_store.rb
266
+ - spec/railsapps/rails_42_sprockets_rails_3/config/routes.rb
261
267
  - spec/railsapps/shared/all/app/mailers/auto_mailer.rb
262
268
  - spec/railsapps/shared/all/app/mailers/mailer.rb
263
269
  - spec/railsapps/shared/all/app/views/mailer/normal_email.html.erb
@@ -284,12 +290,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
284
290
  version: '0'
285
291
  required_rubygems_version: !ruby/object:Gem::Requirement
286
292
  requirements:
287
- - - ">"
293
+ - - ">="
288
294
  - !ruby/object:Gem::Version
289
- version: 1.3.1
295
+ version: '0'
290
296
  requirements: []
291
297
  rubyforge_project:
292
- rubygems_version: 2.4.8
298
+ rubygems_version: 2.2.2
293
299
  signing_key:
294
300
  specification_version: 4
295
301
  summary: Making HTML emails comfortable for the Rails rockstars
@@ -394,6 +400,18 @@ test_files:
394
400
  - spec/railsapps/rails_42/config/initializers/secret_token.rb
395
401
  - spec/railsapps/rails_42/config/initializers/session_store.rb
396
402
  - spec/railsapps/rails_42/config/routes.rb
403
+ - spec/railsapps/rails_42_sprockets_rails_3/.gitignore
404
+ - spec/railsapps/rails_42_sprockets_rails_3/Gemfile
405
+ - spec/railsapps/rails_42_sprockets_rails_3/bin/rails
406
+ - spec/railsapps/rails_42_sprockets_rails_3/config.ru
407
+ - spec/railsapps/rails_42_sprockets_rails_3/config/application.rb
408
+ - spec/railsapps/rails_42_sprockets_rails_3/config/boot.rb
409
+ - spec/railsapps/rails_42_sprockets_rails_3/config/environment.rb
410
+ - spec/railsapps/rails_42_sprockets_rails_3/config/environments/development.rb
411
+ - spec/railsapps/rails_42_sprockets_rails_3/config/initializers/assets.rb
412
+ - spec/railsapps/rails_42_sprockets_rails_3/config/initializers/secret_token.rb
413
+ - spec/railsapps/rails_42_sprockets_rails_3/config/initializers/session_store.rb
414
+ - spec/railsapps/rails_42_sprockets_rails_3/config/routes.rb
397
415
  - spec/railsapps/shared/all/app/mailers/auto_mailer.rb
398
416
  - spec/railsapps/shared/all/app/mailers/mailer.rb
399
417
  - spec/railsapps/shared/all/app/views/mailer/normal_email.html.erb