r69623 - in /branches/upstream/libstrictures-perl: ./ current/ current/lib/ current/maint/ current/t/ current/t/smells-of-vcs/ current/xt/

mxey-guest at users.alioth.debian.org mxey-guest at users.alioth.debian.org
Fri Feb 25 13:41:58 UTC 2011


Author: mxey-guest
Date: Fri Feb 25 13:41:19 2011
New Revision: 69623

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=69623
Log:
[svn-inject] Installing original source of libstrictures-perl (1.002002)

Added:
    branches/upstream/libstrictures-perl/
    branches/upstream/libstrictures-perl/current/
    branches/upstream/libstrictures-perl/current/Changes
    branches/upstream/libstrictures-perl/current/MANIFEST
    branches/upstream/libstrictures-perl/current/META.yml
    branches/upstream/libstrictures-perl/current/Makefile.PL
    branches/upstream/libstrictures-perl/current/README
    branches/upstream/libstrictures-perl/current/lib/
    branches/upstream/libstrictures-perl/current/lib/strictures.pm
    branches/upstream/libstrictures-perl/current/maint/
    branches/upstream/libstrictures-perl/current/maint/Makefile.PL.include
    branches/upstream/libstrictures-perl/current/maint/Makefile.include
    branches/upstream/libstrictures-perl/current/maint/bump-version   (with props)
    branches/upstream/libstrictures-perl/current/t/
    branches/upstream/libstrictures-perl/current/t/smells-of-vcs/
    branches/upstream/libstrictures-perl/current/t/smells-of-vcs/.exists
    branches/upstream/libstrictures-perl/current/t/strictures.t
    branches/upstream/libstrictures-perl/current/xt/
    branches/upstream/libstrictures-perl/current/xt/pod.t

Added: branches/upstream/libstrictures-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/Changes?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/Changes (added)
+++ branches/upstream/libstrictures-perl/current/Changes Fri Feb 25 13:41:19 2011
@@ -1,0 +1,15 @@
+1.002002 - 2011-02-25
+  - only try and mkdir the .git if it doesn't already exist so repeated
+    test runs don't explode
+1.002001 - 2011-02-25
+  - switch .svn to .git in smells-of-vcs test and create it ourselves
+    to ease importing of this dist into subversion repositories
+1.002000 - 2011-02-16
+  - add multidimensional and bareword::filehandles in author mode
+1.1.1 Dec 05 2010
+  - disable uninitialized warnings before calling ->SUPER::VERSION
+1.1.0 Nov 22 2010
+  - enable extra testing only if .git or .svn present to keep requirement
+    for extra modules author-side
+1.0.0 Jul 18 2010
+  - initial release

