sighmon / mjml-rails

MJML + ERb/Haml/Slim view template
https://mjml.io
Other
300 stars 65 forks source link

Use Open3 instead of backticks #59

Closed adrianob closed 4 years ago

adrianob commented 4 years ago

The fix introduced in https://github.com/sighmon/mjml-rails/commit/f05d2bf2e06aa1251ee0a6c7c45dd4f987090722 is not working for me when npm is not installed.

`npm bin` returns nil instead of throwing an exception, so we get a NoMethodError on chomp . This seems to be caused by rails overriding backticks: https://github.com/rails/rails/blob/v5.1.4/activesupport/lib/active_support/core_ext/kernel/agnostics.rb

This PR uses Open3 instead to find the bin path.

sighmon commented 4 years ago

@adrianob Thanks for that fix. 4.3.2 should be released shortly.