Index: /lang/perl/String-IRC/trunk/t/00.load.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/00.load.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/00.load.t (revision 10701)
@@ -0,0 +1,7 @@
+use Test::More tests => 1;
+
+BEGIN {
+use_ok( 'String::IRC' );
+}
+
+diag( "Testing String::IRC $String::IRC::VERSION" );
Index: /lang/perl/String-IRC/trunk/t/01.color.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/01.color.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/01.color.t (revision 10701)
@@ -0,0 +1,29 @@
+# -*- mode: cperl; -*-
+use Test::Base;
+use String::IRC;
+
+plan tests => 1 * blocks;
+
+run {
+    my $block = shift;
+    my $x = String::IRC->new( $block->input );
+
+    my $method = $block->name;
+    $x->$method();
+
+    is "$x", $block->expect, $block->name;
+};
+
+__END__
+=== red
+--- input:  hello
+--- expect: 4hello
+=== blue
+--- input:  hello
+--- expect: 2hello
+=== light_purple
+--- input:  hello
+--- expect: 13hello
+=== red
+--- input:
+--- expect: 4
Index: /lang/perl/String-IRC/trunk/t/x92.pod-spell.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/x92.pod-spell.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/x92.pod-spell.t (revision 10701)
@@ -0,0 +1,12 @@
+# -*- mode: cperl; -*-
+use Test::More;
+eval q{ use Test::Spelling };
+plan skip_all => "Test::Spelling is not installed." if $@;
+add_stopwords(map { split /[\s\:\-]/ } <DATA>); # fixme...
+$ENV{LANG} = 'C';
+all_pod_files_spelling_ok('lib');
+__DATA__
+HIROSE
+Masaaki
+mIRC
+
Index: /lang/perl/String-IRC/trunk/t/91.pod-coverage.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/91.pod-coverage.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/91.pod-coverage.t (revision 10701)
@@ -0,0 +1,7 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
+my $trustme = { trustme => [qr/^(white|black|blue|navy|green|red|brown|maroon|purple|orange|olive|yellow|lightt_green|lime|teal|light_cyan|cyan|aqua|light_blue|royal|pink|light_purple|fuchsia|grey|light_grey|silver)$/] };
+all_pod_coverage_ok($trustme);
Index: /lang/perl/String-IRC/trunk/t/09.op.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/09.op.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/09.op.t (revision 10701)
@@ -0,0 +1,23 @@
+# -*- mode: cperl; -*-
+use Test::Base;
+use String::IRC;
+
+plan tests => 4 * blocks;
+
+run {
+    my $block = shift;
+    my $x = String::IRC->new( $block->input );
+
+    my @methods = split /\s+/, $block->name;
+    $x->$_() for @methods;
+
+    is "$x",             $block->expect, $block->name.q{: double quote};
+    is $x->stringify,    $block->expect, $block->name.q{: stringify};
+    is "".$x,            $block->expect, $block->name.q{: concat};
+    is sprintf("%s",$x), $block->expect, $block->name.q{: sprintf};
+};
+
+__END__
+=== bold yellow
+--- input:  hello
+--- expect: 8hello
Index: /lang/perl/String-IRC/trunk/t/02.decoration.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/02.decoration.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/02.decoration.t (revision 10701)
@@ -0,0 +1,26 @@
+# -*- mode: cperl; -*-
+use Test::Base;
+use String::IRC;
+
+plan tests => 1 * blocks;
+
+run {
+    my $block = shift;
+    my $x = String::IRC->new( $block->input );
+
+    my $method = $block->name;
+    $x->$method();
+
+    is "$x", $block->expect, $block->name;
+};
+
+__END__
+=== bold
+--- input:  hello
+--- expect: hello
+=== underline
+--- input:  hello
+--- expect: hello
+=== inverse
+--- input:  hello
+--- expect: hello
Index: /lang/perl/String-IRC/trunk/t/03.complex.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/03.complex.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/03.complex.t (revision 10701)
@@ -0,0 +1,26 @@
+# -*- mode: cperl; -*-
+use Test::Base;
+use String::IRC;
+
+plan tests => 1 * blocks;
+
+run {
+    my $block = shift;
+    my $x = String::IRC->new( $block->input );
+
+    my @methods = split /\s+/, $block->name;
+    $x->$_() for @methods;
+
+    is "$x", $block->expect, $block->name;
+};
+
+__END__
+=== bold yellow
+--- input:  hello
+--- expect: 8hello
+=== bold yellow underline
+--- input:  hello
+--- expect: 8hello
+=== bold yellow underline inverse
+--- input:  hello
+--- expect: 8hello
Index: /lang/perl/String-IRC/trunk/t/x99.perlcritic.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/x99.perlcritic.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/x99.perlcritic.t (revision 10701)
@@ -0,0 +1,9 @@
+#!perl
+
+if (!require Test::Perl::Critic) {
+    Test::More::plan(
+        skip_all => "Test::Perl::Critic required for testing PBP compliance"
+    );
+}
+
+Test::Perl::Critic::all_critic_ok();
Index: /lang/perl/String-IRC/trunk/t/04.bgcolor.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/04.bgcolor.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/04.bgcolor.t (revision 10701)
@@ -0,0 +1,26 @@
+# -*- mode: cperl; -*-
+use Test::Base;
+use String::IRC;
+
+plan tests => 1 * blocks;
+
+run {
+    my $block = shift;
+    my $x = String::IRC->new( $block->input );
+
+    my ($fg, $bg) = split /\s+/, $block->name;
+    $x->$fg($bg);
+
+    is "$x", $block->expect, $block->name;
+};
+
+__END__
+=== yellow red
+--- input:  hello
+--- expect: 8,4hello
+=== red yellow
+--- input:  hello
+--- expect: 4,8hello
+=== red cyan
+--- input:  hello
+--- expect: 4,11hello
Index: /lang/perl/String-IRC/trunk/t/90.pod.t
===================================================================
--- /lang/perl/String-IRC/trunk/t/90.pod.t (revision 10701)
+++ /lang/perl/String-IRC/trunk/t/90.pod.t (revision 10701)
@@ -0,0 +1,6 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();
Index: /lang/perl/String-IRC/trunk/MANIFEST
===================================================================
--- /lang/perl/String-IRC/trunk/MANIFEST (revision 10701)
+++ /lang/perl/String-IRC/trunk/MANIFEST (revision 10701)
@@ -0,0 +1,34 @@
+Build.PL
+Changes
+inc/Module/AutoInstall.pm
+inc/Module/Install.pm
+inc/Module/Install/AutoInstall.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Build.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Include.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/TestBase.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+inc/Spiffy.pm
+inc/Test/Base.pm
+inc/Test/Base/Filter.pm
+inc/Test/Builder.pm
+inc/Test/Builder/Module.pm
+inc/Test/More.pm
+lib/String/IRC.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README
+t/00.load.t
+t/01.color.t
+t/02.decoration.t
+t/03.complex.t
+t/04.bgcolor.t
+t/09.op.t
+t/90.pod.t
+t/91.pod-coverage.t
Index: /lang/perl/String-IRC/trunk/lib/String/IRC.pm
===================================================================
--- /lang/perl/String-IRC/trunk/lib/String/IRC.pm (revision 10701)
+++ /lang/perl/String-IRC/trunk/lib/String/IRC.pm (revision 10701)
@@ -0,0 +1,188 @@
+package String::IRC;
+
+use warnings;
+use strict;
+use Carp;
+
+our $VERSION = '0.02';
+
+use overload (
+    q{""}    => 'stringify',
+    fallback => 'stringify',
+   );
+
+sub new {
+    my $class = shift;
+    my $self = {};
+    bless $self, $class;
+
+    $self->{string} = shift || "";
+
+    return $self;
+}
+
+sub _add_code_l {
+    my ($self, $code) = @_;
+    $self->{string} = $code . $self->{string};
+    return $self;
+}
+
+my %color_table = (
+    0  => [qw(white)],
+    1  => [qw(black)],
+    2  => [qw(blue         navy)],
+    3  => [qw(green)],
+    4  => [qw(red)],
+    5  => [qw(brown        maroon)],
+    6  => [qw(purple)],
+    7  => [qw(orange       olive)],
+    8  => [qw(yellow)],
+    9  => [qw(lightt_green lime)],
+    10 => [qw(teal)],
+    11 => [qw(light_cyan   cyan aqua)],
+    12 => [qw(light_blue   royal)],
+    13 => [qw(pink         light_purple  fuchsia)],
+    14 => [qw(grey)],
+    15 => [qw(light_grey   silver)],
+   );
+my %color_name_table;
+{
+    ## no critic
+    no strict 'refs';
+    while (my ($code, $colors) = each %color_table) {
+        for my $color (@$colors) {
+            $color_name_table{ $color } = $code;
+
+            *{__PACKAGE__.'::'.$color} = sub {
+                my $color_code = "";
+                if ($_[1] && exists $color_name_table{ $_[1] }) {
+                    $color_code .= "$code,$color_name_table{ $_[1] }";
+                } else {
+                    $color_code .= "$code";
+                }
+                $_[0]->_add_code_l("$color_code");
+            };
+        }
+    }
+}
+
+sub bold      { $_[0]->_add_code_l(""); }
+sub underline { $_[0]->_add_code_l(""); }
+sub inverse   { $_[0]->_add_code_l(""); }
+
+sub stringify { $_[0]->{string} . ""; }
+
+1;
+
+__END__
+
+=head1 NAME
+
+String::IRC - add color codes for mIRC compatible client
+
+=head1 SYNOPSIS
+
+    use String::IRC;
+
+    my $si1 = String::IRC->new('hello');
+    $si1->red->underline;
+    my $si2 = String::IRC->new('world')->yellow('green')->bold;
+    my $msg = "$si1, $si2!";
+
+=head1 DESCRIPTION
+
+String::IRC can be used to add color or decoration code to string.
+
+=head1 METHODS
+
+=head2 new
+
+  $si = String::IRC->new('I love YAKINIKU.');
+
+This method constructs a new "String::IRC" instance and returns
+it.
+
+=head2 COLOR
+
+  $si->COLOR([BG_COLOR]);
+
+Add color code and return String::IRC object. BG_COLOR is
+optional. Available COLOR and BC_COLOR are as follows.
+
+  white
+  black
+  blue navy
+  green
+  red
+  brown maroon
+  purple
+  orange olive
+  yellow
+  lightt_green lime
+  teal
+  light_cyan cyan aqua
+  light_blue royal
+  pink light_purple fuchsia
+  grey
+  light_grey silver
+
+=head2 bold
+
+  $si->bold;
+
+Add bold code and return String::IRC object.
+
+=head2 underline
+
+  $si->underline;
+
+Add underline code and return String::IRC object.
+
+=head2 inverse
+
+  $si->inverse;
+
+Add inverse code and return String::IRC object.
+
+=head2 stringify
+
+  $si->stringify;
+
+Return string which is added color or decoration code.
+
+String::IRC calls this method implicitly by context. You may call it
+explicitly.
+
+=head1 BUGS AND LIMITATIONS
+
+No bugs have been reported.
+
+Please report any bugs or feature requests to
+C<bug-string-irc@rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org>.
+
+=head1 SEE ALSO
+
+L<http://www.mirc.co.uk/help/color.txt>
+
+=head1 AUTHOR
+
+HIROSE Masaaki  C<< <hirose31@gmail.com> >>
+
+=head1 LICENCE AND COPYRIGHT
+
+Copyright (c) 2007, HIROSE Masaaki C<< <hirose31@gmail.com> >>. All rights reserved.
+
+This module is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself. See L<perlartistic>.
+
+=cut
+
+# for Emacsen
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# indent-tabs-mode: nil
+# End:
+
+# vi: set ts=4 sw=4 sts=0 :
Index: /lang/perl/String-IRC/trunk/Makefile.PL
===================================================================
--- /lang/perl/String-IRC/trunk/Makefile.PL (revision 10701)
+++ /lang/perl/String-IRC/trunk/Makefile.PL (revision 10701)
@@ -0,0 +1,13 @@
+use inc::Module::Install;
+
+name        'String-IRC';
+all_from    'lib/String/IRC.pm';
+
+# requires 'UNIVERSAL::require'    => 0;
+
+build_requires 'Test::More'      => 0;
+build_requires 'Test::Base'      => 0;
+
+use_test_base;
+auto_install;
+WriteAll;
Index: /lang/perl/String-IRC/trunk/Changes
===================================================================
--- /lang/perl/String-IRC/trunk/Changes (revision 10701)
+++ /lang/perl/String-IRC/trunk/Changes (revision 10701)
@@ -0,0 +1,7 @@
+Revision history for String-IRC
+
+0.02  2007-02-23
+  * build require Test::Base.
+
+0.01  2007-02-15
+  * Initial release.
Index: /lang/perl/String-IRC/trunk/Build.PL
===================================================================
--- /lang/perl/String-IRC/trunk/Build.PL (revision 10701)
+++ /lang/perl/String-IRC/trunk/Build.PL (revision 10701)
@@ -0,0 +1,1 @@
+require 'Makefile.PL';
Index: /lang/perl/String-IRC/trunk/MANIFEST.SKIP
===================================================================
--- /lang/perl/String-IRC/trunk/MANIFEST.SKIP (revision 10701)
+++ /lang/perl/String-IRC/trunk/MANIFEST.SKIP (revision 10701)
@@ -0,0 +1,26 @@
+^_build
+^Build$
+\.bak$
+\.orig$
+\bRCS\b
+\bCVS\b
+^MANIFEST\.
+^Makefile$
+~$
+^#
+\.old$
+^blib/
+^pm_to_blib
+^MakeMaker-\d
+\.gz$
+\.cvsignore
+^t/x\d+.*\.t
+^tools/
+\.svn/
+^[^/]+\.yaml$
+^[^/]+\.pl$
+^t.pl$
+^[^/]+\.pem$
+^MEMO
+
+color.txt
Index: /lang/perl/String-IRC/trunk/README
===================================================================
--- /lang/perl/String-IRC/trunk/README (revision 10701)
+++ /lang/perl/String-IRC/trunk/README (revision 10701)
@@ -0,0 +1,47 @@
+String-IRC version 0.0.1
+
+[ REPLACE THIS...
+
+  The README is used to introduce the module and provide instructions on
+  how to install the module, any machine dependencies it may have (for
+  example C compilers and installed libraries) and any other information
+  that should be understood before the module is installed.
+
+  A README file is required for CPAN modules since CPAN extracts the
+  README file from a module distribution so that people browsing the
+  archive can use it get an idea of the modules uses. It is usually a
+  good idea to provide version information here so that people can
+  decide whether fixes for the module are worth downloading.
+]
+
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+    perl Build.PL
+    ./Build
+    ./Build test
+    ./Build install
+
+
+Alternatively, to install with Module::Install, you can use the following commands:
+
+    perl Makefile.PL
+    make
+    make test
+    make install
+
+
+
+DEPENDENCIES
+
+None.
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2007, HIROSE Masaaki
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
Index: /lang/perl/String-IRC/.cvsignore
===================================================================
--- /lang/perl/String-IRC/.cvsignore (revision 10701)
+++ /lang/perl/String-IRC/.cvsignore (revision 10701)
@@ -0,0 +1,10 @@
+blib*
+Makefile
+Makefile.old
+Build
+_build*
+pm_to_blib*
+*.tar.gz
+.lwpcookies
+String-IRC-*
+cover_db
