removed usless whitespace check in non-strict regexp match

This commit is contained in:
Adam Meehan 2008-07-21 13:47:19 +10:00
parent 4e8007bc65
commit 539f823b8b

View File

@ -208,7 +208,7 @@ module ValidatesTimeliness
expressions = self.send("#{type}_expressions") expressions = self.send("#{type}_expressions")
time_array = nil time_array = nil
expressions.each do |(regexp, processor)| 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) if matches = regexp.match(time_string.strip)
time_array = processor.call(*matches[1..7]) time_array = processor.call(*matches[1..7])
break break