mjml 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mjml.rb +4 -0
- data/lib/mjml/mailer.rb +2 -2
- data/lib/mjml/version.rb +1 -1
- 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: c4e404ee11c541a4ca416be392afdfa18c7a6ed3
|
4
|
+
data.tar.gz: 0e3af45b2819bd146da93cb927665d415d751c91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 059a3ca00efde34979de2a76b981eb40dbaaa381f56cf2f06cf340c8afc91ff7bf3676bea3e96128e7a4d87dd0c3e405d7c042e956c8c57cc5051bc6f7eaab85
|
7
|
+
data.tar.gz: 454d35748fa6018d4f8a7d5163b5938c03d11a3917d41cac723a6db2ed639bd5b843b5f116f7b1938c037d24e4110718557729c2cf449b5298ae951ac97306dd
|
data/lib/mjml.rb
CHANGED
@@ -15,9 +15,13 @@ module Mjml
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.template(template_mjml)
|
18
|
+
retries ||= 0
|
18
19
|
mjml_path = "#{Dir.pwd}/tmp/template-#{SecureRandom.uuid}.mjml"
|
19
20
|
File.write(mjml_path, template_mjml)
|
20
21
|
render(mjml_path)
|
22
|
+
rescue Errno::ENOENT
|
23
|
+
Dir.mkdir "#{Dir.pwd}/tmp"
|
24
|
+
retry if (retries += 1) < 3
|
21
25
|
end
|
22
26
|
|
23
27
|
def self.configure
|
data/lib/mjml/mailer.rb
CHANGED
@@ -28,7 +28,7 @@ module Mjml
|
|
28
28
|
|
29
29
|
def mjml_content(headers, scope)
|
30
30
|
content =
|
31
|
-
if _layout
|
31
|
+
if self.class._layout
|
32
32
|
mjml_layout_content(headers, scope)
|
33
33
|
else
|
34
34
|
mjml_template_content(headers, scope)
|
@@ -38,7 +38,7 @@ module Mjml
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def mjml_layout_content(headers, scope)
|
41
|
-
erb_layout = Tilt::ERBTemplate.new("#{Dir.pwd}/app/views/layouts/#{_layout}.mjml")
|
41
|
+
erb_layout = Tilt::ERBTemplate.new("#{Dir.pwd}/app/views/layouts/#{self.class._layout}.mjml")
|
42
42
|
erb_template = Tilt::ERBTemplate.new("#{headers[:template_path]}/#{headers[:template_name]}.mjml")
|
43
43
|
erb_layout.render(scope) { erb_template.render(scope) }
|
44
44
|
end
|
data/lib/mjml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mjml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MQuy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|