summaryrefslogtreecommitdiffstats
path: root/lib/Reply/Plugin/Interrupt.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-08-07 22:28:04 -0400
committerJesse Luehrs <doy@tozt.net>2013-09-03 16:50:15 -0400
commit3e19fb26f62ce9fa02e417c015f6668989d1eaad (patch)
tree411f3292cf712606ad177b5229314eb739db4b7b /lib/Reply/Plugin/Interrupt.pm
parent7df1338f58d10c01cf8f742832b57b2736dbf301 (diff)
downloadreply-3e19fb26f62ce9fa02e417c015f6668989d1eaad.tar.gz
reply-3e19fb26f62ce9fa02e417c015f6668989d1eaad.zip
convert all of the plugins
Diffstat (limited to 'lib/Reply/Plugin/Interrupt.pm')
-rw-r--r--lib/Reply/Plugin/Interrupt.pm26
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/Reply/Plugin/Interrupt.pm b/lib/Reply/Plugin/Interrupt.pm
index 1aab2b8..d257785 100644
--- a/lib/Reply/Plugin/Interrupt.pm
+++ b/lib/Reply/Plugin/Interrupt.pm
@@ -1,9 +1,9 @@
-package Reply::Plugin::Interrupt;
+package main;
use strict;
use warnings;
# ABSTRACT: allows using Ctrl+C to interrupt long-running lines
-use base 'Reply::Plugin';
+use mop;
=head1 SYNOPSIS
@@ -17,20 +17,16 @@ exiting the Reply shell entirely.
=cut
-sub compile {
- my $self = shift;
- my ($next, @args) = @_;
+class Reply::Plugin::Interrupt extends Reply::Plugin {
+ method compile ($next, @args) {
+ local $SIG{INT} = sub { die "Interrupted" };
+ $next->(@args);
+ }
- local $SIG{INT} = sub { die "Interrupted" };
- $next->(@args);
-}
-
-sub execute {
- my $self = shift;
- my ($next, @args) = @_;
-
- local $SIG{INT} = sub { die "Interrupted" };
- $next->(@args);
+ method execute ($next, @args) {
+ local $SIG{INT} = sub { die "Interrupted" };
+ $next->(@args);
+ }
}
1;