r35727 - in /branches/upstream/libany-moose-perl/current: Changes META.yml Makefile.PL README dist.ini lib/Any/Moose.pm t/003-is_moose_loaded.t
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Tue May 19 00:32:23 UTC 2009
Author: ryan52-guest
Date: Tue May 19 00:32:18 2009
New Revision: 35727
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35727
Log:
[svn-upgrade] Integrating new upstream version, libany-moose-perl (0.08)
Modified:
branches/upstream/libany-moose-perl/current/Changes
branches/upstream/libany-moose-perl/current/META.yml
branches/upstream/libany-moose-perl/current/Makefile.PL
branches/upstream/libany-moose-perl/current/README
branches/upstream/libany-moose-perl/current/dist.ini
branches/upstream/libany-moose-perl/current/lib/Any/Moose.pm
branches/upstream/libany-moose-perl/current/t/003-is_moose_loaded.t
Modified: branches/upstream/libany-moose-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libany-moose-perl/current/Changes?rev=35727&op=diff
==============================================================================
--- branches/upstream/libany-moose-perl/current/Changes (original)
+++ branches/upstream/libany-moose-perl/current/Changes Tue May 19 00:32:18 2009
@@ -1,3 +1,9 @@
+0.08 Mon 18 May 2009
+ * Add moose_is_preferred and mouse_is_preferred functions for when you
+ need to care about which backend is in use (Sartak)
+ * Deprecate the internal is_moose_loaded in favor of moose_is_preferred
+ (Sartak)
+
0.07 Fri, 10 Apr 2009
* Depend on Mouse 0.20 for better compatibility with Moose >= 0.74 (rafl).
Modified: branches/upstream/libany-moose-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libany-moose-perl/current/META.yml?rev=35727&op=diff
==============================================================================
--- branches/upstream/libany-moose-perl/current/META.yml (original)
+++ branches/upstream/libany-moose-perl/current/META.yml Tue May 19 00:32:18 2009
@@ -10,4 +10,4 @@
name: Any-Moose
requires:
Mouse: 0.20
-version: 0.07
+version: 0.08
Modified: branches/upstream/libany-moose-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libany-moose-perl/current/Makefile.PL?rev=35727&op=diff
==============================================================================
--- branches/upstream/libany-moose-perl/current/Makefile.PL (original)
+++ branches/upstream/libany-moose-perl/current/Makefile.PL Tue May 19 00:32:18 2009
@@ -9,7 +9,7 @@
NAME => 'Any::Moose',
AUTHOR => 'Shawn\ M\ Moore\ \<sartak\@bestpractical\.com\>\,\ Florian\ Ragwitz\ \<rafl\@debian\.org\>\,\ Stevan\ Little\ \<stevan\@iinteractive\.com\>\,\ Tokuhiro\ Matsuno\ \<tokuhirom\@gmail\.com\>',
ABSTRACT => 'use Moose or Mouse modules',
- VERSION => '0.07',
+ VERSION => '0.08',
EXE_FILES => [ qw() ],
(eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
PREREQ_PM => {
Modified: branches/upstream/libany-moose-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libany-moose-perl/current/README?rev=35727&op=diff
==============================================================================
--- branches/upstream/libany-moose-perl/current/README (original)
+++ branches/upstream/libany-moose-perl/current/README Tue May 19 00:32:18 2009
@@ -1,7 +1,7 @@
This archive contains the distribution Any-Moose, version
-0.07:
+0.08:
use Moose or Mouse modules
Modified: branches/upstream/libany-moose-perl/current/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libany-moose-perl/current/dist.ini?rev=35727&op=diff
==============================================================================
--- branches/upstream/libany-moose-perl/current/dist.ini (original)
+++ branches/upstream/libany-moose-perl/current/dist.ini Tue May 19 00:32:18 2009
@@ -1,5 +1,5 @@
name = Any-Moose
-version = 0.07
+version = 0.08
author = Shawn M Moore <sartak at bestpractical.com>
author = Florian Ragwitz <rafl at debian.org>
author = Stevan Little <stevan at iinteractive.com>
Modified: branches/upstream/libany-moose-perl/current/lib/Any/Moose.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libany-moose-perl/current/lib/Any/Moose.pm?rev=35727&op=diff
==============================================================================
--- branches/upstream/libany-moose-perl/current/lib/Any/Moose.pm (original)
+++ branches/upstream/libany-moose-perl/current/lib/Any/Moose.pm Tue May 19 00:32:18 2009
@@ -1,5 +1,5 @@
package Any::Moose;
-our $VERSION = '0.07';
+our $VERSION = '0.08';
# ABSTRACT: use Moose or Mouse modules
@@ -57,7 +57,7 @@
return 'Mouse::Role' if $INC{'Mouse/Role.pm'}
&& Mouse::Meta::Role->_metaclass_cache($pkg);
- if (is_moose_loaded()) {
+ if (_is_moose_loaded()) {
my $meta = Class::MOP::get_metaclass_by_name($pkg);
if ($meta) {
return 'Moose::Role' if $meta->isa('Moose::Meta::Role');
@@ -117,13 +117,13 @@
# If we're loading up the backing class...
if ($fragment eq 'Moose' || $fragment eq 'Moose::Role') {
if (!$PREFERRED) {
- $PREFERRED = is_moose_loaded() ? 'Moose' : 'Mouse';
+ $PREFERRED = _is_moose_loaded() ? 'Moose' : 'Mouse';
(my $file = $PREFERRED . '.pm') =~ s{::}{/}g;
require $file;
}
- $fragment =~ s/^Moose/Mouse/ if $PREFERRED eq 'Mouse';
+ $fragment =~ s/^Moose/Mouse/ if mouse_is_preferred();
return $fragment;
}
@@ -133,19 +133,25 @@
sub load_class {
my ($class_name) = @_;
- return Class::MOP::load_class($class_name)
- if is_moose_loaded();
+ return Class::MOP::load_class($class_name) if moose_is_preferred();
return Mouse::load_class($class_name);
}
sub is_class_loaded {
my ($class_name) = @_;
- return Class::MOP::is_class_loaded($class_name)
- if is_moose_loaded();
+ return Class::MOP::is_class_loaded($class_name) if moose_is_preferred();
return Mouse::is_class_loaded($class_name);
}
-sub is_moose_loaded { !!$INC{'Class/MOP.pm'} }
+sub moose_is_preferred { $PREFERRED eq 'Moose' }
+sub mouse_is_preferred { $PREFERRED eq 'Mouse' }
+
+sub _is_moose_loaded { !!$INC{'Class/MOP.pm'} }
+
+sub is_moose_loaded {
+ Carp::carp("Any::Moose::is_moose_loaded is deprecated. Please use Any::Moose::moose_is_preferred instead");
+ goto \&_is_moose_loaded;
+}
sub _canonicalize_fragment {
my $fragment = shift;
@@ -180,7 +186,7 @@
=head1 VERSION
-version 0.07
+version 0.08
=head1 SYNOPSIS
Modified: branches/upstream/libany-moose-perl/current/t/003-is_moose_loaded.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libany-moose-perl/current/t/003-is_moose_loaded.t?rev=35727&op=diff
==============================================================================
--- branches/upstream/libany-moose-perl/current/t/003-is_moose_loaded.t (original)
+++ branches/upstream/libany-moose-perl/current/t/003-is_moose_loaded.t Tue May 19 00:32:18 2009
@@ -8,7 +8,7 @@
package Test;
BEGIN {
::use_ok('Any::Moose');
- ::ok(!Any::Moose::is_moose_loaded(), '... Moose is not loaded');
+ ::ok(!Any::Moose::_is_moose_loaded(), '... Moose is not loaded');
}
{
@@ -18,7 +18,7 @@
eval 'use Moose';
::skip 'Moose not installed', 1 if $@;
- ::ok(Any::Moose::is_moose_loaded(), '... Moose is loaded');
+ ::ok(Any::Moose::_is_moose_loaded(), '... Moose is loaded');
}
}
}
More information about the Pkg-perl-cvs-commits
mailing list