Skip to content

Commit cf245b0

Browse files
authored
Merge pull request #53 from gwhilts/string_literal_frozen_fix
Change dynamic String literals to String.new()
2 parents ab3d7fd + c596275 commit cf245b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ptools.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class File
1111
if File::ALT_SEPARATOR
1212
MSWINDOWS = true
1313
if ENV['PATHEXT']
14-
WIN32EXTS = ".{#{ENV['PATHEXT'].tr(';', ',').tr('.', '')}}".downcase
14+
WIN32EXTS = String.new(".{#{ENV['PATHEXT'].tr(';', ',').tr('.', '')}}").downcase
1515
else
1616
WIN32EXTS = '.{exe,com,bat}'.freeze
1717
end
@@ -429,13 +429,13 @@ def self.bmp?(file)
429429
# Is the file a jpeg file?
430430
#
431431
def self.jpg?(file)
432-
File.read(file, 10, nil, :encoding => 'binary') == "\377\330\377\340\000\020JFIF".force_encoding(Encoding::BINARY)
432+
File.read(file, 10, nil, :encoding => 'binary') == String.new("\377\330\377\340\000\020JFIF").force_encoding(Encoding::BINARY)
433433
end
434434

435435
# Is the file a png file?
436436
#
437437
def self.png?(file)
438-
File.read(file, 4, nil, :encoding => 'binary') == "\211PNG".force_encoding(Encoding::BINARY)
438+
File.read(file, 4, nil, :encoding => 'binary') == String.new("\211PNG").force_encoding(Encoding::BINARY)
439439
end
440440

441441
# Is the file a gif?

0 commit comments

Comments
 (0)