mjml-rails 4.10.0 → 4.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mjml/version.rb +1 -1
- data/lib/mjml.rb +9 -1
- data/test/mjml_test.rb +16 -0
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: 321f6e1eaed15dffa0b3c65283a095a92ac80cae3b3d3df4f395d446fbc4e490
|
4
|
+
data.tar.gz: 96cce85167d65a6c20cc62ad3d5690ed7e4c166af37311190a0729f33b6a315d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc6708c231290dea0a14a04c03d977f58dd34c5d64116c7aba01601191ebbda08642cf0039bc2ab060b7174a5e8f5fa728dae2da14bceeaa3351f8bb4073b721
|
7
|
+
data.tar.gz: 6f32e5c076fac3d45c69c2e8dfcc6880ef8d73dbf32e1c87dfb51442f466b90917d9591c08fa5bbfd7f748845d2672b35befa3ea8210c6edec104f56398dd5b5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mjml/version.rb
CHANGED
data/lib/mjml.rb
CHANGED
@@ -48,7 +48,8 @@ module Mjml
|
|
48
48
|
check_for_custom_mjml_binary ||
|
49
49
|
check_for_yarn_mjml_binary ||
|
50
50
|
check_for_npm_mjml_binary ||
|
51
|
-
check_for_global_mjml_binary
|
51
|
+
check_for_global_mjml_binary ||
|
52
|
+
check_for_mrml_binary
|
52
53
|
|
53
54
|
return @@valid_mjml_binary if @@valid_mjml_binary
|
54
55
|
|
@@ -102,6 +103,13 @@ module Mjml
|
|
102
103
|
return mjml_bin if mjml_bin.present? && check_version(mjml_bin)
|
103
104
|
end
|
104
105
|
|
106
|
+
def self.check_for_mrml_binary
|
107
|
+
MRML.present?
|
108
|
+
rescue NameError
|
109
|
+
Mjml.mjml_binary_error_string = 'Couldn\'t find MRML - did you add \'mrml\' to your Gemfile?'
|
110
|
+
false
|
111
|
+
end
|
112
|
+
|
105
113
|
def self.discover_mjml_bin
|
106
114
|
logger.warn('`Mjml.discover_mjml_bin` is deprecated and has no effect anymore! ' \
|
107
115
|
'Please use `Mjml.mjml_binary=` to set a custom MJML binary.')
|
data/test/mjml_test.rb
CHANGED
@@ -119,11 +119,13 @@ describe Mjml do
|
|
119
119
|
before do
|
120
120
|
Mjml.mjml_binary = nil
|
121
121
|
Mjml.valid_mjml_binary = nil
|
122
|
+
Mjml.use_mrml = nil
|
122
123
|
end
|
123
124
|
|
124
125
|
after do
|
125
126
|
Mjml.mjml_binary = nil
|
126
127
|
Mjml.valid_mjml_binary = nil
|
128
|
+
Mjml.use_mrml = nil
|
127
129
|
end
|
128
130
|
|
129
131
|
it 'can be set to a custom value with mjml_binary if version is correct' do
|
@@ -156,5 +158,19 @@ describe Mjml do
|
|
156
158
|
assert(err.message.start_with?("MJML.mjml_binary is set to 'set by mjml_binary' " \
|
157
159
|
'but MJML-Rails could not validate that it is a valid MJML binary'))
|
158
160
|
end
|
161
|
+
|
162
|
+
it 'can use MRML and check for a valid binary' do
|
163
|
+
Mjml.use_mrml = true
|
164
|
+
Mjml.stubs(:check_for_custom_mjml_binary).returns(false)
|
165
|
+
Mjml.stubs(:check_for_yarn_mjml_binary).returns(false)
|
166
|
+
Mjml.stubs(:check_for_npm_mjml_binary).returns(false)
|
167
|
+
Mjml.stubs(:check_for_global_mjml_binary).returns(false)
|
168
|
+
expect(Mjml.valid_mjml_binary).must_equal(true)
|
169
|
+
|
170
|
+
Mjml.valid_mjml_binary = nil
|
171
|
+
MRML.stubs(:present?).raises(NameError)
|
172
|
+
assert_nil(Mjml.valid_mjml_binary)
|
173
|
+
expect(Mjml.mjml_binary_error_string).must_equal 'Couldn\'t find MRML - did you add \'mrml\' to your Gemfile?'
|
174
|
+
end
|
159
175
|
end
|
160
176
|
end
|
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.10.
|
4
|
+
version: 4.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Loffler
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
RhdbGYd5Hku1QRVeQ+tN2OYG1/vZeRTqZ4MGLdl6r4iO5XGtWWoR2alg8kKc6yLx
|
37
37
|
P5J+9tLKId50fAv4voQg//wRwePPNiWIXsLUa1LPYWTAznKTvi3dAQ==
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2024-01
|
39
|
+
date: 2024-02-01 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: byebug
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
- !ruby/object:Gem::Version
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
|
-
rubygems_version: 3.
|
195
|
+
rubygems_version: 3.5.3
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: MJML + ERb templates
|
metadata.gz.sig
CHANGED
Binary file
|