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/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 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