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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37fc78307ca3c1e85b631b150aed387a37db392786125cea2336d9696cd9669f
4
- data.tar.gz: 98c17ccd57b004df6d0a03bdeae92de3e4de73f2242335f0f85f84ce006918f2
3
+ metadata.gz: 2b6b7aed097a59ac30303aaf45d11b7f736e521d80f861b93fbf1886be6a15a0
4
+ data.tar.gz: 3d894ce65b6ba9c6f5818acfaf4d34dd57a85b29ed4a071870ff2c4cdc65c9ad
5
5
  SHA512:
6
- metadata.gz: 357492e9fd6db87e71e4151f36b55b24407e40c6d91462bd2d471c2bd084d3fdca096f4413b02754f7292522f7f8529b6ea202bdef150c6777d5a35d26960da1
7
- data.tar.gz: 1ccac9f8f3270d7eb1746e711583b73feb1ae0a97f2bf092d5826cfc4f6eb2f5d3d61d371ab6f7aa6d98726fb3035c4650c57a25c2ea1bb2418dcc2e30a40462
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
- [Hugo Giraudel](https://twitter.com/hugogiraudel) wrote a post on [using MJML in Rails](http://dev.edenspiekermann.com/2016/06/02/using-mjml-in-rails/).
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mjml
4
4
  # Version number no longer matches MJML.io version
5
- VERSION = '4.11.0'
5
+ VERSION = '4.12.0'
6
6
  end
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
- check_for_yarn_mjml_binary ||
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.check_for_yarn_mjml_binary
78
- yarn_bin = `which yarn`.chomp
79
- return if yarn_bin.blank?
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("#{yarn_bin} bin mjml")
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.check_for_npm_mjml_binary
91
- npm_bin = `which npm`.chomp
92
- return if npm_bin.blank?
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(:check_for_yarn_mjml_binary).returns(false)
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.11.0
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
  MIIEdDCCAtygAwIBAgIBATANBgkqhkiG9w0BAQsFAD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2N
25
+ tHZj+9aj1US7cI/sGRsEenlMtoXTjew41x2UwXbHZssaOLsn/ubJr+HP3bLph9it
26
+ gD4VwPpzem66FPNH/uFfAF17H11961fbTvlPtxcVj39EFMH7AgMBAAGjeTB3MAkG
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-04-06 00:00:00.000000000 Z
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.3
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