diff options
author | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-06-30 19:49:49 +0000 |
---|---|---|
committer | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-06-30 19:49:49 +0000 |
commit | b134d5b65b4e26215f871b3c94ad8397af3d00a3 (patch) | |
tree | 86802f8d6a25c53ae8442f7fce04e9a960e68bdb /script | |
parent | 319bf4d0176dfdb8382fdecc607160ba3df38e73 (diff) | |
download | reaction-b134d5b65b4e26215f871b3c94ad8397af3d00a3.tar.gz reaction-b134d5b65b4e26215f871b3c94ad8397af3d00a3.zip |
hopefully now handles overrides and role
Diffstat (limited to 'script')
-rw-r--r-- | script/rclass_back_to_moose.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/script/rclass_back_to_moose.pl b/script/rclass_back_to_moose.pl index 68dbd57..0b5321f 100644 --- a/script/rclass_back_to_moose.pl +++ b/script/rclass_back_to_moose.pl @@ -16,9 +16,9 @@ sub with_file (&) { $data > io($fname); } -sub with_class_block (&) { +sub with_class_or_role_block (&) { my ($code) = @_; - $_ =~ s{^class\s*(.*?)which\s*{(.*?)^};} + $_ =~ s{^(?:class|role)\s*(.*?)which\s*{(.*?)^};} { local *_ = { header => $1, body => $2 }; $code->(); @@ -52,6 +52,7 @@ sub filtered_body { s/^ //g; s/implements *(\S+).*?{/"sub ${\sq $1} {"/ge; s/^does/with/g; + s/^overrides/override/g; $_; } @@ -60,7 +61,7 @@ sub tail { "__PACKAGE__->meta->make_immutable;\n"; } for ("lib/Reaction/InterfaceModel/Object.pm", "lib/Reaction/InterfaceModel/Action/DBIC/Result.pm") { with_file { - with_class_block { + with_class_or_role_block { return top.build_extends.filtered_body.tail; }; }; |