--- /dev/null
+Revision history for Perl extension MooseX-Attribute-ENV.
+
+0.01 Tues, 05 June 2008
+ - Initial release
--- /dev/null
+
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+,v$
+\B\.svn\b
+
+# Avoid Makemaker generated and utility files.
+\bMakefile$
+\bblib
+\bMakeMaker-\d
+\bpm_to_blib$
+\bblibdirs$
+^MANIFEST\.SKIP$
+
+# for developers only :)
+^TODO$
+^VERSIONING\.SKETCH$
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build
+
+# Avoid temp and backup files.
+~$
+\.tmp$
+\.old$
+\.bak$
+\#$
+\b\.#
+
+# avoid OS X finder files
+\.DS_Store$
+
+
+# Don't ship the last dist we built :)
+\.tar\.gz$
+
+# Skip maint stuff
+^maint/
\ No newline at end of file
--- /dev/null
+use inc::Module::Install;
+
+perl_version '5.008006';
+name 'MooseX-Attribute-ENV';
+all_from 'lib/MooseX/Attribute/ENV.pm';
+author 'John Napiorkowski <jjnapiork@cpan.org>';
+
+requires 'Moose' => '0.48';
+
+build_requires 'Test::More';
+build_requires 'File::Find';
+
+auto_install;
+
+WriteAll;
+
--- /dev/null
+MooseX-Attribute-ENV
+
+This is a L<Moose> attribute trait that you use when you want the default value
+for an attribute to be populated from the %ENV hash. So, for example if you
+have set the environment variable MYAPP_MYCLASS_USERNAME = 'John' you can do:
+
+ package MyApp::MyClass;
+
+ use Moose;
+ use MooseX::Attribute::ENV;
+
+ has 'username' => (is=>'ro', traits=>['ENV']);
+
+ package main;
+
+ my $myclass = MyApp::MyClass->new();
+
+ print $myclass->username; # STDOUT => 'John';
+
+This is basically similar functionality to something like:
+
+ has 'attr' => (
+ is=>'ro',
+ default=> sub {
+ $ENV{uc __PACKAGE_.'attr'};
+ },
+ );
+
+but this module has a few other features that offer merit, as well as being a
+simple enough attribute trait that I hope it can serve as a learning tool.
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the
+perldoc command.
+
+ perldoc MooseX-Attribute-ENV
+
+You can also look for information at:
+
+ RT, CPAN's request tracker
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Attribute-ENV
+
+ AnnoCPAN, Annotated CPAN documentation
+ http://annocpan.org/dist/MooseX-Attribute-ENV
+
+ CPAN Ratings
+ http://cpanratings.perl.org/d/MooseX-Attribute-ENV
+
+ Search CPAN
+ http://search.cpan.org/dist/MooseX-Attribute-ENV
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2008 John Napiorkowski
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
--- /dev/null
+package MooseX::Attribute::ENV;
+
+
+=head1 NAME
+
+MooseX::Attribute::ENV - Set default of an attribute to a value from %ENV
+
+=head1 VERSION
+
+Version 0.01
+
+=cut
+
+our $VERSION = '0.01';
+
+=head1 SYNOPSIS
+
+The following is example usage for this component.
+
+ package Myapp::MyClass;
+
+ use Moose;
+ use MooseX::Attribute::ENV;
+
+ has 'username' => (traits => ['ENV']);
+ has 'password' => (traits => ['ENV'], env_key => 'GLOBAL_PASSWORD');
+ has 'last_login' => (traits => ['ENV'], default => sub {localtime} );
+
+Please see the test cases for more detailed examples.
+
+=head1 DESCRIPTION
+
+This is a L<Moose> attribute trait that you use when you want the default value
+for an attribute to be populated from the %ENV hash. So, for example if you
+have set the environment variable MYAPP_MYCLASS_USERNAME = 'John' you can do:
+
+ package MyApp::MyClass;
+
+ use Moose;
+ use MooseX::Attribute::ENV;
+
+ has 'username' => (is=>'ro', traits=>['ENV']);
+
+ package main;
+
+ my $myclass = MyApp::MyClass->new();
+
+ print $myclass->username; # STDOUT => 'John';
+
+This is basically similar functionality to something like:
+
+ has 'attr' => (
+ is=>'ro',
+ default=> sub {
+ $ENV{uc __PACKAGE_.'attr'};
+ },
+ );
+
+but this module has a few other features that offer merit, as well as being a
+simple enough attribute trait that I hope it can serve as a learning tool. It
+also does it's best to respect existing builders, defaults and lazy_build
+options.
+
+=head1 METHODS
+
+This module defines the following methods.
+
+=head1 AUTHOR
+
+John Napiorkowski, C<< <jjnapiork at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to:
+
+ C<MooseX-Attribute-ENV at rt.cpan.org>
+
+or through the web interface at:
+
+ L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Attribute-ENV>
+
+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 MooseX::Attribute::ENV
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Attribute-ENV>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/MooseX-Attribute-ENV>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/MooseX-Attribute-ENV>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/DBIx-Class-PopulateMore>
+
+=back
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=cut
+
+1;
--- /dev/null
+use strict;
+use warnings;
+
+BEGIN {
+
+ use Test::More;
+ use File::Find;
+}
+
+
+=head1 NAME
+
+t/newlines.t - test to make sure all text files are in unix linefeed format
+
+=head1 DESCRIPTION
+
+Descends through the distribution directory and verifies that all text files
+(files with an extention matching a pattern, such as *.txt) are in unix
+linefeed format.
+
+=head1 TESTS
+
+This module defines the following tests.
+
+=head2 Descend Distribution
+
+Starting at the Distribution root, look at all files in all subdirections and
+if the file matches a text type (according to a particular regex for it's
+extension) add it to a files of files to test.
+
+=cut
+
+my @files;
+
+ find({
+ wanted => \&process,
+ follow => 0
+ }, '.');
+
+sub process
+{
+ my $file = $_;
+
+ return if $File::Find::dir =~m/\.svn/;
+ return if $File::Find::dir =~m/archive/;
+
+ push @files, $File::Find::name
+ if $file =~m/\.yml$|\.pm$|\.pod$|\.tt$|\.txt$|\.js$|\.css$|\.sql$|\.html$/;
+}
+
+
+=head2 test linefeedtype
+
+Check if the generated files are correctly unix linefeeds
+
+=cut
+
+my $CR = "\015"; # Apple II family, Mac OS thru version 9
+my $CRLF = "\015\012"; # CP/M, MP/M, DOS, Microsoft Windows
+my $FF = "\014"; # printer form feed
+my $LF = "\012"; # Unix, Linux, Xenix, Mac OS X, BeOS, Amiga
+
+my $test_builder = Test::More->builder;
+
+if( $#files )
+{
+ $test_builder->plan(tests => ($#files+1)*2);
+
+ foreach my $file (@files)
+ {
+ ## Get a good filehandle
+ open( my $fh, '<', $file)
+ or fail "Can't open $file, can't finish testing";
+
+ ## Only need to test the first line.
+ my ($first, $second) = <$fh>;
+
+ ## Don't need this anymore
+ close($fh);
+
+ SKIP: {
+
+ skip "$file is Empty!", 2 unless $first;
+
+ ## Are we DOS or MACOS/APPLE?
+ ok $first!~m/$CRLF$|$CR$|$FF$/, "$file isn't in a forbidden format";
+
+ ## If there is more than one line, we HAVE to be UNIX
+
+ SKIP: {
+
+ skip "$file only has a single line", 1 unless $second;
+ ok $first=~m/$LF$/, "$file Is unix linefeed";
+ }
+ }
+ }
+}
+else
+{
+ $test_builder->plan(skip_all => 'No Text Files Found! (This is probably BIG Trouble...');
+}
+
+=head1 AUTHOR
+
+John Napiorkowski, C<< <jjn1056 at yahoo.com> >>
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2008 John Napiorkowski.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=cut
+
+
+1;
\ No newline at end of file
--- /dev/null
+use strict;
+use warnings;
+use Test::More;
+
+# 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 $@;
+
+# 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 $@;
+
+all_pod_coverage_ok();
--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More;
+
+# 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 $@;
+
+all_pod_files_ok();
--- /dev/null
+use warnings;
+use strict;
+
+use MooseX::Attribute::ENV;
+use Test::More tests => 1;
+
+diag( "Testing MooseX::Attribute::ENV $MooseX::Attribute::ENV::VERSION, Perl $], $^X" );
+use_ok( 'MooseX::Attribute::ENV' );
+
+