ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:100012] [Ruby master Bug#17169] Bad value for range using infinity for Time
@ 2020-09-15 15:31 sarcasm008
  2020-09-15 16:12 ` [ruby-core:100013] " merch-redmine
  2020-09-30  2:24 ` [ruby-core:100228] " nobu
  0 siblings, 2 replies; 3+ messages in thread
From: sarcasm008 @ 2020-09-15 15:31 UTC (permalink / raw
  To: ruby-core

Issue #17169 has been reported by isarcasm (Igor Tsykalo).

----------------------------------------
Bug #17169: Bad value for range using infinity for Time
https://bugs.ruby-lang.org/issues/17169

* Author: isarcasm (Igor Tsykalo)
* Status: Open
* 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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:100013] [Ruby master Bug#17169] Bad value for range using infinity for Time
  2020-09-15 15:31 [ruby-core:100012] [Ruby master Bug#17169] Bad value for range using infinity for Time sarcasm008
@ 2020-09-15 16:12 ` merch-redmine
  2020-09-30  2:24 ` [ruby-core:100228] " nobu
  1 sibling, 0 replies; 3+ messages in thread
From: merch-redmine @ 2020-09-15 16:12 UTC (permalink / raw
  To: ruby-core

Issue #17169 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Open to Rejected

@matz already rejected enhancing Time ranges in https://bugs.ruby-lang.org/issues/12961#note-5: `So we only need to fix Date class. I don't think we should enhance Time ranges to support Integer/Float.`  So the current behavior is not a bug.  If you would like, we could switch this issue to a feature request, but considering it has already been rejected recently, I think it is unlikely to be accepted.

----------------------------------------
Bug #17169: Bad value for range using infinity for Time
https://bugs.ruby-lang.org/issues/17169#change-87563

* 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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:100228] [Ruby master Bug#17169] Bad value for range using infinity for Time
  2020-09-15 15:31 [ruby-core:100012] [Ruby master Bug#17169] Bad value for range using infinity for Time sarcasm008
  2020-09-15 16:12 ` [ruby-core:100013] " merch-redmine
@ 2020-09-30  2:24 ` nobu
  1 sibling, 0 replies; 3+ messages in thread
From: nobu @ 2020-09-30  2:24 UTC (permalink / raw
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-30  2:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-15 15:31 [ruby-core:100012] [Ruby master Bug#17169] Bad value for range using infinity for Time sarcasm008
2020-09-15 16:12 ` [ruby-core:100013] " merch-redmine
2020-09-30  2:24 ` [ruby-core:100228] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).