From 450d0704189a8b28dfb1c7658637fda40cbf36da Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Thu, 5 Sep 2024 19:03:54 +0200 Subject: [PATCH] Avoid modifying frozen string literals (#1364) In particular, the extconf.rb build script. But there's also one test as well. --- ext/mysql2/extconf.rb | 2 +- spec/mysql2/client_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/mysql2/extconf.rb b/ext/mysql2/extconf.rb index bee77585..a1f6cb24 100644 --- a/ext/mysql2/extconf.rb +++ b/ext/mysql2/extconf.rb @@ -86,7 +86,7 @@ def add_ssl_defines(header) /usr/local/opt/mysql@* /usr/local/opt/mysql-client /usr/local/opt/mysql-client@* -].map { |dir| dir << '/bin' } +].map { |dir| "#{dir}/bin" } # For those without HOMEBREW_ROOT in PATH dirs << "#{ENV['HOMEBREW_ROOT']}/bin" if ENV['HOMEBREW_ROOT'] diff --git a/spec/mysql2/client_spec.rb b/spec/mysql2/client_spec.rb index 14f446df..a8f90da2 100644 --- a/spec/mysql2/client_spec.rb +++ b/spec/mysql2/client_spec.rb @@ -886,7 +886,7 @@ def run_gc end it "should carry over the original string's encoding" do - str = "abc'def\"ghi\0jkl%mno" + str = "abc'def\"ghi\0jkl%mno".dup escaped = Mysql2::Client.escape(str) expect(escaped.encoding).to eql(str.encoding)