roadie-rails 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +8 -1
- data/lib/roadie/rails/mail_inliner.rb +7 -2
- data/lib/roadie/rails/version.rb +1 -1
- data/spec/lib/roadie/rails/mail_inliner_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a3ebc3aff7c53caa14674f15dc37ab6150554f8
|
4
|
+
data.tar.gz: 8f6b87cd08b8f2e2d1760204c94838281d000f2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6840bb17f8c116882bbc654a39a1073315a8f11c13eff80020ab6fb024ed4801b482112d14352299243ce7b8aa81ecc0ca971e950593b2593182361551c6fab0
|
7
|
+
data.tar.gz: c87ba9352200a9f49392da40f05d919be762a3787d9fc48ac8d8c0e9f3a8189fdf6775a74ae089b66292db58ddee4bc9d1796ac6e71eb4af812460ab42790bc4
|
data/Changelog.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
### development version
|
2
2
|
|
3
|
-
[full changelog](https://github.com/Mange/roadie/compare/v1.0.
|
3
|
+
[full changelog](https://github.com/Mange/roadie/compare/v1.0.1...master)
|
4
4
|
|
5
5
|
* Nothing yet
|
6
6
|
|
7
|
+
### 1.0.1
|
8
|
+
|
9
|
+
[full changelog](https://github.com/Mange/roadie/compare/v1.0.0...v1.0.1)
|
10
|
+
|
11
|
+
* Bug fixes
|
12
|
+
* Inline HTML in emails without a plaintext part
|
13
|
+
|
7
14
|
### 1.0.0
|
8
15
|
|
9
16
|
[full changelog](https://github.com/Mange/roadie/compare/v1.0.0.pre1...v1.0.0)
|
@@ -9,16 +9,21 @@ module Roadie
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def execute
|
12
|
+
improve_body if email.content_type =~ /^text\/html/
|
12
13
|
improve_html_part(email.html_part) if email.html_part
|
13
14
|
email
|
14
15
|
end
|
15
16
|
|
16
17
|
private
|
18
|
+
def improve_body
|
19
|
+
email.body = transform_html(email.body.decoded)
|
20
|
+
end
|
21
|
+
|
17
22
|
def improve_html_part(html_part)
|
18
|
-
html_part.body =
|
23
|
+
html_part.body = transform_html(html_part.body.decoded)
|
19
24
|
end
|
20
25
|
|
21
|
-
def
|
26
|
+
def transform_html(old_html)
|
22
27
|
DocumentBuilder.build(old_html, options).transform
|
23
28
|
end
|
24
29
|
end
|
data/lib/roadie/rails/version.rb
CHANGED
@@ -29,6 +29,26 @@ module Roadie
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
context "with an HTML email" do
|
33
|
+
let(:html) { "<h1>Hello world!</h1>" }
|
34
|
+
let(:email) do
|
35
|
+
html_string = html
|
36
|
+
Mail.new do
|
37
|
+
content_type 'text/html; charset=UTF-8'
|
38
|
+
body html_string
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it "adjusts the html part using Roadie" do
|
43
|
+
document = double "A document", transform: "transformed HTML"
|
44
|
+
expect(DocumentBuilder).to receive(:build).with(html, instance_of(Options)).and_return document
|
45
|
+
|
46
|
+
inliner.execute
|
47
|
+
|
48
|
+
expect(email.body.decoded).to eq("transformed HTML")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
32
52
|
context "with an multipart email" do
|
33
53
|
let(:html) { "<h1>Hello world!</h1>" }
|
34
54
|
let(:email) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roadie-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.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: 2014-06-
|
11
|
+
date: 2014-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: roadie
|