[Moose-commits] r7204 - in MooseX-GlobRef-Object/trunk: . lib lib/MooseX/GlobRef lib/MooseX/GlobRef/Meta t t/tlib/MooseX/GlobRef/Meta xt

dexter at code2.0beta.co.uk dexter at code2.0beta.co.uk
Tue Dec 30 22:17:31 GMT 2008


Author: dexter
Date: 2008-12-30 14:17:30 -0800 (Tue, 30 Dec 2008)
New Revision: 7204

Added:
   MooseX-GlobRef-Object/trunk/xt/consistent_version_numbers.t
   MooseX-GlobRef-Object/trunk/xt/copyright.t
   MooseX-GlobRef-Object/trunk/xt/cover.sh
   MooseX-GlobRef-Object/trunk/xt/distribution.t
   MooseX-GlobRef-Object/trunk/xt/minimumversion.t
   MooseX-GlobRef-Object/trunk/xt/pod_spell.xt
   MooseX-GlobRef-Object/trunk/xt/pod_syntax.t
Removed:
   MooseX-GlobRef-Object/trunk/lib/Moose/
   MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Class/
   MooseX-GlobRef-Object/trunk/t/040_class_trait.t
   MooseX-GlobRef-Object/trunk/t/cover.sh
   MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/Meta/Class/
   MooseX-GlobRef-Object/trunk/xt/pod.t
Modified:
   MooseX-GlobRef-Object/trunk/Build.PL
   MooseX-GlobRef-Object/trunk/Changes
   MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Class.pm
   MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Instance.pm
   MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Object.pm
   MooseX-GlobRef-Object/trunk/xt/pod_coverage.t
Log:
* Cannot be implemented as class trait.
* More authoring tests.

Modified: MooseX-GlobRef-Object/trunk/Build.PL
===================================================================
--- MooseX-GlobRef-Object/trunk/Build.PL	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/Build.PL	2008-12-30 22:17:30 UTC (rev 7204)
@@ -18,7 +18,7 @@
     optional => {
     },
     build_requires => {
-        'Test::Unit::Lite'   => 0.07,
+        'Test::Unit::Lite'   => 0.11,
         'Test::Assert'       => 0,
     },
     create_makefile_pl => 'traditional',

Modified: MooseX-GlobRef-Object/trunk/Changes
===================================================================
--- MooseX-GlobRef-Object/trunk/Changes	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/Changes	2008-12-30 22:17:30 UTC (rev 7204)
@@ -1,4 +1,9 @@
 ------------------------------------------------------------------------
+0.04 | Piotr Roszatycki <dexter at debian.org> | 2008-12-30
+
+* Cannot be implemented as class trait.
+
+------------------------------------------------------------------------
 0.03 | Piotr Roszatycki <dexter at debian.org> | 2008-12-09
 
 New:

Modified: MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Class.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Class.pm	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Class.pm	2008-12-30 22:17:30 UTC (rev 7204)
@@ -17,7 +17,7 @@
 use strict;
 use warnings;
 
-our $VERSION = 0.03;
+our $VERSION = 0.04;
 
 
 use parent 'Moose::Meta::Class';

Modified: MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Instance.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Instance.pm	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Meta/Instance.pm	2008-12-30 22:17:30 UTC (rev 7204)
@@ -50,7 +50,7 @@
 use strict;
 use warnings;
 
-our $VERSION = 0.03;
+our $VERSION = 0.04;
 
 
 use parent 'Moose::Meta::Instance';

