[#106341] [Ruby master Bug#18369] users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" } — dorianmariefr <noreply@...>
Issue #18369 has been reported by dorianmariefr (Dorian Mari辿).
14 messages
2021/11/30
[#106351] [Ruby master Bug#18371] Release branches (release information in general) — "tenderlovemaking (Aaron Patterson)" <noreply@...>
Issue #18371 has been reported by tenderlovemaking (Aaron Patterson).
7 messages
2021/11/30
[ruby-core:106039] [Ruby master Feature#18331] Kernel.#Time
From:
"sawa (Tsuyoshi Sawada)" <noreply@...>
Date:
2021-11-13 12:27:31 UTC
List:
ruby-core #106039
Issue #18331 has been reported by sawa (Tsuyoshi Sawada).
----------------------------------------
Feature #18331: Kernel.#Time
https://bugs.ruby-lang.org/issues/18331
* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
----------------------------------------
I remember that, once, Matz suggested a new literal notation for date/time, but he later withdrew it. It seems like introducing new syntax at this point is less realistic. But I believe that many people have wanted a simple way to create a date/time object.
I propose `Kernel.Time` or `Kernel#Time`, in much of the same way as `Kernel.#Integer`, `Kernel.#Float`, `Kernel.#Complex` and others. It should take a string as the first required argument and some optional keyword arguments.
```rb
TIme("2021-11-13T21:21:18.027294 +0900") # => 2021-11-13 21:21:18.027294 +0900
TIme("2021-11-13 21:21:18.027294 +0900") # => 2021-11-13 21:21:18.027294 +0900
Time("foo", exception: false) # => nil
```
I leave out the specifics. There should be room for debate.
I wish the features nobu implemented in https://bugs.ruby-lang.org/issues/18033 for `Time.new` can be carried over to `Kernel.#Time`.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>