Hi, When a hash literal is passed as first argument to a method, Ruby throws a syntax error. Example code: ~~~ruby def foo *args p args end foo 'Hello' foo 123 foo ['Hello', 123] foo {:hello => 123} # Syntax Error: Un...NorthernLights (Imran "")
Patch to the above bug : ~~~ class SmartTime < Time def self.mktime year, month, day case month when 4, 6, 9, 11 if day == 31 raise ArgumentError, 'argument out of range _ APR, JUNE, SEP, NOV', caller ...NorthernLights (Imran "")
Akira Tanaka: I've highlighted this bug and offered a patch also. I love Ruby a lot. I wish I could say the same about its community. Tsuyoshi Sawada: It is a working solution. Instead of trolling, share your ingenious alternative.NorthernLights (Imran "")
The following is a pure Ruby-based patch to address the issues raised in [Bug 10588 Invalid Dates](http://bugs.ruby-lang.org/issues/10588): ~~~ruby class SmartTime < Time def self.mktime year, month, day case month when ...NorthernLights (Imran "")
I was in the process of implementing a date-routine, which could prevent possible out-of-range/invalid date values. The interpreter, rightfully, threw an out-of range error, when I tried any of the following: puts Time.mktime 2014, 1...NorthernLights (Imran "")