Modified: MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Object.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Object.pm	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/lib/MooseX/GlobRef/Object.pm	2008-12-30 22:17:30 UTC (rev 7204)
@@ -52,7 +52,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.03';
+our $VERSION = 0.04;
 
 
 use metaclass 'MooseX::GlobRef::Meta::Class' => (

Deleted: MooseX-GlobRef-Object/trunk/t/040_class_trait.t
===================================================================
--- MooseX-GlobRef-Object/trunk/t/040_class_trait.t	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/t/040_class_trait.t	2008-12-30 22:17:30 UTC (rev 7204)
@@ -1,20 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use File::Spec;
-use Cwd;
-
-BEGIN {
-    unshift @INC, map { /(.*)/; $1 } split(/:/, $ENV{PERL5LIB}) if defined $ENV{PERL5LIB} and ${^TAINT};
-
-    my $cwd = ${^TAINT} ? do { local $_=getcwd; /(.*)/; $1 } : '.';
-    unshift @INC, File::Spec->catdir($cwd, 't/tlib');
-};
-
-use Test::Unit::Lite;
-
-local $SIG{__WARN__} = sub { require Carp; Carp::confess("Warning: $_[0]") };
-
-Test::Unit::HarnessUnit->new->start('MooseX::GlobRef::Meta::Class::Trait::GlobRefTestSuite');

Deleted: MooseX-GlobRef-Object/trunk/t/cover.sh
===================================================================
--- MooseX-GlobRef-Object/trunk/t/cover.sh	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/t/cover.sh	2008-12-30 22:17:30 UTC (rev 7204)
@@ -1,6 +0,0 @@
-cd $(dirname $0)
-cd ..
-perl Build.PL
-cover -delete
-HARNESS_PERL_SWITCHES=-MDevel::Cover ./Build test
-cover

Added: MooseX-GlobRef-Object/trunk/xt/consistent_version_numbers.t
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/consistent_version_numbers.t	                        (rev 0)
+++ MooseX-GlobRef-Object/trunk/xt/consistent_version_numbers.t	2008-12-30 22:17:30 UTC (rev 7204)
@@ -0,0 +1,46 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+our $VERSION = '0.999_001';
+
+use File::Find;
+use File::Slurp;
+
+use Test::More qw(no_plan); ## no critic (Bangs::ProhibitNoPlan)
+
+
+my $last_version = undef;
+find({wanted => \&check_version, no_chdir => 1}, 'blib');
+if (! defined $last_version) {
+    ## no critic (RequireInterpolationOfMetachars)
+    fail('Failed to find any files with $VERSION');
+    ## use critic
+} # end if
+
+
+sub check_version {
+    # $_ is the full path to the file
+    return if ! m{blib/script/}xms && ! m{ [.] pm \z}xms;
+
+    my $content = read_file($_);
+
+    # only look at perl scripts, not sh scripts
+    return if m{blib/script/}xms && $content !~ m/\A \#![^\r\n]+?perl/xms;
+
+    my @version_lines = $content =~ m/ ( [^\n]* \$VERSION [^\n]* ) /gxms;
+    if (@version_lines == 0) {
+       fail($_);
+    } # end if
+    foreach my $line (@version_lines) {
+        if (!defined $last_version) {
+            $last_version = shift @version_lines;
+            pass($_);
+        } else {
+            is($line, $last_version, $_);
+        } # end if
+    } # end foreach
+
+    return;
+} # end check_version()

Added: MooseX-GlobRef-Object/trunk/xt/copyright.t
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/copyright.t	                        (rev 0)
+++ MooseX-GlobRef-Object/trunk/xt/copyright.t	2008-12-30 22:17:30 UTC (rev 7204)
@@ -0,0 +1,82 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+our $VERSION = '0.999_001';
+
+use File::Find;
+use File::Slurp;
+use Readonly;
+
+use Test::More qw(no_plan); ## no critic (Bangs::ProhibitNoPlan)
+
+
+Readonly my $LOCALTIME_YEAR_FIELD_NUMBER => 5;
+Readonly my $LOCALTIME_YEAR_OFFSET       => 1900;
+
+
+my $this_year =
+    (localtime)[$LOCALTIME_YEAR_FIELD_NUMBER] + $LOCALTIME_YEAR_OFFSET;
+my $copyrights_found = 0;
+find({wanted => \&check_file, no_chdir => 1}, 'blib');
+foreach ( grep { m/^readme/ixms } read_dir(q<.>) ) {
+    check_file();
+} # end foreach
+
+ok($copyrights_found != 0, 'found a copyright statement');
+
+
+sub check_file {
+    # $_ is the path to a filename, relative to the root of the
+    # distribution
+
+    # Only test plain files
+    return if (! -f $_);
+
+    ## no critic (ProhibitComplexRegexes)
+    # Filter the list of filenames
+    return if not
+        m<
+            ^
+            (?: README.*          # docs
+                |  .*/scripts/[^/]+  # programs
+                |  .*/script/[^/]+   # programs
+                |  .*/bin/[^/]+      # programs
+                |  .*\.(?:
+                            pl        # program ext
+                        |   pm        # module ext
+                        |   html      # doc ext
+                        |   3pm       # doc ext
+                        |   [13]      # doc ext
+                    )
+            )
+            $
+        >xms;
+    ## use critic
+
+    my $content = read_file($_);
+
+    # Note: man pages will fail to match if the correct form of the
+    # copyright symbol is used because the man page translators don't
+    # handle UTF-8.
+    #
+    # For some reason, Vim writes a bad utf8 version of the copyright sign
+    # if I attempt to modify the line.  So, disable the violation.  *sigh*
+    ## no critic (ProhibitEscapedMetacharacters)
+    my @copyright_years = $content =~ m<
+                                       (?: copyright(?:\s\(c\))? | \(c\) )
+                                       \s*
+                                       (?: \d{4} \\? [-,]\s*)?
+                                       (\d{4})
+                                       >gixms;
+    if (0 < grep {$_ ne $this_year} @copyright_years) {
+        fail("$_ copyrights: @copyright_years");
+    } elsif (0 == @copyright_years) {
+        pass("$_, no copyright found");
+    } else {
+        pass($_);
+    } # end if
+
+    return $copyrights_found += @copyright_years;
+} # end check_file()

Copied: MooseX-GlobRef-Object/trunk/xt/cover.sh (from rev 7020, MooseX-GlobRef-Object/trunk/t/cover.sh)
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/cover.sh	                        (rev 0)
+++ MooseX-GlobRef-Object/trunk/xt/cover.sh	2008-12-30 22:17:30 UTC (rev 7204)
@@ -0,0 +1,6 @@
+cd $(dirname $0)
+cd ..
+perl Build.PL
+cover -delete
+HARNESS_PERL_SWITCHES=-MDevel::Cover ./Build test
+cover

Added: MooseX-GlobRef-Object/trunk/xt/distribution.t
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/distribution.t	                        (rev 0)
+++ MooseX-GlobRef-Object/trunk/xt/distribution.t	2008-12-30 22:17:30 UTC (rev 7204)
@@ -0,0 +1,9 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+our $VERSION = '0.999_001';
+
+# No POD coverage due to complaints about builtins when using Fatal.
+use Test::Distribution ( distversion => 1, not => 'podcover' );

Added: MooseX-GlobRef-Object/trunk/xt/minimumversion.t
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/minimumversion.t	                        (rev 0)
+++ MooseX-GlobRef-Object/trunk/xt/minimumversion.t	2008-12-30 22:17:30 UTC (rev 7204)
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval "use Test::MinimumVersion";
+plan skip_all => "Test::MinimumVersion required for testing minimum version" if $@;
+
+all_minimum_version_from_metayml_ok();

Deleted: MooseX-GlobRef-Object/trunk/xt/pod.t
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/pod.t	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/xt/pod.t	2008-12-30 22:17:30 UTC (rev 7204)
@@ -1,11 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-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();

Modified: MooseX-GlobRef-Object/trunk/xt/pod_coverage.t
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/pod_coverage.t	2008-12-30 22:13:08 UTC (rev 7203)
+++ MooseX-GlobRef-Object/trunk/xt/pod_coverage.t	2008-12-30 22:17:30 UTC (rev 7204)
@@ -5,11 +5,9 @@
 
 use Test::More;
 
-use lib 't/tlib', 'tlib';
-
 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({
-    also_private => [ qr/^(BUILD|meta|unimport)$/ ],
+    also_private => [ qr/^(unimport|BUILD)$/ ],
 });

Added: MooseX-GlobRef-Object/trunk/xt/pod_spell.xt
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/pod_spell.xt	                        (rev 0)
+++ MooseX-GlobRef-Object/trunk/xt/pod_spell.xt	2008-12-30 22:17:30 UTC (rev 7204)
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval q{ use Test::Spelling };
+plan skip_all => "Test::Spelling is not installed." if $@;
+
+set_spell_cmd('aspell -a -d en');
+add_stopwords( map { split /[\s\:\-]/ } <DATA> );
+$ENV{LANG} = 'C';
+all_pod_files_spelling_ok('lib');
+
+__DATA__
+Roszatycki

Copied: MooseX-GlobRef-Object/trunk/xt/pod_syntax.t (from rev 7020, MooseX-GlobRef-Object/trunk/xt/pod.t)
===================================================================
--- MooseX-GlobRef-Object/trunk/xt/pod_syntax.t	                        (rev 0)
+++ MooseX-GlobRef-Object/trunk/xt/pod_syntax.t	2008-12-30 22:17:30 UTC (rev 7204)
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+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 Moose-commits mailing list