[#104004] [Ruby master Feature#17883] Load bundler/setup earlier to make `bundle exec ruby -r` respect Gemfile — mame@...
Issue #17883 has been reported by mame (Yusuke Endoh).
21 messages
2021/05/24
[ruby-core:103706] [Ruby master Feature#17825] Uniformize Float::INFINITY and Date::infinity.new
From:
nobu@...
Date:
2021-05-04 01:43:14 UTC
List:
ruby-core #103706
Issue #17825 has been updated by nobu (Nobuyoshi Nakada).
Description updated
It's hard to remove that class because of marshal compatibility.
```diff
diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb
index 65c34ace492..e96d102d7da 100644
--- a/ext/date/lib/date.rb
+++ b/ext/date/lib/date.rb
@@ -9,6 +9,8 @@
false
end
+ INFINITY = Float::INFINITY # :nodoc:
+
class Infinity < Numeric # :nodoc:
def initialize(d=1) @d = d <=> 0 end
@@ -60,4 +62,5 @@
end
+ deprecate_constant :Infinity
end
```
----------------------------------------
Feature #17825: Uniformize Float::INFINITY and Date::infinity.new
https://bugs.ruby-lang.org/issues/17825#change-91799
* Author: Aoernis (lucas billaudot)
* Status: Open
* Priority: Normal
----------------------------------------
With `Float` you can do
``` ruby
Float::INFINITY # Infinity
```
and with `Date` you can do
``` ruby
Date::Infinity.new # #<Date::Infinity:0x00007f8d46a59ee0 @d=1>
```
but not
``` ruby
Date::INFINITY # uninitialized constant Date::INFINITY
```
#### Background
`Date::Infinity.new` and `Float::INFINITY` have both the same ancestors and have same using purpose
So it feel odd no be able to call them the same way
#### Proposal
Just make `Date::INFINITY` a working thing
And maybe mark `Date::Infinity.new` as deprecated ¯\_(ツ)_/¯
Thanks for reading
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>