From: nobu@... Date: 2020-09-30T02:24:04+00:00 Subject: [ruby-core:100228] [Ruby master Bug#17169] Bad value for range using infinity for Time Issue #17169 has been updated by nobu (Nobuyoshi Nakada). Probably, since ruby 2.7, you can use begin-less/end-less ranges instead. ---------------------------------------- Bug #17169: Bad value for range using infinity for Time https://bugs.ruby-lang.org/issues/17169#change-87817 * Author: isarcasm (Igor Tsykalo) * Status: Rejected * Priority: Normal * ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- How to reproduce: ``` ruby -Float::INFINITY...Float::INFINITY # works Date.today...Float::INFINITY # works -Float::INFINITY...Date.today # works Time.now...Float::INFINITY #fails with "ArgumentError: bad value for range" -Float::INFINITY...Time.now #fails with "ArgumentError: bad value for range" ``` I don't see why there should be a difference in this respect between Date and Time This is issue is related to https://bugs.ruby-lang.org/issues/12961 which is Closed but actually only fixed the Date case. P.S.: The Time.now...Float::INFINITY works with Rails' ActiveSupport via Time monkey-patching. However, monkey patching Float feels riskier. -- https://bugs.ruby-lang.org/ Unsubscribe: