r51504 - in /branches/upstream/libclass-perl: ./ current/ current/Changes current/MANIFEST current/META.yml current/Makefile.PL current/SIGNATURE current/lib/ current/lib/CLASS.pm current/t/ current/t/CLASS.t

jeremiah-guest at users.alioth.debian.org jeremiah-guest at users.alioth.debian.org
Sun Jan 24 22:47:31 UTC 2010


Author: jeremiah-guest
Date: Sun Jan 24 22:47:15 2010
New Revision: 51504

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=51504
Log:
[svn-inject] Installing original source of libclass-perl

Added:
    branches/upstream/libclass-perl/
    branches/upstream/libclass-perl/current/
    branches/upstream/libclass-perl/current/Changes
    branches/upstream/libclass-perl/current/MANIFEST
    branches/upstream/libclass-perl/current/META.yml
    branches/upstream/libclass-perl/current/Makefile.PL
    branches/upstream/libclass-perl/current/SIGNATURE
    branches/upstream/libclass-perl/current/lib/
    branches/upstream/libclass-perl/current/lib/CLASS.pm
    branches/upstream/libclass-perl/current/t/
    branches/upstream/libclass-perl/current/t/CLASS.t

Added: branches/upstream/libclass-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-perl/current/Changes?rev=51504&op=file
==============================================================================
--- branches/upstream/libclass-perl/current/Changes (added)
+++ branches/upstream/libclass-perl/current/Changes Sun Jan 24 22:47:15 2010
@@ -1,0 +1,24 @@
+1.00  Mon Oct  9 18:10:58 PDT 2006
+    - Add a LICENSE notice
+    - This is 1.00, why not
+    - Remove the really, really old Test::More bundled with this and just
+      depend on it instead.
+
+0.91  Tue May 20 01:23:08 PDT 2003
+    - CLASS is now a real constant (thanks Juerd)
+
+0.90  Fri Nov 29 14:26:09 PST 2002
+    * Colm figured out a way to add $CLASS
+    * Cut out using any other modules so load time is now negligible.
+    - This pretty much makes the module Feature Complete so jacking
+      up to 0.90 as a beta release.
+
+0.03  Tue Aug 28 01:32:07 EDT 2001
+    - Eliminated nearly ALL the code!
+    - Explicitly tested all the way back to 5.004
+
+0.02  Fri Aug 24 23:34:51 EDT 2001
+    * Added CLASS keyword
+
+0.01  Thu Jun 28 13:14:31 EDT 2001
+    - First working version.

Added: branches/upstream/libclass-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-perl/current/MANIFEST?rev=51504&op=file
==============================================================================
--- branches/upstream/libclass-perl/current/MANIFEST (added)
+++ branches/upstream/libclass-perl/current/MANIFEST Sun Jan 24 22:47:15 2010
@@ -1,0 +1,7 @@
+Changes
+MANIFEST
+Makefile.PL
+lib/CLASS.pm
+t/CLASS.t
+META.yml                                 Module meta-data (added by MakeMaker)
+SIGNATURE                                Public-key signature (added by MakeMaker)

Added: branches/upstream/libclass-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-perl/current/META.yml?rev=51504&op=file
==============================================================================
--- branches/upstream/libclass-perl/current/META.yml (added)
+++ branches/upstream/libclass-perl/current/META.yml Sun Jan 24 22:47:15 2010
@@ -1,0 +1,12 @@
+--- #YAML:1.0
+name:                CLASS
+version:             1.00
+abstract:            Alias for __PACKAGE__
+license:             perl
+generated_by:        ExtUtils::MakeMaker version 6.31
+distribution_type:   module
+requires:     
+    Test::More:                    0.07
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
+    version: 1.2

