Skip to content

Commit

Permalink
Use Moose stuff if it's loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
sartak committed Feb 3, 2009
1 parent ec51645 commit 058e72e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Any/Moose.pm
Expand Up @@ -72,8 +72,11 @@ sub any_moose {
return $fragment if $INC{'Class/MOP.pm'}
&& Class::MOP::does_metaclass_exist($package);

# If we're loading up the backing class, then give them Mouse
return 'Mouse' if $fragment eq 'Moose';
# If we're loading up the backing class...
if ($fragment eq 'Moose') {
return 'Moose' if $INC{'Class/MOP.pm'};
return 'Mouse';
}

require Carp;
Carp::croak "Neither Moose nor Mouse backs the '$package' package.";
Expand Down

0 comments on commit 058e72e

Please sign in to comment.