r63858 - in /branches/upstream/libdir-self-perl: ./ current/ current/lib/ current/lib/Dir/ current/t/ current/t/zerlegungsgleichheit/

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sun Oct 17 13:35:17 UTC 2010


Author: gregoa
Date: Sun Oct 17 13:34:43 2010
New Revision: 63858

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

Added:
    branches/upstream/libdir-self-perl/
    branches/upstream/libdir-self-perl/current/
    branches/upstream/libdir-self-perl/current/MANIFEST
    branches/upstream/libdir-self-perl/current/META.yml
    branches/upstream/libdir-self-perl/current/Makefile.PL
    branches/upstream/libdir-self-perl/current/README
    branches/upstream/libdir-self-perl/current/lib/
    branches/upstream/libdir-self-perl/current/lib/Dir/
    branches/upstream/libdir-self-perl/current/lib/Dir/Self.pm
    branches/upstream/libdir-self-perl/current/t/
    branches/upstream/libdir-self-perl/current/t/Dir-Self.t
    branches/upstream/libdir-self-perl/current/t/zerlegungsgleichheit/
    branches/upstream/libdir-self-perl/current/t/zerlegungsgleichheit/d.t

Added: branches/upstream/libdir-self-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdir-self-perl/current/MANIFEST?rev=63858&op=file
==============================================================================
--- branches/upstream/libdir-self-perl/current/MANIFEST (added)
+++ branches/upstream/libdir-self-perl/current/MANIFEST Sun Oct 17 13:34:43 2010
@@ -1,0 +1,7 @@
+Makefile.PL
+MANIFEST
+README
+t/Dir-Self.t
+t/zerlegungsgleichheit/d.t
+lib/Dir/Self.pm
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libdir-self-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdir-self-perl/current/META.yml?rev=63858&op=file
==============================================================================
--- branches/upstream/libdir-self-perl/current/META.yml (added)
+++ branches/upstream/libdir-self-perl/current/META.yml Sun Oct 17 13:34:43 2010
@@ -1,0 +1,16 @@
+--- #YAML:1.0
+name:                Dir-Self
+version:             0.10
+abstract:            a __DIR__ constant for the directory your source file is in
+license:             ~
+author:              
+    - Lukas Mai <l.mai @web.de>
+generated_by:        ExtUtils::MakeMaker version 6.44
+distribution_type:   module
+requires:     
+    Carp:                          0
+    File::Spec:                    0
+    Test::More:                    0
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3

Added: branches/upstream/libdir-self-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdir-self-perl/current/Makefile.PL?rev=63858&op=file
==============================================================================
--- branches/upstream/libdir-self-perl/current/Makefile.PL (added)
+++ branches/upstream/libdir-self-perl/current/Makefile.PL Sun Oct 17 13:34:43 2010
@@ -1,0 +1,16 @@
+use 5.005;
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    NAME              => 'Dir::Self',
+    VERSION_FROM      => 'lib/Dir/Self.pm', # finds $VERSION
+    PREREQ_PM         => {
+    	'Test::More'  =>  0,
+    	'Carp' => 0,
+    	'File::Spec' => 0,
+    },
+    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
+      (ABSTRACT_FROM  => 'lib/Dir/Self.pm', # retrieve abstract from module
+       AUTHOR         => 'Lukas Mai <l.mai @web.de>') : ()),
+);

Added: branches/upstream/libdir-self-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdir-self-perl/current/README?rev=63858&op=file
==============================================================================
--- branches/upstream/libdir-self-perl/current/README (added)
+++ branches/upstream/libdir-self-perl/current/README Sun Oct 17 13:34:43 2010
@@ -1,0 +1,29 @@
+Dir-Self version 0.10
+=====================
+
+Provides a __DIR__ pseudo-constant expanding to the full path to the
+surrounding source file. Useful for access to files "in the same
+directory".
+
+INSTALLATION
+
+To install this module type the following:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+DEPENDENCIES
+
+  Test::More (build only)
+  File::Spec
+  Carp
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2007, 2008 by Lukas Mai
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.8.8 or,
+at your option, any later version of Perl 5 you may have available.

