mjml-rails 4.15.0 → 4.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mjml/mrml_parser.rb +15 -10
- data/lib/mjml/version.rb +1 -1
- data/test/mrml_parser_test.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c6559e7522a96885f084a543108e00fc80bf778dd371edbf6a67ffb20c8269a
|
4
|
+
data.tar.gz: e14f43e0de4ad7524c1774784552299fd9689b1643b9504e73f44bed92677c2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe6820680ae3e42c303ac19d687b2fd01b7c36eb16f9deb590a34e3fe0eb6fd55774f09f95514a46239d233c2209b73247f0e8c577a2c3902e509596c0f8e7ac
|
7
|
+
data.tar.gz: 79ef029fc1a7cecdc35bb3e7681edb865968e5263e110bf7a0b1a87316a6d403e60d6e8383936fda29d6494e118cbf64b8756599933291b6711a63de08fd0548
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mjml/mrml_parser.rb
CHANGED
@@ -2,27 +2,32 @@
|
|
2
2
|
|
3
3
|
module Mjml
|
4
4
|
class MrmlParser
|
5
|
-
attr_reader :input
|
5
|
+
attr_reader :template_path, :input
|
6
6
|
|
7
7
|
# Create new parser
|
8
8
|
#
|
9
|
+
# @param template_path [String] The path to the .mjml file
|
9
10
|
# @param input [String] The string to transform in html
|
10
|
-
def initialize(input)
|
11
|
-
@
|
11
|
+
def initialize(template_path, input)
|
12
|
+
@template_path = template_path
|
13
|
+
@input = input
|
14
|
+
@with_cache = Cache.new(template_path)
|
12
15
|
end
|
13
16
|
|
14
17
|
# Render mjml template
|
15
18
|
#
|
16
19
|
# @return [String]
|
17
20
|
def render
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
@with_cache.cache do
|
22
|
+
MRML.to_html(input)
|
23
|
+
rescue NameError
|
24
|
+
Mjml.logger.fatal('MRML is not installed. Please add `gem "mrml"` to your Gemfile.')
|
25
|
+
raise
|
26
|
+
rescue StandardError
|
27
|
+
raise if Mjml.raise_render_exception
|
24
28
|
|
25
|
-
|
29
|
+
''
|
30
|
+
end
|
26
31
|
end
|
27
32
|
end
|
28
33
|
end
|
data/lib/mjml/version.rb
CHANGED
data/test/mrml_parser_test.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mjml-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.15.
|
4
|
+
version: 4.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Loffler
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
Qqk2dn/fFE9vdcl9OaOw2Zizne/1VFL/jkzXLqnLgbKD/q129mVCBgw2CKYnQfMN
|
36
36
|
4RwBjPyqnMxWnSq6Ycn7HdFEkgyf2cAxFfH5QtDsjEuca+/LAJMeAQ==
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2025-04-
|
38
|
+
date: 2025-04-07 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: byebug
|
metadata.gz.sig
CHANGED
Binary file
|