Added: branches/upstream/libclass-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-perl/current/Makefile.PL?rev=51504&op=file
==============================================================================
--- branches/upstream/libclass-perl/current/Makefile.PL (added)
+++ branches/upstream/libclass-perl/current/Makefile.PL Sun Jan 24 22:47:15 2010
@@ -1,0 +1,35 @@
+# A template for Makefile.PL used by Arena Networks.
+# - Set the $PACKAGE variable to the name of your module.
+# - Set $LAST_API_CHANGE to reflect the last version you changed the API 
+#   of your module.
+# - Fill in your dependencies in PREREQ_PM
+# Alternatively, you can say the hell with this and use h2xs.
+
+use 5.004;
+
+use ExtUtils::MakeMaker;
+
+$PACKAGE = 'CLASS';
+($PACKAGE_FILE = $PACKAGE) =~ s|::|/|g;
+$LAST_API_CHANGE = 0;
+
+eval "require $PACKAGE";
+
+unless ($@) { # Make sure we did find the module.
+    print <<"CHANGE_WARN" if ${$PACKAGE.'::VERSION'} < $LAST_API_CHANGE;
+
+NOTE: There have been API changes between this version and any older
+than version $LAST_API_CHANGE!  Please read the Changes file if you
+are upgrading from a version older than $LAST_API_CHANGE.
+
+CHANGE_WARN
+}
+
+WriteMakefile(
+    NAME            => $PACKAGE,
+    VERSION_FROM    => "lib/$PACKAGE_FILE.pm", # finds $VERSION
+    ABSTRACT_FROM   => "lib/$PACKAGE_FILE.pm",
+    PREREQ_PM       => { Test::More => 0.07  },
+
+    $ExtUtils::MakeMaker::VERSION >= 6.31 ? (LICENSE         => 'perl') : ()
+);

Added: branches/upstream/libclass-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-perl/current/SIGNATURE?rev=51504&op=file
==============================================================================
--- branches/upstream/libclass-perl/current/SIGNATURE (added)
+++ branches/upstream/libclass-perl/current/SIGNATURE Sun Jan 24 22:47:15 2010
@@ -1,0 +1,29 @@
+This file contains message digests of all files listed in MANIFEST,
+signed via the Module::Signature module, version 0.55.
+
+To verify the content in this distribution, first make sure you have
+Module::Signature installed, then type:
+
+    % cpansign -v
+
+It will check each file's integrity, as well as the signature's
+validity.  If "==> Signature verified OK! <==" is not displayed,
+the distribution may already have been compromised, and you should
+not run its Makefile.PL or Build.PL.
+
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+SHA1 b8ba9c799722a08c6cef0155fc4c3a965fcc0867 Changes
+SHA1 c51815d9a4fe047a704263c2620d661e5ecc436a MANIFEST
+SHA1 6c38201dffc8cd299ffea8f8593399cd2d1ff525 META.yml
+SHA1 87babfcf4e52547d81a18cd633fbaa94ed585a95 Makefile.PL
+SHA1 21da58e9d12fab889ca5ea316fb6afb6da8bef47 lib/CLASS.pm
+SHA1 dcc1fb792f2a3838362583d9d70e019d35b1aa01 t/CLASS.t
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.5 (Darwin)
+
+iD8DBQFFKvSYWMohlhD1QycRAj9XAJ9fxEF29ZrRO6GH/wposuId3Y9p4ACbBNaU
+DYb1cIxTMzkZikqbjha4CNY=
+=YsdZ
+-----END PGP SIGNATURE-----

Added: branches/upstream/libclass-perl/current/lib/CLASS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-perl/current/lib/CLASS.pm?rev=51504&op=file
==============================================================================
--- branches/upstream/libclass-perl/current/lib/CLASS.pm (added)
+++ branches/upstream/libclass-perl/current/lib/CLASS.pm Sun Jan 24 22:47:15 2010
@@ -1,0 +1,83 @@
+package CLASS;
+
+use 5.004;
+
+$VERSION = '1.00';
+
+BEGIN { 
+    # Faster than 'use constant'.  Load time critical.
+    # Must eval to make $] constant.
+    *PERL_VERSION = eval qq{ sub () { $] } };
+}
+
+sub import {
+    my $caller = caller;
+    *{$caller.'::CLASS'} = \$caller;
+
+    # This logic is compiled out.
+    if( PERL_VERSION >= 5.008 ) {
+        # 5.8.x smart enough to make this a constant.
+        *{$caller.'::CLASS'} = sub () { $caller };
+    }
+    else {
+        # Make CLASS a constant.
+        *{$caller.'::CLASS'} = eval qq{ sub () { q{$caller} } };
+    }
+}
+
+
+=head1 NAME
+
+CLASS - Alias for __PACKAGE__
+
+
+=head1 SYNOPSIS
+
+  package Foo;
+  use CLASS;
+
+  print CLASS;                  # Foo
+  print "My class is $CLASS\n"; # My class is Foo
+
+  sub bar { 23 }
+
+  print CLASS->bar;     # 23
+  print $CLASS->bar;    # 23
+
+
+=head1 DESCRIPTION
+
+CLASS and $CLASS are both synonyms for __PACKAGE__.  Easier to type.
+
+$CLASS has the additional benefit of working in strings.
+
+
+=head1 NOTES
+
+CLASS is a constant, not a subroutine call.  $CLASS is a plain
+variable, it is not tied.  There is no performance loss for using
+CLASS over __PACKAGE__ except the loading of the module. (Thanks
+Juerd)
+
+
+=head1 AUTHOR
+
+Michael G Schwern <schwern at pobox.com>
+
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+See L<http://www.perl.com/perl/misc/Artistic.html>
+
+
+=head1 SEE ALSO
+
+L<perlmod(1)>
+
+=cut
+
+
+1;