Added: branches/upstream/libstrictures-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/MANIFEST?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/MANIFEST (added)
+++ branches/upstream/libstrictures-perl/current/MANIFEST Fri Feb 25 13:41:19 2011
@@ -1,0 +1,11 @@
+Changes
+lib/strictures.pm
+maint/bump-version
+maint/Makefile.include
+maint/Makefile.PL.include
+Makefile.PL
+MANIFEST			This list of files
+t/smells-of-vcs/.exists
+t/strictures.t
+xt/pod.t
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libstrictures-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/META.yml?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/META.yml (added)
+++ branches/upstream/libstrictures-perl/current/META.yml Fri Feb 25 13:41:19 2011
@@ -1,0 +1,21 @@
+--- #YAML:1.0
+name:               strictures
+version:            1.002002
+abstract:           turn on strict and make all warnings fatal
+author:
+    - mst - Matt S. Trout (cpan:MSTROUT) <mst at shadowcat.co.uk>
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
+requires:  {}
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.56
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Added: branches/upstream/libstrictures-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/Makefile.PL?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/Makefile.PL (added)
+++ branches/upstream/libstrictures-perl/current/Makefile.PL Fri Feb 25 13:41:19 2011
@@ -1,0 +1,10 @@
+use strict;
+use warnings FATAL => 'all';
+use ExtUtils::MakeMaker;
+
+(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
+
+WriteMakefile(
+  NAME => 'strictures',
+  VERSION_FROM => 'lib/strictures.pm',
+);

Added: branches/upstream/libstrictures-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/README?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/README (added)
+++ branches/upstream/libstrictures-perl/current/README Fri Feb 25 13:41:19 2011
@@ -1,0 +1,109 @@
+NAME
+    strictures - turn on strict and make all warnings fatal
+
+SYNOPSIS
+      use strictures 1;
+
+    is equivalent to
+
+      use strict;
+      use warnings FATAL => 'all';
+
+    except when called from a file where $0 matches:
+
+      /^x?t\/.*(?:load|compile|coverage|use_ok).*\.t$/
+
+    and when either '.git' or '.svn' is present in the current directory
+    (with the intention of only forcing extra tests on the author side) - or
+    when the PERL_STRICTURES_EXTRA environment variable is set, in which
+    case
+
+      use strictures 1;
+
+    is equivalent to
+
+      use strict;
+      use warnings FATAL => 'all';
+      no indirect 'fatal';
+      no multidimensional;
+      no bareword::filehandles;
+
+    Note that _EXTRA may at some point add even more tests, with only a
+    minor version increase, but any changes to the effect of 'use
+    strictures' in normal mode will involve a major version bump.
+
+    Be aware: THIS MEANS THE EXTRA TEST MODULES ARE REQUIRED FOR AUTHORS OF
+    STRICTURES USING CODE - but not by end users thereof.
+
+DESCRIPTION
+    I've been writing the equivalent of this module at the top of my code
+    for about a year now. I figured it was time to make it shorter.
+
+    Things like the importer in 'use Moose' don't help me because they turn
+    warnings on but don't make them fatal - which from my point of view is
+    useless because I want an exception to tell me my code isn't warnings
+    clean.
+
+    Any time I see a warning from my code, that indicates a mistake.
+
+    Any time my code encounters a mistake, I want a crash - not spew to
+    STDERR and then unknown (and probably undesired) subsequent behaviour.
+
+    I also want to ensure that obvious coding mistakes, like indirect object
+    syntax (and not so obvious mistakes that cause things to accidentally
+    compile as such) get caught, but not at the cost of an XS dependency and
+    not at the cost of blowing things up on another machine.
+
+    Therefore, strictures turns on indirect checking only when it thinks
+    it's running in a compilation (or pod coverage) test - though if this
+    causes undesired behaviour this can be overridden by setting the
+    PERL_STRICTURES_EXTRA environment variable.
+
+    If additional useful author side checks come to mind, I'll add them to
+    the _EXTRA code path only - this will result in a minor version increase
+    (i.e. 1.000000 to 1.001000 (1.1.0) or similar). Any fixes only to the
+    mechanism of this code will result in a subversion increas (i.e.
+    1.000000 to 1.000001 (1.0.1)).
+
+    If the behaviour of 'use strictures' in normal mode changes in any way,
+    that will constitute a major version increase - and the code already
+    checks when its version is tested to ensure that
+
+      use strictures 1;
+
+    will continue to only introduce the current set of strictures even if
+    2.0 is installed.
+
+METHODS
+  import
+    This method does the setup work described above in "DESCRIPTION"
+
+  VERSION
+    This method traps the strictures->VERSION(1) call produced by a use line
+    with a version number on it and does the version check.
+
+COMMUNITY AND SUPPORT
+  IRC channel
+    irc.perl.org #toolchain
+
+    (or bug 'mst' in query on there or freenode)
+
+  Git repository
+    Gitweb is on http://git.shadowcat.co.uk/ and the clone URL is:
+
+      git clone git://git.shadowcat.co.uk/p5sagit/strictures.git
+
+AUTHOR
+    mst - Matt S. Trout (cpan:MSTROUT) <mst at shadowcat.co.uk>
+
+CONTRIBUTORS
+    None required yet. Maybe this module is perfect (hahahahaha ...).
+
+COPYRIGHT
+    Copyright (c) 2010 the strictures "AUTHOR" and "CONTRIBUTORS" as listed
+    above.
+
+LICENSE
+    This library is free software and may be distributed under the same
+    terms as perl itself.
+

Added: branches/upstream/libstrictures-perl/current/lib/strictures.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/lib/strictures.pm?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/lib/strictures.pm (added)
+++ branches/upstream/libstrictures-perl/current/lib/strictures.pm Fri Feb 25 13:41:19 2011
@@ -1,0 +1,180 @@
+package strictures;
+
+use strict;
+use warnings FATAL => 'all';
+
+our $VERSION = '1.002002'; # 1.2.2
+
+sub VERSION {
+  for ($_[1]) {
+    last unless defined && !ref && int != 1;
+    die "Major version specified as $_ - this is strictures version 1";
+  }
+  # disable this since Foo->VERSION(undef) correctly returns the version
+  # and that can happen either if our caller passes undef explicitly or
+  # because the for above autovivified $_[1] - I could make it stop but
+  # it's pointless since we don't want to blow up if the caller does
+  # something valid either.
+  no warnings 'uninitialized';
+  shift->SUPER::VERSION(@_);
+}
+
+sub import {
+  strict->import;
+  warnings->import(FATAL => 'all');
+  my $extra_tests = do {
+    if (exists $ENV{PERL_STRICTURES_EXTRA}) {
+      $ENV{PERL_STRICTURES_EXTRA}
+    } else {
+      !!($0 =~ /^x?t\/.*(?:load|compile|coverage|use_ok).*\.t$/
+         and (-e '.git' or -e '.svn'))
+    }
+  };
+  if ($extra_tests) {
+    if (eval {
+          require indirect;
+          require multidimensional;
+          require bareword::filehandles;
+          1
+        }) {
+      indirect->unimport(':fatal');
+      multidimensional->unimport;
+      bareword::filehandles->unimport;
+    } else {
+      die "strictures.pm extra testing active but couldn't load modules.
+Extra testing is auto-enabled in checkouts only, so if you're the author
+of a strictures using module you need to run:
+
+  cpan indirect multidimensional bareword::filehandles
+
+but these modules are not required by your users.
+
+Error loading modules was: $@";
+    }
+  }
+}
+
+1;
+
+__END__
+=head1 NAME
+
+strictures - turn on strict and make all warnings fatal
+
+=head1 SYNOPSIS
+
+  use strictures 1;
+
+is equivalent to
+
+  use strict;
+  use warnings FATAL => 'all';
+
+except when called from a file where $0 matches:
+
+  /^x?t\/.*(?:load|compile|coverage|use_ok).*\.t$/
+
+and when either '.git' or '.svn' is present in the current directory (with
+the intention of only forcing extra tests on the author side) - or when the
+PERL_STRICTURES_EXTRA environment variable is set, in which case
+
+  use strictures 1;
+
+is equivalent to
+
+  use strict;
+  use warnings FATAL => 'all';
+  no indirect 'fatal';
+  no multidimensional;
+  no bareword::filehandles;
+
+Note that _EXTRA may at some point add even more tests, with only a minor
+version increase, but any changes to the effect of 'use strictures' in
+normal mode will involve a major version bump.
+
+Be aware: THIS MEANS THE EXTRA TEST MODULES ARE REQUIRED FOR AUTHORS OF
+STRICTURES USING CODE - but not by end users thereof.
+
+=head1 DESCRIPTION
+
+I've been writing the equivalent of this module at the top of my code for
+about a year now. I figured it was time to make it shorter.
+
+Things like the importer in 'use Moose' don't help me because they turn
+warnings on but don't make them fatal - which from my point of view is
+useless because I want an exception to tell me my code isn't warnings clean.
+
+Any time I see a warning from my code, that indicates a mistake.
+
+Any time my code encounters a mistake, I want a crash - not spew to STDERR
+and then unknown (and probably undesired) subsequent behaviour.
+
+I also want to ensure that obvious coding mistakes, like indirect object
+syntax (and not so obvious mistakes that cause things to accidentally compile
+as such) get caught, but not at the cost of an XS dependency and not at the
+cost of blowing things up on another machine.
+
+Therefore, strictures turns on indirect checking only when it thinks it's
+running in a compilation (or pod coverage) test - though if this causes
+undesired behaviour this can be overridden by setting the
+PERL_STRICTURES_EXTRA environment variable.
+
+If additional useful author side checks come to mind, I'll add them to the
+_EXTRA code path only - this will result in a minor version increase (i.e.
+1.000000 to 1.001000 (1.1.0) or similar). Any fixes only to the mechanism of
+this code will result in a subversion increas (i.e. 1.000000 to 1.000001
+(1.0.1)).
+
+If the behaviour of 'use strictures' in normal mode changes in any way, that
+will constitute a major version increase - and the code already checks
+when its version is tested to ensure that
+
+  use strictures 1;
+
+will continue to only introduce the current set of strictures even if 2.0 is
+installed.
+
+=head1 METHODS
+
+=head2 import
+
+This method does the setup work described above in L</DESCRIPTION>
+
+=head2 VERSION
+
+This method traps the strictures->VERSION(1) call produced by a use line
+with a version number on it and does the version check.
+
+=head1 COMMUNITY AND SUPPORT
+
+=head2 IRC channel
+
+irc.perl.org #toolchain
+
+(or bug 'mst' in query on there or freenode)
+
+=head2 Git repository
+
+Gitweb is on http://git.shadowcat.co.uk/ and the clone URL is:
+
+  git clone git://git.shadowcat.co.uk/p5sagit/strictures.git
+
+=head1 AUTHOR
+
+mst - Matt S. Trout (cpan:MSTROUT) <mst at shadowcat.co.uk>
+
+=head1 CONTRIBUTORS
+
+None required yet. Maybe this module is perfect (hahahahaha ...).
+
+=head1 COPYRIGHT
+
+Copyright (c) 2010 the strictures L</AUTHOR> and L</CONTRIBUTORS>
+as listed above.
+
+=head1 LICENSE
+
+This library is free software and may be distributed under the same terms
+as perl itself.
+
+=cut

Added: branches/upstream/libstrictures-perl/current/maint/Makefile.PL.include
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/maint/Makefile.PL.include?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/maint/Makefile.PL.include (added)
+++ branches/upstream/libstrictures-perl/current/maint/Makefile.PL.include Fri Feb 25 13:41:19 2011
@@ -1,0 +1,7 @@
+use Distar;
+
+author 'mst - Matt S. Trout (cpan:MSTROUT) <mst at shadowcat.co.uk>';
+
+manifest_include(
+  '' => qr{t/smells-of-vcs/.exists},
+);

Added: branches/upstream/libstrictures-perl/current/maint/Makefile.include
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/maint/Makefile.include?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/maint/Makefile.include (added)
+++ branches/upstream/libstrictures-perl/current/maint/Makefile.include Fri Feb 25 13:41:19 2011
@@ -1,0 +1,11 @@
+bump:
+	maint/bump-version
+	rm Makefile
+bumpminor:
+	maint/bump-version minor
+	rm Makefile
+bumpmajor:
+	maint/bump-version major
+	rm Makefile
+upload: $(DISTVNAME).tar$(SUFFIX)
+	cpan-upload $<

Added: branches/upstream/libstrictures-perl/current/maint/bump-version
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/maint/bump-version?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/maint/bump-version (added)
+++ branches/upstream/libstrictures-perl/current/maint/bump-version Fri Feb 25 13:41:19 2011
@@ -1,0 +1,36 @@
+#!/usr/bin/env perl
+
+use 5.010;
+use strict;
+use warnings FATAL => 'all';
+use autodie;
+
+chomp(my $LATEST = qx(grep '^[0-9]' Changes | head -1 | awk '{print \$1}'));
+
+my @parts = split /\./, $LATEST;
+
+my $OLD_DECIMAL = sprintf('%i.%03i%03i', @parts);
+
+my %bump_part = (major => 0, minor => 1, bugfix => 2);
+
+my $bump_this = 
+  $bump_part{$ARGV[0]||'bugfix'}
+    // die "no idea which part to bump - $ARGV[0] means nothing to me";
+
+my @new_parts = @parts;
+
+$new_parts[$bump_this]++;
+
+my $NEW_DECIMAL = sprintf('%i.%03i%03i', @new_parts);
+
+warn "Bumping $OLD_DECIMAL -> $NEW_DECIMAL\n";
+
+my $PM_FILE = 'lib/Module/Metadata.pm';
+
+my $file = do { local (@ARGV, $/) = ($PM_FILE); <> };
+
+$file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD_DECIMAL}/${NEW_DECIMAL}/;
+
+open my $out, '>', $PM_FILE;
+
+print $out $file;

Propchange: branches/upstream/libstrictures-perl/current/maint/bump-version
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libstrictures-perl/current/t/smells-of-vcs/.exists
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/t/smells-of-vcs/.exists?rev=69623&op=file
==============================================================================
    (empty)

Added: branches/upstream/libstrictures-perl/current/t/strictures.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/t/strictures.t?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/t/strictures.t (added)
+++ branches/upstream/libstrictures-perl/current/t/strictures.t Fri Feb 25 13:41:19 2011
@@ -1,0 +1,46 @@
+# -e is sufficient here.
+-e 't/smells-of-vcs/.git'
+  or mkdir('t/smells-of-vcs/.git')
+  or die "Couldn't create fake .git: $!";
+
+use Test::More qw(no_plan);
+
+our (@us, @expect);
+
+sub capture_stuff { [ $^H, ${^WARNING_BITS} ] }
+
+sub capture_us { push @us, capture_stuff }
+sub capture_expect { push @expect, capture_stuff }
+
+{
+  use strictures 1;
+  BEGIN { capture_us }
+}
+
+{
+  use strict;
+  use warnings FATAL => 'all';
+  BEGIN { capture_expect }
+}
+
+# I'm assuming here we'll have more cases later. maybe not. eh.
+
+foreach my $idx (0 .. $#us) {
+  is($us[$idx][0], $expect[$idx][0], 'Hints ok for case '.($idx+1));
+  is($us[$idx][1], $expect[$idx][1], 'Warnings ok for case '.($idx+1));
+}
+
+{
+  local $0 = 't/00load.t';
+  sub Foo::new { 1 }
+  chdir("t/smells-of-vcs");
+  my $r = eval q{
+    use strictures 1;
+    new Foo 1, 2, 3;
+  };
+  # I don't test $@ here since if indirect isn't installed we hit one
+  # error and if it is we hit another; it's enough the code path's hit.
+  ok(!$r, 'strictures blows up for t/00load.t');
+}
+
+ok(!eval q{use strictures 2; 1; }, "Can't use strictures 2 (this is version 1)");

Added: branches/upstream/libstrictures-perl/current/xt/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstrictures-perl/current/xt/pod.t?rev=69623&op=file
==============================================================================
--- branches/upstream/libstrictures-perl/current/xt/pod.t (added)
+++ branches/upstream/libstrictures-perl/current/xt/pod.t Fri Feb 25 13:41:19 2011
@@ -1,0 +1,15 @@
+use Test::More;
+use Test::Pod;
+use Test::Pod::Coverage;
+use strict;
+use warnings FATAL => 'all';
+
+# the all_ things attempt to plan, which we didn't want, so stop them
+# from doing that
+no warnings 'redefine';
+local *Test::Builder::plan = sub { };
+
+all_pod_files_ok;
+all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::CountParents' });
+
+done_testing;




More information about the Pkg-perl-cvs-commits mailing list