summaryrefslogtreecommitdiff
path: root/lib/irb/extend-command.rb
diff options
context:
space:
mode:
authorStan Lo <stan001212@gmail.com>2023-04-05 22:40:34 +0100
committergit <svn-admin@ruby-lang.org>2023-04-05 21:40:40 +0000
commit2f8e5c80e65a14b3a9298b6cae7ee7fc53890540 (patch)
treeca1b18b39c4a0d95017361207b635d71a173a639 /lib/irb/extend-command.rb
parent1587494b0b5f64a9976dcf0bd94dfe98123c2c27 (diff)
[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
Diffstat (limited to 'lib/irb/extend-command.rb')
-rw-r--r--lib/irb/extend-command.rb7
1 files changed, 3 insertions, 4 deletions
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