diff --git a/.gitignore b/.gitignore index f0736be..d3f510e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ test/tmp test/version_tmp tmp .byebug_history +spec/fixtures/*.html # YARD artifacts .yardoc diff --git a/.travis.yml b/.travis.yml index f53a7dd..32a6ed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,6 @@ notifications: email: false before_script: - - nvm install 6.5 - - nvm use 6.5 - - npm install + - nvm install node + - nvm use node + - rake prepare diff --git a/Rakefile b/Rakefile index 492f98d..435c45a 100644 --- a/Rakefile +++ b/Rakefile @@ -8,3 +8,10 @@ Rake::TestTask.new do |t| end task default: :test + +# Prepare env for tests +task :prepare do + system 'npm install -g mjml@^2.3.3' + template_path = "#{Dir.pwd}/spec/fixtures/hello" + system "mjml #{template_path}.mjml -o #{template_path}.html" +end diff --git a/lib/mjml/parser.rb b/lib/mjml/parser.rb index 59ff10c..887683a 100644 --- a/lib/mjml/parser.rb +++ b/lib/mjml/parser.rb @@ -44,7 +44,7 @@ def mjml_bin end def mjml_version - ver = `#{mjml_bin} -V`.strip + ver, _status = Open3.capture2(mjml_bin, '-V') (ver =~ VERSION_REGEX).nil? ? nil : ver end end diff --git a/package.json b/package.json deleted file mode 100644 index 5c90b30..0000000 --- a/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "mjml-ruby", - "version": "1.0.0", - "description": "For tests", - "dependencies": { - "mjml": "2.3.2" - }, - "devDependencies": {}, - "repository": { - "type": "git", - "url": "git+https://github.com/kolybasov/mjml-ruby.git" - }, - "author": "Mykola Basov (http://twitter.com/kolybasov)", - "license": "MIT", - "bugs": { - "url": "https://github.com/kolybasov/mjml-ruby/issues" - }, - "homepage": "https://github.com/kolybasov/mjml-ruby#readme" -} diff --git a/spec/fixtures/hello.html b/spec/fixtures/hello.html deleted file mode 100644 index e789392..0000000 --- a/spec/fixtures/hello.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - -
Hello, mjml-ruby!
- - \ No newline at end of file