Skip to content

Commit

Permalink
[DOC] Improve NEWS.md rendering and add missing features (#9308)
Browse files Browse the repository at this point in the history
* Fix rendering of the file on docs.ruby-lang.org:
  * More indentation for code;
  * Properly qualified methods to link to docs;
* Add two minor yet notable changes:
  * Time.new stricter parsing of strings;
  * NoMethodError rendering logic change.
  • Loading branch information
zverok committed Dec 21, 2023
1 parent e04197a commit fc549b2
Showing 1 changed file with 45 additions and 25 deletions.
70 changes: 45 additions & 25 deletions NEWS.md
Expand Up @@ -36,26 +36,27 @@ Note: We're only listing outstanding class updates.

* Encoding

* Encoding#replicate has been removed, it was already deprecated. [[Feature #18949]]
* `Encoding#replicate` has been removed, it was already deprecated. [[Feature #18949]]

* Fiber

* Introduce Fiber#kill. [[Bug #595]]
```ruby
fiber = Fiber.new do
while true
puts "Yielding..."
Fiber.yield

```ruby
fiber = Fiber.new do
while true
puts "Yielding..."
Fiber.yield
end
ensure
puts "Exiting..."
end
ensure
puts "Exiting..."
end

fiber.resume
# Yielding...
fiber.kill
# Exiting...
```
fiber.resume
# Yielding...
fiber.kill
# Exiting...
```
* MatchData
Expand All @@ -75,7 +76,7 @@ Note: We're only listing outstanding class updates.
* ObjectSpace::WeakMap
* `ObjectSpace::WeakMap#delete` was added to eagerly clear weak map
* ObjectSpace::WeakMap#delete was added to eagerly clear weak map
entries. [[Feature #19561]]
* Proc
Expand All @@ -84,7 +85,7 @@ Note: We're only listing outstanding class updates.
* Process
* New `Process.warmup` method that notify the Ruby virtual machine that the boot sequence is finished,
* New Process.warmup method that notify the Ruby virtual machine that the boot sequence is finished,
and that now is a good time to optimize the application. This is useful
for long-running applications. The actual optimizations performed are entirely
implementation-specific and may change in the future without notice. [[Feature #18885]]
Expand All @@ -93,10 +94,6 @@ Note: We're only listing outstanding class updates.
* Process::Status#& and Process::Status#>> are deprecated. [[Bug #19868]]
* Queue

* Queue#freeze now raises TypeError. [[Bug #17146]]

* Range
* Range#reverse_each can now process beginless ranges with an Integer endpoint. [[Feature #18515]]
Expand All @@ -109,16 +106,29 @@ Note: We're only listing outstanding class updates.
Refinement#refined_class is deprecated and will be removed in Ruby
3.4. [[Feature #19714]]
* SizedQueue

* SizedQueue#freeze now raises TypeError. [[Bug #17146]]

* String
* String#unpack now raises ArgumentError for unknown directives. [[Bug #19150]]
* String#bytesplice now accepts new arguments index/length or range of the
source string to be copied. [[Feature #19314]]
* Thread::Queue
* Thread::Queue#freeze now raises TypeError. [[Bug #17146]]
* Thread::SizedQueue
* Thread::SizedQueue#freeze now raises TypeError. [[Bug #17146]]
* Time
* Time.new with a string argument became stricter. [[Bug #19293]]
```ruby
Time.new('2023-12-20')
# no time information (ArgumentError)
```

* TracePoint

* TracePoint supports `rescue` event. When the raised exception was rescued,
Expand Down Expand Up @@ -150,7 +160,7 @@ Note: We're only listing outstanding class updates.
connections. Socket#recvmsg and Socket#recvmsg_nonblock returns `nil` instead of an empty packet on closed
connections. [[Bug #19012]]

* Name resolution such as `Socket.getaddrinfo`, `Socket.getnameinfo`, `Addrinfo.getaddrinfo`, etc.
* Name resolution such as Socket.getaddrinfo, Socket.getnameinfo, Addrinfo.getaddrinfo, etc.
can now be interrupted. [[Feature #19965]]

* Random::Formatter#alphanumeric is extended to accept optional `chars`
Expand Down Expand Up @@ -290,6 +300,14 @@ changelog for details of the default gems or bundled gems.
deprecated. `it` will be a reference to the first block parameter in Ruby 3.4.
[[Feature #18980]]

* Error message for NoMethodError have changed to not use the target object's `#inspect`
for efficiency, and says "instance of ClassName" instead. [[Feature #18285]]

```ruby
([1] * 100).nonexisting
# undefined method `nonexisting' for an instance of Array (NoMethodError)
```

## Stdlib compatibility issues

* `racc` is promoted to bundled gems.
Expand Down Expand Up @@ -456,6 +474,7 @@ changelog for details of the default gems or bundled gems.
[Feature #10602]: https://bugs.ruby-lang.org/issues/10602
[Bug #17146]: https://bugs.ruby-lang.org/issues/17146
[Feature #18183]: https://bugs.ruby-lang.org/issues/18183
[Feature #18285]: https://bugs.ruby-lang.org/issues/18285
[Feature #18498]: https://bugs.ruby-lang.org/issues/18498
[Feature #18515]: https://bugs.ruby-lang.org/issues/18515
[Feature #18551]: https://bugs.ruby-lang.org/issues/18551
Expand All @@ -465,6 +484,7 @@ changelog for details of the default gems or bundled gems.
[Bug #19012]: https://bugs.ruby-lang.org/issues/19012
[Feature #19057]: https://bugs.ruby-lang.org/issues/19057
[Bug #19150]: https://bugs.ruby-lang.org/issues/19150
[Bug #19293]: https://bugs.ruby-lang.org/issues/19293
[Feature #19314]: https://bugs.ruby-lang.org/issues/19314
[Feature #19347]: https://bugs.ruby-lang.org/issues/19347
[Feature #19351]: https://bugs.ruby-lang.org/issues/19351
Expand Down

0 comments on commit fc549b2

Please sign in to comment.