From 539f823b8b78d9d4fbd7a194fd2af2bb1fd00f0f Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Mon, 21 Jul 2008 13:47:19 +1000 Subject: [PATCH] removed usless whitespace check in non-strict regexp match --- lib/validates_timeliness/formats.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validates_timeliness/formats.rb b/lib/validates_timeliness/formats.rb index 9895219..da3f35f 100644 --- a/lib/validates_timeliness/formats.rb +++ b/lib/validates_timeliness/formats.rb @@ -208,7 +208,7 @@ module ValidatesTimeliness expressions = self.send("#{type}_expressions") time_array = nil expressions.each do |(regexp, processor)| - regexp = strict || type == :datetime ? /\A#{regexp}\Z/ : (type == :date ? /\A#{regexp}\s?/ : /\s?#{regexp}\Z/) + regexp = strict || type == :datetime ? /\A#{regexp}\Z/ : (type == :date ? /\A#{regexp}/ : /#{regexp}\Z/) if matches = regexp.match(time_string.strip) time_array = processor.call(*matches[1..7]) break