aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Feist <shabble@cowu.be>2010-07-24 18:04:17 +0000
committerTom Feist <shabble@cowu.be>2010-07-24 18:04:17 +0000
commit5ad9608ab4c8e828ea979377ce94066a3f7ddccb (patch)
tree131e259d481c3e534a89943231272f454187746c
parentadded some text files with various irssi perl-xs glue function dumps (diff)
downloadirssi-scripts-5ad9608ab4c8e828ea979377ce94066a3f7ddccb.tar.gz
irssi-scripts-5ad9608ab4c8e828ea979377ce94066a3f7ddccb.zip
moved testing stuff to a signle dir
l---------history-search/irssi/scripts1
-rw-r--r--scrolled-reminder/scrolled_reminder.pl (renamed from scrolled-reminder/scrolled-reminder.pl)6
-rw-r--r--test/.gitignore1
-rwxr-xr-xtest/build_links.pl58
-rw-r--r--test/irssi/config (renamed from history-search/irssi/config)0
-rw-r--r--test/irssi/default.theme (renamed from history-search/irssi/default.theme)0
-rwxr-xr-xtest/run_irssi.sh (renamed from history-search/run_irssi.sh)0
7 files changed, 63 insertions, 3 deletions
diff --git a/history-search/irssi/scripts b/history-search/irssi/scripts
deleted file mode 120000
index b870225..0000000
--- a/history-search/irssi/scripts
+++ /dev/null
@@ -1 +0,0 @@
-../ \ No newline at end of file
diff --git a/scrolled-reminder/scrolled-reminder.pl b/scrolled-reminder/scrolled_reminder.pl
index e2775dc..d768220 100644
--- a/scrolled-reminder/scrolled-reminder.pl
+++ b/scrolled-reminder/scrolled_reminder.pl
@@ -45,12 +45,14 @@ sub handle_keypress {
} elsif ($key == 11) { # Ctrl-k
} else {
}
- Irssi::signal_remove('gui key pressed', 'handle_keypress');
+
+ Irssi::signal_remove('gui key pressed', \&handle_keypress);
}
sub require_confirmation {
my ($window) = @_;
- Irssi::signal_add_first('gui key pressed', 'handle_keypress');
+ Irssi::signal_add_first('gui key pressed', \&handle_keypress);
+
$window->print("You are scrolled up Really send?");
write_to_prompt($window, 'Press Ctrl-K to confirm, Ctrl-C to cancel ');
}
diff --git a/test/.gitignore b/test/.gitignore
new file mode 100644
index 0000000..1ab4a53
--- /dev/null
+++ b/test/.gitignore
@@ -0,0 +1 @@
+irssi/scripts/*
diff --git a/test/build_links.pl b/test/build_links.pl
new file mode 100755
index 0000000..daed67c
--- /dev/null
+++ b/test/build_links.pl
@@ -0,0 +1,58 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use File::Find;
+use File::Basename qw/basename/;
+#use File::Spec ();
+use Cwd qw/realpath/;
+
+use FindBin;
+
+my $scripts_dir = $FindBin::Bin . '/irssi/scripts';
+print "Cleanup....\n";
+find(\&cleanup, "irssi/scripts/");
+print "Scanning for new....\n";
+find(\&wanted, '../');
+print "Done\n";
+
+sub cleanup {
+ my $file = $_;
+ my $path = $File::Find::name;
+ my $dir = $File::Find::dir;
+
+ # only process symlinks
+ my $abs_path = realpath($path); #File::Spec->rel2abs($path);
+ return unless defined $abs_path;
+ return unless (-l $abs_path);
+ print "Thinking about deleting $path\n";
+
+}
+
+sub wanted {
+ my $file = $_;
+ my $path = $File::Find::name;
+ my $dir = $File::Find::dir;
+
+ my $abs_path = realpath($path); #File::Spec->rel2abs($path);
+ #$abs_path = File::Spec->canonpath($abs_path);
+
+ return if $dir =~ /(?:test|docs)$/;
+ return unless $file =~ /\.pl$/;
+ return unless defined $abs_path;
+ return unless -f $abs_path;
+
+ print "Thinking about $scripts_dir/$file => $abs_path\n";
+ create_link($abs_path);
+}
+
+
+sub create_link {
+ my $target = shift;
+ my $name = basename($target);
+ my $link = $scripts_dir . '/' . $name;
+
+ my $ret = symlink($target, $link);
+ die "link creation failed - T: $target, L: $link" unless $ret;
+}
diff --git a/history-search/irssi/config b/test/irssi/config
index 6b46771..6b46771 100644
--- a/history-search/irssi/config
+++ b/test/irssi/config
diff --git a/history-search/irssi/default.theme b/test/irssi/default.theme
index 357a98e..357a98e 100644
--- a/history-search/irssi/default.theme
+++ b/test/irssi/default.theme
diff --git a/history-search/run_irssi.sh b/test/run_irssi.sh
index 9b73b49..9b73b49 100755
--- a/history-search/run_irssi.sh
+++ b/test/run_irssi.sh