1 Commits

Author SHA1 Message Date
Gryphon Shafer
956d549bcd Some OCD cleanup; addition of Travis and Coveralls 2014-09-25 11:04:31 -07:00
13 changed files with 120 additions and 138 deletions

24
.gitignore vendored
View File

@@ -1,5 +1,5 @@
blib/
.build/
/blib/
/.build/
_build/
cover_db/
inc/
@@ -7,14 +7,14 @@ Build
!Build/
Build.bat
.last_cover_stats
Makefile
Makefile.old
MANIFEST.bak
META.yml
MYMETA.yml
/Makefile
/Makefile.old
/MANIFEST.bak
/META.yml
/META.json
/MYMETA.*
nytprof.out
pm_to_blib
.tar.gz
.lwpcookies
.tmp
SQL-Abstract-Complete-*
/pm_to_blib
*.o
*.bs
dest

31
.travis.yml Normal file
View File

@@ -0,0 +1,31 @@
---
language: perl
perl:
- blead
- 5.20
- 5.18
- 5.16
- 5.14
env: PERL_CPANM_OPT="--quiet --notest --force --skip-satisfied"
before_install:
- git clone git://github.com/haarg/perl-travis-helper
- source perl-travis-helper/init
- build-perl
- perl -V
- cpanm -v -n -f Test::Pod Test::Pod::Coverage Test::CheckManifest Devel::Cover::Report::Coveralls
- git config --global github.user gryphonshafer
install:
- export RELEASE_TESTING=1 AUTOMATED_TESTING=1 AUTHOR_TESTING=1 HARNESS_OPTIONS=c HARNESS_TIMER=1
- cpanm -v -n --installdeps .
script:
- perl Makefile.PL && make test
- PERL5OPT=-MDevel::Cover=-coverage,statement,branch,condition,path,subroutine prove -lrsv t
- cover
after_success:
- cover -report coveralls
notifications:
email:
on_failure: always
on_success: change
recipients:
- gryphon@gryphonshafer.com

View File

@@ -5,3 +5,6 @@ Revision history for SQL::Abstract::Complete
1.03 Mon Jun 10 16:49:35 PDT 2013
Switch from Clone::Fast to Storable dclone for deep copy
1.04 Wed Sep 25 10:00:58 PDT 2014
Some OCD cleanup; addition of Travis and Coveralls.

View File

@@ -1,10 +1,9 @@
Changes
MANIFEST
Makefile.PL
README
lib/SQL/Abstract/Complete.pm
Makefile.PL
MANIFEST
README.md
t/00-load.t
t/boilerplate.t
t/Complete.t
t/manifest.t
t/pod-coverage.t

View File

@@ -1,21 +1,31 @@
#!/usr/bin/env perl
use strict;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'SQL::Abstract::Complete',
AUTHOR => q{Gryphon Shafer <gryphon@cpan.org>},
VERSION_FROM => 'lib/SQL/Abstract/Complete.pm',
ABSTRACT_FROM => 'lib/SQL/Abstract/Complete.pm',
($ExtUtils::MakeMaker::VERSION >= 6.3002
? ('LICENSE'=> 'perl')
: ()),
PL_FILES => {},
PREREQ_PM => {
'Test::More' => 0,
'NAME' => 'SQL::Abstract::Complete',
'AUTHOR' => 'Gryphon Shafer <gryphon@cpan.org>',
'VERSION_FROM' => 'lib/SQL/Abstract/Complete.pm',
'ABSTRACT_FROM' => 'lib/SQL/Abstract/Complete.pm',
'PL_FILES' => {},
'MIN_PERL_VERSION' => '5.010',
'PREREQ_PM' => {
'SQL::Abstract' => 1.5,
'Storable' => 0,
'Test::Most' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'SQL-Abstract-Complete-*' },
'dist' => { 'COMPRESS' => 'gzip -9f', 'SUFFIX' => 'gz' },
'clean' => { 'FILES' => 'SQL-Abstract-Complete-*' },
( $ExtUtils::MakeMaker::VERSION >= 6.3002 ? ( 'LICENSE' => 'perl' ) : () ),
( eval { ExtUtils::MakeMaker->VERSION(6.46) } ? ( 'META_MERGE' => {
'meta-spec' => { version => 2 },
'resources' => {
'repository' => {
'type' => 'git',
'url' => 'https://github.com/gryphonshafer/SQL-Abstract-Complete.git',
'web' => 'https://github.com/gryphonshafer/SQL-Abstract-Complete',
},
} } ) : ()
),
);

View File

