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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a768bdc7c72cb474b41346d9f48685d46ac7eb477850f417eac944abcfe3289
4
- data.tar.gz: ceca1bd32af0d391c92a5ff0a00a80751e34b069571fe57567fc3b1cfee656ff
3
+ metadata.gz: 9c6559e7522a96885f084a543108e00fc80bf778dd371edbf6a67ffb20c8269a
4
+ data.tar.gz: e14f43e0de4ad7524c1774784552299fd9689b1643b9504e73f44bed92677c2e
5
5
  SHA512:
6
- metadata.gz: a2a6098dadd2d9004b7043903b61056da28d2d061bebb391c7ed9ab537f24879dac30b46d08388c41871a74c7a7e4e703d1b206e08f0980aeaeb006e3674ed7c
7
- data.tar.gz: f626fc4c6141133b42cba395e137f557ed3259198a40ab7b445a8ec5b3521cbb74a5a499df5d3e0a176f5f3a8c10e5f933e37fa000d45957784c1d9869b4a778
6
+ metadata.gz: fe6820680ae3e42c303ac19d687b2fd01b7c36eb16f9deb590a34e3fe0eb6fd55774f09f95514a46239d233c2209b73247f0e8c577a2c3902e509596c0f8e7ac
7
+ data.tar.gz: 79ef029fc1a7cecdc35bb3e7681edb865968e5263e110bf7a0b1a87316a6d403e60d6e8383936fda29d6494e118cbf64b8756599933291b6711a63de08fd0548
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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
- @input = input
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
- MRML.to_html(input)
19
- rescue NameError
20
- Mjml.logger.fatal('MRML is not installed. Please add `gem "mrml"` to your Gemfile.')
21
- raise
22
- rescue StandardError
23
- raise if Mjml.raise_render_exception
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mjml
4
4
  # Version number no longer matches MJML.io version
5
- VERSION = '4.15.0'
5
+ VERSION = '4.15.1'
6
6
  end
@@ -3,7 +3,7 @@
3
3
  require 'test_helper'
4
4
 
5
5
  describe Mjml::MrmlParser do
6
- let(:parser) { Mjml::MrmlParser.new(input) }
6
+ let(:parser) { Mjml::MrmlParser.new('test_template', input) }
7
7
 
8
8
  describe '#render' do
9
9
  describe 'when input is valid' do
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.0
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-05 00:00:00.000000000 Z
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