From a1c64240a338eacc3606674693a57fc81453292b Mon Sep 17 00:00:00 2001 From: xaicron Date: Fri, 8 Jul 2011 20:16:58 +0900 Subject: [PATCH] initial commit --- .gitignore | 20 ++++++++++++++++++++ .shipit | 2 ++ Changes | 4 ++++ MANIFEST.SKIP | 15 +++++++++++++++ Makefile.PL | 15 +++++++++++++++ README | 27 +++++++++++++++++++++++++++ lib/App/envfile.pm | 42 ++++++++++++++++++++++++++++++++++++++++++ t/00_compile.t | 5 +++++ xt/01_podspell.t | 37 +++++++++++++++++++++++++++++++++++++ xt/02_pod.t | 6 ++++++ xt/03_pod-coverage.t | 11 +++++++++++ xt/04_perlcritic.t | 13 +++++++++++++ xt/05_script-shebang.t | 18 ++++++++++++++++++ xt/perlcriticrc | 3 +++ 14 files changed, 218 insertions(+) create mode 100644 .gitignore create mode 100644 .shipit create mode 100644 Changes create mode 100644 MANIFEST.SKIP create mode 100644 Makefile.PL create mode 100644 README create mode 100644 lib/App/envfile.pm create mode 100644 t/00_compile.t create mode 100644 xt/01_podspell.t create mode 100644 xt/02_pod.t create mode 100644 xt/03_pod-coverage.t create mode 100644 xt/04_perlcritic.t create mode 100644 xt/05_script-shebang.t create mode 100644 xt/perlcriticrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea99654 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +cover_db +MYMETA.yml +META.yml +Makefile +blib +inc +pm_to_blib +MANIFEST +MANIFEST.bak +Makefile.old +nytprof* +ppport.h +xs/*c +xs/*o +xs/*obj +*.bs +*.def +*.old +dll* +*~ diff --git a/.shipit b/.shipit new file mode 100644 index 0000000..d2778c7 --- /dev/null +++ b/.shipit @@ -0,0 +1,2 @@ +steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN +git.push_to = origin diff --git a/Changes b/Changes new file mode 100644 index 0000000..d8b7b9a --- /dev/null +++ b/Changes @@ -0,0 +1,4 @@ +Revision history for Perl extension App::envfile + +0.01 Fri Jul 8 20:16:56 2011 + - original version diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP new file mode 100644 index 0000000..50a65fc --- /dev/null +++ b/MANIFEST.SKIP @@ -0,0 +1,15 @@ +\bRCS\b +\bCVS\b +\.svn/ +\.git/ +^MANIFEST\. +^Makefile$ +~$ +\.old$ +^blib/ +^pm_to_blib +^MakeMaker-\d +\.gz$ +\.shipit +\.gitignore +\ppport.h diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..2b38b87 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,15 @@ +use inc::Module::Install; +name 'App-envfile'; +all_from 'lib/App/envfile.pm'; + +#requires ''; + +#build_requires ''; +test_requires 'Test::More', 0.96; + +tests join q{ }, map { sprintf 't%s.t', '/*' x $_ } 1..3; +author_tests 'xt'; + +auto_set_repository(); + +WriteAll; diff --git a/README b/README new file mode 100644 index 0000000..1060083 --- /dev/null +++ b/README @@ -0,0 +1,27 @@ +This is Perl module App::envfile. + +INSTALLATION + +App::envfile installation is straightforward. If your CPAN shell is set up, +you should just be able to do + + % cpan App::envfile + +Download it, unpack it, then build it as per the usual: + + % perl Makefile.PL + % make && make test + +Then install it: + + % make install + +DOCUMENTATION + +App::envfile documentation is available as in POD. So you can do: + + % perldoc App::envfile + +to read the documentation online with your favorite pager. + +xaicron diff --git a/lib/App/envfile.pm b/lib/App/envfile.pm new file mode 100644 index 0000000..0ff25e9 --- /dev/null +++ b/lib/App/envfile.pm @@ -0,0 +1,42 @@ +package App::envfile; + +use strict; +use warnings; +use 5.008_001; +our $VERSION = '0.01'; + +1; +__END__ + +=encoding utf-8 + +=for stopwords + +=head1 NAME + +App::envfile - + +=head1 SYNOPSIS + + use App::envfile; + +=head1 DESCRIPTION + +App::envfile is + +=head1 AUTHOR + +xaicron Exaicron@cpan.orgE + +=head1 COPYRIGHT + +Copyright 2011 - xaicron + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=head1 SEE ALSO + +=cut diff --git a/t/00_compile.t b/t/00_compile.t new file mode 100644 index 0000000..d88efbb --- /dev/null +++ b/t/00_compile.t @@ -0,0 +1,5 @@ +use strict; +use warnings; +use Test::More tests => 1; + +BEGIN { use_ok 'App::envfile' } diff --git a/xt/01_podspell.t b/xt/01_podspell.t new file mode 100644 index 0000000..936b31d --- /dev/null +++ b/xt/01_podspell.t @@ -0,0 +1,37 @@ +use strict; +use warnings; +use Test::More; +use Test::Requires 'Test::Spelling'; +use Config; +use File::Spec; +use ExtUtils::MakeMaker; + +my %cmd_map = ( + spell => 'spell', + aspell => 'aspell list -l en', + ispell => 'ispell -l', + hunspell => 'hunspell -d en_US -l', +); + +my $spell_cmd; +for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { + next if $dir eq ''; + ($spell_cmd) = map { $cmd_map{$_} } grep { + my $abs = File::Spec->catfile($dir, $_); + -x $abs or MM->maybe_command($abs); + } keys %cmd_map; + last if $spell_cmd; +} +$spell_cmd = $ENV{SPELL_CMD} if $ENV{SPELL_CMD}; +plan skip_all => "spell command are not available." unless $spell_cmd; +add_stopwords(map { split /[\s\:\-]/ } ); +set_spell_cmd($spell_cmd); +$ENV{LANG} = 'C'; +all_pod_files_spelling_ok('lib'); + +__DATA__ +App::envfile + +# personal section +xaicron +xaicron@cpan.org diff --git a/xt/02_pod.t b/xt/02_pod.t new file mode 100644 index 0000000..2e9d958 --- /dev/null +++ b/xt/02_pod.t @@ -0,0 +1,6 @@ +use strict; +use warnings; +use Test::More; +use Test::Requires { 'Test::Pod' => 1.00 }; + +all_pod_files_ok(); diff --git a/xt/03_pod-coverage.t b/xt/03_pod-coverage.t new file mode 100644 index 0000000..3ecd08c --- /dev/null +++ b/xt/03_pod-coverage.t @@ -0,0 +1,11 @@ +use strict; +use warnings; +use Test::More; +use Test::Requires { 'Test::Pod::Coverage' => 1.04 }; + +unless ($ENV{TEST_POD_COVERAGE}) { + plan skip_all => "\$ENV{TEST_POD_COVERAGE} is not set."; + exit; +} + +all_pod_coverage_ok({also_private => [qw(unimport BUILD DEMOLISH)]}); diff --git a/xt/04_perlcritic.t b/xt/04_perlcritic.t new file mode 100644 index 0000000..24577de --- /dev/null +++ b/xt/04_perlcritic.t @@ -0,0 +1,13 @@ +use strict; +use warnings; +use Test::More; +use Test::Requires { 'Test::Perl::Critic' => 1.02 }; + +unless ($ENV{TEST_PERLCRITIC}) { + plan skip_all => "\$ENV{TEST_PERLCRITIC} is not set."; + exit; +} + +Test::Perl::Critic->import( -profile => 'xt/perlcriticrc'); + +all_critic_ok('lib'); diff --git a/xt/05_script-shebang.t b/xt/05_script-shebang.t new file mode 100644 index 0000000..0a54890 --- /dev/null +++ b/xt/05_script-shebang.t @@ -0,0 +1,18 @@ +use strict; +use warnings; +use Test::More;use Test::Requires 'Test::Script::Shebang'; +use File::Find qw/find/; + +my @files; +for my $dir (qw/bin script/) { + next unless -d $dir; + find +{ + no_chdir => 1, + wanted => sub { push @files, $_ if -f }, + }, $dir; +} +plan skip_all => 'script not found' unless @files; + +check_shebang(@files); + +done_testing; diff --git a/xt/perlcriticrc b/xt/perlcriticrc new file mode 100644 index 0000000..83553d4 --- /dev/null +++ b/xt/perlcriticrc @@ -0,0 +1,3 @@ +[TestingAndDebugging::ProhibitNoStrict] +allow=refs +[-Subroutines::ProhibitSubroutinePrototypes]