roadie 3.5.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e5b48f0784734003ec7b2826452465632585b838d3aaa317f5924819974bf47
4
- data.tar.gz: 99b19ff36fb188c5002202364bf024406fd182b2579bb12130e6046e05c32c1c
3
+ metadata.gz: 19c2bb2df5f06249e20336bee272088f2224749fcb20741c411647428221e20e
4
+ data.tar.gz: cd7e290f724bf71fd8b56d8f013ebc2dd246b5594fc730d5899639d1dbdada38
5
5
  SHA512:
6
- metadata.gz: 95be1c483af2e4aad57fb354ed4cee8e92c0447312987415c60b2d043102dcb30e75389a65f14d0d7eda3c3f8a94de5c1f44a89a99a6b0c626560ab60ce9ad60
7
- data.tar.gz: f15c30dca75fe2268360265fd8f7d48838938259fd4fc37dd0f695148ce3cdc96905106ad6408b0e664ae0676d41a82b41c24ca09935d42206a02144b1a26d8b
6
+ metadata.gz: 8767e97ed3592ff69e969d646537775b9a0c571d62f54bb02555e102f5acedf5813435d0f4b1b58b52adb4187608cfe33020a7019c98aebd8ad5077ef3e3b4e8
7
+ data.tar.gz: 220fdd872e42acea4e4aebe9dc04f34d3a9e996254d5135af4663d98534362ade3b0d1c21368afd6c046282814b4f0d061f8e20f14451d295fb511f0c4888366
data/Changelog.md CHANGED
@@ -1,8 +1,18 @@
1
1
  ### dev
2
2
 
3
- [full changelog](https://github.com/Mange/roadie/compare/v3.4.0...master)
3
+ ### dev
4
+
5
+ [full changelog](https://github.com/Mange/roadie/compare/v3.5.1...master)
6
+
7
+ * Nothing yet.
8
+
9
+ ### 3.5.1
10
+
11
+ [full changelog](https://github.com/Mange/roadie/compare/v3.5.0...v3.5.1)
4
12
 
5
- Nothing yet.
13
+ * Gracefully handle empty string email body, such as those provided by
14
+ `ActionMailer::Base::NullMail` objects - [adamkiczula (Adam
15
+ Kiczula)](https://github.com/adamkiczula) (#163).
6
16
 
7
17
  ### 3.5.0
8
18
 
@@ -25,6 +25,7 @@ module Roadie
25
25
  # @return [nil] passed DOM will be mutated
26
26
  def improve
27
27
  ensure_doctype_present
28
+ ensure_html_element_present
28
29
  head = ensure_head_element_present
29
30
  ensure_declared_charset head
30
31
  end
@@ -48,6 +49,12 @@ module Roadie
48
49
  defined?(JRuby)
49
50
  end
50
51
 
52
+ def ensure_html_element_present
53
+ return if dom.at_xpath('html')
54
+ html = Nokogiri::XML::Node.new 'html', dom
55
+ dom << html
56
+ end
57
+
51
58
  def ensure_head_element_present
52
59
  if (head = dom.at_xpath('html/head'))
53
60
  head
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Roadie
4
- VERSION = "3.5.0"
4
+ VERSION = "3.5.1"
5
5
  end
@@ -36,6 +36,7 @@ module Roadie
36
36
 
37
37
  describe "basic HTML structure" do
38
38
  it "inserts a <html> element as the root" do
39
+ expect(improve("")).to have_selector("html")
39
40
  expect(improve("<h1>Hey!</h1>")).to have_selector("html h1")
40
41
  expect(improve("<html></html>").css('html').size).to eq(1)
41
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadie
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Bergmark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-27 00:00:00.000000000 Z
11
+ date: 2019-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -181,8 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  requirements: []
184
- rubyforge_project:
185
- rubygems_version: 2.7.3
184
+ rubygems_version: 3.0.2
186
185
  signing_key:
187
186
  specification_version: 4
188
187
  summary: Making HTML emails comfortable for the Ruby rockstars