Added: branches/upstream/libdir-self-perl/current/lib/Dir/Self.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdir-self-perl/current/lib/Dir/Self.pm?rev=63858&op=file
==============================================================================
--- branches/upstream/libdir-self-perl/current/lib/Dir/Self.pm (added)
+++ branches/upstream/libdir-self-perl/current/lib/Dir/Self.pm Sun Oct 17 13:34:43 2010
@@ -1,0 +1,91 @@
+package Dir::Self;
+
+use 5.005;
+use strict;
+
+use File::Spec ();
+
+*VERSION = \'0.10';
+
+sub _croak {
+	require Carp;
+	local $^W = 0;
+	*_croak = \&Carp::croak;
+	goto &Carp::croak;
+}
+
+sub __DIR__ () {
+	my $level = shift || 0;
+	my $file = (caller $level)[1];
+	File::Spec->rel2abs(join '', (File::Spec->splitpath($file))[0, 1])
+}
+
+sub _const {
+	my $value = shift;
+	sub () { $value }
+}
+
+sub import {
+	my $class = shift;
+	my $caller = caller;
+
+	@_ or @_ = '__DIR__';
+
+	for my $item (@_) {
+		if ($item eq '__DIR__') {
+			no strict 'refs';
+			*{$caller . '::__DIR__'} = \&__DIR__;
+		} elsif ($item eq ':static') {
+			no strict 'refs';
+			*{$caller . '::__DIR__'} = _const &__DIR__(1);
+		} else {
+			_croak qq{"$item" is not exported by the $class module};
+		}
+	}
+}
+
+1
+__END__
+
+=head1 NAME
+
+Dir::Self - a __DIR__ constant for the directory your source file is in
+
+=head1 SYNOPSIS
+
+  use Dir::Self;
+  
+  use lib __DIR__ . "/lib";
+  
+  my $conffile = __DIR__ . "/config";
+
+=head1 DESCRIPTION
+
+Perl has two pseudo-constants describing the current location in your source
+code, C<__FILE__> and C<__LINE__>. This module adds C<__DIR__>, which expands
+to the directory your source file is in, as an absolute pathname.
+
+This is useful if your code wants to access files in the same directory, like
+helper modules or configuration data. This is a bit like L<FindBin> except
+it's not limited to the main program, i.e. you can also use it in modules. And
+it actually works.
+
+As of version 0.10 each use of C<__DIR__> recomputes the directory name; this
+ensures that files in different directories that share the same package name
+get correct results. If you don't want this, C<use Dir::Self qw(:static)> will
+create a true C<__DIR__> constant in your package that contains the directory
+name at the point of C<use>.
+
+=head1 AUTHOR
+
+Lukas Mai E<lt>l.mai @web.deE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2007, 2008 by Lukas Mai
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.8.8 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut

Added: branches/upstream/libdir-self-perl/current/t/Dir-Self.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdir-self-perl/current/t/Dir-Self.t?rev=63858&op=file
==============================================================================
--- branches/upstream/libdir-self-perl/current/t/Dir-Self.t (added)
+++ branches/upstream/libdir-self-perl/current/t/Dir-Self.t Sun Oct 17 13:34:43 2010
@@ -1,0 +1,18 @@
+#!perl -w
+use strict;
+
+use Test::More tests => 3;
+
+use Dir::Self;
+ok 1, 'use Dir::Self';
+
+#########################
+
+# Insert your test code below, the Test::More module is use()ed here so read
+# its man page ( perldoc Test::More ) for help writing this test script.
+
+like __DIR__, '/\bt$/';
+
+use lib __DIR__;
+require "zerlegungsgleichheit/d.t";
+like zd(), '/\bzerlegungsgleichheit$/';

Added: branches/upstream/libdir-self-perl/current/t/zerlegungsgleichheit/d.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdir-self-perl/current/t/zerlegungsgleichheit/d.t?rev=63858&op=file
==============================================================================
--- branches/upstream/libdir-self-perl/current/t/zerlegungsgleichheit/d.t (added)
+++ branches/upstream/libdir-self-perl/current/t/zerlegungsgleichheit/d.t Sun Oct 17 13:34:43 2010
@@ -1,0 +1,5 @@
+use strict;
+
+sub zd { __DIR__ }
+
+1




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