From 911efbb727daa4afe5428cdf664afee1a070a164 Mon Sep 17 00:00:00 2001 From: Mykola Basov Date: Sun, 4 Jul 2021 19:35:02 +0300 Subject: [PATCH 1/2] Fix semver regex --- lib/mjml.rb | 4 ++-- spec/mjml_spec.rb | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/mjml.rb b/lib/mjml.rb index a93d498..088b5ee 100644 --- a/lib/mjml.rb +++ b/lib/mjml.rb @@ -9,8 +9,8 @@ class BinaryNotFound < StandardError; end # Constants MIME_TYPE = 'text/mjml'.freeze EXTENSION = '.mjml'.freeze - VERSION_3_REGEX = /^(\d\.\d\.\d)/i - VERSION_4_REGEX = /^mjml-cli: (\d\.\d\.\d)/i + VERSION_3_REGEX = /^(\d+\.\d+\.\d+)/i + VERSION_4_REGEX = /^mjml-cli: (\d+\.\d+\.\d+)/i # Available settings module Config diff --git a/spec/mjml_spec.rb b/spec/mjml_spec.rb index d43599e..c353ee2 100644 --- a/spec/mjml_spec.rb +++ b/spec/mjml_spec.rb @@ -16,5 +16,13 @@ MJML::Config.bin_path = bin_path end + + it 'should work with multi-digit versions' do + version = '3.10.235'.match(MJML::VERSION_3_REGEX) + _(version[1]).must_equal('3.10.235') + + version = "mjml-core: 4.10.235\nmjml-cli: 4.10.235".match(MJML::VERSION_4_REGEX) + _(version[1]).must_equal('4.10.235') + end end end From 939b135ccd1b0fef1aa3798724a3eeb6a1c02fbf Mon Sep 17 00:00:00 2001 From: Mykola Basov Date: Sun, 4 Jul 2021 19:37:12 +0300 Subject: [PATCH 2/2] bump version to 0.4.1 --- lib/mjml/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mjml/version.rb b/lib/mjml/version.rb index 450010b..9ab895d 100644 --- a/lib/mjml/version.rb +++ b/lib/mjml/version.rb @@ -1,3 +1,3 @@ module MJML - VERSION = '0.4.0'.freeze + VERSION = '0.4.1'.freeze end