aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authormatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-06-30 19:49:49 +0000
committermatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-06-30 19:49:49 +0000
commitb134d5b65b4e26215f871b3c94ad8397af3d00a3 (patch)
tree86802f8d6a25c53ae8442f7fce04e9a960e68bdb /script
parent319bf4d0176dfdb8382fdecc607160ba3df38e73 (diff)
downloadreaction-b134d5b65b4e26215f871b3c94ad8397af3d00a3.tar.gz
reaction-b134d5b65b4e26215f871b3c94ad8397af3d00a3.zip
hopefully now handles overrides and role
Diffstat (limited to 'script')
-rw-r--r--script/rclass_back_to_moose.pl7
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;
};
};