@@ -1,4 +1,4 @@
SQL::Abstract::Complete - Generate complete SQL from Perl data structures
# SQL::Abstract::Complete - Generate complete SQL from Perl data structures
This module was inspired by the excellent SQL::Abstract, from which in
inherits. However, in trying to use the module, I found that what I really
@@ -7,12 +7,14 @@ by clauses. So, I set out to create a more complete abstract SQL generation
module. (To be fair, SQL::Abstract kept it's first $table argument
inflexible for backwards compatibility reasons.)
[![Build Status](https://travis-ci.org/gryphonshafer/SQL-Abstract-Complete.svg)](https://travis-ci.org/gryphonshafer/SQL-Abstract-Complete)
[![Coverage Status](https://coveralls.io/repos/gryphonshafer/SQL-Abstract-Complete/badge.png)](https://coveralls.io/r/gryphonshafer/SQL-Abstract-Complete)
This module only changes the select() method and adds a small new wrinkle to
new(). Everything else from SQL::Abstract is inheritted as-is. Consequently,
you should read the SQL::Abstract documentation before continuing.
INSTALLATION
## Installation
To install this module, run the following commands:
@@ -21,7 +23,7 @@ To install this module, run the following commands:
make test
make install
SUPPORT AND DOCUMENTATION
## Support and Documentation
After installing, you can find documentation for this module with the
perldoc command.
@@ -30,23 +32,14 @@ perldoc command.
You can also look for information at:
RT, CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=SQL-Abstract-Complete
- [GitHub](https://github.com/gryphonshafer/SQL-Abstract-Complete "GitHub")
- [AnnoCPAN](http://annocpan.org/dist/SQL-Abstract-Complete "AnnoCPAN")
- [CPAN Ratings](http://cpanratings.perl.org/m/SQL-Abstract-Complete "CPAN Ratings")
- [Search CPAN](http://search.cpan.org/dist/SQL-Abstract-Complete "Search CPAN")
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/SQL-Abstract-Complete
## Author and License
CPAN Ratings
http://cpanratings.perl.org/d/SQL-Abstract-Complete
Search CPAN
http://search.cpan.org/dist/SQL-Abstract-Complete/
AUTHOR AND LICENSE
Gryphon Shafer, gryphon@cpan.org
Gryphon Shafer, [gryphon@cpan.org](mailto:gryphon@cpan.org "Email Gryphon Shafer")
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.
it under the same terms as Perl itself.

View File

@@ -1,12 +1,14 @@
package SQL::Abstract::Complete;
use strict;
use warnings;
use SQL::Abstract 1.5;
use Storable 'dclone';
use vars '@ISA';
@ISA = 'SQL::Abstract';
our $VERSION = '1.03';
our $VERSION = '1.04';
sub new {
my $self = shift;
@@ -140,7 +142,7 @@ sub select {
}
1;
__END__
=pod
=head1 NAME
@@ -334,7 +336,6 @@ Gryphon Shafer E<lt>gryphon@cpan.orgE<gt>.
=head1 LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.
it under the same terms as Perl itself.
=cut

View File

@@ -1,8 +1,6 @@
#!perl -T
use Test::More tests => 1;
BEGIN {
use_ok( 'SQL::Abstract::Complete' ) || print "Bail out!\n";
}
#!/usr/bin/env perl
use Test::Most;
BEGIN { use_ok('SQL::Abstract::Complete') }
diag( "Testing SQL::Abstract::Complete $SQL::Abstract::Complete::VERSION, Perl $], $^X" );
done_testing();

View File

@@ -1,7 +1,7 @@
use strict;
use warnings;
use Test::More 'tests' => 22;
use Test::Most;
use constant MODULE => 'SQL::Abstract::Complete';
@@ -147,3 +147,5 @@ is(
is( $sac->_sqlcase('from'), 'FROM', q{$sac->_sqlcase('from')} );
is( $sac->_sqlcase(undef), '', '$sac->_sqlcase(undef)' );
done_testing;

View File

@@ -1,51 +0,0 @@
#!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");
}
}
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]/,
);
}
TODO: {
local $TODO = "Need to replace the 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)
);
module_boilerplate_ok('lib/SQL/Abstract/Complete.pm');
}

View File

@@ -1,8 +1,12 @@
#!perl -T
use strict;
use warnings;
use Test::More;
#!/usr/bin/env perl
use Test::Most;
eval "use Test::CheckManifest 0.9";
plan skip_all => "Test::CheckManifest 0.9 required" if $@;
ok_manifest({filter => [qr/\.git/]});
eval('use Test::CheckManifest 0.9');
plan( 'skip_all' => "Test::CheckManifest 0.9 required" ) if $@;
ok_manifest( { 'filter' => [
qr/\.git/,
qr/\.travis\.yml$/,
qr/perl-travis-helper/,
qr/cover_db/,
] } );
done_testing();

View File

@@ -1,19 +1,13 @@
#!perl -T
use strict;
use warnings;
use Test::More;
#!/usr/bin/env perl
use Test::Most;
# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
if $@;
eval("use Test::Pod::Coverage $min_tpc");
plan( 'skip_all' => "Test::Pod::Coverage $min_tpc required for testing POD coverage" ) if $@;
# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
if $@;
eval("use Pod::Coverage $min_pc");
plan( 'skip_all' => "Pod::Coverage $min_pc required for testing POD coverage" ) if $@;
all_pod_coverage_ok();
all_pod_coverage_ok( { 'trustme' => ['BUILD'] } );
done_testing();

12
t/pod.t
View File

@@ -1,11 +1,9 @@
#!perl -T
use strict;
use warnings;
use Test::More;
#!/usr/bin/env perl
use Test::Most;
# Ensure a recent version of Test::Pod
my $min_tp = 1.22;
eval "use Test::Pod $min_tp";
plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
eval("use Test::Pod $min_tp");
plan( 'skip_all' => "Test::Pod $min_tp required for testing POD" ) if $@;
all_pod_files_ok();
done_testing();