blib/lib/Video/DVDRip/GUI/Rules.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 21 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # $Id: Rules.pm 2258 2006-11-25 08:12:37Z joern $
2  
3 #-----------------------------------------------------------------------
4 # Copyright (C) 2001-2006 Jörn Reder <joern AT zyn.de>.
5 # All Rights Reserved. See file COPYRIGHT for details.
6 #
7 # This module is part of Video::DVDRip, which is free software; you can
8 # redistribute it and/or modify it under the same terms as Perl itself.
9 #-----------------------------------------------------------------------
10  
11 package Video::DVDRip::GUI::Rules;
12  
13 use strict;
14  
15 use base qw(Gtk2::Ex::FormFactory::Rules);
16  
17 sub new {
18 my $class = shift;
19
20 my $self = $class->SUPER::new(@_);
21
22 my $rules = $self->get_rules;
23 my $msg = $self->get_rules_messages;
24
25 $rules->{"project-name"} = sub { $_[0] =~ m!^[-\w.]+$!i };
26 $rules->{"project-path"} = sub { $_[0] =~ m!^[-\w./]+$!i };
27
28 $msg->{"project-name"} = "Project name must contain no special characters";
29 $msg->{"project-path"} = "Path must contain no special characters";
30  
31 return $self;
32 }
33  
34 1;