awesomemailer 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "awesomemailer"
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Flip Sasser"]
@@ -26,11 +26,14 @@ module AwesomeMailer
26
26
 
27
27
  private
28
28
  def apply_styles_to_body!(selector, properties)
29
- rewrite_relative_urls(properties) if host
30
29
  search_selector = selector =~ /^body/ ? selector : "body #{selector}"
31
- document.search(search_selector).each do |element|
30
+ elements = document.search(search_selector)
31
+ rewrite_relative_urls(properties) if host
32
+ elements.each do |element|
32
33
  element['style'] = [element['style'], properties].flatten.compact.join('; ')
33
34
  end
35
+ rescue Nokogiri::CSS::SyntaxError # Complex CSS? Just dump it somewhere
36
+ apply_styles_to_head!(selector, properties)
34
37
  end
35
38
 
36
39
  def apply_styles_to_head!(selector, properties, indent = 0)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awesomemailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: