From 2879f43477faeb936e9d7e4a47bd615a5b996993 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 7 Jan 2025 11:34:20 +0100 Subject: [PATCH] Refactor buffer usage to only use `append_as_bytes` --- lib/openssl/buffering.rb | 12 ++++++------ test/openssl/test_buffering.rb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/openssl/buffering.rb b/lib/openssl/buffering.rb index ceb2efb73..1464a4292 100644 --- a/lib/openssl/buffering.rb +++ b/lib/openssl/buffering.rb @@ -37,8 +37,8 @@ def append_as_bytes(string) end end - alias_method :concat, :append_as_bytes - alias_method :<<, :append_as_bytes + undef_method :concat + undef_method :<< end ## @@ -73,7 +73,7 @@ def initialize(*) def fill_rbuff begin - @rbuffer << self.sysread(BLOCK_SIZE) + @rbuffer.append_as_bytes(self.sysread(BLOCK_SIZE)) rescue Errno::EAGAIN retry rescue EOFError @@ -450,10 +450,10 @@ def <<(s) def puts(*args) s = Buffer.new if args.empty? - s << "\n" + s.append_as_bytes("\n") end args.each{|arg| - s << arg.to_s + s.append_as_bytes(arg.to_s) s.sub!(/(?