Issue #7137 has been updated by shyouhei (Shyouhei Urabe).


-1 is not about parsing. Stop messing.
----------------------------------------
Bug #7137: Date.parse overly lenient when attempting to parse Monday?
https://bugs.ruby-lang.org/issues/7137#change-30537

Author: garysweaver (Gary Weaver)
Status: Rejected
Priority: Low
Assignee: tadf (tadayoshi funaba)
Category: lib
Target version: 
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


irb(main):001:0> require 'date'
=> true
irb(main):002:0> Date.parse('Monitoring')
=> #<Date: 2012-10-08 ((2456209j,0s,0n),+0s,2299161j)>
irb(main):003:0> Object.constants.sort.each{|c|puts "#{c}=#{Object.const_get(c)}" if c.to_s.start_with? 'RUBY'}; nil
RUBY_COPYRIGHT=ruby - Copyright (C) 1993-2012 Yukihiro Matsumoto
RUBY_DESCRIPTION=ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
RUBY_ENGINE=ruby
RUBY_PATCHLEVEL=194
RUBY_PLATFORM=x86_64-linux
RUBY_RELEASE_DATE=2012-04-20
RUBY_REVISION=35410
RUBY_VERSION=1.9.3
=> nil

It's nice that it tries to make sense out of strings liberally, but turning "Monitoring" into "Monday" seems a bit too lenient. Understand the workaround is not to use Date.parse, but I think this is buggy.

Thanks!


-- 
http://bugs.ruby-lang.org/