From 2f8e5c80e65a14b3a9298b6cae7ee7fc53890540 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Wed, 5 Apr 2023 22:40:34 +0100 Subject: [ruby/irb] Drop Ruby 2.6 support (https://github.com/ruby/irb/pull/555) * Remove all Ruby 2.6 support * Drop Ruby 2.6 specific testing conditions * Only run Ruby 2.7+ on CI * Bump Ruby requirement to 2.7+ https://github.com/ruby/irb/commit/3f714b616c --- lib/irb/extend-command.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/irb/extend-command.rb') diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb index 4018eb13a6..8e985274b1 100644 --- a/lib/irb/extend-command.rb +++ b/lib/irb/extend-command.rb @@ -256,13 +256,12 @@ module IRB # :nodoc: end if load_file - kwargs = ", **kwargs" if RUBY_VERSION >= "2.7.0" line = __LINE__; eval %[ - def #{cmd_name}(*opts#{kwargs}, &b) + def #{cmd_name}(*opts, **kwargs, &b) Kernel.require_relative "#{load_file}" arity = ::IRB::ExtendCommand::#{cmd_class}.instance_method(:execute).arity args = (1..(arity < 0 ? ~arity : arity)).map {|i| "arg" + i.to_s } - args << "*opts#{kwargs}" if arity < 0 + args << "*opts, **kwargs" if arity < 0 args << "&block" args = args.join(", ") line = __LINE__; eval %[ @@ -273,7 +272,7 @@ module IRB # :nodoc: end end ], nil, __FILE__, line - __send__ :#{cmd_name}_, *opts#{kwargs}, &b + __send__ :#{cmd_name}_, *opts, **kwargs, &b end ], nil, __FILE__, line else -- cgit v1.2.3