diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-29 06:39:50 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-29 06:39:50 +0000 |
commit | 0977fe17053680310cb0611e9ad2df705d05a070 (patch) | |
tree | 193303ea0a80ff3afab2278ad36cb60b1353fe2a /lib/date/format.rb | |
parent | fec60bc7c4f851d0cf1c4670ef8f2d9c597b7598 (diff) | |
download | ruby-0977fe17053680310cb0611e9ad2df705d05a070.tar.gz |
* instruby.rb, ext/extmk.rb, lib/benchmark.rb, lib/cgi.rb,
lib/debug.rb, lib/getoptlong.rb, lib/optparse.rb, lib/time.rb,
lib/date/format.rb, lib/irb/ruby-lex.rb lib/uri/common.rb: revert
escape for `-' in character class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date/format.rb')
-rw-r--r-- | lib/date/format.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb index 2d5de09220..10283988fc 100644 --- a/lib/date/format.rb +++ b/lib/date/format.rb @@ -80,7 +80,7 @@ class Date when '%F' return unless __strptime(str, '%Y-%m-%d', elem) when '%G' - return unless str.sub!(/\A([\-+]?\d+)/o, '') + return unless str.sub!(/\A([-+]?\d+)/o, '') val = $1.to_i elem[:cwyear] = val when '%g' @@ -163,7 +163,7 @@ class Date when '%x' return unless __strptime(str, '%m/%d/%y', elem) when '%Y' - return unless str.sub!(/\A([\-+]?\d+)/o, '') + return unless str.sub!(/\A([-+]?\d+)/o, '') val = $1.to_i elem[:year] = val when '%y' @@ -173,7 +173,7 @@ class Date elem[:year] = val elem[:cent] ||= if val >= 69 then 19 else 20 end when '%Z', '%z' - return unless str.sub!(/\A([a-z0-9:+\-]+(?:\s+dst\b)?)/io, '') + return unless str.sub!(/\A([a-z0-9:+-]+(?:\s+dst\b)?)/io, '') val = $1 elem[:zone] = val offset = zone_to_diff(val) @@ -227,7 +227,7 @@ class Date def self._parse(str, comp=false) str = str.dup - str.gsub!(/[^\-+.\/:0-9a-z]+/ino, ' ') + str.gsub!(/[^.\/:0-9a-z+-]+/ino, ' ') # day if str.sub!(/(#{PARSE_DAYPAT})\S*/ino, ' ') @@ -246,7 +246,7 @@ class Date ( [a-z]+(?:\s+dst)?\b | - [\-+]\d+(?::?\d+) + [-+]\d+(?::?\d+) ) )? /inox, @@ -308,7 +308,7 @@ class Date end # iso - elsif str.sub!(/([\-+]?\d+)-(\d+)-(-?\d+)/no, ' ') + elsif str.sub!(/([-+]?\d+)-(\d+)-(-?\d+)/no, ' ') year = $1.to_i mon = $2.to_i mday = $3.to_i @@ -332,7 +332,7 @@ class Date mday = $4.to_i # vms - elsif str.sub!(/(-?\d+)-(#{PARSE_MONTHPAT})[^\-]*-(-?\d+)/ino, ' ') + elsif str.sub!(/(-?\d+)-(#{PARSE_MONTHPAT})[^-]*-(-?\d+)/ino, ' ') mday = $1.to_i mon = ABBR_MONTHS[$2.downcase] year = $3.to_i @@ -363,7 +363,7 @@ class Date # ddd elsif str.sub!( - /([\-+]?)(\d{4,14}) + /([-+]?)(\d{4,14}) (?: \s* T? @@ -375,7 +375,7 @@ class Date ( Z | - [\-+]\d{2,4} + [-+]\d{2,4} ) \b )? @@ -444,7 +444,7 @@ class Date if ZONES.include?(abb) offset = ZONES[abb] offset += 3600 if dst - elsif /\A([+\-])(\d{2}):?(\d{2})?\Z/no =~ str + elsif /\A([+-])(\d{2}):?(\d{2})?\Z/no =~ str offset = $2.to_i * 3600 + $3.to_i * 60 offset *= -1 if $1 == '-' end |