mjml-rails 4.2.4
Legitimate MJML Rails gem
“Render MJML + ERb template views in Rails”
Ruby subshell command executionpopen pipes to/from command
SHA-256a755fae40e30eb7e4f0b06a4abc90e0ea9dc69d0f7bcbc0490973aa5b32e80ff
MaleculeO(C)H₂(CmPo)
Evidence
60:47…
61 let(:error) { 'shell error' }
62 let(:stderr) { mock('stderr', eof?: false, read: error) }
63
64 before { Open3.stubs(popen3: [nil, nil, stderr, nil]) }
65
66 it 'raises exception' do
67 -> { parser.run "/tmp/input_file.mjml" }.must_raise(Mjml::Parser::ParseError, error)
68 end
69 end
70 end
71end
⋯4 lines
16
17 def self.check_version(bin)
18 IO.popen("#{bin} --version") { |io| io.read.include?("mjml-core: #{Mjml.mjml_binary_version_supported}") }
19 rescue
20 false
⋯6 lines
28:6… Check for a local install of MJML binary
29 installer_path = (`npm bin` || `yarn bin`).chomp
30 mjml_bin = File.join(installer_path, 'mjml')
31 return mjml_bin if check_version(mjml_bin)
32
33 puts Mjml.mjml_bina …
51:26… hen top-level layout/template is rendered
52 #
53 # [0] - https://github.com/mjmlio/mjml/blob/master/doc/guide.md#mjml
54 if compiled_source =~ /<mjml(.+)?>/i
55 "Mjml::Mjmltemplate.to_html(begin;# …
No evidence locations were recorded for this file. Raw result