Added: branches/upstream/libclass-perl/current/t/CLASS.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-perl/current/t/CLASS.t?rev=51504&op=file
==============================================================================
--- branches/upstream/libclass-perl/current/t/CLASS.t (added)
+++ branches/upstream/libclass-perl/current/t/CLASS.t Sun Jan 24 22:47:15 2010
@@ -1,0 +1,82 @@
+#!/usr/bin/perl -w
+
+use 5.004;
+
+use Test::More tests => 22;
+
+BEGIN { use_ok('CLASS'); }
+
+
+package Foo;
+use CLASS;
+
+::is( CLASS,  __PACKAGE__,              'CLASS is right' );
+::is( $CLASS,  __PACKAGE__,             '$CLASS is right' );
+
+
+sub bar { 23 }
+sub check_caller { caller }
+
+::is( CLASS->bar, 23,              'CLASS->meth' );
+::is( $CLASS->bar, 23,             '$CLASS->meth' );
+
+#line 42
+eval { CLASS->i_dont_exist };
+my $CLASS_death = $@;
+#line 42
+eval { $CLASS->i_dont_exist };
+my $CLASS_scalar_death = $@;
+#line 42
+eval { __PACKAGE__->i_dont_exist };
+my $Foo_death = $@;
+::is( $CLASS_death, $Foo_death,   '__PACKAGE__ and CLASS die the same' );
+::is( $CLASS_scalar_death, $Foo_death, '__PACKAGE__ and $CLASS die the same' );
+
+#line 29
+my $CLASS_caller = CLASS->check_caller;
+my $CLASS_scalar_caller = $CLASS->check_caller;
+my $Foo_caller   = __PACKAGE__->check_caller;
+::is($CLASS_caller, $Foo_caller,  'caller preserved' );
+::is($CLASS_scalar_caller, $Foo_caller,  'caller preserved' );
+
+
+sub foo { return join ':', @_ }
+
+::is( CLASS->foo,         'Foo',        'Right CLASS  to class method call' );
+::is( $CLASS->foo,         'Foo',       'Right $CLASS to class method call' );
+::is( CLASS->foo('bar'),  'Foo:bar',    'CLASS:  Arguments preserved' );
+::is( $CLASS->foo('bar'),  'Foo:bar',   '$CLASS: Arguments preserved' );
+
+
+{
+    package Bar;
+    use CLASS;
+
+    sub Yarrow::Func {
+        my($passed_class, $passed_class_scalar) = @_;
+        ::is( CLASS, __PACKAGE__,    'CLASS works in tricky subroutine' );
+        ::is( $CLASS, __PACKAGE__,   '$CLASS works in tricky subroutine' );
+
+        ::is( $passed_class,        'Foo', 'CLASS as sub argument'  );
+        ::is( $passed_class_scalar, 'Foo', '$CLASS as sub argument' );
+
+        ::is( $_[0], 'Foo', 'CLASS in @_'  );
+        ::is( $_[1], 'Foo', '$CLASS in @_' );
+    }
+}
+
+Yarrow::Func(CLASS, $CLASS);
+
+
+# Make sure AUTOLOAD is preserved.
+package Bar;
+sub AUTOLOAD { return "Autoloader" }
+
+::is( CLASS->i_dont_exist, 'Autoloader',        'CLASS:  AUTOLOAD preserved' );
+::is( $CLASS->i_dont_exist, 'Autoloader',       '$CLASS: AUTOLOAD preserved' );
+
+
+package main;
+eval q{ CLASS(42); };
+like( $@, '/^Too many arguments for main::CLASS/', 
+                                                'CLASS properly prototyped' );




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