End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
XMP#puts
puts(exps)
lib/irb/xmp.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/irb/xmp.rb, line 80
def puts(exps)
@io.puts exps
if @irb.context.ignore_sigint
begin
trap_proc_b = trap("SIGINT"){@irb.signal_handle}
catch(:IRB_EXIT) do
@irb.eval_input
end
ensure
trap("SIGINT", trap_proc_b)
end
else
catch(:IRB_EXIT) do
@irb.eval_input
end
end
end
Evaluates the given exps, for example:
Example
require 'irb/xmp' x = XMP.new x.puts '{:a => 1, :b => 2, :c => 3}' #=> {:a => 1, :b => 2, :c => 3} # ==>{:a=>1, :b=>2, :c=>3} x.puts 'foo = "bar"' # => foo = "bar" # ==>"bar"