mjml-rails 4.11.0 → 4.12.0
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/README.md +6 -3
- data/lib/mjml/version.rb +1 -1
- data/lib/mjml.rb +10 -18
- data/test/mjml_test.rb +1 -2
- data.tar.gz.sig +0 -0
- metadata +24 -24
- 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: 2b6b7aed097a59ac30303aaf45d11b7f736e521d80f861b93fbf1886be6a15a0
|
4
|
+
data.tar.gz: 3d894ce65b6ba9c6f5818acfaf4d34dd57a85b29ed4a071870ff2c4cdc65c9ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3dd354857e11c5a8864365a1e19c591eaec48a1349d3f675522f6835e5c830d9dd0328957866cbb5e085f1fab6679dec1588f8233841a33626469e9d5eb17a1
|
7
|
+
data.tar.gz: be4f6c9bf8192a20bba52cf2f196e33e96b9d6d7546efccb5c7efec9fb8295fd8caebff39f4131b4e9444dfc254b9c8814e039e529c43bb18fe7714ff0e2acd2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -79,6 +79,9 @@ npm install -g mjml
|
|
79
79
|
|
80
80
|
# with yarn
|
81
81
|
yarn add mjml
|
82
|
+
|
83
|
+
# with bun
|
84
|
+
bun add mjml
|
82
85
|
```
|
83
86
|
|
84
87
|
MJML-Rails falls back to a global installation of MJML but it is strongly recommended to add MJML directly to your project.
|
@@ -151,9 +154,9 @@ MJML-Rails has the following settings with defaults:
|
|
151
154
|
|
152
155
|
- `use_mrml: false`
|
153
156
|
Enabling this will allow you to use Rust implementation of MJML via the `mrml` gem. It comes with prebuilt binaries instead of having to install MJML along with Node. When enabled the options `mjml_binary_version_supported`, `mjml_binary`, `minify`, `beautify` and `validation_level` are ignored.
|
154
|
-
|
157
|
+
|
155
158
|
- `fonts`
|
156
|
-
By default, MJML-Rails uses MJML default fonts, but enables you to override it.
|
159
|
+
By default, MJML-Rails uses MJML default fonts, but enables you to override it.
|
157
160
|
Example : `config.fonts = { Raleway: 'https://fonts.googleapis.com/css?family=Raleway }`
|
158
161
|
|
159
162
|
|
@@ -211,7 +214,7 @@ npm install -g mjml@3.3.5
|
|
211
214
|
|
212
215
|
### How to guides
|
213
216
|
|
214
|
-
[
|
217
|
+
[Kitty Giraudel](https://twitter.com/KittyGiraudel) wrote a post on [using MJML in Rails](http://dev.edenspiekermann.com/2016/06/02/using-mjml-in-rails/).
|
215
218
|
|
216
219
|
## Using Email Layouts
|
217
220
|
|
data/lib/mjml/version.rb
CHANGED
data/lib/mjml.rb
CHANGED
@@ -48,8 +48,7 @@ module Mjml
|
|
48
48
|
def self.valid_mjml_binary
|
49
49
|
self.valid_mjml_binary = @@valid_mjml_binary ||
|
50
50
|
check_for_custom_mjml_binary ||
|
51
|
-
|
52
|
-
check_for_npm_mjml_binary ||
|
51
|
+
check_for_package_mjml_binary ||
|
53
52
|
check_for_global_mjml_binary ||
|
54
53
|
check_for_mrml_binary
|
55
54
|
|
@@ -74,30 +73,23 @@ module Mjml
|
|
74
73
|
'it is a valid MJML binary. Please check your configuration.'
|
75
74
|
end
|
76
75
|
|
77
|
-
def self.
|
78
|
-
|
79
|
-
return if
|
76
|
+
def self.check_for_mjml_package(package_manager, bin_command, binary_path)
|
77
|
+
pm_bin = `which #{package_manager}`.chomp
|
78
|
+
return if pm_bin.blank?
|
80
79
|
|
81
|
-
stdout, _, status = Open3.capture3("#{
|
80
|
+
stdout, _, status = Open3.capture3("#{pm_bin} #{bin_command}")
|
82
81
|
return unless status.success?
|
83
82
|
|
84
|
-
mjml_bin = stdout.chomp
|
83
|
+
mjml_bin = File.join(stdout.chomp, *binary_path)
|
85
84
|
return mjml_bin if check_version(mjml_bin)
|
86
85
|
rescue Errno::ENOENT # package manager is not installed
|
87
86
|
nil
|
88
87
|
end
|
89
88
|
|
90
|
-
def self.
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
stdout, _, status = Open3.capture3("#{npm_bin} root")
|
95
|
-
return unless status.success?
|
96
|
-
|
97
|
-
mjml_bin = File.join(stdout.chomp, '.bin', 'mjml')
|
98
|
-
return mjml_bin if check_version(mjml_bin)
|
99
|
-
rescue Errno::ENOENT # package manager is not installed
|
100
|
-
nil
|
89
|
+
def self.check_for_package_mjml_binary
|
90
|
+
check_for_mjml_package('bun', 'pm bin', ['mjml']) ||
|
91
|
+
check_for_mjml_package('npm', 'root', ['.bin', 'mjml']) ||
|
92
|
+
check_for_mjml_package('yarn', 'bin mjml', [])
|
101
93
|
end
|
102
94
|
|
103
95
|
def self.check_for_global_mjml_binary
|
data/test/mjml_test.rb
CHANGED
@@ -162,8 +162,7 @@ describe Mjml do
|
|
162
162
|
it 'can use MRML and check for a valid binary' do
|
163
163
|
Mjml.use_mrml = true
|
164
164
|
Mjml.stubs(:check_for_custom_mjml_binary).returns(false)
|
165
|
-
Mjml.stubs(:
|
166
|
-
Mjml.stubs(:check_for_npm_mjml_binary).returns(false)
|
165
|
+
Mjml.stubs(:check_for_package_mjml_binary).returns(false)
|
167
166
|
Mjml.stubs(:check_for_global_mjml_binary).returns(false)
|
168
167
|
expect(Mjml.valid_mjml_binary).must_equal(true)
|
169
168
|
|
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.
|
4
|
+
version: 4.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Loffler
|
@@ -13,30 +13,30 @@ cert_chain:
|
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
14
|
MIIEdDCCAtygAwIBAgIBATANBgkqhkiG9w0BAQs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
|
27
|
+
A1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBTo6MDHQYDOj+zwdyTsCljW
|
28
|
+
+zZwszAeBgNVHREEFzAVgRNzaWdobW9uQHNpZ2htb24uY29tMB4GA1UdEgQXMBWB
|
29
|
+
E3NpZ2htb25Ac2lnaG1vbi5jb20wDQYJKoZIhvcNAQELBQADggGBAAj8eUP4oTrt
|
30
|
+
Rnf7qJec8F2EA2mJLUz+PrGrM/eiP0jIVeGGrwfvn9hBtU+3IG6IPj16nb40T+/Q
|
31
|
+
iSNIYxOZHYxj2CZf2CKKIz5slESybSlfuX/3i6WgZ3GP9X+z5jZE43fA1zR9kWIN
|
32
|
+
xVl3McOoST+/UP+skagMdOl8S6qg8THdb9qTZLDT+XJVLNE8k7bcOiTKa6ef/hCR
|
33
|
+
A9C/1rxJJHehHewkQQPLJg5edufj2t+BVY0tnMT24TXVCS7qy9BjZ/f1hC+4jrUA
|
34
|
+
ezb/gRETp2GvGgoIrrZSiTiODKfIuhjifaxy1c+E/XfvN7gtO6awgTKHg+gt6y55
|
35
|
+
ECdz0FTGporEyMBWc+GqSpfIXKKlNUsWyEEo9J3mjDfED/1nP+bePK+B3wwc69sl
|
36
|
+
Qqk2dn/fFE9vdcl9OaOw2Zizne/1VFL/jkzXLqnLgbKD/q129mVCBgw2CKYnQfMN
|
37
|
+
4RwBjPyqnMxWnSq6Ycn7HdFEkgyf2cAxFfH5QtDsjEuca+/LAJMeAQ==
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2024-
|
39
|
+
date: 2024-08-24 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.5.
|
195
|
+
rubygems_version: 3.5.11
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: MJML + ERb templates
|
metadata.gz.sig
CHANGED
Binary file
|