mail_style 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mail_style/inline_styles.rb +10 -1
  2. metadata +44 -21
@@ -16,7 +16,7 @@ module MailStyle
16
16
 
17
17
  def write_inline_styles
18
18
  # Parse only text/html parts
19
- @parts.select{|p| p.content_type == 'text/html'}.each do |part|
19
+ parsable_parts(@parts).each do |part|
20
20
  part.body = parse_html(part.body)
21
21
  end
22
22
 
@@ -24,6 +24,15 @@ module MailStyle
24
24
  real_content_type, ctype_attrs = parse_content_type
25
25
  self.body = parse_html(body) if body.is_a?(String) && real_content_type == 'text/html'
26
26
  end
27
+
28
+ def parsable_parts(parts)
29
+ selected = []
30
+ parts.each do |p|
31
+ selected << p if p.content_type == 'text/html'
32
+ selected += parsable_parts(p.parts)
33
+ end
34
+ selected
35
+ end
27
36
 
28
37
  def parse_html(html)
29
38
  # Parse original html
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail_style
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 4
9
+ version: 0.1.4
5
10
  platform: ruby
6
11
  authors:
7
12
  - Jim Neath
@@ -9,49 +14,65 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-01-29 00:00:00 +00:00
17
+ date: 2010-05-03 00:00:00 +01:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: actionmailer
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 2
30
+ - 3
23
31
  version: 1.2.3
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: nokogiri
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 0
44
+ - 0
33
45
  version: 1.0.0
34
- version:
46
+ type: :runtime
47
+ version_requirements: *id002
35
48
  - !ruby/object:Gem::Dependency
36
49
  name: css_parser
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
40
52
  requirements:
41
53
  - - ">="
42
54
  - !ruby/object:Gem::Version
55
+ segments:
56
+ - 1
57
+ - 0
58
+ - 0
43
59
  version: 1.0.0
44
- version:
60
+ type: :runtime
61
+ version_requirements: *id003
45
62
  - !ruby/object:Gem::Dependency
46
63
  name: rspec-rails
47
- type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
50
66
  requirements:
51
67
  - - ">="
52
68
  - !ruby/object:Gem::Version
69
+ segments:
70
+ - 1
71
+ - 2
72
+ - 6
53
73
  version: 1.2.6
54
- version:
74
+ type: :development
75
+ version_requirements: *id004
55
76
  description: Making HTML emails a little less painful. Writes css inline and corrects image urls.
56
77
  email: jimneath@googlemail.com
57
78
  executables: []
@@ -89,18 +110,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
110
  requirements:
90
111
  - - ">="
91
112
  - !ruby/object:Gem::Version
113
+ segments:
114
+ - 0
92
115
  version: "0"
93
- version:
94
116
  required_rubygems_version: !ruby/object:Gem::Requirement
95
117
  requirements:
96
118
  - - ">="
97
119
  - !ruby/object:Gem::Version
120
+ segments:
121
+ - 0
98
122
  version: "0"
99
- version:
100
123
  requirements: []
101
124
 
102
125
  rubyforge_project:
103
- rubygems_version: 1.3.5
126
+ rubygems_version: 1.3.6
104
127
  signing_key:
105
128
  specification_version: 3
106
129
  summary: Making HTML emails a little less painful. Writes css inline and corrects image urls.