File Coverage

blib/lib/IRC/Toolkit.pm
Criterion Covered Total %
statement 36 36 100.0
branch 6 6 100.0
condition 3 6 50.0
subroutine 10 10 100.0
pod n/a
total 55 58 94.8


line stmt bran cond sub pod time code
1             package IRC::Toolkit;
2             $IRC::Toolkit::VERSION = '0.092001';
3 2     2   32251 use strictures 2;
  2         2562  
  2         81  
4 2     2   382 use Carp;
  2         2  
  2         469  
5              
6             ## Core bits can be added to this list ...
7             ## ... but removing modules will break stuff downstream
8             my @modules = qw/
9             Case
10             Colors
11             CTCP
12             ISupport
13             Masks
14             Modes
15             Parser
16             /;
17              
18             sub import {
19 3     3   3555 my ($self, @load) = @_;
20 3 100       12 @load = @modules unless @load;
21 3         4 my $pkg = caller;
22 3         3 my @failed;
23 3         7 for my $mod (@load) {
24 12         41 my $ld = "package $pkg; use IRC::Toolkit::$mod; 1;";
25 2 100 33 2   860 eval $ld and not $@ or warn "$@\n" and push @failed, $mod;
  2   66 2   4  
  2     2   24  
  2     2   975  
  2     2   3  
  2     1   20  
  2     1   578  
  2         5  
  2         30  
  2         1216  
  2         5  
  2         22  
  2         1009  
  1         3  
  1         17  
  1         759  
  1         3  
  1         10  
  1         515  
  1         2  
  1         10  
  12         847  
26             }
27 3 100       215 confess "Failed to import ".join ' ', @failed if @failed;
28 2         31 1
29             }
30              
31             print
32             qq[ #otw also known as the "Welcome To Every Watchlist Channel"\n],
33             qq[ #otw: On The Watchlist\n]
34             unless caller; 1;
35              
36              
37             =pod
38              
39             =head1 NAME
40              
41             IRC::Toolkit - Useful IRC objects and utilities
42              
43             =head1 SYNOPSIS
44              
45             ## Import the most commonly used Tookit:: modules
46             ## (Case, Colors, CTCP, ISupport, Masks, Modes, Parser)
47             use IRC::Toolkit;
48              
49             ## Import a list of modules:
50             use IRC::Toolkit qw/
51             CTCP
52             Masks
53             Modes
54             Numerics
55             /;
56              
57             ## ... or individually:
58             use IRC::Toolkit::Numerics;
59              
60             =head1 DESCRIPTION
61              
62             A collection of useful IRC-related utilities. See their respective
63             documentation, below.
64              
65             Modules that export functions use L, which is quite flexible;
66             see the L docs for details.
67              
68             L; Objects representing incoming or outgoing IRC events
69              
70             L; Objects representing a single mode change
71              
72             L; Objects representing a set of mode changes
73              
74             L; RFC-compliant case folding tools
75              
76             L; Color/format code interpolation & removal
77              
78             L; CTCP quoting and extraction tools
79              
80             L; ISUPPORT (numeric 005) parser
81              
82             L; Hostmask parsing and matching tools
83              
84             L; Mode-line parsing tools
85              
86             L; IRC numerics translation to/from RPL or ERR names
87              
88             L; Functional interface to L
89              
90             L; Produce sequential TS6 IDs
91              
92             L; A Role for classes that track IRC casemapping
93             settings
94              
95             =head1 SEE ALSO
96              
97             L
98              
99             L
100              
101             =head1 AUTHOR
102              
103             Jon Portnoy
104              
105             Portions of code are derived from L, L, and
106             L, which are copyright their respective authors;
107             these items are documented where they are found.
108              
109             Licensed under the same terms as Perl.
110              
111             =cut
112