[Bast-commits] r3367 - in trunk/DBIx-Class-InflateColumn-IP: . lib
lib/DBIx lib/DBIx/Class lib/DBIx/Class/InflateColumn t
ilmari at dev.catalyst.perl.org
ilmari at dev.catalyst.perl.org
Wed May 23 15:39:43 GMT 2007
Author: ilmari
Date: 2007-05-23 15:39:42 +0100 (Wed, 23 May 2007)
New Revision: 3367
Added:
trunk/DBIx-Class-InflateColumn-IP/Changes
trunk/DBIx-Class-InflateColumn-IP/MANIFEST
trunk/DBIx-Class-InflateColumn-IP/MANIFEST.SKIP
trunk/DBIx-Class-InflateColumn-IP/Makefile.PL
trunk/DBIx-Class-InflateColumn-IP/README
trunk/DBIx-Class-InflateColumn-IP/lib/
trunk/DBIx-Class-InflateColumn-IP/lib/DBIx/
trunk/DBIx-Class-InflateColumn-IP/lib/DBIx/Class/
trunk/DBIx-Class-InflateColumn-IP/lib/DBIx/Class/InflateColumn/
trunk/DBIx-Class-InflateColumn-IP/lib/DBIx/Class/InflateColumn/IP.pm
trunk/DBIx-Class-InflateColumn-IP/t/
trunk/DBIx-Class-InflateColumn-IP/t/00-load.t
trunk/DBIx-Class-InflateColumn-IP/t/boilerplate.t
trunk/DBIx-Class-InflateColumn-IP/t/pod-coverage.t
trunk/DBIx-Class-InflateColumn-IP/t/pod.t
Log:
Initial import.
Added: trunk/DBIx-Class-InflateColumn-IP/Changes
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/Changes (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/Changes 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,5 @@
+Revision history for DBIx::Class::InflateColumn::IP
+
+0.01 Wed May 23 14:53:10 2007
+ - First version, released on an unsuspecting world.
+
Added: trunk/DBIx-Class-InflateColumn-IP/MANIFEST
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/MANIFEST (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/MANIFEST 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,11 @@
+Makefile.PL
+Changes
+MANIFEST
+MANIFEST.SKIP
+META.yml # Will be created by "make dist"
+README
+lib/DBIx/Class/InflateColumn/IP.pm
+t/00-load.t
+t/boilerplate.t
+t/pod-coverage.t
+t/pod.t
Added: trunk/DBIx-Class-InflateColumn-IP/MANIFEST.SKIP
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/MANIFEST.SKIP (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/MANIFEST.SKIP 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,19 @@
+\bRCS\b
+\bCVS\b
+,v$
+\B\.svn\b
+t/var
+^blib/
+^pm_to_blib
+^MakeMaker-\d
+Makefile$
+Makefile.old$
+Build.PL
+Build.bat
+\.db
+t/TEST$
+t/SMOKE$
+^blibdirs\.ts
+\.gz
+~$
+^\.cvsignore
Added: trunk/DBIx-Class-InflateColumn-IP/Makefile.PL
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/Makefile.PL (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/Makefile.PL 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,21 @@
+use strict;
+use warnings;
+use inc::Module::Install 0.65;
+
+name 'DBIx-Class-InflateColumn-IP';
+license 'perl';
+perl_version '5.006001';
+all_from 'lib/DBIx/Class/InflateColumn/IP.pm';
+
+requires 'DBIx::Class' => 0.07005;
+requires 'Net::IP';
+
+tests 't/*.t';
+clean_files 'DBIx-Class-InflateColumn-IP-*';
+
+eval {
+ system 'pod2text lib/DBIx/Class/InflateColumn/IP.pm > README';
+};
+
+auto_install;
+WriteAll;
Added: trunk/DBIx-Class-InflateColumn-IP/README
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/README (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/README 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,71 @@
+NAME
+ DBIx::Class::InflateColumn::IP - Auto-create Net::IP objects from
+ columns.
+
+VERSION
+ Version 0.01
+
+SYNOPSIS
+ Load this component and declare the relevant columns as IP addresses.
+
+ package Host;
+ __PACKAGE__->load_components(qw/InflateColumn::IP/);
+ __PACKAGE__->add_columns(
+ ip_address => {
+ data_type => 'integer',
+ is_nullable => 0,
+ is_ip => 1,
+ }
+ );
+
+ Then you can treat the specified column as a Data::Currency object.
+
+ print 'IP address: ', $host->ip_address->ip;
+ print 'Address type: ', $host->ip_address->iptype;
+
+METHODS
+ register_column
+ Chains with "register_column" in DBIx::Class::Row, and sets up IP
+ address columns appropriately. This would not normally be called
+ directly by end users.
+
+AUTHOR
+ Dagfinn Ilmari Mannsåker, "<ilmari at ilmari.org>"
+
+BUGS
+ Please report any bugs or feature requests to
+ "bug-dbix-class-inflatecolumn-ip at rt.cpan.org", or through the web
+ interface at
+ <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-InflateColumn
+ -IP>. I will be notified, and then you'll automatically be notified of
+ progress on your bug as I make changes.
+
+SUPPORT
+ You can find documentation for this module with the perldoc command.
+
+ perldoc DBIx::Class::InflateColumn::IP
+
+ You can also look for information at:
+
+ * AnnoCPAN: Annotated CPAN documentation
+ <http://annocpan.org/dist/DBIx-Class-InflateColumn-IP>
+
+ * CPAN Ratings
+ <http://cpanratings.perl.org/d/DBIx-Class-InflateColumn-IP>
+
+ * RT: CPAN's request tracker
+ <http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class-InflateColumn-I
+ P>
+
+ * Search CPAN
+ <http://search.cpan.org/dist/DBIx-Class-InflateColumn-IP>
+
+SEE ALSO
+ DBIx::Class, Net::IP
+
+COPYRIGHT & LICENSE
+ Copyright 2007 Dagfinn Ilmari Mannsåker, all rights reserved.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself.
+
Added: trunk/DBIx-Class-InflateColumn-IP/lib/DBIx/Class/InflateColumn/IP.pm
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/lib/DBIx/Class/InflateColumn/IP.pm (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/lib/DBIx/Class/InflateColumn/IP.pm 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,98 @@
+package DBIx::Class::InflateColumn::IP;
+
+use warnings;
+use strict;
+
+=head1 NAME
+
+DBIx::Class::InflateColumn::IP - Auto-create Net::IP objects from columns.
+
+=head1 VERSION
+
+Version 0.01
+
+=cut
+
+our $VERSION = '0.01';
+
+=head1 SYNOPSIS
+
+Load this component and declare the relevant columns as IP addresses.
+
+ package Host;
+ __PACKAGE__->load_components(qw/InflateColumn::IP/);
+ __PACKAGE__->add_columns(
+ ip_address => {
+ data_type => 'integer',
+ is_nullable => 0,
+ is_ip => 1,
+ }
+ );
+
+Then you can treat the specified column as a Data::Currency object.
+
+ print 'IP address: ', $host->ip_address->ip;
+ print 'Address type: ', $host->ip_address->iptype;
+
+=head1 METHODS
+
+=head2 register_column
+
+Chains with L<DBIx::Class::Row/register_column>, and sets up IP address
+columns appropriately. This would not normally be called directly by end
+users.
+
+=head1 AUTHOR
+
+Dagfinn Ilmari Mannsåker, C<< <ilmari at ilmari.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to
+C<bug-dbix-class-inflatecolumn-ip at rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-InflateColumn-IP>.
+I will be notified, and then you'll automatically be notified of progress on
+your bug as I make changes.
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc DBIx::Class::InflateColumn::IP
+
+You can also look for information at:
+
+=over 4
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/DBIx-Class-InflateColumn-IP>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/DBIx-Class-InflateColumn-IP>
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class-InflateColumn-IP>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/DBIx-Class-InflateColumn-IP>
+
+=back
+
+=head1 SEE ALSO
+
+L<DBIx::Class>, L<Net::IP>
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2007 Dagfinn Ilmari Mannsåker, all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=cut
+
+1; # End of DBIx::Class::InflateColumn::IP
Added: trunk/DBIx-Class-InflateColumn-IP/t/00-load.t
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/t/00-load.t (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/t/00-load.t 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,9 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok( 'DBIx::Class::InflateColumn::IP' );
+}
+
+diag( "Testing DBIx::Class::InflateColumn::IP $DBIx::Class::InflateColumn::IP::VERSION, Perl $], $^X" );
Added: trunk/DBIx-Class-InflateColumn-IP/t/boilerplate.t
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/t/boilerplate.t (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/t/boilerplate.t 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,48 @@
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More tests => 3;
+
+sub not_in_file_ok {
+ my ($filename, %regex) = @_;
+ open my $fh, "<", $filename
+ or die "couldn't open $filename for reading: $!";
+
+ my %violated;
+
+ while (my $line = <$fh>) {
+ while (my ($desc, $regex) = each %regex) {
+ if ($line =~ $regex) {
+ push @{$violated{$desc}||=[]}, $.;
+ }
+ }
+ }
+
+ if (%violated) {
+ fail("$filename contains boilerplate text");
+ diag "$_ appears on lines @{$violated{$_}}" for keys %violated;
+ } else {
+ pass("$filename contains no boilerplate text");
+ }
+}
+
+not_in_file_ok(README =>
+ "The README is used..." => qr/The README is used/,
+ "'version information here'" => qr/to provide version information/,
+);
+
+not_in_file_ok(Changes =>
+ "placeholder date/time" => qr(Date/time)
+);
+
+sub module_boilerplate_ok {
+ my ($module) = @_;
+ not_in_file_ok($module =>
+ 'the great new $MODULENAME' => qr/ - The great new /,
+ 'boilerplate description' => qr/Quick summary of what the module/,
+ 'stub function definition' => qr/function[12]/,
+ );
+}
+
+module_boilerplate_ok('lib/DBIx/Class/InflateColumn/IP.pm');
Added: trunk/DBIx-Class-InflateColumn-IP/t/pod-coverage.t
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/t/pod-coverage.t (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/t/pod-coverage.t 2007-05-23 14:39:42 UTC (rev 3367)
@@ -0,0 +1,6 @@
+#!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 $@;
+all_pod_coverage_ok();
Added: trunk/DBIx-Class-InflateColumn-IP/t/pod.t
===================================================================
--- trunk/DBIx-Class-InflateColumn-IP/t/pod.t (rev 0)
+++ trunk/DBIx-Class-InflateColumn-IP/t/pod.t 2007-05-23 14:39:42 UTC (rev 3367)
@@ -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();
More information about the Bast-commits
mailing list