PrePAN

Sign in to PrePAN

Path::Iterator::Rule::RT Add RT Ticket Status as a filter

Good

Synopsis

use 5.010;
use strict;
use warnings;

use lib 'lib';
use Path::Iterator::Rule;
use Path::Iterator::Rule::RT;

die "Usage: $0 DIRs" if not @ARGV;
my $rule = Path::Iterator::Rule->new;

$rule->or(
    $rule->new->status_new(),
    $rule->new->status_open(),
    $rule->new->status_resolved()
);

#$rule->status_new;
#$rule->status_open;
#$rule->status_resolved;

for my $file ( $rule->all(@ARGV) ) {
    say $file;
}

Description

The idea of this module is there are directories named after RT Ticket numbers and you want to perform actions based on the tickets status.

The main use case I currently have for this is to remove directories after a ticket had been closed. I suspect I am not the only person with ticket litter in their directories.

I would like this quick hack to grow up into a real module so if you have other use cases, ideas or comments please comment below.

Thanks

Comments

Please sign up to post a review.