Closed atoomic closed 5 years ago
After fixing the __insert_before_child issues from GH #6 I could noticed that rewrite_file does not perform an "in place" update as documented in the POD...
__insert_before_child
Steps to reproduce:
Create a test.pl file
test.pl
sub is_array { return ref $_[0] eq 'ARRAY'; } 1;
then run the one-liner
perl -Ilib -MRef::Util::Rewriter -E 'use Test::More; note "Before:\n", qx[cat test.pl]; Ref::Util::Rewriter::rewrite_file( "test.pl" ); note "After:\n", qx[cat test.pl];'
output
# Before: # # sub is_array { # # return ref $_[0] eq 'ARRAY'; # } # # 1; # After: # # sub is_array { # # return ref $_[0] eq 'ARRAY'; # } # # 1;
The function rewrite_file returns the updated content but do not perform the update...
rewrite_file
Fix merged. :)
After fixing the
__insert_before_child
issues from GH #6 I could noticed that rewrite_file does not perform an "in place" update as documented in the POD...Steps to reproduce:
Create a
test.pl
filethen run the one-liner
output
The function
rewrite_file
returns the updated content but do not perform the update...