r3277 - in /packages/libmoose-perl/branches/upstream/current:
Build.PL
Changes MANIFEST META.yml Makefile.PL README lib/Moose.pm t/000_load.t
t/018_import_unimport.t t/202_example_Moose_POOP.t
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Fri Jul 14 20:16:05 UTC 2006
Author: gregoa-guest
Date: Fri Jul 14 20:16:04 2006
New Revision: 3277
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=3277
Log:
Load /tmp/tmp.SmisdC7740/libmoose-perl-0.11 into
packages/libmoose-perl/branches/upstream/current.
Added:
packages/libmoose-perl/branches/upstream/current/t/018_import_unimport.t
Modified:
packages/libmoose-perl/branches/upstream/current/Build.PL
packages/libmoose-perl/branches/upstream/current/Changes
packages/libmoose-perl/branches/upstream/current/MANIFEST
packages/libmoose-perl/branches/upstream/current/META.yml
packages/libmoose-perl/branches/upstream/current/Makefile.PL
packages/libmoose-perl/branches/upstream/current/README
packages/libmoose-perl/branches/upstream/current/lib/Moose.pm
packages/libmoose-perl/branches/upstream/current/t/000_load.t
packages/libmoose-perl/branches/upstream/current/t/202_example_Moose_POOP.t
Modified: packages/libmoose-perl/branches/upstream/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/Build.PL?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/Build.PL (original)
+++ packages/libmoose-perl/branches/upstream/current/Build.PL Fri Jul 14 20:16:04 2006
@@ -12,7 +12,8 @@
'Sub::Name' => '0.02',
'UNIVERSAL::require' => '0.10',
'Sub::Exporter' => '0.954',
- 'Sub::Install' => '0.92',
+ 'Sub::Install' => '0.92',
+ 'B' => '0',
},
optional => {
},
Modified: packages/libmoose-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/Changes?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/Changes (original)
+++ packages/libmoose-perl/branches/upstream/current/Changes Fri Jul 14 20:16:04 2006
@@ -1,4 +1,14 @@
Revision history for Perl extension Moose
+
+0.11 Wed. July 12, 2006
+ * Moose
+ - added an &unimport method to remove all the keywords
+ that Moose will import, simply add 'no Moose' to the
+ bottom of your class file.
+
+ * t/
+ - fixed some test failures caused by a forgotten test
+ dependency.
0.10 Thurs. July 6, 2006
* Moose
@@ -12,7 +22,6 @@
but it does not yet utilize the optimizations
it makes available. Stay tuned for that ;)
-
0.09_03 Fri. June 23, 2006
++ DEVELOPER RELEASE ++
* Moose
Modified: packages/libmoose-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/MANIFEST?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/MANIFEST (original)
+++ packages/libmoose-perl/branches/upstream/current/MANIFEST Fri Jul 14 20:16:04 2006
@@ -37,6 +37,7 @@
t/015_override_and_foreign_classes.t
t/016_always_strict_warnings.t
t/017_wrapped_method_context_propagation.t
+t/018_import_unimport.t
t/020_foreign_inheritence.t
t/021_moose_w_metaclass.t
t/022_moose_respects_base.t
Modified: packages/libmoose-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/META.yml?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/META.yml (original)
+++ packages/libmoose-perl/branches/upstream/current/META.yml Fri Jul 14 20:16:04 2006
@@ -1,13 +1,14 @@
---
name: Moose
-version: 0.10
+version: 0.11
author:
- 'Stevan Little E<lt>stevan at iinteractive.comE<gt>'
- 'Christian Hansen E<lt>chansen at cpan.orgE<gt>'
- 'Yuval Kogman E<lt>nothingmuch at woobling.orgE<gt>'
-abstract: "Moose, it's the new Camel"
+abstract: A complete modern object system for Perl 5
license: perl
requires:
+ B: 0
Carp: 0
Class::MOP: 0.30
Scalar::Util: 1.18
@@ -22,7 +23,7 @@
provides:
Moose:
file: lib/Moose.pm
- version: 0.10
+ version: 0.11
Moose::Meta::Attribute:
file: lib/Moose/Meta/Attribute.pm
version: 0.06
Modified: packages/libmoose-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/Makefile.PL?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/Makefile.PL (original)
+++ packages/libmoose-perl/branches/upstream/current/Makefile.PL Fri Jul 14 20:16:04 2006
@@ -5,6 +5,7 @@
'NAME' => 'Moose',
'VERSION_FROM' => 'lib/Moose.pm',
'PREREQ_PM' => {
+ 'B' => '0',
'Carp' => '0',
'Class::MOP' => '0.30',
'Scalar::Util' => '1.18',
Modified: packages/libmoose-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/README?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/README (original)
+++ packages/libmoose-perl/branches/upstream/current/README Fri Jul 14 20:16:04 2006
@@ -1,4 +1,4 @@
-Moose version 0.10
+Moose version 0.11
===========================
See the individual module documentation for more information
@@ -22,6 +22,7 @@
Sub::Name
UNIVERSAL::require
Sub::Exporter
+ B
COPYRIGHT AND LICENCE
Modified: packages/libmoose-perl/branches/upstream/current/lib/Moose.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/lib/Moose.pm?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/lib/Moose.pm (original)
+++ packages/libmoose-perl/branches/upstream/current/lib/Moose.pm Fri Jul 14 20:16:04 2006
@@ -4,11 +4,12 @@
use strict;
use warnings;
-our $VERSION = '0.10';
+our $VERSION = '0.11';
use Scalar::Util 'blessed', 'reftype';
use Carp 'confess';
use Sub::Name 'subname';
+use B 'svref_2object';
use UNIVERSAL::require;
use Sub::Exporter;
@@ -166,6 +167,27 @@
goto $exporter;
}
+
+ sub unimport {
+ no strict 'refs';
+ my $class = caller();
+ # loop through the exports ...
+ foreach my $name (keys %exports) {
+
+ # if we find one ...
+ if (defined &{$class . '::' . $name}) {
+ my $keyword = \&{$class . '::' . $name};
+
+ # make sure it is from Moose
+ my $pkg_name = eval { svref_2object($keyword)->GV->STASH->NAME };
+ next if $@;
+ next if $pkg_name ne 'Moose';
+
+ # and if it is from Moose then undef the slot
+ delete ${$class . '::'}{$name};
+ }
+ }
+ }
}
## Utility functions
@@ -200,7 +222,7 @@
=head1 NAME
-Moose - Moose, it's the new Camel
+Moose - A complete modern object system for Perl 5
=head1 SYNOPSIS
@@ -442,6 +464,27 @@
=back
+=head1 UNEXPORTING FUNCTIONS
+
+=head2 B<unimport>
+
+Moose offers a way of removing the keywords it exports though the C<unimport>
+method. You simply have to say C<no Moose> at the bottom of your code for this
+to work. Here is an example:
+
+ package Person;
+ use Moose;
+
+ has 'first_name' => (is => 'rw', isa => 'Str');
+ has 'last_name' => (is => 'rw', isa => 'Str');
+
+ sub full_name {
+ my $self = shift;
+ $self->first_name . ' ' . $self->last_name
+ }
+
+ no Moose; # keywords are removed from the Person package
+
=head1 FUTURE PLANS
Here is just a sampling of the plans we have in store for Moose:
Modified: packages/libmoose-perl/branches/upstream/current/t/000_load.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/t/000_load.t?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/t/000_load.t (original)
+++ packages/libmoose-perl/branches/upstream/current/t/000_load.t Fri Jul 14 20:16:04 2006
@@ -7,4 +7,4 @@
BEGIN {
use_ok('Moose');
-}
+}
Added: packages/libmoose-perl/branches/upstream/current/t/018_import_unimport.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/t/018_import_unimport.t?rev=3277&op=file
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/t/018_import_unimport.t (added)
+++ packages/libmoose-perl/branches/upstream/current/t/018_import_unimport.t Fri Jul 14 20:16:04 2006
@@ -1,0 +1,38 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 23;
+
+BEGIN {
+ use_ok('Moose');
+}
+
+my @moose_exports = qw(
+ extends with
+ has
+ before after around
+ override super
+ augment inner
+);
+
+{
+ package Foo;
+}
+
+eval q{
+ package Foo;
+ use Moose;
+};
+ok(!$@, '... Moose succesfully exported into Foo');
+
+can_ok('Foo', $_) for @moose_exports;
+
+eval q{
+ package Foo;
+ no Moose;
+};
+ok(!$@, '... Moose succesfully un-exported from Foo');
+
+ok(!Foo->can($_), '... Foo can no longer do ' . $_) for @moose_exports;
Modified: packages/libmoose-perl/branches/upstream/current/t/202_example_Moose_POOP.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmoose-perl/branches/upstream/current/t/202_example_Moose_POOP.t?rev=3277&op=diff
==============================================================================
--- packages/libmoose-perl/branches/upstream/current/t/202_example_Moose_POOP.t (original)
+++ packages/libmoose-perl/branches/upstream/current/t/202_example_Moose_POOP.t Fri Jul 14 20:16:04 2006
@@ -6,8 +6,8 @@
use Test::More;
BEGIN {
- eval "use DBM::Deep;";
- plan skip_all => "DBM::Deep required for this test" if $@;
+ eval "use DBM::Deep 0.983; use DateTime::Format::MySQL;";
+ plan skip_all => "DBM::Deep and DateTime::Format::MySQL required for this test" if $@;
plan tests => 89;
}
More information about the Pkg-perl-cvs-commits
mailing list