From 25152bc8bf6d2c4feaf211902fc9d6c9f992f274 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sat, 4 Dec 2010 05:48:25 +0000 Subject: easy_exec: override /script exec with a function to export all of the Irssi:: namespace functions for ease of testing. --- feature-tests/easy_exec.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 feature-tests/easy_exec.pl (limited to 'feature-tests') diff --git a/feature-tests/easy_exec.pl b/feature-tests/easy_exec.pl new file mode 100644 index 0000000..76cd79f --- /dev/null +++ b/feature-tests/easy_exec.pl @@ -0,0 +1,25 @@ +use strict; +use warnings; + +use Irssi (@Irssi::EXPORT_OK); +use Irssi::Irc; +use Irssi::TextUI; + +use Data::Dumper; + +our $VERSION = '0.1'; +our %IRSSI = ( + authors => '', + contact => '', + name => '', + description => '', + license => 'Public Domain', + ); + +Irssi::signal_add_first 'command script exec', \&better_exec; + +sub better_exec { + my ($args, $serv, $witem) = @_; + eval $args; + Irssi::signal_stop(); +} -- cgit v1.2.3