Allow empty values for OptRegexp options

unstable
James Lee 2012-03-26 17:06:43 -06:00
parent d6ba1d3a32
commit 98882621c0
1 changed files with 2 additions and 0 deletions

View File

@ -462,6 +462,7 @@ class OptRegexp < OptBase
unless super
return false
end
return true if (not required? and value.nil?)
begin
Regexp.compile(value)
@ -473,6 +474,7 @@ class OptRegexp < OptBase
end
def normalize(value)
return nil if value.nil?
return Regexp.compile(value)
end