adding in some plugins
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Plugin / Turtles.pm
diff --git a/lib/Devel/REPL/Plugin/Turtles.pm b/lib/Devel/REPL/Plugin/Turtles.pm
new file mode 100644 (file)
index 0000000..dbc7322
--- /dev/null
@@ -0,0 +1,16 @@
+package Devel::REPL::Plugin::Turtles;
+use Moose::Role;
+
+around 'eval' => sub {
+    my $next = shift;
+    my ($self, $line) = @_;
+    if ($line =~ /^#(.*)/) {
+        return $next->($self, ('$self->' . $1 . '; return();'));
+    }
+    else {
+        return $next->($self, $line);
+    }
+    
+};
+
+1;
\ No newline at end of file