r5357 - in /packages/libclass-data-accessor-perl/trunk: ./ debian/
inc/ lib/Class/Data/ t/
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Wed May 9 10:02:03 UTC 2007
Author: eloy
Date: Wed May 9 10:02:01 2007
New Revision: 5357
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5357
Log:
new upstream version
Added:
packages/libclass-data-accessor-perl/trunk/inc/
- copied from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/inc/
packages/libclass-data-accessor-perl/trunk/t/accessor.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/accessor.t
packages/libclass-data-accessor-perl/trunk/t/basic.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/basic.t
packages/libclass-data-accessor-perl/trunk/t/manifest.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/manifest.t
packages/libclass-data-accessor-perl/trunk/t/pod_coverage.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/pod_coverage.t
packages/libclass-data-accessor-perl/trunk/t/pod_spelling.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/pod_spelling.t
packages/libclass-data-accessor-perl/trunk/t/pod_syntax.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/pod_syntax.t
packages/libclass-data-accessor-perl/trunk/t/strict.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/strict.t
packages/libclass-data-accessor-perl/trunk/t/style_no_tabs.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/style_no_tabs.t
packages/libclass-data-accessor-perl/trunk/t/warnings.t
- copied unchanged from r5356, packages/libclass-data-accessor-perl/branches/upstream/current/t/warnings.t
Removed:
packages/libclass-data-accessor-perl/trunk/Build.PL
packages/libclass-data-accessor-perl/trunk/t/Accessor.t
packages/libclass-data-accessor-perl/trunk/t/pod-coverage.t
packages/libclass-data-accessor-perl/trunk/t/pod.t
Modified:
packages/libclass-data-accessor-perl/trunk/Changes
packages/libclass-data-accessor-perl/trunk/MANIFEST
packages/libclass-data-accessor-perl/trunk/MANIFEST.SKIP
packages/libclass-data-accessor-perl/trunk/META.yml
packages/libclass-data-accessor-perl/trunk/Makefile.PL
packages/libclass-data-accessor-perl/trunk/README
packages/libclass-data-accessor-perl/trunk/debian/changelog
packages/libclass-data-accessor-perl/trunk/debian/rules
packages/libclass-data-accessor-perl/trunk/lib/Class/Data/Accessor.pm
Modified: packages/libclass-data-accessor-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/Changes?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/Changes (original)
+++ packages/libclass-data-accessor-perl/trunk/Changes Wed May 9 10:02:01 2007
@@ -1,13 +1,18 @@
-Revision history for Class::Data::Accessor.
-
-0.03 2006-06-23 19:50:23
- - Added warning when attempting to make DESTROY accessor
- - Added mk_classaccessors class method
- - Doc patch (Aran Deltac)
-
-0.02
- - Doc fixes
- - Added no warnings qw/redefine/ for usage with C3
-
-0.01 2005-11-27 21:21:46
- - initial release
+Revision history for Class::Data::Accessor.
+
+0 04000 Sat May 05 21:17:23 2007
+ - Converted to Module::Install
+ - Added culterific tests/TEST_AUTHOR
+ - Converted to distro friendly version number
+
+0.03 2006-06-23 19:50:23
+ - Added warning when attempting to make DESTROY accessor
+ - Added mk_classaccessors class method
+ - Doc patch (Aran Deltac)
+
+0.02
+ - Doc fixes
+ - Added no warnings qw/redefine/ for usage with C3
+
+0.01 2005-11-27 21:21:46
+ - initial release
Modified: packages/libclass-data-accessor-perl/trunk/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/MANIFEST?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/MANIFEST (original)
+++ packages/libclass-data-accessor-perl/trunk/MANIFEST Wed May 9 10:02:01 2007
@@ -1,11 +1,28 @@
-Build.PL
-Changes
-lib/Class/Data/Accessor.pm
-MANIFEST This list of files
-MANIFEST.SKIP
-t/Accessor.t
-t/pod-coverage.t
-t/pod.t
-META.yml
-Makefile.PL
-README
+Changes
+inc/Module/AutoInstall.pm
+inc/Module/Install.pm
+inc/Module/Install/AutoInstall.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Build.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Include.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/Class/Data/Accessor.pm
+Makefile.PL
+MANIFEST This list of files
+MANIFEST.SKIP
+META.yml
+README
+t/accessor.t
+t/basic.t
+t/manifest.t
+t/pod_coverage.t
+t/pod_spelling.t
+t/pod_syntax.t
+t/strict.t
+t/style_no_tabs.t
+t/warnings.t
Modified: packages/libclass-data-accessor-perl/trunk/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/MANIFEST.SKIP?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/MANIFEST.SKIP (original)
+++ packages/libclass-data-accessor-perl/trunk/MANIFEST.SKIP Wed May 9 10:02:01 2007
@@ -1,35 +1,37 @@
-# Avoid version control files.
-\bRCS\b
-\bCVS\b
-,v$
-,B$
-,D$
-\B\.svn\b
-aegis.log$
-\bconfig$
-\bbuild$
-
-# Avoid Makemaker generated and utility files.
-\bMakefile$
-\bblib
-\bMakeMaker-\d
-\bpm_to_blib$
-\bblibdirs$
-
-# Avoid Module::Build generated and utility files.
-\bBuild$
-\b_build
-
-# Avoid temp and backup files.
-~$
-\.gz$
-\.old$
-\.bak$
-\.swp$
-\.tdy$
-\.tmp$
-\#$
-\b\.#
-
-# Avoid author test files.
-\bpod-spelling.t$
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+,v$
+,B$
+,D$
+\B\.svn\b
+aegis.log$
+\bconfig$
+\bbuild$
+
+# Avoid Makemaker generated and utility files.
+\bMakefile$
+\bblib
+\bMakeMaker-\d
+\bpm_to_blib$
+\bblibdirs$
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build
+Build.PL
+Build.bat
+
+# Avoid temp and backup files.
+~$
+\.gz$
+\.old$
+\.bak$
+\.swp$
+\.tdy$
+\.tmp$
+\#$
+\b\.#
+
+# Avoid author test files.
+\bpod-spelling.t$
Modified: packages/libclass-data-accessor-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/META.yml?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/META.yml (original)
+++ packages/libclass-data-accessor-perl/trunk/META.yml Wed May 9 10:02:01 2007
@@ -1,13 +1,19 @@
----
-name: Class-Data-Accessor
-version: 0.03
-author: ~
-abstract: 'Inheritable, overridable class and instance data accessor creation'
-license: perl
-requires:
- Carp: 0
-provides:
- Class::Data::Accessor:
- file: lib/Class/Data/Accessor.pm
- version: 0.03
-generated_by: Module::Build version 0.26
+---
+abstract: Inheritable, overridable class and instance data accessor creation
+author: Based on the creative stylings of Damian Conway, Michael G Schwern,
+distribution_type: module
+generated_by: Module::Install version 0.65
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
+name: Class-Data-Accessor
+no_index:
+ directory:
+ - inc
+ - t
+requires:
+ Carp: 0
+ perl: 5.6.1
+tests: t/*.t t/*/*.t
+version: 0.04000
Modified: packages/libclass-data-accessor-perl/trunk/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/Makefile.PL?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/Makefile.PL (original)
+++ packages/libclass-data-accessor-perl/trunk/Makefile.PL Wed May 9 10:02:01 2007
@@ -1,31 +1,21 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
-
- unless (eval "use Module::Build::Compat 0.02; 1" ) {
- print "This module requires Module::Build to install itself.\n";
-
- require ExtUtils::MakeMaker;
- my $yn = ExtUtils::MakeMaker::prompt
- (' Install Module::Build now from CPAN?', 'y');
-
- unless ($yn =~ /^y/i) {
- die " *** Cannot install without Module::Build. Exiting ...\n";
- }
-
- require Cwd;
- require File::Spec;
- require CPAN;
-
- # Save this 'cause CPAN will chdir all over the place.
- my $cwd = Cwd::cwd();
- my $makefile = File::Spec->rel2abs($0);
-
- CPAN::Shell->install('Module::Build::Compat')
- or die " *** Cannot install without Module::Build. Exiting ...\n";
-
- chdir $cwd or die "Cannot chdir() back to $cwd: $!";
- }
- eval "use Module::Build::Compat 0.02; 1" or die $@;
- use lib '_build/lib';
- Module::Build::Compat->run_build_pl(args => \@ARGV);
- require Module::Build;
- Module::Build::Compat->write_makefile(build_class => 'Module::Build');
+# $Id: Makefile.PL 3256 2007-05-06 03:54:57Z claco $
+use strict;
+use warnings;
+use inc::Module::Install 0.65;
+
+name 'Class-Data-Accessor';
+license 'perl';
+perl_version '5.006001';
+all_from 'lib/Class/Data/Accessor.pm';
+
+requires 'Carp';
+
+tests "t/*.t t/*/*.t";
+clean_files "Class-Data-Accessor-* t/var";
+
+eval {
+ system 'pod2text lib/Class/Data/Accessor.pm > README';
+};
+
+auto_install;
+WriteAll;
Modified: packages/libclass-data-accessor-perl/trunk/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/README?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/README (original)
+++ packages/libclass-data-accessor-perl/trunk/README Wed May 9 10:02:01 2007
@@ -1,152 +1,152 @@
-NAME
- Class::Data::Accessor - Inheritable, overridable class and instance data
- accessor creation
-
-SYNOPSIS
- package Stuff;
- use base qw(Class::Data::Accessor);
-
- # Set up DataFile as inheritable class data.
- Stuff->mk_classaccessor('DataFile');
-
- # Declare the location of the data file for this class.
- Stuff->DataFile('/etc/stuff/data');
-
- # Or, all in one shot:
- Stuff->mk_classaccessor(DataFile => '/etc/stuff/data');
-
- Stuff->DataFile; # returns /etc/stuff/data
-
- my $stuff = Stuff->new; # your new, not ours
-
- $stuff->DataFile; # returns /etc/stuff/data
-
- $stuff->DataFile('/etc/morestuff'); # sets it on the object
-
- Stuff->DataFile; # still returns /etc/stuff/data
-
-DESCRIPTION
- Class::Data::Accessor is the marriage of Class::Accessor and
- Class::Data::Inheritable into a single module. It is used for creating
- accessors to class data that overridable in subclasses as well as in
- class instances.
-
- For example:
-
- Pere::Ubu->mk_classaccessor('Suitcase');
-
- will generate the method Suitcase() in the class Pere::Ubu.
-
- This new method can be used to get and set a piece of class data.
-
- Pere::Ubu->Suitcase('Red');
- $suitcase = Pere::Ubu->Suitcase;
-
- Taking this one step further, you can make a subclass that inherits from
- Pere::Ubu:
-
- package Raygun;
- use base qw(Pere::Ubu);
-
- # Raygun's suitcase is Red.
- $suitcase = Raygun->Suitcase;
-
- Raygun inherits its Suitcase class data from Pere::Ubu.
-
- Inheritance of class data works analogous to method inheritance. As long
- as Raygun does not "override" its inherited class data (by using
- Suitcase() to set a new value) it will continue to use whatever is set
- in Pere::Ubu and inherit further changes:
-
- # Both Raygun's and Pere::Ubu's suitcases are now Blue
- Pere::Ubu->Suitcase('Blue');
-
- However, should Raygun decide to set its own Suitcase() it has now
- "overridden" Pere::Ubu and is on its own, just like if it had overridden
- a method:
-
- # Raygun has an orange suitcase, Pere::Ubu's is still Blue.
- Raygun->Suitcase('Orange');
-
- Now that Raygun has overridden Pere::Ubu, further changes by Pere::Ubu
- no longer effect Raygun.
-
- # Raygun still has an orange suitcase, but Pere::Ubu is using Samsonite.
- Pere::Ubu->Suitcase('Samsonite');
-
- You can also override this class data on a per-object basis. If $obj isa
- Pere::Ubu then
-
- $obj->Suitcase; # will return Samsonite
-
- $obj->Suitcase('Purple'); # will set Suitcase *for this object only*
-
- And after you've done that,
-
- $obj->Suitcase; # will return Purple
-
- but
-
- Pere::Ubu->Suitcase; # will still return Samsonite
-
- If you don't want this behaviour use Class::Data::Inheritable instead.
-
- "mk_classaccessor" will die if used as an object method instead of as a
- class method.
-
-METHODS
- mk_classaccessor
- Class->mk_classaccessor($data_accessor_name);
- Class->mk_classaccessor($data_accessor_name => $value);
-
- This is a class method used to declare new class data accessors. A new
- accessor will be created in the Class using the name from
- $data_accessor_name, and optionally initially setting it to the given
- value.
-
- To facilitate overriding, mk_classaccessor creates an alias to the
- accessor, _field_accessor(). So Suitcase() would have an alias
- _Suitcase_accessor() that does the exact same thing as Suitcase(). This
- is useful if you want to alter the behavior of a single accessor yet
- still get the benefits of inheritable class data. For example.
-
- sub Suitcase {
- my($self) = shift;
- warn "Fashion tragedy" if @_ and $_[0] eq 'Plaid';
-
- $self->_Suitcase_accessor(@_);
- }
-
- Overriding accessors does not work in the same class as you declare the
- accessor in. It only works in subclasses due to the fact that
- subroutines are loaded at compile time and accessors are loaded at
- runtime, thus overriding any subroutines with the same name in the same
- class.
-
- mk_classaccessors(@accessornames)
- Takes a list of names and generates an accessor for each name in the
- list using "mk_classaccessor".
-
-AUTHORS
- Based on the creative stylings of Damian Conway, Michael G Schwern, Tony
- Bowden (Class::Data::Inheritable) and Michael G Schwern, Marty Pauley
- (Class::Accessor).
-
- Coded by Matt S Trout Tweaks by Christopher H. Laco.
-
-BUGS and QUERIES
- If your object isn't hash-based, this will currently break. My
- modifications aren't exactly sophisticated so far.
-
- mstrout at cpan.org or bug me on irc.perl.org, nick mst claco at cpan.org or
- irc.perl.org, nick claco
-
-LICENSE
- This module is free software. It may be used, redistributed and/or
- modified under the terms of the Perl Artistic License (see
- http://www.perl.com/perl/misc/Artistic.html)
-
-SEE ALSO
- perltootc has a very elaborate discussion of class data in Perl.
- Class::Accessor, Class::Data::Inheritable
-
+NAME
+ Class::Data::Accessor - Inheritable, overridable class and instance data
+ accessor creation
+
+SYNOPSIS
+ package Stuff;
+ use base qw(Class::Data::Accessor);
+
+ # Set up DataFile as inheritable class data.
+ Stuff->mk_classaccessor('DataFile');
+
+ # Declare the location of the data file for this class.
+ Stuff->DataFile('/etc/stuff/data');
+
+ # Or, all in one shot:
+ Stuff->mk_classaccessor(DataFile => '/etc/stuff/data');
+
+ Stuff->DataFile; # returns /etc/stuff/data
+
+ my $stuff = Stuff->new; # your new, not ours
+
+ $stuff->DataFile; # returns /etc/stuff/data
+
+ $stuff->DataFile('/etc/morestuff'); # sets it on the object
+
+ Stuff->DataFile; # still returns /etc/stuff/data
+
+DESCRIPTION
+ Class::Data::Accessor is the marriage of Class::Accessor and
+ Class::Data::Inheritable into a single module. It is used for creating
+ accessors to class data that overridable in subclasses as well as in
+ class instances.
+
+ For example:
+
+ Pere::Ubu->mk_classaccessor('Suitcase');
+
+ will generate the method Suitcase() in the class Pere::Ubu.
+
+ This new method can be used to get and set a piece of class data.
+
+ Pere::Ubu->Suitcase('Red');
+ $suitcase = Pere::Ubu->Suitcase;
+
+ Taking this one step further, you can make a subclass that inherits from
+ Pere::Ubu:
+
+ package Raygun;
+ use base qw(Pere::Ubu);
+
+ # Raygun's suitcase is Red.
+ $suitcase = Raygun->Suitcase;
+
+ Raygun inherits its Suitcase class data from Pere::Ubu.
+
+ Inheritance of class data works analogous to method inheritance. As long
+ as Raygun does not "override" its inherited class data (by using
+ Suitcase() to set a new value) it will continue to use whatever is set
+ in Pere::Ubu and inherit further changes:
+
+ # Both Raygun's and Pere::Ubu's suitcases are now Blue
+ Pere::Ubu->Suitcase('Blue');
+
+ However, should Raygun decide to set its own Suitcase() it has now
+ "overridden" Pere::Ubu and is on its own, just like if it had overridden
+ a method:
+
+ # Raygun has an orange suitcase, Pere::Ubu's is still Blue.
+ Raygun->Suitcase('Orange');
+
+ Now that Raygun has overridden Pere::Ubu, further changes by Pere::Ubu
+ no longer effect Raygun.
+
+ # Raygun still has an orange suitcase, but Pere::Ubu is using Samsonite.
+ Pere::Ubu->Suitcase('Samsonite');
+
+ You can also override this class data on a per-object basis. If $obj isa
+ Pere::Ubu then
+
+ $obj->Suitcase; # will return Samsonite
+
+ $obj->Suitcase('Purple'); # will set Suitcase *for this object only*
+
+ And after you've done that,
+
+ $obj->Suitcase; # will return Purple
+
+ but
+
+ Pere::Ubu->Suitcase; # will still return Samsonite
+
+ If you don't want this behaviour use Class::Data::Inheritable instead.
+
+ "mk_classaccessor" will die if used as an object method instead of as a
+ class method.
+
+METHODS
+ mk_classaccessor
+ Class->mk_classaccessor($data_accessor_name);
+ Class->mk_classaccessor($data_accessor_name => $value);
+
+ This is a class method used to declare new class data accessors. A new
+ accessor will be created in the Class using the name from
+ $data_accessor_name, and optionally initially setting it to the given
+ value.
+
+ To facilitate overriding, mk_classaccessor creates an alias to the
+ accessor, _field_accessor(). So Suitcase() would have an alias
+ _Suitcase_accessor() that does the exact same thing as Suitcase(). This
+ is useful if you want to alter the behavior of a single accessor yet
+ still get the benefits of inheritable class data. For example.
+
+ sub Suitcase {
+ my($self) = shift;
+ warn "Fashion tragedy" if @_ and $_[0] eq 'Plaid';
+
+ $self->_Suitcase_accessor(@_);
+ }
+
+ Overriding accessors does not work in the same class as you declare the
+ accessor in. It only works in subclasses due to the fact that
+ subroutines are loaded at compile time and accessors are loaded at
+ runtime, thus overriding any subroutines with the same name in the same
+ class.
+
+ mk_classaccessors(@accessornames)
+ Takes a list of names and generates an accessor for each name in the
+ list using "mk_classaccessor".
+
+AUTHORS
+ Based on the creative stylings of Damian Conway, Michael G Schwern, Tony
+ Bowden (Class::Data::Inheritable) and Michael G Schwern, Marty Pauley
+ (Class::Accessor).
+
+ Coded by Matt S Trout Tweaks by Christopher H. Laco.
+
+BUGS and QUERIES
+ If your object isn't hash-based, this will currently break. My
+ modifications aren't exactly sophisticated so far.
+
+ mstrout at cpan.org or bug me on irc.perl.org, nick mst claco at cpan.org or
+ irc.perl.org, nick claco
+
+LICENSE
+ This module is free software. It may be used, redistributed and/or
+ modified under the terms of the Perl Artistic License (see
+ http://www.perl.com/perl/misc/Artistic.html)
+
+SEE ALSO
+ perltootc has a very elaborate discussion of class data in Perl.
+ Class::Accessor, Class::Data::Inheritable
+
Modified: packages/libclass-data-accessor-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/debian/changelog?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/debian/changelog (original)
+++ packages/libclass-data-accessor-perl/trunk/debian/changelog Wed May 9 10:02:01 2007
@@ -1,3 +1,10 @@
+libclass-data-accessor-perl (0.04000-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/rules - converted for using Module::AutoInstall
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org> Wed, 09 May 2007 11:59:26 +0200
+
libclass-data-accessor-perl (0.03-1) unstable; urgency=low
* New upstream release
Modified: packages/libclass-data-accessor-perl/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/debian/rules?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/debian/rules (original)
+++ packages/libclass-data-accessor-perl/trunk/debian/rules Wed May 9 10:02:01 2007
@@ -1,14 +1,4 @@
#!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
-#
-# It was later modified by Jason Kohles <email at jasonkohles.com>
-# http://www.jasonkohles.com/ to support Module::Build installed modules
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
# If set to a true value then MakeMaker's prompt function will
# always return the default without waiting for user input.
@@ -25,20 +15,14 @@
build: build-stamp
build-stamp:
dh_testdir
-
- # Add commands to compile the package here
- $(PERL) Build.PL installdirs=vendor
- OPTIMIZE="-Wall -O2 -g" $(PERL) Build
-
+ $(PERL) Makefile.PL INSTALLDIRS=vendor
+ $(MAKE) OPTIMIZE="-Wall -O2 -g"
touch build-stamp
clean:
dh_testdir
dh_testroot
-
- # Add commands to clean up after the build process here
- [ ! -f Build ] || $(PERL) Build distclean
-
+ -$(MAKE) distclean
dh_clean build-stamp install-stamp
install: build install-stamp
@@ -46,11 +30,8 @@
dh_testdir
dh_testroot
dh_clean -k
-
- # Add commands to install the package into debian/$PACKAGE_NAME here
- $(PERL) Build test
- $(PERL) Build install destdir=$(TMP)
-
+ $(MAKE) test
+ $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
touch install-stamp
binary-arch:
@@ -59,9 +40,7 @@
binary-indep: build install
dh_testdir
dh_testroot
-# dh_installcron
-# dh_installmenu
-# dh_installexamples
+ dh_installexamples
dh_installdocs README
dh_installchangelogs Changes
dh_perl
Modified: packages/libclass-data-accessor-perl/trunk/lib/Class/Data/Accessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-data-accessor-perl/trunk/lib/Class/Data/Accessor.pm?rev=5357&op=diff
==============================================================================
--- packages/libclass-data-accessor-perl/trunk/lib/Class/Data/Accessor.pm (original)
+++ packages/libclass-data-accessor-perl/trunk/lib/Class/Data/Accessor.pm Wed May 9 10:02:01 2007
@@ -1,214 +1,216 @@
-package Class::Data::Accessor;
-use strict qw(vars subs);
-use Carp;
-use vars qw($VERSION);
-$VERSION = '0.03';
-
-sub mk_classaccessor {
- my ($declaredclass, $attribute, $data) = @_;
-
- if( ref $declaredclass ) {
- croak("mk_classaccessor() is a class method, not an object method");
- }
-
- if( $attribute eq 'DESTROY' ) {
- carp("Having a data accessor named DESTROY in '$declaredclass' is unwise.");
- }
-
- my $accessor = sub {
- if (ref $_[0]) {
- return $_[0]->{$attribute} = $_[1] if @_ > 1;
- return $_[0]->{$attribute} if exists $_[0]->{$attribute};
- }
-
- my $wantclass = ref($_[0]) || $_[0];
-
- return $wantclass->mk_classaccessor($attribute)->(@_)
- if @_>1 && $wantclass ne $declaredclass;
-
- $data = $_[1] if @_>1;
- return $data;
- };
-
- no warnings qw/redefine/;
- my $alias = "_${attribute}_accessor";
- *{$declaredclass.'::'.$attribute} = $accessor;
- *{$declaredclass.'::'.$alias} = $accessor;
-}
-
-sub mk_classaccessors {
- my ($declaredclass, @attributes) = @_;
-
- foreach my $attribute (@attributes) {
- $declaredclass->mk_classaccessor($attribute);
- }
-};
-
-__END__
-
-=head1 NAME
-
-Class::Data::Accessor - Inheritable, overridable class and instance data accessor creation
-
-=head1 SYNOPSIS
-
- package Stuff;
- use base qw(Class::Data::Accessor);
-
- # Set up DataFile as inheritable class data.
- Stuff->mk_classaccessor('DataFile');
-
- # Declare the location of the data file for this class.
- Stuff->DataFile('/etc/stuff/data');
-
- # Or, all in one shot:
- Stuff->mk_classaccessor(DataFile => '/etc/stuff/data');
-
-
- Stuff->DataFile; # returns /etc/stuff/data
-
- my $stuff = Stuff->new; # your new, not ours
-
- $stuff->DataFile; # returns /etc/stuff/data
-
- $stuff->DataFile('/etc/morestuff'); # sets it on the object
-
- Stuff->DataFile; # still returns /etc/stuff/data
-
-=head1 DESCRIPTION
-
-Class::Data::Accessor is the marriage of L<Class::Accessor> and
-L<Class::Data::Inheritable> into a single module. It is used for creating
-accessors to class data that overridable in subclasses as well as in
-class instances.
-
-For example:
-
- Pere::Ubu->mk_classaccessor('Suitcase');
-
-will generate the method Suitcase() in the class Pere::Ubu.
-
-This new method can be used to get and set a piece of class data.
-
- Pere::Ubu->Suitcase('Red');
- $suitcase = Pere::Ubu->Suitcase;
-
-Taking this one step further, you can make a subclass that inherits from
-Pere::Ubu:
-
- package Raygun;
- use base qw(Pere::Ubu);
-
- # Raygun's suitcase is Red.
- $suitcase = Raygun->Suitcase;
-
-Raygun inherits its Suitcase class data from Pere::Ubu.
-
-Inheritance of class data works analogous to method inheritance. As
-long as Raygun does not "override" its inherited class data (by using
-Suitcase() to set a new value) it will continue to use whatever is set
-in Pere::Ubu and inherit further changes:
-
- # Both Raygun's and Pere::Ubu's suitcases are now Blue
- Pere::Ubu->Suitcase('Blue');
-
-However, should Raygun decide to set its own Suitcase() it has now
-"overridden" Pere::Ubu and is on its own, just like if it had
-overridden a method:
-
- # Raygun has an orange suitcase, Pere::Ubu's is still Blue.
- Raygun->Suitcase('Orange');
-
-Now that Raygun has overridden Pere::Ubu, further changes by Pere::Ubu
-no longer effect Raygun.
-
- # Raygun still has an orange suitcase, but Pere::Ubu is using Samsonite.
- Pere::Ubu->Suitcase('Samsonite');
-
-You can also override this class data on a per-object basis.
-If $obj isa Pere::Ubu then
-
- $obj->Suitcase; # will return Samsonite
-
- $obj->Suitcase('Purple'); # will set Suitcase *for this object only*
-
-And after you've done that,
-
- $obj->Suitcase; # will return Purple
-
-but
-
- Pere::Ubu->Suitcase; # will still return Samsonite
-
-If you don't want this behaviour use L<Class::Data::Inheritable> instead.
-
-C<mk_classaccessor> will die if used as an object method instead of as a
-class method.
-
-=head1 METHODS
-
-=head2 mk_classaccessor
-
- Class->mk_classaccessor($data_accessor_name);
- Class->mk_classaccessor($data_accessor_name => $value);
-
-This is a class method used to declare new class data accessors.
-A new accessor will be created in the Class using the name from
-$data_accessor_name, and optionally initially setting it to the given
-value.
-
-To facilitate overriding, mk_classaccessor creates an alias to the
-accessor, _field_accessor(). So Suitcase() would have an alias
-_Suitcase_accessor() that does the exact same thing as Suitcase().
-This is useful if you want to alter the behavior of a single accessor
-yet still get the benefits of inheritable class data. For example.
-
- sub Suitcase {
- my($self) = shift;
- warn "Fashion tragedy" if @_ and $_[0] eq 'Plaid';
-
- $self->_Suitcase_accessor(@_);
- }
-
-Overriding accessors does not work in the same class as you declare
-the accessor in. It only works in subclasses due to the fact that
-subroutines are loaded at compile time and accessors are loaded at
-runtime, thus overriding any subroutines with the same name in the
-same class.
-
-=head2 mk_classaccessors(@accessornames)
-
-Takes a list of names and generates an accessor for each name in the list using
-C<mk_classaccessor>.
-
-=head1 AUTHORS
-
-Based on the creative stylings of Damian Conway, Michael G Schwern,
-Tony Bowden (Class::Data::Inheritable) and Michael G Schwern, Marty Pauley
-(Class::Accessor).
-
-Coded by Matt S Trout
-Tweaks by Christopher H. Laco.
-
-=head1 BUGS and QUERIES
-
-If your object isn't hash-based, this will currently break. My modifications
-aren't exactly sophisticated so far.
-
-mstrout at cpan.org or bug me on irc.perl.org, nick mst
-claco at cpan.org or irc.perl.org, nick claco
-
-=head1 LICENSE
-
-This module is free software. It may be used, redistributed and/or
-modified under the terms of the Perl Artistic License (see
-http://www.perl.com/perl/misc/Artistic.html)
-
-=head1 SEE ALSO
-
-L<perltootc> has a very elaborate discussion of class data in Perl.
-L<Class::Accessor>, L<Class::Data::Inheritable>
-
-=cut
-
-1;
+package Class::Data::Accessor;
+use strict;
+use warnings;
+use Carp;
+use vars qw($VERSION);
+$VERSION = '0.04000';
+
+sub mk_classaccessor {
+ my ($declaredclass, $attribute, $data) = @_;
+
+ if( ref $declaredclass ) {
+ croak("mk_classaccessor() is a class method, not an object method");
+ }
+
+ if( $attribute eq 'DESTROY' ) {
+ carp("Having a data accessor named DESTROY in '$declaredclass' is unwise.");
+ }
+
+ my $accessor = sub {
+ if (ref $_[0]) {
+ return $_[0]->{$attribute} = $_[1] if @_ > 1;
+ return $_[0]->{$attribute} if exists $_[0]->{$attribute};
+ }
+
+ my $wantclass = ref($_[0]) || $_[0];
+
+ return $wantclass->mk_classaccessor($attribute)->(@_)
+ if @_>1 && $wantclass ne $declaredclass;
+
+ $data = $_[1] if @_>1;
+ return $data;
+ };
+
+ no warnings qw/redefine/;
+ no strict qw/refs/;
+ my $alias = "_${attribute}_accessor";
+ *{$declaredclass.'::'.$attribute} = $accessor;
+ *{$declaredclass.'::'.$alias} = $accessor;
+}
+
+sub mk_classaccessors {
+ my ($declaredclass, @attributes) = @_;
+
+ foreach my $attribute (@attributes) {
+ $declaredclass->mk_classaccessor($attribute);
+ }
+};
+
+__END__
+
+=head1 NAME
+
+Class::Data::Accessor - Inheritable, overridable class and instance data accessor creation
+
+=head1 SYNOPSIS
+
+ package Stuff;
+ use base qw(Class::Data::Accessor);
+
+ # Set up DataFile as inheritable class data.
+ Stuff->mk_classaccessor('DataFile');
+
+ # Declare the location of the data file for this class.
+ Stuff->DataFile('/etc/stuff/data');
+
+ # Or, all in one shot:
+ Stuff->mk_classaccessor(DataFile => '/etc/stuff/data');
+
+
+ Stuff->DataFile; # returns /etc/stuff/data
+
+ my $stuff = Stuff->new; # your new, not ours
+
+ $stuff->DataFile; # returns /etc/stuff/data
+
+ $stuff->DataFile('/etc/morestuff'); # sets it on the object
+
+ Stuff->DataFile; # still returns /etc/stuff/data
+
+=head1 DESCRIPTION
+
+Class::Data::Accessor is the marriage of L<Class::Accessor> and
+L<Class::Data::Inheritable> into a single module. It is used for creating
+accessors to class data that overridable in subclasses as well as in
+class instances.
+
+For example:
+
+ Pere::Ubu->mk_classaccessor('Suitcase');
+
+will generate the method Suitcase() in the class Pere::Ubu.
+
+This new method can be used to get and set a piece of class data.
+
+ Pere::Ubu->Suitcase('Red');
+ $suitcase = Pere::Ubu->Suitcase;
+
+Taking this one step further, you can make a subclass that inherits from
+Pere::Ubu:
+
+ package Raygun;
+ use base qw(Pere::Ubu);
+
+ # Raygun's suitcase is Red.
+ $suitcase = Raygun->Suitcase;
+
+Raygun inherits its Suitcase class data from Pere::Ubu.
+
+Inheritance of class data works analogous to method inheritance. As
+long as Raygun does not "override" its inherited class data (by using
+Suitcase() to set a new value) it will continue to use whatever is set
+in Pere::Ubu and inherit further changes:
+
+ # Both Raygun's and Pere::Ubu's suitcases are now Blue
+ Pere::Ubu->Suitcase('Blue');
+
+However, should Raygun decide to set its own Suitcase() it has now
+"overridden" Pere::Ubu and is on its own, just like if it had
+overridden a method:
+
+ # Raygun has an orange suitcase, Pere::Ubu's is still Blue.
+ Raygun->Suitcase('Orange');
+
+Now that Raygun has overridden Pere::Ubu, further changes by Pere::Ubu
+no longer effect Raygun.
+
+ # Raygun still has an orange suitcase, but Pere::Ubu is using Samsonite.
+ Pere::Ubu->Suitcase('Samsonite');
+
+You can also override this class data on a per-object basis.
+If $obj isa Pere::Ubu then
+
+ $obj->Suitcase; # will return Samsonite
+
+ $obj->Suitcase('Purple'); # will set Suitcase *for this object only*
+
+And after you've done that,
+
+ $obj->Suitcase; # will return Purple
+
+but
+
+ Pere::Ubu->Suitcase; # will still return Samsonite
+
+If you don't want this behaviour use L<Class::Data::Inheritable> instead.
+
+C<mk_classaccessor> will die if used as an object method instead of as a
+class method.
+
+=head1 METHODS
+
+=head2 mk_classaccessor
+
+ Class->mk_classaccessor($data_accessor_name);
+ Class->mk_classaccessor($data_accessor_name => $value);
+
+This is a class method used to declare new class data accessors.
+A new accessor will be created in the Class using the name from
+$data_accessor_name, and optionally initially setting it to the given
+value.
+
+To facilitate overriding, mk_classaccessor creates an alias to the
+accessor, _field_accessor(). So Suitcase() would have an alias
+_Suitcase_accessor() that does the exact same thing as Suitcase().
+This is useful if you want to alter the behavior of a single accessor
+yet still get the benefits of inheritable class data. For example.
+
+ sub Suitcase {
+ my($self) = shift;
+ warn "Fashion tragedy" if @_ and $_[0] eq 'Plaid';
+
+ $self->_Suitcase_accessor(@_);
+ }
+
+Overriding accessors does not work in the same class as you declare
+the accessor in. It only works in subclasses due to the fact that
+subroutines are loaded at compile time and accessors are loaded at
+runtime, thus overriding any subroutines with the same name in the
+same class.
+
+=head2 mk_classaccessors(@accessornames)
+
+Takes a list of names and generates an accessor for each name in the list using
+C<mk_classaccessor>.
+
+=head1 AUTHORS
+
+Based on the creative stylings of Damian Conway, Michael G Schwern,
+Tony Bowden (Class::Data::Inheritable) and Michael G Schwern, Marty Pauley
+(Class::Accessor).
+
+Coded by Matt S Trout
+Tweaks by Christopher H. Laco.
+
+=head1 BUGS and QUERIES
+
+If your object isn't hash-based, this will currently break. My modifications
+aren't exactly sophisticated so far.
+
+mstrout at cpan.org or bug me on irc.perl.org, nick mst
+claco at cpan.org or irc.perl.org, nick claco
+
+=head1 LICENSE
+
+This module is free software. It may be used, redistributed and/or
+modified under the terms of the Perl Artistic License (see
+http://www.perl.com/perl/misc/Artistic.html)
+
+=head1 SEE ALSO
+
+L<perltootc> has a very elaborate discussion of class data in Perl.
+L<Class::Accessor>, L<Class::Data::Inheritable>
+
+=cut
+
+1;
More information about the Pkg-perl-cvs-commits
mailing list