I am trying to duplicate the ARGV array to remove the frozen status of each element but nothing I do seems to work.
All other posts I can find on the subject suggest that using .dup should work however it isn’t. Here is how I have used it:
args = ARGV.dup
puts args[0].frozen?
=> true
i = 0
argv.each {|x|
args[i] = x.dup
i += 1 }
puts args[0].frozen?
=> true
I have also tried using the assign operator and clone method in these scenarios.
I tried and got the following:
Basically this should suffice: