Write specs for new Ruby 3.3 features and changes
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Bắt đầu bằng cách xem xét các spec Ruby 3.3 hiện có trong ruby/spec và các mục chưa được đánh dấu trong NEWS-3.3.0.md, sử dụng tài liệu tham chiếu Ruby Changes 3.3 để biết chi tiết về hành vi. Thêm spec cho các tính năng và thay đổi còn lại bên trong guard ruby_version_is "3.3", bao gồm phần công việc được liệt kê về Socket và C API, đồng thời xác nhận rằng bộ test bao phủ hành vi được ghi trong tài liệu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
ruby/spec already contains some specs for 3.3, but we should aim to cover all new features and important changes.
This will improve the test coverage of these features (and maybe discover a few bugs along the way), allow other Ruby implementations to implement the changes faster with more confidence and document clearly the new behavior.
The new specs should be within a version guard block:
ruby_version_is "3.3" do
# New specs
end
NOTE: https://rubyreferences.github.io/rubychanges/3.3.html gives more details for many features and changes.
From https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.3.0.md:
NEWS for Ruby 3.3.0
Core classes updates
Note: We're only listing outstanding class updates.
Array
- Array#pack now raises ArgumentError for unknown directives. [Bug #19150]
Dir
- Dir.for_fd added for returning a Dir object for the directory specified
by the provided directory file descriptor. [Feature #19347] - Dir.fchdir added for changing the directory to the directory specified
by the provided directory file descriptor. [Feature #19347] - Dir#chdir added for changing the directory to the directory specified by
the providedDirobject. [Feature #19347]
Encoding
-
Encoding#replicatehas been removed, it was already deprecated. [Feature #18949]
Fiber
- Introduce Fiber#kill. [Bug #595]
fiber = Fiber.new do
while true
puts "Yielding..."
Fiber.yield
end
ensure
puts "Exiting..."
end
fiber.resume
# Yielding...
fiber.kill
# Exiting...
MatchData
- MatchData#named_captures now accepts optional
symbolize_names
keyword. [Feature #19591]
Module
- Module#set_temporary_name added for setting a temporary name for a
module. [Feature #19521]
ObjectSpace::WeakKeyMap
- New core class to build collections with weak references.
The class use equality semantic to lookup keys like a regular hash,
but it doesn't hold strong references on the keys. [Feature #18498]
ObjectSpace::WeakMap
- ObjectSpace::WeakMap#delete was added to eagerly clear weak map
entries. [Feature #19561]
Proc
- Now Proc#dup and Proc#clone call
#initialize_dupand#initialize_clone
hooks respectively. [Feature #19362]
Process
- 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]
Process::Status
- Process::Status#& and Process::Status#>> are deprecated. [Bug #19868]
Range
- Range#reverse_each can now process beginless ranges with an Integer endpoint. [Feature #18515]
- Range#reverse_each now raises TypeError for endless ranges. [Feature #18551]
- Range#overlap? added for checking if two ranges overlap. [Feature #19839]
Refinement
- Add Refinement#target as an alternative of Refinement#refined_class.
Refinement#refined_class is deprecated and will be removed in Ruby
3.4. [Feature #19714]
Regexp
- The cache-based optimization now supports lookarounds and atomic groupings. That is, match
for Regexp containing these extensions can now also be performed in linear time to the length
of the input string. However, these cannot contain captures and cannot be nested. [Feature #19725]
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]
Time.new('2023-12-20')
# no time information (ArgumentError)
TracePoint
- TracePoint supports
rescueevent. When the raised exception was rescued,
the TracePoint will fire the hook.rescueevent only supports Ruby-level
rescue. [Feature #19572]
Socket
-
Socket#recv and Socket#recv_nonblock returns
nilinstead of an empty string on closed
connections. Socket#recvmsg and Socket#recvmsg_nonblock returnsnilinstead of an empty packet on closed
connections. [Bug #19012] -
Name resolution such as Socket.getaddrinfo, Socket.getnameinfo, Addrinfo.getaddrinfo, etc.
can now be interrupted. [Feature #19965]
Random
- Random::Formatter#alphanumeric is extended to accept optional
chars
keyword argument. [Feature #18183]
Compatibility issues
-
Subprocess creation/forking via the following file open methods is deprecated. [Feature #19630]
- Kernel#open
- URI.open
- IO.binread
- IO.foreach
- IO.readlines
- IO.read
- IO.write
-
When given a non-lambda, non-literal block, Kernel#lambda with now raises
ArgumentError instead of returning it unmodified. These usages have been
issuing warnings under theWarning[:deprecated]category since Ruby 3.0.0.
[Feature #19777] -
itcalls without arguments in a block with no ordinary parameters are
deprecated.itwill 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]([1] * 100).nonexisting # undefined method `nonexisting' for an instance of Array (NoMethodError) -
Now anonymous parameters forwarding is disallowed inside a block
that uses anonymous parameters. [Feature #19370]
C API updates
rb_postponed_job updates
- New APIs and deprecated APIs (see comments for details)
- added:
rb_postponed_job_preregister() - added:
rb_postponed_job_trigger() - deprecated:
rb_postponed_job_register()(and semantic change. see below) - deprecated:
rb_postponed_job_register_one()
- added:
- The postponed job APIs have been changed to address some rare crashes.
To solve the issue, we introduced new two APIs and deprecated current APIs.
The semantics of these functions have also changed slightly;rb_postponed_job_register
now behaves like theoncevariant in that multiple calls with the same
funcmight be coalesced into a single execution of thefunc
[Feature #20057]
Some updates for internal thread event hook APIs
-
rb_internal_thread_event_data_twith a target Ruby thread (VALUE)
and callback functions (rb_internal_thread_event_callback) receive it.
https://github.com/ruby/ruby/pull/8885 - The following functions are introduced to manipulate Ruby thread local data
from internal thread event hook APIs (they are introduced since Ruby 3.2).
https://github.com/ruby/ruby/pull/8936-
rb_internal_thread_specific_key_create() -
rb_internal_thread_specific_get() -
rb_internal_thread_specific_set()
-
-
rb_profile_thread_frames()is introduced to get a frames from
a specific thread.
[Feature #10602] -
rb_data_define()is introduced to defineData. [Feature #19757] -
rb_ext_resolve_symbol()is introduced to search a function from
extension libraries. [Feature #20005]
IO related updates:
- The details of
rb_io_twill be hidden and deprecated attributes
are added for each members. [Feature #19057] -
rb_io_path(VALUE io)is introduced to get a path ofio. -
rb_io_closed_p(VALUE io)to get opening or closing ofio. -
rb_io_mode(VALUE io)to get the mode ofio. -
rb_io_open_descriptor()is introduced to make an IO object from a file
descriptor.
- Ngôn ngữ chính
- Ruby
- Star
- 623
- Fork
- 401
- Merge trung bình
- 15 giờ 14 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ruby/spec
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
-
Improving Marshal specsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Replace most matchers by `obj.should.foo`Có thể làm lại được @eregon đã nhận 148 ngày trước và không có pull request nào đang mở. Đang mở
ruby/spec#1350 · 3 bình luận · 3 reaction · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
Issue tương tự
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
simp/pupmod-simp-stunnel#173 ·
-
Polish QDrantĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
o19s/quepid#1825 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`judges download` into an existing directory fails with a raw `EISDIR` after locking the durableĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 7 ngày