From 9c856ff60afeaaa37b2bc3edbe97081980936d21 Mon Sep 17 00:00:00 2001 From: Daniel Cooper Date: Mon, 22 Jul 2019 16:24:02 +0100 Subject: [PATCH 1/2] Malformed "other_versions" should not raise --- lib/semantic/version.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/semantic/version.rb b/lib/semantic/version.rb index 7eda70c..fa44367 100644 --- a/lib/semantic/version.rb +++ b/lib/semantic/version.rb @@ -93,6 +93,7 @@ def <=> other_version def satisfies? other_version return true if other_version.strip == '*' + return false unless other_version.match?(/\d/) parts = other_version.split(/(\d(.+)?)/, 2) comparator, other_version_string = parts[0].strip, parts[1].strip From b2bb26909b2ebdebb1ea0ae2712f3c1fbd3b03e8 Mon Sep 17 00:00:00 2001 From: Daniel Cooper Date: Mon, 22 Jul 2019 16:27:57 +0100 Subject: [PATCH 2/2] Update version.rb --- lib/semantic/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/semantic/version.rb b/lib/semantic/version.rb index fa44367..3a4452c 100644 --- a/lib/semantic/version.rb +++ b/lib/semantic/version.rb @@ -93,7 +93,7 @@ def <=> other_version def satisfies? other_version return true if other_version.strip == '*' - return false unless other_version.match?(/\d/) + return false unless other_version.match(/\d/) parts = other_version.split(/(\d(.+)?)/, 2) comparator, other_version_string = parts[0].strip, parts[1].strip