From 6d81969b475262aba251e99b518181bdf7c5a523 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 7 Nov 2025 16:41:47 +0900 Subject: [PATCH 01/10] Development of 4.0.0 started. --- NEWS.md | 2 +- include/ruby/internal/abi.h | 2 +- include/ruby/version.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index b22cf5c290e9ae..3407140eecddb9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# NEWS for Ruby 3.5.0 +# NEWS for Ruby 4.0.0 This document is a list of user-visible feature changes since the **3.4.0** release, except for bug fixes. diff --git a/include/ruby/internal/abi.h b/include/ruby/internal/abi.h index 322761fc683341..e735a67564d885 100644 --- a/include/ruby/internal/abi.h +++ b/include/ruby/internal/abi.h @@ -24,7 +24,7 @@ * In released versions of Ruby, this number is not defined since teeny * versions of Ruby should guarantee ABI compatibility. */ -#define RUBY_ABI_VERSION 4 +#define RUBY_ABI_VERSION 0 /* Windows does not support weak symbols so ruby_abi_version will not exist * in the shared library. */ diff --git a/include/ruby/version.h b/include/ruby/version.h index a521d925edd7ce..24c846a1ca6ce2 100644 --- a/include/ruby/version.h +++ b/include/ruby/version.h @@ -61,13 +61,13 @@ * doesn't mean a total rewrite. Practically when it comes to API versioning, * major and minor version changes are equally catastrophic. */ -#define RUBY_API_VERSION_MAJOR 3 +#define RUBY_API_VERSION_MAJOR 4 /** * Minor version. As of writing this version changes annually. Greater * version doesn't mean "better"; they just mean years passed. */ -#define RUBY_API_VERSION_MINOR 5 +#define RUBY_API_VERSION_MINOR 0 /** * Teeny version. This digit is kind of reserved these days. Kept 0 for the From da6ba845545036f9bb89dae390dda78e23a3a337 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 7 Nov 2025 09:45:06 +0100 Subject: [PATCH 02/10] [ruby/json] Get rid of JSON.deep_const_get (private API) https://github.com/ruby/json/commit/826cb2a4f4 --- ext/json/lib/json/common.rb | 19 +++++++------------ test/json/json_common_interface_test.rb | 5 ----- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb index 60178c2a59c464..f22d911f552ec5 100644 --- a/ext/json/lib/json/common.rb +++ b/ext/json/lib/json/common.rb @@ -71,8 +71,13 @@ def create_additions_proc(opts) end when object_class if opts[:create_additions] != false - if class_name = object[JSON.create_id] - klass = JSON.deep_const_get(class_name) + if class_path = object[JSON.create_id] + klass = begin + Object.const_get(class_path) + rescue NameError => e + raise ArgumentError, "can't get const #{class_path}: #{e}" + end + if klass.respond_to?(:json_creatable?) ? klass.json_creatable? : klass.respond_to?(:json_create) create_additions_warning if create_additions.nil? object = klass.json_create(object) @@ -147,16 +152,6 @@ def parser=(parser) # :nodoc: const_set :Parser, parser end - # Return the constant located at _path_. The format of _path_ has to be - # either ::A::B::C or A::B::C. In any case, A has to be located at the top - # level (absolute namespace path?). If there doesn't exist a constant at - # the given path, an ArgumentError is raised. - def deep_const_get(path) # :nodoc: - Object.const_get(path) - rescue NameError => e - raise ArgumentError, "can't get const #{path}: #{e}" - end - # Set the module _generator_ to be used by JSON. def generator=(generator) # :nodoc: old, $VERBOSE = $VERBOSE, nil diff --git a/test/json/json_common_interface_test.rb b/test/json/json_common_interface_test.rb index 077d7e1539666e..37fa439575cd87 100644 --- a/test/json/json_common_interface_test.rb +++ b/test/json/json_common_interface_test.rb @@ -68,11 +68,6 @@ def test_create_id JSON.create_id = 'json_class' end - def test_deep_const_get - assert_raise(ArgumentError) { JSON.deep_const_get('Nix::Da') } - assert_equal File::SEPARATOR, JSON.deep_const_get('File::SEPARATOR') - end - def test_parse assert_equal [ 1, 2, 3, ], JSON.parse('[ 1, 2, 3 ]') end From cd8902cce871144931a492408945d233f0926584 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 7 Nov 2025 09:51:34 +0100 Subject: [PATCH 03/10] [ruby/json] Deprecate `JSON::State#[]` and `JSON::State#[]=` This prevent from freezing and sharing state instances. If you needs some sort of arguments or extra state to the generator methods, consider using `JSON::Coder` instead. https://github.com/ruby/json/commit/e9fbc8937f --- ext/json/lib/json/ext/generator/state.rb | 4 ++ test/json/json_generator_test.rb | 50 ++++++++++++++---------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/ext/json/lib/json/ext/generator/state.rb b/ext/json/lib/json/ext/generator/state.rb index 1f56e6c682cc6d..ce5c185cabeed2 100644 --- a/ext/json/lib/json/ext/generator/state.rb +++ b/ext/json/lib/json/ext/generator/state.rb @@ -75,6 +75,8 @@ def to_h # # Returns the value returned by method +name+. def [](name) + ::JSON.deprecation_warning("JSON::State#[] is deprecated and will be removed in json 3.0.0") + if respond_to?(name) __send__(name) else @@ -87,6 +89,8 @@ def [](name) # # Sets the attribute name to value. def []=(name, value) + ::JSON.deprecation_warning("JSON::State#[]= is deprecated and will be removed in json 3.0.0") + if respond_to?(name_writer = "#{name}=") __send__ name_writer, value else diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb index a6950f88878db8..1b3c702c982f94 100755 --- a/test/json/json_generator_test.rb +++ b/test/json/json_generator_test.rb @@ -183,7 +183,9 @@ def test_states assert_equal('{"1":2}', json) s = JSON.state.new assert s.check_circular? - assert s[:check_circular?] + assert_deprecated_warning(/JSON::State/) do + assert s[:check_circular?] + end h = { 1=>2 } h[3] = h assert_raise(JSON::NestingError) { generate(h) } @@ -193,7 +195,9 @@ def test_states a << a assert_raise(JSON::NestingError) { generate(a, s) } assert s.check_circular? - assert s[:check_circular?] + assert_deprecated_warning(/JSON::State/) do + assert s[:check_circular?] + end end def test_falsy_state @@ -375,28 +379,32 @@ def to_s end def test_hash_likeness_set_symbol - state = JSON.state.new - assert_equal nil, state[:foo] - assert_equal nil.class, state[:foo].class - assert_equal nil, state['foo'] - state[:foo] = :bar - assert_equal :bar, state[:foo] - assert_equal :bar, state['foo'] - state_hash = state.to_hash - assert_kind_of Hash, state_hash - assert_equal :bar, state_hash[:foo] + assert_deprecated_warning(/JSON::State/) do + state = JSON.state.new + assert_equal nil, state[:foo] + assert_equal nil.class, state[:foo].class + assert_equal nil, state['foo'] + state[:foo] = :bar + assert_equal :bar, state[:foo] + assert_equal :bar, state['foo'] + state_hash = state.to_hash + assert_kind_of Hash, state_hash + assert_equal :bar, state_hash[:foo] + end end def test_hash_likeness_set_string - state = JSON.state.new - assert_equal nil, state[:foo] - assert_equal nil, state['foo'] - state['foo'] = :bar - assert_equal :bar, state[:foo] - assert_equal :bar, state['foo'] - state_hash = state.to_hash - assert_kind_of Hash, state_hash - assert_equal :bar, state_hash[:foo] + assert_deprecated_warning(/JSON::State/) do + state = JSON.state.new + assert_equal nil, state[:foo] + assert_equal nil, state['foo'] + state['foo'] = :bar + assert_equal :bar, state[:foo] + assert_equal :bar, state['foo'] + state_hash = state.to_hash + assert_kind_of Hash, state_hash + assert_equal :bar, state_hash[:foo] + end end def test_json_state_to_h_roundtrip From a881f2a0f441bf6d06a68bf711ca81dd6b3a1026 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 7 Nov 2025 10:04:43 +0100 Subject: [PATCH 04/10] [ruby/json] Release 2.16.0 https://github.com/ruby/json/commit/5a12067f88 --- ext/json/lib/json/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/json/lib/json/version.rb b/ext/json/lib/json/version.rb index dc01ba290b8cc2..cc25a0453e20c9 100644 --- a/ext/json/lib/json/version.rb +++ b/ext/json/lib/json/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JSON - VERSION = '2.15.2' + VERSION = '2.16.0' end From a00f425e824b599240415eee7c1256b224d073c9 Mon Sep 17 00:00:00 2001 From: git Date: Fri, 7 Nov 2025 09:07:35 +0000 Subject: [PATCH 05/10] Update default gems list at a881f2a0f441bf6d06a68bf711ca81 [ci skip] --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 3407140eecddb9..d8dc21f795d291 100644 --- a/NEWS.md +++ b/NEWS.md @@ -192,7 +192,7 @@ The following default gems are updated. * io-console 0.8.1 * io-nonblock 0.3.2 * io-wait 0.3.3 -* json 2.15.2 +* json 2.16.0 * net-http 0.7.0 * openssl 4.0.0.pre * optparse 0.8.0 From f3dd4bef786f8d56a2702b340f66e3a374c3ad3f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 7 Nov 2025 18:41:04 +0900 Subject: [PATCH 06/10] Skip removed test for JSON.deep_const_get --- tool/rbs_skip_tests | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tool/rbs_skip_tests b/tool/rbs_skip_tests index bdea3e59571b91..28133153739292 100644 --- a/tool/rbs_skip_tests +++ b/tool/rbs_skip_tests @@ -73,6 +73,8 @@ test_iconv(JSONSingletonTest) test_recurse_proc(JSONInstanceTest) test_recurse_proc(JSONSingletonTest) +test_deep_const_get(JSONSingletonTest) + CGITest CGI is retired CGISingletonTest CGI is retired From a4c051b870ac7f7b3c5482baf05600e1f6751b47 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 29 Oct 2025 22:14:22 +0900 Subject: [PATCH 07/10] Remove PATH check --- file.c | 90 ---------------------------------------------------------- 1 file changed, 90 deletions(-) diff --git a/file.c b/file.c index 4fc2fec75f59a6..2c8e87b768e4db 100644 --- a/file.c +++ b/file.c @@ -6494,96 +6494,6 @@ rb_is_absolute_path(const char *path) return 0; } -#ifndef ENABLE_PATH_CHECK -# if defined DOSISH || defined __CYGWIN__ -# define ENABLE_PATH_CHECK 0 -# else -# define ENABLE_PATH_CHECK 1 -# endif -#endif - -#if ENABLE_PATH_CHECK -static int -path_check_0(VALUE path) -{ - struct stat st; - const char *p0 = StringValueCStr(path); - const char *e0; - rb_encoding *enc; - char *p = 0, *s; - - if (!rb_is_absolute_path(p0)) { - char *buf = ruby_getcwd(); - VALUE newpath; - - newpath = rb_str_new2(buf); - xfree(buf); - - rb_str_cat2(newpath, "/"); - rb_str_cat2(newpath, p0); - path = newpath; - p0 = RSTRING_PTR(path); - } - e0 = p0 + RSTRING_LEN(path); - enc = rb_enc_get(path); - for (;;) { -#ifndef S_IWOTH -# define S_IWOTH 002 -#endif - if (STAT(p0, &st) == 0 && S_ISDIR(st.st_mode) && (st.st_mode & S_IWOTH) -#ifdef S_ISVTX - && !(p && (st.st_mode & S_ISVTX)) -#endif - && !access(p0, W_OK)) { - rb_enc_warn(enc, "Insecure world writable dir %s in PATH, mode 0%" -#if SIZEOF_DEV_T > SIZEOF_INT - PRI_MODET_PREFIX"o", -#else - "o", -#endif - p0, st.st_mode); - if (p) *p = '/'; - RB_GC_GUARD(path); - return 0; - } - s = strrdirsep(p0, e0, enc); - if (p) *p = '/'; - if (!s || s == p0) return 1; - p = s; - e0 = p; - *p = '\0'; - } -} -#endif - -int -rb_path_check(const char *path) -{ - rb_warn_deprecated_to_remove_at(3.6, "rb_path_check", NULL); -#if ENABLE_PATH_CHECK - const char *p0, *p, *pend; - const char sep = PATH_SEP_CHAR; - - if (!path) return 1; - - pend = path + strlen(path); - p0 = path; - p = strchr(path, sep); - if (!p) p = pend; - - for (;;) { - if (!path_check_0(rb_str_new(p0, p - p0))) { - return 0; /* not safe */ - } - p0 = p + 1; - if (p0 > pend) break; - p = strchr(p0, sep); - if (!p) p = pend; - } -#endif - return 1; -} - int ruby_is_fd_loadable(int fd) { From f4e01783d3412b10f9978b5297142979cb067ce8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 30 Oct 2025 14:14:58 +0900 Subject: [PATCH 08/10] Prism update for 4.0 --- lib/prism/ffi.rb | 2 ++ prism/options.c | 10 ++++++++++ prism/options.h | 5 ++++- test/prism/test_helper.rb | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index a3bf5786bd67b7..f6ad6f98b1cb92 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -434,6 +434,8 @@ def dump_options_version(version) 2 when /\A3\.5(\.\d+)?\z/ 3 + when /\A4\.0(\.\d+)?\z/ + 4 else if current raise CurrentVersionError, RUBY_VERSION diff --git a/prism/options.c b/prism/options.c index 1b5c022cf54f9f..373d76a21fee45 100644 --- a/prism/options.c +++ b/prism/options.c @@ -93,6 +93,11 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length return true; } + if (strncmp(version, "4.0", 3) == 0) { + options->version = PM_OPTIONS_VERSION_CRUBY_4_0; + return true; + } + return false; } @@ -111,6 +116,11 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length options->version = PM_OPTIONS_VERSION_CRUBY_3_5; return true; } + + if (strncmp(version, "4.0.", 4) == 0 && is_number(version + 4, length - 4)) { + options->version = PM_OPTIONS_VERSION_CRUBY_4_0; + return true; + } } if (length >= 6) { diff --git a/prism/options.h b/prism/options.h index 1a92c470f1ea7d..44cd745e15520d 100644 --- a/prism/options.h +++ b/prism/options.h @@ -94,8 +94,11 @@ typedef enum { /** The vendored version of prism in CRuby 3.5.x. */ PM_OPTIONS_VERSION_CRUBY_3_5 = 3, + /** The vendored version of prism in CRuby 4.0.x. */ + PM_OPTIONS_VERSION_CRUBY_4_0 = 4, + /** The current version of prism. */ - PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_3_5 + PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_0 } pm_options_version_t; /** diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb index 84871722c9b6ad..faf6117668a404 100644 --- a/test/prism/test_helper.rb +++ b/test/prism/test_helper.rb @@ -230,7 +230,7 @@ def self.windows? end # All versions that prism can parse - SYNTAX_VERSIONS = %w[3.3 3.4 3.5] + SYNTAX_VERSIONS = %w[3.3 3.4 3.5 4.0] # Returns an array of ruby versions that a given filepath should test against: # test.txt # => all available versions From 996cae65f3cc8fed60c6bb758b00882cac49389d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 30 Oct 2025 12:43:26 +0900 Subject: [PATCH 09/10] Depricate IO operation with `|` --- io.c | 35 +++------------------------ test/ruby/test_io.rb | 50 +++++++-------------------------------- test/ruby/test_io_m17n.rb | 24 ------------------- 3 files changed, 11 insertions(+), 98 deletions(-) diff --git a/io.c b/io.c index 78ac0bb2c65d9e..5366c74c498332 100644 --- a/io.c +++ b/io.c @@ -8223,21 +8223,6 @@ rb_io_s_sysopen(int argc, VALUE *argv, VALUE _) return INT2NUM(fd); } -static VALUE -check_pipe_command(VALUE filename_or_command) -{ - char *s = RSTRING_PTR(filename_or_command); - long l = RSTRING_LEN(filename_or_command); - char *e = s + l; - int chlen; - - if (rb_enc_ascget(s, e, &chlen, rb_enc_get(filename_or_command)) == '|') { - VALUE cmd = rb_str_new(s+chlen, l-chlen); - return cmd; - } - return Qnil; -} - /* * call-seq: * open(path, mode = 'r', perm = 0666, **opts) -> io or nil @@ -8283,13 +8268,7 @@ rb_f_open(int argc, VALUE *argv, VALUE _) redirect = TRUE; } else { - VALUE cmd = check_pipe_command(tmp); - if (!NIL_P(cmd)) { - // TODO: when removed in 4.0, update command_injection.rdoc - rb_warn_deprecated_to_remove_at(4.0, "Calling Kernel#open with a leading '|'", "IO.popen"); - argv[0] = cmd; - return rb_io_s_popen(argc, argv, rb_cIO); - } + argv[0] = tmp; } } } @@ -8308,16 +8287,8 @@ static VALUE rb_io_open_generic(VALUE klass, VALUE filename, int oflags, enum rb_io_mode fmode, const struct rb_io_encoding *convconfig, mode_t perm) { - VALUE cmd; - if (klass == rb_cIO && !NIL_P(cmd = check_pipe_command(filename))) { - // TODO: when removed in 4.0, update command_injection.rdoc - rb_warn_deprecated_to_remove_at(4.0, "IO process creation with a leading '|'", "IO.popen"); - return pipe_open_s(cmd, rb_io_oflags_modestr(oflags), fmode, convconfig); - } - else { - return rb_file_open_generic(io_alloc(klass), filename, - oflags, fmode, convconfig, perm); - } + return rb_file_open_generic(io_alloc(klass), filename, + oflags, fmode, convconfig, perm); } static VALUE diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 0025aa5a7dd502..dd8ccbc96a63a5 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2619,36 +2619,15 @@ def o.to_open(kw); kw; end assert_equal({:a=>1}, open(o, {a: 1})) end - def test_open_pipe - assert_deprecated_warning(/Kernel#open with a leading '\|'/) do # https://bugs.ruby-lang.org/issues/19630 - open("|" + EnvUtil.rubybin, "r+") do |f| - f.puts "puts 'foo'" - f.close_write - assert_equal("foo\n", f.read) - end - end - end + def test_path_with_pipe + mkcdtmpdir do + cmd = "|echo foo" + assert_file.not_exist?(cmd) - def test_read_command - assert_deprecated_warning(/IO process creation with a leading '\|'/) do # https://bugs.ruby-lang.org/issues/19630 - assert_equal("foo\n", IO.read("|echo foo")) - end - assert_raise(Errno::ENOENT, Errno::EINVAL) do - File.read("|#{EnvUtil.rubybin} -e puts") - end - assert_raise(Errno::ENOENT, Errno::EINVAL) do - File.binread("|#{EnvUtil.rubybin} -e puts") - end - assert_raise(Errno::ENOENT, Errno::EINVAL) do - Class.new(IO).read("|#{EnvUtil.rubybin} -e puts") - end - assert_raise(Errno::ENOENT, Errno::EINVAL) do - Class.new(IO).binread("|#{EnvUtil.rubybin} -e puts") - end - assert_raise(Errno::ESPIPE) do - assert_deprecated_warning(/IO process creation with a leading '\|'/) do # https://bugs.ruby-lang.org/issues/19630 - IO.read("|#{EnvUtil.rubybin} -e 'puts :foo'", 1, 1) - end + pipe_errors = [Errno::ENOENT, Errno::EINVAL, Errno::EACCES, Errno::EPERM] + assert_raise(*pipe_errors) { open(cmd, "r+") } + assert_raise(*pipe_errors) { IO.read(cmd) } + assert_raise(*pipe_errors) { IO.foreach(cmd) {|x| assert false } } end end @@ -2853,19 +2832,6 @@ def test_reopen_ivar end def test_foreach - a = [] - - assert_deprecated_warning(/IO process creation with a leading '\|'/) do # https://bugs.ruby-lang.org/issues/19630 - IO.foreach("|" + EnvUtil.rubybin + " -e 'puts :foo; puts :bar; puts :baz'") {|x| a << x } - end - assert_equal(["foo\n", "bar\n", "baz\n"], a) - - a = [] - assert_deprecated_warning(/IO process creation with a leading '\|'/) do # https://bugs.ruby-lang.org/issues/19630 - IO.foreach("|" + EnvUtil.rubybin + " -e 'puts :zot'", :open_args => ["r"]) {|x| a << x } - end - assert_equal(["zot\n"], a) - make_tempfile {|t| a = [] IO.foreach(t.path) {|x| a << x } diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index b01d627d920d7e..1986026bfb3d9c 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -1395,30 +1395,6 @@ def test_popenv_r_enc_enc_in_opt2 } end - def test_open_pipe_r_enc - EnvUtil.suppress_warning do # https://bugs.ruby-lang.org/issues/19630 - open("|#{EnvUtil.rubybin} -e 'putc 255'", "r:ascii-8bit") {|f| - assert_equal(Encoding::ASCII_8BIT, f.external_encoding) - assert_equal(nil, f.internal_encoding) - s = f.read - assert_equal(Encoding::ASCII_8BIT, s.encoding) - assert_equal("\xff".force_encoding("ascii-8bit"), s) - } - end - end - - def test_open_pipe_r_enc2 - EnvUtil.suppress_warning do # https://bugs.ruby-lang.org/issues/19630 - open("|#{EnvUtil.rubybin} -e 'putc \"\\u3042\"'", "r:UTF-8") {|f| - assert_equal(Encoding::UTF_8, f.external_encoding) - assert_equal(nil, f.internal_encoding) - s = f.read - assert_equal(Encoding::UTF_8, s.encoding) - assert_equal("\u3042", s) - } - end - end - def test_s_foreach_enc with_tmpdir { generate_file("t", "\xff") From 1f32464a2dcaf641c9fd77a323a13e44dd1d2670 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 7 Nov 2025 17:57:55 +0900 Subject: [PATCH 10/10] Update Bundler::CurrentRuby::ALL_RUBY_VERSIONS --- lib/bundler/current_ruby.rb | 2 +- spec/bundler/bundler/current_ruby_spec.rb | 14 +++++++------- spec/bundler/bundler/dsl_spec.rb | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb index b350baa24fd528..abb7ca2195daa6 100644 --- a/lib/bundler/current_ruby.rb +++ b/lib/bundler/current_ruby.rb @@ -11,7 +11,7 @@ def self.current_ruby end class CurrentRuby - ALL_RUBY_VERSIONS = (18..27).to_a.concat((30..35).to_a).freeze + ALL_RUBY_VERSIONS = [*18..27, *30..34, *40].freeze KNOWN_MINOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.reverse.join(".") }.freeze KNOWN_MAJOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.last.to_s }.uniq.freeze PLATFORM_MAP = { diff --git a/spec/bundler/bundler/current_ruby_spec.rb b/spec/bundler/bundler/current_ruby_spec.rb index 83c42e73e1efe4..aa19a414076508 100644 --- a/spec/bundler/bundler/current_ruby_spec.rb +++ b/spec/bundler/bundler/current_ruby_spec.rb @@ -22,7 +22,7 @@ ruby_32: Gem::Platform::RUBY, ruby_33: Gem::Platform::RUBY, ruby_34: Gem::Platform::RUBY, - ruby_35: Gem::Platform::RUBY, + ruby_40: Gem::Platform::RUBY, mri: Gem::Platform::RUBY, mri_18: Gem::Platform::RUBY, mri_19: Gem::Platform::RUBY, @@ -39,7 +39,7 @@ mri_32: Gem::Platform::RUBY, mri_33: Gem::Platform::RUBY, mri_34: Gem::Platform::RUBY, - mri_35: Gem::Platform::RUBY, + mri_40: Gem::Platform::RUBY, rbx: Gem::Platform::RUBY, truffleruby: Gem::Platform::RUBY, jruby: Gem::Platform::JAVA, @@ -61,7 +61,7 @@ windows_32: Gem::Platform::WINDOWS, windows_33: Gem::Platform::WINDOWS, windows_34: Gem::Platform::WINDOWS, - windows_35: Gem::Platform::WINDOWS } + windows_40: Gem::Platform::WINDOWS } end let(:deprecated) do @@ -81,7 +81,7 @@ mswin_32: Gem::Platform::MSWIN, mswin_33: Gem::Platform::MSWIN, mswin_34: Gem::Platform::MSWIN, - mswin_35: Gem::Platform::MSWIN, + mswin_40: Gem::Platform::MSWIN, mswin64: Gem::Platform::MSWIN64, mswin64_19: Gem::Platform::MSWIN64, mswin64_20: Gem::Platform::MSWIN64, @@ -97,7 +97,7 @@ mswin64_32: Gem::Platform::MSWIN64, mswin64_33: Gem::Platform::MSWIN64, mswin64_34: Gem::Platform::MSWIN64, - mswin64_35: Gem::Platform::MSWIN64, + mswin64_40: Gem::Platform::MSWIN64, mingw: Gem::Platform::UNIVERSAL_MINGW, mingw_18: Gem::Platform::UNIVERSAL_MINGW, mingw_19: Gem::Platform::UNIVERSAL_MINGW, @@ -114,7 +114,7 @@ mingw_32: Gem::Platform::UNIVERSAL_MINGW, mingw_33: Gem::Platform::UNIVERSAL_MINGW, mingw_34: Gem::Platform::UNIVERSAL_MINGW, - mingw_35: Gem::Platform::UNIVERSAL_MINGW, + mingw_40: Gem::Platform::UNIVERSAL_MINGW, x64_mingw: Gem::Platform::UNIVERSAL_MINGW, x64_mingw_20: Gem::Platform::UNIVERSAL_MINGW, x64_mingw_21: Gem::Platform::UNIVERSAL_MINGW, @@ -129,7 +129,7 @@ x64_mingw_32: Gem::Platform::UNIVERSAL_MINGW, x64_mingw_33: Gem::Platform::UNIVERSAL_MINGW, x64_mingw_34: Gem::Platform::UNIVERSAL_MINGW, - x64_mingw_35: Gem::Platform::UNIVERSAL_MINGW } + x64_mingw_40: Gem::Platform::UNIVERSAL_MINGW } end # rubocop:enable Naming/VariableNumber diff --git a/spec/bundler/bundler/dsl_spec.rb b/spec/bundler/bundler/dsl_spec.rb index e88033e9554240..286dfa71151877 100644 --- a/spec/bundler/bundler/dsl_spec.rb +++ b/spec/bundler/bundler/dsl_spec.rb @@ -201,8 +201,8 @@ describe "#gem" do # rubocop:disable Naming/VariableNumber [:ruby, :ruby_18, :ruby_19, :ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24, :ruby_25, :ruby_26, :ruby_27, - :ruby_30, :ruby_31, :ruby_32, :ruby_33, :ruby_34, :ruby_35, :mri, :mri_18, :mri_19, :mri_20, :mri_21, :mri_22, :mri_23, :mri_24, - :mri_25, :mri_26, :mri_27, :mri_30, :mri_31, :mri_32, :mri_33, :mri_34, :mri_35, :jruby, :rbx, :truffleruby].each do |platform| + :ruby_30, :ruby_31, :ruby_32, :ruby_33, :ruby_34, :ruby_40, :mri, :mri_18, :mri_19, :mri_20, :mri_21, :mri_22, :mri_23, :mri_24, + :mri_25, :mri_26, :mri_27, :mri_30, :mri_31, :mri_32, :mri_33, :mri_34, :mri_40, :jruby, :rbx, :truffleruby].each do |platform| it "allows #{platform} as a valid platform" do subject.gem("foo", platform: platform) end