summaryrefslogtreecommitdiff
path: root/spec/ruby/core/kernel
AgeCommit message (Collapse)Author
2024-03-19Implement chilled stringsÉtienne Barrié
[Feature #20205] As a path toward enabling frozen string literals by default in the future, this commit introduce "chilled strings". From a user perspective chilled strings pretend to be frozen, but on the first attempt to mutate them, they lose their frozen status and emit a warning rather than to raise a `FrozenError`. Implementation wise, `rb_compile_option_struct.frozen_string_literal` is no longer a boolean but a tri-state of `enabled/disabled/unset`. When code is compiled with frozen string literals neither explictly enabled or disabled, string literals are compiled with a new `putchilledstring` instruction. This instruction is identical to `putstring` except it marks the String with the `STR_CHILLED (FL_USER3)` and `FL_FREEZE` flags. Chilled strings have the `FL_FREEZE` flag as to minimize the need to check for chilled strings across the codebase, and to improve compatibility with C extensions. Notes: - `String#freeze`: clears the chilled flag. - `String#-@`: acts as if the string was mutable. - `String#+@`: acts as if the string was mutable. - `String#clone`: copies the chilled flag. Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-14Update to ruby/spec@89175b2Benoit Daloze
2024-03-01Add an example for fallback to shNobuyoshi Nakada
2024-02-26Update to ruby/spec@3a510bbBenoit Daloze
2024-02-15ruby-spec: Accept the receiver in backtracesYusuke Endoh
2024-02-15ruby-spec: Accept both a backtick and a single quote in error messagesYusuke Endoh
2024-02-05Update to ruby/spec@3fc4444Benoit Daloze
2024-01-12Ignore windows_31j module with mswinHiroshi SHIBATA
2023-11-27Update to ruby/spec@c3206f6Benoit Daloze
2023-10-30Update to ruby/spec@bd7017fBenoit Daloze
2023-09-12Make Kernel#lambda raise when given non-literal blockAlan Wu
Previously, Kernel#lambda returned a non-lambda proc when given a non-literal block and issued a warning under the `:deprecated` category. With this change, Kernel#lambda will always return a lambda proc, if it returns without raising. Due to interactions with block passing optimizations, we previously had two separate code paths for detecting whether Kernel#lambda got a literal block. This change allows us to remove one path, the hack done with rb_control_frame_t::block_code introduced in 85a337f for supporting situations where Kernel#lambda returned a non-lambda proc. [Feature #19777] Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/8405
2023-09-04Update to ruby/spec@96d1072Benoit Daloze
2023-08-10Deprecate Kernel#open and IO support for subprocess creation/forkingMike Dalessio
Deprecate Kernel#open and IO support for subprocess creation and forking. This deprecates subprocess creation and forking in - Kernel#open - URI.open - IO.binread - IO.foreach - IO.readlines - IO.read - IO.write This behavior is slated to be removed in Ruby 4.0 [Feature #19630] Notes: Merged: https://github.com/ruby/ruby/pull/7915
2023-07-30Add examples of `return` in `eval`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8127
2023-07-24Use the caller location as default filename for eval family of methodsJean Boussier
[Feature #19755] Before (in /tmp/test.rb): ```ruby Object.class_eval("p __FILE__") # => "(eval)" ``` After: ```ruby Object.class_eval("p __FILE__") # => "(eval at /tmp/test.rb:1)" ``` This makes it much easier to track down generated code in case the author forgot to provide a filename argument. Notes: Merged: https://github.com/ruby/ruby/pull/8070
2023-06-26Update to ruby/spec@30e1c35Benoit Daloze
2023-05-29Update to ruby/spec@c3677cfBenoit Daloze
2023-04-25Update to ruby/spec@7f6ca5bBenoit Daloze
2023-04-25Workaround CRuby adding x86_64-linux-fake in $LOADED_FEATURESBenoit Daloze
2023-04-25Update to ruby/spec@7f69c86Benoit Daloze
2023-03-10Accept `sleep(nil)` as sleep forever. (#7484)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-02-27Update to ruby/spec@e7dc804Benoit Daloze
2023-02-08Only emit circular dependency warning for owned thread shieldsJean byroot Boussier
[Bug #19415] If multiple threads attemps to load the same file concurrently it's not a circular dependency issue. So we check that the existing ThreadShield is owner by the current fiber before warning about circular dependencies. Notes: Merged: https://github.com/ruby/ruby/pull/7257
2023-02-06Revert "Only emit circular dependency warning for owned thread shields"Jean byroot Boussier
This reverts commit fa49651e05a06512e18ccb2f54a7198c9ff579de. Notes: Merged: https://github.com/ruby/ruby/pull/7256
2023-02-06Only emit circular dependency warning for owned thread shieldsJean Boussier
[Bug #19415] If multiple threads attemps to load the same file concurrently it's not a circular dependency issue. So we check that the existing ThreadShield is owner by the current fiber before warning about circular dependencies. Notes: Merged: https://github.com/ruby/ruby/pull/7252
2023-01-05Update to ruby/spec@9d69b95Benoit Daloze
2022-11-07Update to ruby/spec@740ccc8Benoit Daloze
2022-09-28Update to ruby/spec@1d9d5c6Benoit Daloze
2022-08-29Update to ruby/spec@d01709fBenoit Daloze
2022-08-20[Bug #18955] format single character for `%c`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6258
2022-08-10Only allow procs created by Symbol#to_proc to call public methodsJeremy Evans
Fixes [Bug #18826] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6018 Merged-By: jeremyevans <code@jeremyevans.net>
2022-06-26Update to ruby/spec@ab32a1aBenoit Daloze
2022-04-25Update to ruby/spec@3affe1eBenoit Daloze
2022-03-28Update to ruby/spec@aaf998fBenoit Daloze
2022-03-17spec: disable a part of Kernel.open spec where spawns a process for WASIYuta Saito
WASI doesn't provide a way to spawn a new process Notes: Merged: https://github.com/ruby/ruby/pull/5672
2022-03-17spec: disable part of require_relative spec where uses symlink for WASIYuta Saito
cap-std, an underlying sandbox implementation of WASI in wasmtime, doesn't allow to create a symlink to an absolute path to enforce sandbox restriction. See also: https://github.com/bytecodealliance/cap-std/commit/257867a1d3a589b2561b00111ffa4db3bab0e8be Notes: Merged: https://github.com/ruby/ruby/pull/5656
2022-01-28Update to ruby/spec@902ab83Benoit Daloze
2022-01-10Update to ruby/spec@226cfdcBenoit Daloze
2022-01-03Kernel#=~: delete卜部昌平
Has been deprecated since ebff9dc10e6e72239c23e50acc7d3cbfdc659e7a.
2021-12-16Restore the global random seedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5281
2021-12-16Fix Kernel#srand and Kernel#rand descriptions [ci skip]Nobuyoshi Nakada
Actually used methods are all instance method, not the singleton method. Notes: Merged: https://github.com/ruby/ruby/pull/5281
2021-12-16Refine wording about the default random seed [ci skip]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5281
2021-12-16Use `to_s` and `puts` in testsNobuyoshi Nakada
`to_s` has the explict specification while `inspect` is often vague.
2021-11-29Update to ruby/spec@7f22a0bBenoit Daloze
2021-10-28Update to ruby/spec@21a48d9Benoit Daloze
2021-10-20Update to ruby/spec@d6921efBenoit Daloze
2021-10-05Update to ruby/spec@ccf0d85Benoit Daloze
2021-09-07Update to ruby/spec@b1e93a2Benoit Daloze
2021-07-29Update to ruby/spec@b65d01fBenoit Daloze
2021-06-02Update to ruby/spec@a0b7d0dBenoit Daloze