From ddbe8011e2ecd2477e5acceab2127d5bd84331fb Mon Sep 17 00:00:00 2001 From: Matteo Rossi Date: Tue, 22 Oct 2024 12:19:10 +0200 Subject: [PATCH] fix: extend compatibility to rubies 2.6 and 2.5 The `Date::Error` exception class was added with Ruby 2.7 but this gem still supports a couple of versions below that. --- lib/itax_code/parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/itax_code/parser.rb b/lib/itax_code/parser.rb index 4c94a1b..97c1ee0 100644 --- a/lib/itax_code/parser.rb +++ b/lib/itax_code/parser.rb @@ -84,7 +84,7 @@ def day def birthdate @birthdate ||= Date.parse("#{year}-#{month}-#{day}").to_s - rescue Date::Error + rescue ArgumentError raise DateTaxCodeError end