From 456efb95072323384bf93263ff4e437bb24dd285 Mon Sep 17 00:00:00 2001 From: Matt Brictson Date: Thu, 26 Dec 2024 11:38:28 -0600 Subject: [PATCH] Fix frozen string literal warnings on Ruby 3.4 (#65) * Fix frozen string literal warnings on Ruby 3.4 * Use dup to ensure exact compatibility with original impl --- lib/plist/parser.rb | 2 +- test/test_data_elements.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plist/parser.rb b/lib/plist/parser.rb index 038b194..7a4ce12 100755 --- a/lib/plist/parser.rb +++ b/lib/plist/parser.rb @@ -56,7 +56,7 @@ def tag_start(name, attributes) def text(contents) if @open.last - @open.last.text ||= '' + @open.last.text ||= ''.dup @open.last.text.concat(contents) end end diff --git a/test/test_data_elements.rb b/test/test_data_elements.rb index 02fcf20..c5358cf 100644 --- a/test/test_data_elements.rb +++ b/test/test_data_elements.rb @@ -53,7 +53,7 @@ def test_generator_io_and_file END - expected.chomp! + expected = expected.chomp fd = IO.sysopen('test/assets/example_data.bin') io = IO.open(fd, 'r')