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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce8a69dbcbde5d6e722af8f693bd1de1d98fe215
4
- data.tar.gz: 46819cad96918dbe23644317d75d857910b20b95
3
+ metadata.gz: 1a3ebc3aff7c53caa14674f15dc37ab6150554f8
4
+ data.tar.gz: 8f6b87cd08b8f2e2d1760204c94838281d000f2f
5
5
  SHA512:
6
- metadata.gz: d8c079d85d8d4b32f1e3a42593dece9429cc2048a1efbbc1336d2f47581d09786adc1ac34f6a14fbed384fd2a6bfa4c33f60884351e8f3b72e5e2face41a5222
7
- data.tar.gz: ab3a115a5e91b27b0d6b02d5af2828741cedd7d39e7d723169d019838fdb8db1420d53857eefd773459b3508627839047dbdec3fc6a72d5758a73e9aa1ba6bea
6
+ metadata.gz: 6840bb17f8c116882bbc654a39a1073315a8f11c13eff80020ab6fb024ed4801b482112d14352299243ce7b8aa81ecc0ca971e950593b2593182361551c6fab0
7
+ data.tar.gz: c87ba9352200a9f49392da40f05d919be762a3787d9fc48ac8d8c0e9f3a8189fdf6775a74ae089b66292db58ddee4bc9d1796ac6e71eb4af812460ab42790bc4
@@ -1,9 +1,16 @@
1
1
  ### development version
2
2
 
3
- [full changelog](https://github.com/Mange/roadie/compare/v1.0.0...master)
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 = make_new_html(html_part.body.decoded)
23
+ html_part.body = transform_html(html_part.body.decoded)
19
24
  end
20
25
 
21
- def make_new_html(old_html)
26
+ def transform_html(old_html)
22
27
  DocumentBuilder.build(old_html, options).transform
23
28
  end
24
29
  end
@@ -1,5 +1,5 @@
1
1
  module Roadie
2
2
  module Rails
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -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.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-27 00:00:00.000000000 Z
11
+ date: 2014-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roadie