From 5ac2026f7eed78958d69d051e7a8e993dcf51205 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Sat, 6 Jun 2015 17:50:16 +0000 Subject: Moose-2.1405 --- Changes | 4593 +++++++++++ Changes.Class-MOP | 1800 +++++ LICENSE | 379 + MANIFEST | 1042 +++ META.json | 2575 ++++++ META.yml | 1879 +++++ Makefile.PL | 246 + README.md | 10 + TODO | 488 ++ author/docGenerator.pl | 279 + author/extract-inline-tests | 47 + author/find-dupe-test-numbers | 23 + benchmarks/caf_vs_moose.pl | 85 + benchmarks/cmop/all.yml | 29 + benchmarks/cmop/foo.pl | 5 + benchmarks/cmop/lib/Bench/Accessor.pm | 49 + benchmarks/cmop/lib/Bench/Construct.pm | 36 + benchmarks/cmop/lib/Bench/Run.pm | 55 + benchmarks/cmop/lib/MOP/Immutable/Point.pm | 21 + benchmarks/cmop/lib/MOP/Immutable/Point3D.pm | 22 + benchmarks/cmop/lib/MOP/Installed/Point.pm | 26 + benchmarks/cmop/lib/MOP/Installed/Point3D.pm | 22 + benchmarks/cmop/lib/MOP/Point.pm | 24 + benchmarks/cmop/lib/MOP/Point3D.pm | 20 + benchmarks/cmop/lib/Plain/Point.pm | 44 + benchmarks/cmop/lib/Plain/Point3D.pm | 35 + benchmarks/cmop/loading-benchmark.pl | 27 + benchmarks/cmop/profile.pl | 25 + benchmarks/cmop/run_yml.pl | 18 + benchmarks/immutable.pl | 99 + benchmarks/lotsa-classes.pl | 78 + benchmarks/method_modifiers.pl | 116 + benchmarks/moose_bench.pl | 152 + benchmarks/simple_class.pl | 31 + benchmarks/simple_compile.pl | 34 + benchmarks/simple_constructor.pl | 26 + benchmarks/type_constraints.pl | 53 + benchmarks/type_constraints2.pl | 153 + bin/moose-outdated | 22 + dist.ini | 464 ++ doc/moosex-compile | 176 + inc/CheckAuthorDeps.pm | 52 + inc/CheckDelta.pm | 18 + inc/CheckReleaseType.pm | 37 + inc/Clean.pm | 50 + inc/ExtractInlineTests.pm | 58 + inc/GenerateDocs.pm | 57 + inc/GitUpToDate.pm | 52 + inc/MMHelper.pm | 79 + inc/MakeMaker.pm | 96 + inc/MyInline.pm | 98 + inc/SimpleAuthority.pm | 13 + inc/SimpleProvides.pm | 34 + inc/TestRelease.pm | 17 + lib/Class/MOP.pm | 1232 +++ lib/Class/MOP/Attribute.pm | 1100 +++ lib/Class/MOP/Class.pm | 2312 ++++++ lib/Class/MOP/Class/Immutable/Trait.pm | 172 + lib/Class/MOP/Deprecated.pm | 95 + lib/Class/MOP/Instance.pm | 533 ++ lib/Class/MOP/Method.pm | 343 + lib/Class/MOP/Method/Accessor.pm | 409 + lib/Class/MOP/Method/Constructor.pm | 251 + lib/Class/MOP/Method/Generated.pm | 142 + lib/Class/MOP/Method/Inlined.pm | 195 + lib/Class/MOP/Method/Meta.pm | 169 + lib/Class/MOP/Method/Wrapped.pm | 331 + lib/Class/MOP/MiniTrait.pm | 113 + lib/Class/MOP/Mixin.pm | 111 + lib/Class/MOP/Mixin/AttributeCore.pm | 125 + lib/Class/MOP/Mixin/HasAttributes.pm | 171 + lib/Class/MOP/Mixin/HasMethods.pm | 304 + lib/Class/MOP/Mixin/HasOverloads.pm | 237 + lib/Class/MOP/Module.pm | 213 + lib/Class/MOP/Object.pm | 200 + lib/Class/MOP/Overload.pm | 342 + lib/Class/MOP/Package.pm | 464 ++ lib/Moose.pm | 1277 +++ lib/Moose/Conflicts.pm | 113 + lib/Moose/Cookbook.pod | 289 + .../BankAccount_MethodModifiersAndSubclassing.pod | 384 + .../Basics/BinaryTree_AttributeFeatures.pod | 397 + .../Basics/BinaryTree_BuilderAndLazyBuild.pod | 176 + lib/Moose/Cookbook/Basics/Company_Subtypes.pod | 602 ++ .../Basics/DateTime_ExtendingNonMooseParent.pod | 134 + .../Cookbook/Basics/Document_AugmentAndInner.pod | 197 + .../Genome_OverloadingSubtypesAndCoercion.pod | 325 + .../Cookbook/Basics/HTTP_SubtypesAndCoercion.pod | 345 + lib/Moose/Cookbook/Basics/Immutable.pod | 99 + .../Cookbook/Basics/Person_BUILDARGSAndBUILD.pod | 180 + .../Basics/Point_AttributesAndSubclassing.pod | 489 ++ .../Cookbook/Extending/Debugging_BaseClassRole.pod | 152 + lib/Moose/Cookbook/Extending/ExtensionOverview.pod | 404 + .../Cookbook/Extending/Mooseish_MooseSugar.pod | 160 + .../Legacy/Debugging_BaseClassReplacement.pod | 182 + .../Cookbook/Legacy/Labeled_AttributeMetaclass.pod | 337 + lib/Moose/Cookbook/Legacy/Table_ClassMetaclass.pod | 132 + .../Cookbook/Meta/GlobRef_InstanceMetaclass.pod | 304 + lib/Moose/Cookbook/Meta/Labeled_AttributeTrait.pod | 325 + .../Meta/PrivateOrPublic_MethodMetaclass.pod | 224 + lib/Moose/Cookbook/Meta/Table_MetaclassTrait.pod | 156 + lib/Moose/Cookbook/Meta/WhyMeta.pod | 117 + lib/Moose/Cookbook/Roles/ApplicationToInstance.pod | 191 + lib/Moose/Cookbook/Roles/Comparable_CodeReuse.pod | 379 + .../Roles/Restartable_AdvancedComposition.pod | 230 + lib/Moose/Cookbook/Snack/Keywords.pod | 240 + lib/Moose/Cookbook/Snack/Types.pod | 130 + lib/Moose/Cookbook/Style.pod | 77 + lib/Moose/Deprecated.pm | 98 + lib/Moose/Exception.pm | 206 + lib/Moose/Exception/AccessorMustReadWrite.pm | 13 + ...dParameterizableTypeTakesParameterizableType.pm | 18 + .../AddRoleTakesAMooseMetaRoleInstance.pm | 18 + .../Exception/AddRoleToARoleTakesAMooseMetaRole.pm | 18 + lib/Moose/Exception/ApplyTakesABlessedInstance.pm | 18 + ...oClassNeedsAClassMOPClassInstanceOrASubclass.pm | 18 + lib/Moose/Exception/AttributeConflictInRoles.pm | 31 + .../Exception/AttributeConflictInSummation.pm | 27 + .../AttributeExtensionIsNotSupportedInRoles.pm | 18 + lib/Moose/Exception/AttributeIsRequired.pm | 28 + ...MustBeAnClassMOPMixinAttributeCoreOrSubclass.pm | 18 + lib/Moose/Exception/AttributeNamesDoNotMatch.pm | 24 + lib/Moose/Exception/AttributeValueIsNotAnObject.pm | 27 + lib/Moose/Exception/AttributeValueIsNotDefined.pm | 21 + .../Exception/AutoDeRefNeedsArrayRefOrHashRef.pm | 13 + lib/Moose/Exception/BadOptionFormat.pm | 24 + .../BothBuilderAndDefaultAreNotAllowed.pm | 18 + lib/Moose/Exception/BuilderDoesNotExist.pm | 13 + .../BuilderMethodNotSupportedForAttribute.pm | 13 + .../BuilderMethodNotSupportedForInlineAttribute.pm | 25 + lib/Moose/Exception/BuilderMustBeAMethodName.pm | 18 + .../CallingMethodOnAnImmutableInstance.pm | 18 + .../CallingReadOnlyMethodOnAnImmutableInstance.pm | 18 + lib/Moose/Exception/CanExtendOnlyClasses.pm | 14 + lib/Moose/Exception/CanOnlyConsumeRole.pm | 17 + lib/Moose/Exception/CanOnlyWrapBlessedCode.pm | 24 + lib/Moose/Exception/CanReblessOnlyIntoASubclass.pm | 14 + .../Exception/CanReblessOnlyIntoASuperclass.pm | 13 + .../CannotAddAdditionalTypeCoercionsToUnion.pm | 17 + .../Exception/CannotAddAsAnAttributeToARole.pm | 19 + .../Exception/CannotApplyBaseClassRolesToRole.pm | 12 + .../CannotAssignValueToReadOnlyAccessor.pm | 19 + .../Exception/CannotAugmentIfLocalMethodPresent.pm | 12 + lib/Moose/Exception/CannotAugmentNoSuperMethod.pm | 25 + lib/Moose/Exception/CannotAutoDerefWithoutIsa.pm | 13 + .../CannotAutoDereferenceTypeConstraint.pm | 13 + lib/Moose/Exception/CannotCalculateNativeType.pm | 13 + .../Exception/CannotCallAnAbstractBaseMethod.pm | 18 + lib/Moose/Exception/CannotCallAnAbstractMethod.pm | 11 + lib/Moose/Exception/CannotCoerceAWeakRef.pm | 13 + .../CannotCoerceAttributeWhichHasNoCoercion.pm | 16 + ...otCreateHigherOrderTypeWithoutATypeParameter.pm | 12 + .../CannotCreateMethodAliasLocalMethodIsPresent.pm | 24 + ...CreateMethodAliasLocalMethodIsPresentInClass.pm | 18 + .../CannotDelegateLocalMethodIsPresent.pm | 13 + lib/Moose/Exception/CannotDelegateWithoutIsa.pm | 12 + lib/Moose/Exception/CannotFindDelegateMetaclass.pm | 13 + lib/Moose/Exception/CannotFindType.pm | 18 + .../Exception/CannotFindTypeGivenToMatchOnType.pm | 32 + .../Exception/CannotFixMetaclassCompatibility.pm | 25 + .../Exception/CannotGenerateInlineConstraint.pm | 29 + .../CannotInitializeMooseMetaRoleComposite.pm | 29 + .../Exception/CannotInlineTypeConstraintCheck.pm | 13 + lib/Moose/Exception/CannotLocatePackageInINC.pm | 40 + .../Exception/CannotMakeMetaclassCompatible.pm | 22 + lib/Moose/Exception/CannotOverrideALocalMethod.pm | 19 + .../Exception/CannotOverrideBodyOfMetaMethods.pm | 18 + .../CannotOverrideLocalMethodIsPresent.pm | 12 + lib/Moose/Exception/CannotOverrideNoSuperMethod.pm | 25 + .../CannotRegisterUnnamedTypeConstraint.pm | 11 + .../CannotUseLazyBuildAndDefaultSimultaneously.pm | 13 + lib/Moose/Exception/CircularReferenceInAlso.pm | 30 + lib/Moose/Exception/ClassDoesNotHaveInitMeta.pm | 21 + lib/Moose/Exception/ClassDoesTheExcludedRole.pm | 21 + lib/Moose/Exception/ClassNamesDoNotMatch.pm | 24 + .../CloneObjectExpectsAnInstanceOfMetaclass.pm | 19 + lib/Moose/Exception/CodeBlockMustBeACodeRef.pm | 12 + lib/Moose/Exception/CoercingWithoutCoercions.pm | 12 + lib/Moose/Exception/CoercionAlreadyExists.pm | 19 + lib/Moose/Exception/CoercionNeedsTypeConstraint.pm | 13 + .../ConflictDetectedInCheckRoleExclusions.pm | 21 + ...nflictDetectedInCheckRoleExclusionsInToClass.pm | 15 + .../ConstructClassInstanceTakesPackageName.pm | 11 + lib/Moose/Exception/CouldNotCreateMethod.pm | 31 + lib/Moose/Exception/CouldNotCreateWriter.pm | 23 + lib/Moose/Exception/CouldNotEvalConstructor.pm | 33 + lib/Moose/Exception/CouldNotEvalDestructor.pm | 33 + .../CouldNotFindTypeConstraintToCoerceFrom.pm | 19 + .../CouldNotGenerateInlineAttributeMethod.pm | 25 + .../CouldNotLocateTypeConstraintForUnion.pm | 13 + lib/Moose/Exception/CouldNotParseType.pm | 29 + .../CreateMOPClassTakesArrayRefOfAttributes.pm | 12 + .../CreateMOPClassTakesArrayRefOfSuperclasses.pm | 12 + .../CreateMOPClassTakesHashRefOfMethods.pm | 12 + lib/Moose/Exception/CreateTakesArrayRefOfRoles.pm | 12 + .../Exception/CreateTakesHashRefOfAttributes.pm | 12 + lib/Moose/Exception/CreateTakesHashRefOfMethods.pm | 12 + .../Exception/DefaultToMatchOnTypeMustBeCodeRef.pm | 32 + .../DelegationToAClassWhichIsNotLoaded.pm | 19 + .../Exception/DelegationToARoleWhichIsNotLoaded.pm | 19 + .../Exception/DelegationToATypeWhichIsNotAClass.pm | 13 + lib/Moose/Exception/DoesRequiresRoleName.pm | 12 + .../EnumCalledWithAnArrayRefAndAdditionalArgs.pm | 23 + lib/Moose/Exception/EnumValuesMustBeString.pm | 25 + lib/Moose/Exception/ExtendsMissingArgs.pm | 12 + lib/Moose/Exception/HandlesMustBeAHashRef.pm | 19 + lib/Moose/Exception/IllegalInheritedOptions.pm | 22 + .../IllegalMethodTypeToAddMethodModifier.pm | 30 + .../Exception/IncompatibleMetaclassOfSuperclass.pm | 26 + lib/Moose/Exception/InitMetaRequiresClass.pm | 12 + .../InitializeTakesUnBlessedPackageName.pm | 17 + .../Exception/InstanceBlessedIntoWrongClass.pm | 13 + .../Exception/InstanceMustBeABlessedReference.pm | 19 + .../InvalidArgPassedToMooseUtilMetaRole.pm | 40 + lib/Moose/Exception/InvalidArgumentToMethod.pm | 44 + .../Exception/InvalidArgumentsToTraitAliases.pm | 31 + ...TypeGivenToCreateParameterizedTypeConstraint.pm | 13 + lib/Moose/Exception/InvalidHandleValue.pm | 19 + lib/Moose/Exception/InvalidHasProvidedInARole.pm | 18 + lib/Moose/Exception/InvalidNameForType.pm | 17 + lib/Moose/Exception/InvalidOverloadOperator.pm | 20 + lib/Moose/Exception/InvalidRoleApplication.pm | 18 + lib/Moose/Exception/InvalidTypeConstraint.pm | 23 + ...TypeGivenToCreateParameterizedTypeConstraint.pm | 13 + lib/Moose/Exception/InvalidValueForIs.pm | 13 + lib/Moose/Exception/IsaDoesNotDoTheRole.pm | 13 + lib/Moose/Exception/IsaLacksDoesMethod.pm | 13 + lib/Moose/Exception/LazyAttributeNeedsADefault.pm | 13 + lib/Moose/Exception/Legacy.pm | 7 + .../Exception/MOPAttributeNewNeedsAttributeName.pm | 18 + lib/Moose/Exception/MatchActionMustBeACodeRef.pm | 27 + .../Exception/MessageParameterMustBeCodeRef.pm | 18 + ...etaclassIsAClassNotASubclassOfGivenMetaclass.pm | 23 + ...MetaclassIsARoleNotASubclassOfGivenMetaclass.pm | 25 + .../MetaclassIsNotASubclassOfGivenMetaclass.pm | 22 + .../MetaclassMustBeASubclassOfMooseMetaClass.pm | 13 + .../MetaclassMustBeASubclassOfMooseMetaRole.pm | 13 + .../MetaclassMustBeDerivedFromClassMOPClass.pm | 18 + lib/Moose/Exception/MetaclassNotLoaded.pm | 13 + lib/Moose/Exception/MetaclassTypeIncompatible.pm | 38 + .../Exception/MethodExpectedAMetaclassObject.pm | 23 + lib/Moose/Exception/MethodExpectsFewerArgs.pm | 26 + lib/Moose/Exception/MethodExpectsMoreArgs.pm | 24 + .../Exception/MethodModifierNeedsMethodName.pm | 12 + lib/Moose/Exception/MethodNameConflictInRoles.pm | 46 + .../MethodNameNotFoundInInheritanceHierarchy.pm | 19 + lib/Moose/Exception/MethodNameNotGiven.pm | 12 + lib/Moose/Exception/MustDefineAMethodName.pm | 12 + lib/Moose/Exception/MustDefineAnAttributeName.pm | 12 + .../Exception/MustDefineAnOverloadOperator.pm | 12 + .../MustHaveAtLeastOneValueToEnumerate.pm | 18 + lib/Moose/Exception/MustPassAHashOfOptions.pm | 18 + .../MustPassAMooseMetaRoleInstanceOrSubclass.pm | 23 + ...ckageNameOrAnExistingClassMOPPackageInstance.pm | 18 + .../Exception/MustPassEvenNumberOfArguments.pm | 24 + .../MustPassEvenNumberOfAttributeOptions.pm | 23 + .../Exception/MustProvideANameForTheAttribute.pm | 18 + lib/Moose/Exception/MustSpecifyAtleastOneMethod.pm | 12 + lib/Moose/Exception/MustSpecifyAtleastOneRole.pm | 12 + .../MustSpecifyAtleastOneRoleToApplicant.pm | 18 + .../MustSupplyAClassMOPAttributeInstance.pm | 18 + lib/Moose/Exception/MustSupplyADelegateToMethod.pm | 18 + lib/Moose/Exception/MustSupplyAMetaclass.pm | 19 + .../MustSupplyAMooseMetaAttributeInstance.pm | 18 + .../MustSupplyAnAccessorTypeToConstructWith.pm | 18 + .../MustSupplyAnAttributeToConstructWith.pm | 18 + .../MustSupplyArrayRefAsCurriedArguments.pm | 12 + .../Exception/MustSupplyPackageNameAndName.pm | 19 + ...NeedsTypeConstraintUnionForTypeCoercionUnion.pm | 24 + .../NeitherAttributeNorAttributeNameIsGiven.pm | 11 + .../Exception/NeitherClassNorClassNameIsGiven.pm | 11 + .../Exception/NeitherRoleNorRoleNameIsGiven.pm | 11 + .../Exception/NeitherTypeNorTypeNameIsGiven.pm | 11 + .../Exception/NoAttributeFoundInSuperClass.pm | 13 + .../NoBodyToInitializeInAnAbstractBaseClass.pm | 18 + lib/Moose/Exception/NoCasesMatched.pm | 26 + .../NoConstraintCheckForTypeConstraint.pm | 13 + lib/Moose/Exception/NoDestructorClassSpecified.pm | 12 + .../Exception/NoImmutableTraitSpecifiedForClass.pm | 16 + lib/Moose/Exception/NoParentGivenToSubtype.pm | 17 + lib/Moose/Exception/OnlyInstancesCanBeCloned.pm | 19 + lib/Moose/Exception/OperatorIsRequired.pm | 18 + lib/Moose/Exception/OverloadConflictInSummation.pm | 61 + lib/Moose/Exception/OverloadRequiresAMetaClass.pm | 12 + lib/Moose/Exception/OverloadRequiresAMetaMethod.pm | 12 + .../Exception/OverloadRequiresAMetaOverload.pm | 12 + .../OverloadRequiresAMethodNameOrCoderef.pm | 12 + lib/Moose/Exception/OverloadRequiresAnOperator.pm | 12 + .../Exception/OverloadRequiresNamesForCoderef.pm | 12 + .../Exception/OverrideConflictInComposition.pm | 42 + lib/Moose/Exception/OverrideConflictInSummation.pm | 65 + .../Exception/PackageDoesNotUseMooseExporter.pm | 27 + .../PackageNameAndNameParamsNotGivenToWrap.pm | 24 + .../Exception/PackagesAndModulesAreNotCachable.pm | 25 + .../Exception/ParameterIsNotSubtypeOfParent.pm | 25 + .../Exception/ReferencesAreNotAllowedAsDefault.pm | 26 + .../RequiredAttributeLacksInitialization.pm | 18 + .../Exception/RequiredAttributeNeedsADefault.pm | 13 + .../Exception/RequiredMethodsImportedByClass.pm | 45 + .../RequiredMethodsNotImplementedByClass.pm | 30 + lib/Moose/Exception/Role/Attribute.pm | 12 + lib/Moose/Exception/Role/AttributeName.pm | 12 + lib/Moose/Exception/Role/Class.pm | 14 + .../Role/EitherAttributeOrAttributeName.pm | 49 + lib/Moose/Exception/Role/Instance.pm | 12 + lib/Moose/Exception/Role/InstanceClass.pm | 12 + .../Exception/Role/InvalidAttributeOptions.pm | 13 + lib/Moose/Exception/Role/Method.pm | 12 + lib/Moose/Exception/Role/ParamsHash.pm | 12 + lib/Moose/Exception/Role/Role.pm | 16 + lib/Moose/Exception/Role/RoleForCreate.pm | 13 + lib/Moose/Exception/Role/RoleForCreateMOPClass.pm | 13 + lib/Moose/Exception/Role/TypeConstraint.pm | 14 + lib/Moose/Exception/RoleDoesTheExcludedRole.pm | 27 + lib/Moose/Exception/RoleExclusionConflict.pm | 26 + lib/Moose/Exception/RoleNameRequired.pm | 12 + .../Exception/RoleNameRequiredForMooseMetaRole.pm | 12 + lib/Moose/Exception/RolesDoNotSupportAugment.pm | 11 + lib/Moose/Exception/RolesDoNotSupportExtends.pm | 11 + lib/Moose/Exception/RolesDoNotSupportInner.pm | 11 + ...oNotSupportRegexReferencesForMethodModifiers.pm | 19 + .../Exception/RolesInCreateTakesAnArrayRef.pm | 13 + .../RolesListMustBeInstancesOfMooseMetaRole.pm | 25 + .../Exception/SingleParamsToNewMustBeHashRef.pm | 11 + lib/Moose/Exception/TriggerMustBeACodeRef.pm | 13 + ...onstraintCannotBeUsedForAParameterizableType.pm | 24 + .../Exception/TypeConstraintIsAlreadyCreated.pm | 25 + .../Exception/TypeParameterMustBeMooseMetaType.pm | 12 + lib/Moose/Exception/UnableToCanonicalizeHandles.pm | 19 + .../UnableToCanonicalizeNonRolePackage.pm | 19 + .../UnableToRecognizeDelegateMetaclass.pm | 21 + .../Exception/UndefinedHashKeysPassedToMethod.pm | 24 + .../UnionCalledWithAnArrayRefAndAdditionalArgs.pm | 23 + .../Exception/UnionTakesAtleastTwoTypeNames.pm | 11 + .../ValidationFailedForInlineTypeConstraint.pm | 48 + .../Exception/ValidationFailedForTypeConstraint.pm | 32 + lib/Moose/Exception/WrapTakesACodeRefToBless.pm | 25 + lib/Moose/Exception/WrongTypeConstraintGiven.pm | 20 + lib/Moose/Exporter.pm | 1065 +++ lib/Moose/Intro.pod | 77 + lib/Moose/Manual.pod | 334 + lib/Moose/Manual/Attributes.pod | 697 ++ lib/Moose/Manual/BestPractices.pod | 292 + lib/Moose/Manual/Classes.pod | 218 + lib/Moose/Manual/Concepts.pod | 439 + lib/Moose/Manual/Construction.pod | 225 + lib/Moose/Manual/Contributing.pod | 546 ++ lib/Moose/Manual/Delegation.pod | 313 + lib/Moose/Manual/Delta.pod | 1275 +++ lib/Moose/Manual/Exceptions.pod | 239 + lib/Moose/Manual/Exceptions/Manifest.pod | 8343 ++++++++++++++++++++ lib/Moose/Manual/FAQ.pod | 470 ++ lib/Moose/Manual/MOP.pod | 214 + lib/Moose/Manual/MethodModifiers.pod | 432 + lib/Moose/Manual/MooseX.pod | 326 + lib/Moose/Manual/Resources.pod | 515 ++ lib/Moose/Manual/Roles.pod | 422 + lib/Moose/Manual/Support.pod | 204 + lib/Moose/Manual/Types.pod | 491 ++ lib/Moose/Manual/Unsweetened.pod | 386 + lib/Moose/Meta/Attribute.pm | 1734 ++++ lib/Moose/Meta/Attribute/Native.pm | 299 + lib/Moose/Meta/Attribute/Native/Trait.pm | 244 + lib/Moose/Meta/Attribute/Native/Trait/Array.pm | 384 + lib/Moose/Meta/Attribute/Native/Trait/Bool.pm | 146 + lib/Moose/Meta/Attribute/Native/Trait/Code.pm | 129 + lib/Moose/Meta/Attribute/Native/Trait/Counter.pm | 157 + lib/Moose/Meta/Attribute/Native/Trait/Hash.pm | 226 + lib/Moose/Meta/Attribute/Native/Trait/Number.pm | 155 + lib/Moose/Meta/Attribute/Native/Trait/String.pm | 187 + lib/Moose/Meta/Class.pm | 1002 +++ lib/Moose/Meta/Class/Immutable/Trait.pm | 123 + lib/Moose/Meta/Instance.pm | 109 + lib/Moose/Meta/Method.pm | 100 + lib/Moose/Meta/Method/Accessor.pm | 208 + lib/Moose/Meta/Method/Accessor/Native.pm | 157 + lib/Moose/Meta/Method/Accessor/Native/Array.pm | 28 + .../Meta/Method/Accessor/Native/Array/Writer.pm | 27 + .../Meta/Method/Accessor/Native/Array/accessor.pm | 56 + .../Meta/Method/Accessor/Native/Array/clear.pm | 28 + .../Meta/Method/Accessor/Native/Array/count.pm | 22 + .../Meta/Method/Accessor/Native/Array/delete.pm | 50 + .../Meta/Method/Accessor/Native/Array/elements.pm | 22 + .../Meta/Method/Accessor/Native/Array/first.pm | 42 + .../Method/Accessor/Native/Array/first_index.pm | 42 + lib/Moose/Meta/Method/Accessor/Native/Array/get.pm | 31 + .../Meta/Method/Accessor/Native/Array/grep.pm | 41 + .../Meta/Method/Accessor/Native/Array/insert.pm | 58 + .../Meta/Method/Accessor/Native/Array/is_empty.pm | 22 + .../Meta/Method/Accessor/Native/Array/join.pm | 41 + lib/Moose/Meta/Method/Accessor/Native/Array/map.pm | 41 + .../Meta/Method/Accessor/Native/Array/natatime.pm | 65 + lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm | 47 + .../Meta/Method/Accessor/Native/Array/push.pm | 36 + .../Meta/Method/Accessor/Native/Array/reduce.pm | 42 + lib/Moose/Meta/Method/Accessor/Native/Array/set.pm | 64 + .../Method/Accessor/Native/Array/shallow_clone.pm | 26 + .../Meta/Method/Accessor/Native/Array/shift.pm | 47 + .../Meta/Method/Accessor/Native/Array/shuffle.pm | 24 + .../Meta/Method/Accessor/Native/Array/sort.pm | 44 + .../Method/Accessor/Native/Array/sort_in_place.pm | 45 + .../Meta/Method/Accessor/Native/Array/splice.pm | 72 + .../Meta/Method/Accessor/Native/Array/uniq.pm | 24 + .../Meta/Method/Accessor/Native/Array/unshift.pm | 36 + lib/Moose/Meta/Method/Accessor/Native/Bool/not.pm | 20 + lib/Moose/Meta/Method/Accessor/Native/Bool/set.pm | 24 + .../Meta/Method/Accessor/Native/Bool/toggle.pm | 29 + .../Meta/Method/Accessor/Native/Bool/unset.pm | 24 + .../Meta/Method/Accessor/Native/Code/execute.pm | 20 + .../Method/Accessor/Native/Code/execute_method.pm | 20 + .../Meta/Method/Accessor/Native/Collection.pm | 167 + .../Meta/Method/Accessor/Native/Counter/Writer.pm | 24 + .../Meta/Method/Accessor/Native/Counter/dec.pm | 30 + .../Meta/Method/Accessor/Native/Counter/inc.pm | 30 + .../Meta/Method/Accessor/Native/Counter/reset.pm | 36 + .../Meta/Method/Accessor/Native/Counter/set.pm | 25 + lib/Moose/Meta/Method/Accessor/Native/Hash.pm | 28 + .../Meta/Method/Accessor/Native/Hash/Writer.pm | 31 + .../Meta/Method/Accessor/Native/Hash/accessor.pm | 61 + .../Meta/Method/Accessor/Native/Hash/clear.pm | 28 + .../Meta/Method/Accessor/Native/Hash/count.pm | 22 + .../Meta/Method/Accessor/Native/Hash/defined.pm | 31 + .../Meta/Method/Accessor/Native/Hash/delete.pm | 40 + .../Meta/Method/Accessor/Native/Hash/elements.pm | 23 + .../Meta/Method/Accessor/Native/Hash/exists.pm | 31 + lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm | 35 + .../Meta/Method/Accessor/Native/Hash/is_empty.pm | 22 + lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm | 22 + lib/Moose/Meta/Method/Accessor/Native/Hash/kv.pm | 23 + lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm | 103 + .../Method/Accessor/Native/Hash/shallow_clone.pm | 26 + .../Meta/Method/Accessor/Native/Hash/values.pm | 22 + .../Meta/Method/Accessor/Native/Number/abs.pm | 29 + .../Meta/Method/Accessor/Native/Number/add.pm | 31 + .../Meta/Method/Accessor/Native/Number/div.pm | 31 + .../Meta/Method/Accessor/Native/Number/mod.pm | 31 + .../Meta/Method/Accessor/Native/Number/mul.pm | 31 + .../Meta/Method/Accessor/Native/Number/set.pm | 25 + .../Meta/Method/Accessor/Native/Number/sub.pm | 31 + lib/Moose/Meta/Method/Accessor/Native/Reader.pm | 47 + .../Meta/Method/Accessor/Native/String/append.pm | 31 + .../Meta/Method/Accessor/Native/String/chomp.pm | 40 + .../Meta/Method/Accessor/Native/String/chop.pm | 40 + .../Meta/Method/Accessor/Native/String/clear.pm | 24 + .../Meta/Method/Accessor/Native/String/inc.pm | 33 + .../Meta/Method/Accessor/Native/String/length.pm | 22 + .../Meta/Method/Accessor/Native/String/match.pm | 42 + .../Meta/Method/Accessor/Native/String/prepend.pm | 31 + .../Meta/Method/Accessor/Native/String/replace.pm | 69 + .../Meta/Method/Accessor/Native/String/substr.pm | 123 + lib/Moose/Meta/Method/Accessor/Native/Writer.pm | 174 + lib/Moose/Meta/Method/Augmented.pm | 175 + lib/Moose/Meta/Method/Constructor.pm | 145 + lib/Moose/Meta/Method/Delegation.pm | 258 + lib/Moose/Meta/Method/Destructor.pm | 255 + lib/Moose/Meta/Method/Meta.pm | 112 + lib/Moose/Meta/Method/Overridden.pm | 164 + lib/Moose/Meta/Mixin/AttributeCore.pm | 184 + lib/Moose/Meta/Object/Trait.pm | 107 + lib/Moose/Meta/Role.pm | 1095 +++ lib/Moose/Meta/Role/Application.pm | 225 + lib/Moose/Meta/Role/Application/RoleSummation.pm | 440 ++ lib/Moose/Meta/Role/Application/ToClass.pm | 314 + lib/Moose/Meta/Role/Application/ToInstance.pm | 141 + lib/Moose/Meta/Role/Application/ToRole.pm | 283 + lib/Moose/Meta/Role/Attribute.pm | 263 + lib/Moose/Meta/Role/Composite.pm | 324 + lib/Moose/Meta/Role/Method.pm | 101 + lib/Moose/Meta/Role/Method/Conflicting.pm | 139 + lib/Moose/Meta/Role/Method/Required.pm | 129 + lib/Moose/Meta/TypeCoercion.pm | 243 + lib/Moose/Meta/TypeCoercion/Union.pm | 145 + lib/Moose/Meta/TypeConstraint.pm | 604 ++ lib/Moose/Meta/TypeConstraint/Class.pm | 265 + lib/Moose/Meta/TypeConstraint/DuckType.pm | 221 + lib/Moose/Meta/TypeConstraint/Enum.pm | 230 + lib/Moose/Meta/TypeConstraint/Parameterizable.pm | 200 + lib/Moose/Meta/TypeConstraint/Parameterized.pm | 188 + lib/Moose/Meta/TypeConstraint/Registry.pm | 210 + lib/Moose/Meta/TypeConstraint/Role.pm | 239 + lib/Moose/Meta/TypeConstraint/Union.pm | 348 + lib/Moose/Object.pm | 272 + lib/Moose/Role.pm | 381 + lib/Moose/Spec/Role.pod | 397 + lib/Moose/Unsweetened.pod | 77 + lib/Moose/Util.pm | 734 ++ lib/Moose/Util/MetaRole.pm | 329 + lib/Moose/Util/TypeConstraints.pm | 1459 ++++ lib/Moose/Util/TypeConstraints/Builtins.pm | 305 + lib/Test/Moose.pm | 232 + lib/metaclass.pm | 155 + lib/oose.pm | 137 + mop.c | 286 + mop.h | 109 + perltidyrc | 21 + ppport.h | 7452 +++++++++++++++++ t/00-report-prereqs.dd | 199 + t/00-report-prereqs.t | 203 + t/000_load.t | 10 + t/attributes/accessor_context.t | 68 + t/attributes/accessor_inlining.t | 32 + t/attributes/accessor_override_method.t | 57 + t/attributes/accessor_overwrite_warning.t | 25 + t/attributes/attr_dereference_test.t | 80 + t/attributes/attribute_accessor_generation.t | 204 + t/attributes/attribute_custom_metaclass.t | 90 + t/attributes/attribute_delegation.t | 483 ++ t/attributes/attribute_does.t | 99 + t/attributes/attribute_inherited_slot_specs.t | 269 + t/attributes/attribute_lazy_initializer.t | 148 + t/attributes/attribute_names.t | 57 + t/attributes/attribute_reader_generation.t | 103 + t/attributes/attribute_required.t | 66 + t/attributes/attribute_traits.t | 63 + t/attributes/attribute_traits_n_meta.t | 63 + t/attributes/attribute_traits_parameterized.t | 57 + t/attributes/attribute_traits_registered.t | 114 + t/attributes/attribute_triggers.t | 219 + t/attributes/attribute_type_unions.t | 96 + t/attributes/attribute_without_any_methods.t | 22 + t/attributes/attribute_writer_generation.t | 117 + t/attributes/bad_coerce.t | 33 + t/attributes/chained_coercion.t | 46 + t/attributes/clone_weak.t | 177 + t/attributes/default_class_role_types.t | 47 + t/attributes/default_undef.t | 23 + t/attributes/delegation_and_modifiers.t | 54 + t/attributes/delegation_arg_aliasing.t | 40 + t/attributes/delegation_target_not_loaded.t | 35 + t/attributes/illegal_options_for_inheritance.t | 75 + t/attributes/inherit_lazy_build.t | 75 + t/attributes/lazy_no_default.t | 22 + t/attributes/method_generation_rules.t | 61 + t/attributes/misc_attribute_coerce_lazy.t | 48 + t/attributes/misc_attribute_tests.t | 270 + t/attributes/more_attr_delegation.t | 263 + t/attributes/no_init_arg.t | 32 + t/attributes/no_slot_access.t | 87 + t/attributes/non_alpha_attr_names.t | 66 + t/attributes/numeric_defaults.t | 130 + t/attributes/trigger_and_coerce.t | 53 + t/attributes/type_constraint.t | 41 + t/basics/always_strict_warnings.t | 71 + t/basics/basic_class_setup.t | 50 + t/basics/buildargs.t | 41 + t/basics/buildargs_warning.t | 32 + t/basics/create.t | 61 + t/basics/create_anon.t | 125 + t/basics/deprecations.t | 23 + t/basics/destruction.t | 51 + t/basics/error_handling.t | 19 + t/basics/global-destruction-helper.pl | 34 + t/basics/global_destruction.t | 49 + t/basics/import_unimport.t | 98 + t/basics/inner_and_augment.t | 117 + t/basics/load_into_main.t | 16 + t/basics/method_modifier_with_regexp.t | 84 + t/basics/methods.t | 44 + t/basics/moose_object_does.t | 158 + t/basics/moose_respects_type_constraints.t | 59 + t/basics/override_and_foreign_classes.t | 72 + t/basics/override_augment_inner_super.t | 69 + t/basics/rebless.t | 136 + t/basics/require_superclasses.t | 64 + t/basics/super_and_override.t | 79 + t/basics/super_warns_on_args.t | 44 + t/basics/universal_methods_wrappable.t | 29 + t/basics/wrapped_method_cxt_propagation.t | 56 + t/bugs/DEMOLISHALL.t | 54 + t/bugs/DEMOLISHALL_shortcutted.t | 35 + t/bugs/DEMOLISH_eats_exceptions.t | 149 + t/bugs/DEMOLISH_eats_mini.t | 79 + t/bugs/DEMOLISH_fails_without_metaclass.t | 34 + t/bugs/Moose_Object_error.t | 10 + t/bugs/anon_method_metaclass.t | 50 + t/bugs/application_metarole_compat.t | 56 + t/bugs/apply_role_to_one_instance_only.t | 43 + t/bugs/attribute_trait_parameters.t | 46 + t/bugs/augment_recursion_bug.t | 47 + t/bugs/coerce_without_coercion.t | 26 + t/bugs/constructor_object_overload.t | 19 + t/bugs/create_anon_recursion.t | 29 + t/bugs/create_anon_role_pass.t | 39 + t/bugs/delete_sub_stash.t | 23 + t/bugs/handles_foreign_class_bug.t | 111 + t/bugs/immutable_metaclass_does_role.t | 90 + t/bugs/immutable_n_default_x2.t | 39 + t/bugs/inheriting_from_roles.t | 21 + t/bugs/inline_reader_bug.t | 29 + t/bugs/instance_application_role_args.t | 50 + t/bugs/lazybuild_required_undef.t | 33 + t/bugs/mark_as_methods_overloading_breakage.t | 33 + ...se_exporter_false_circular_reference_rt_63818.t | 154 + t/bugs/moose_octal_defaults.t | 121 + t/bugs/native_trait_handles_bad_value.t | 27 + t/bugs/overloading_edge_cases.t | 43 + t/bugs/reader_precedence_bug.t | 21 + t/bugs/role_caller.t | 30 + t/bugs/subclass_use_base_bug.t | 28 + t/bugs/subtype_conflict_bug.t | 11 + t/bugs/subtype_quote_bug.t | 34 + t/bugs/super_recursion.t | 69 + t/bugs/traits_with_exporter.t | 77 + t/bugs/type_constraint_messages.t | 65 + t/cmop/ArrayBasedStorage_test.t | 203 + t/cmop/AttributesWithHistory_test.t | 118 + t/cmop/BinaryTree_test.t | 329 + t/cmop/C3MethodDispatchOrder_test.t | 41 + t/cmop/ClassEncapsulatedAttributes_test.t | 106 + t/cmop/Class_C3_compatibility.t | 64 + t/cmop/InsideOutClass_test.t | 223 + t/cmop/InstanceCountingClass_test.t | 57 + t/cmop/LazyClass_test.t | 81 + t/cmop/Perl6Attribute_test.t | 41 + t/cmop/RT_27329_fix.t | 47 + t/cmop/RT_39001_fix.t | 40 + t/cmop/RT_41255.t | 51 + t/cmop/add_attribute_alternate.t | 109 + t/cmop/add_method_debugmode.t | 140 + t/cmop/add_method_modifier.t | 135 + t/cmop/advanced_methods.t | 168 + t/cmop/anon_class.t | 70 + t/cmop/anon_class_create_init.t | 150 + t/cmop/anon_class_keep_alive.t | 52 + t/cmop/anon_class_leak.t | 26 + t/cmop/anon_class_removal.t | 40 + t/cmop/anon_packages.t | 40 + t/cmop/attribute.t | 248 + t/cmop/attribute_duplication.t | 58 + t/cmop/attribute_errors_and_edge_cases.t | 232 + t/cmop/attribute_get_read_write.t | 114 + t/cmop/attribute_initializer.t | 50 + t/cmop/attribute_introspection.t | 131 + t/cmop/attribute_non_alpha_name.t | 34 + t/cmop/attributes.t | 262 + t/cmop/basic.t | 78 + t/cmop/before_after_dollar_under.t | 70 + t/cmop/class_errors_and_edge_cases.t | 222 + t/cmop/class_is_pristine.t | 23 + t/cmop/class_precedence_list.t | 160 + t/cmop/constant_codeinfo.t | 22 + t/cmop/create_class.t | 113 + t/cmop/custom_instance.t | 137 + t/cmop/deprecated.t | 31 + t/cmop/get_code_info.t | 52 + t/cmop/immutable_custom_trait.t | 76 + t/cmop/immutable_metaclass.t | 300 + t/cmop/immutable_w_constructors.t | 301 + t/cmop/immutable_w_custom_metaclass.t | 71 + t/cmop/inline_and_dollar_at.t | 19 + t/cmop/inline_structor.t | 291 + t/cmop/insertion_order.t | 35 + t/cmop/instance.t | 137 + t/cmop/instance_inline.t | 46 + t/cmop/instance_metaclass_incompat.t | 68 + t/cmop/instance_metaclass_incompat_dyn.t | 66 + t/cmop/lib/ArrayBasedStorage.pm | 132 + t/cmop/lib/AttributesWithHistory.pm | 135 + t/cmop/lib/BinaryTree.pm | 142 + t/cmop/lib/C3MethodDispatchOrder.pm | 145 + t/cmop/lib/ClassEncapsulatedAttributes.pm | 150 + t/cmop/lib/InsideOutClass.pm | 194 + t/cmop/lib/InstanceCountingClass.pm | 72 + t/cmop/lib/LazyClass.pm | 162 + t/cmop/lib/MyMetaClass.pm | 14 + t/cmop/lib/MyMetaClass/Attribute.pm | 8 + t/cmop/lib/MyMetaClass/Instance.pm | 8 + t/cmop/lib/MyMetaClass/Method.pm | 8 + t/cmop/lib/MyMetaClass/Random.pm | 6 + t/cmop/lib/Perl6Attribute.pm | 82 + t/cmop/lib/SyntaxError.pm | 9 + t/cmop/load.t | 176 + t/cmop/magic.t | 76 + t/cmop/make_mutable.t | 220 + t/cmop/meta_method.t | 66 + t/cmop/meta_package.t | 280 + t/cmop/meta_package_extension.t | 95 + t/cmop/metaclass.t | 58 + t/cmop/metaclass_incompatibility.t | 264 + t/cmop/metaclass_incompatibility_dyn.t | 66 + t/cmop/metaclass_inheritance.t | 43 + t/cmop/metaclass_loads_classes.t | 38 + t/cmop/metaclass_reinitialize.t | 205 + t/cmop/method.t | 172 + t/cmop/method_modifiers.t | 203 + t/cmop/methods.t | 431 + t/cmop/modify_parent_method.t | 99 + t/cmop/new_and_clone_metaclasses.t | 124 + t/cmop/null_stash.t | 11 + t/cmop/numeric_defaults.t | 124 + t/cmop/package_variables.t | 230 + t/cmop/random_eval_bug.t | 51 + t/cmop/rebless_instance.t | 95 + t/cmop/rebless_instance_away.t | 44 + t/cmop/rebless_overload.t | 27 + t/cmop/rebless_with_extra_params.t | 95 + t/cmop/scala_style_mixin_composition.t | 172 + t/cmop/self_introspection.t | 359 + t/cmop/subclasses.t | 45 + t/cmop/subname.t | 42 + t/cmop/universal_methods.t | 38 + t/compat/composite_metaroles.t | 44 + ...extends_nonmoose_that_isa_moose_with_metarole.t | 204 + t/compat/foreign_inheritence.t | 88 + t/compat/inc_hash.t | 101 + t/compat/module_refresh_compat.t | 88 + t/compat/moose_respects_base.t | 46 + t/examples/Child_Parent_attr_inherit.t | 136 + t/examples/example1.t | 125 + t/examples/example2.t | 155 + t/examples/example_Moose_POOP.t | 428 + t/examples/example_Protomoose.t | 281 + t/examples/example_w_DCS.t | 87 + t/examples/example_w_TestDeep.t | 71 + t/examples/record_set_iterator.t | 114 + t/exceptions/attribute.t | 1194 +++ t/exceptions/class-mop-attribute.t | 213 + t/exceptions/class-mop-class-immutable-trait.t | 57 + t/exceptions/class-mop-class.t | 685 ++ t/exceptions/class-mop-method-accessor.t | 279 + t/exceptions/class-mop-method-constructor.t | 75 + t/exceptions/class-mop-method-generated.t | 41 + t/exceptions/class-mop-method-meta.t | 25 + t/exceptions/class-mop-method-wrapped.t | 25 + t/exceptions/class-mop-method.t | 41 + t/exceptions/class-mop-mixin-hasattributes.t | 98 + t/exceptions/class-mop-mixin-hasmethods.t | 141 + t/exceptions/class-mop-module.t | 25 + t/exceptions/class-mop-object.t | 109 + t/exceptions/class-mop-package.t | 41 + t/exceptions/class.t | 304 + t/exceptions/cmop.t | 20 + .../exception-lazyattributeneedsadefault.t | 66 + t/exceptions/frame-leak.t | 23 + t/exceptions/meta-role.t | 242 + t/exceptions/metaclass.t | 34 + t/exceptions/moose-exporter.t | 119 + t/exceptions/moose-meta-attribute-native-traits.t | 147 + t/exceptions/moose-meta-class-immutable-trait.t | 29 + .../moose-meta-method-accessor-native-array.t | 488 ++ .../moose-meta-method-accessor-native-collection.t | 53 + .../moose-meta-method-accessor-native-grep.t | 63 + .../moose-meta-method-accessor-native-hash-set.t | 70 + .../moose-meta-method-accessor-native-hash.t | 63 + ...oose-meta-method-accessor-native-string-match.t | 63 + ...se-meta-method-accessor-native-string-replace.t | 110 + ...ose-meta-method-accessor-native-string-substr.t | 150 + t/exceptions/moose-meta-method-accessor-native.t | 138 + t/exceptions/moose-meta-method-accessor.t | 55 + t/exceptions/moose-meta-method-augmented.t | 33 + t/exceptions/moose-meta-method-constructor.t | 41 + t/exceptions/moose-meta-method-delegation.t | 173 + t/exceptions/moose-meta-method-destructor.t | 94 + t/exceptions/moose-meta-method-overridden.t | 36 + .../moose-meta-role-application-rolesummation.t | 215 + t/exceptions/moose-meta-role-application-toclass.t | 432 + t/exceptions/moose-meta-role-application-torole.t | 350 + t/exceptions/moose-meta-role-application.t | 121 + t/exceptions/moose-meta-role-attribute.t | 41 + t/exceptions/moose-meta-role-composite.t | 84 + t/exceptions/moose-meta-typecoercion-union.t | 56 + t/exceptions/moose-meta-typecoercion.t | 59 + t/exceptions/moose-meta-typeconstraint-enum.t | 64 + .../moose-meta-typeconstraint-parameterizable.t | 67 + .../moose-meta-typeconstraint-parameterized.t | 83 + t/exceptions/moose-meta-typeconstraint-registry.t | 27 + t/exceptions/moose-meta-typeconstraint.t | 139 + t/exceptions/moose-role.t | 321 + t/exceptions/moose-util-metarole.t | 129 + t/exceptions/moose-util-typeconstraints.t | 171 + t/exceptions/moose.t | 173 + t/exceptions/object.t | 77 + t/exceptions/overload.t | 15 + t/exceptions/rt-92818.t | 45 + t/exceptions/rt-94795.t | 34 + t/exceptions/stringify.t | 111 + t/exceptions/traits.t | 34 + t/exceptions/typeconstraints.t | 293 + t/exceptions/util.t | 188 + t/immutable/apply_roles_to_immutable.t | 38 + t/immutable/buildargs.t | 45 + t/immutable/constructor_is_not_moose.t | 100 + t/immutable/constructor_is_wrapped.t | 27 + t/immutable/default_values.t | 79 + t/immutable/definition_context.t | 82 + t/immutable/immutable_constructor_error.t | 30 + t/immutable/immutable_destroy.t | 21 + t/immutable/immutable_meta_class.t | 25 + t/immutable/immutable_metaclass_with_traits.t | 36 + t/immutable/immutable_moose.t | 84 + t/immutable/immutable_roundtrip.t | 33 + t/immutable/immutable_trigger_from_constructor.t | 36 + t/immutable/inline_close_over.t | 361 + t/immutable/inline_fallbacks.t | 70 + t/immutable/inlined_constructors_n_types.t | 60 + t/immutable/multiple_demolish_inline.t | 45 + t/lib/Bar.pm | 9 + t/lib/Bar7/Meta/Trait.pm | 8 + t/lib/Bar7/Meta/Trait2.pm | 13 + t/lib/Foo.pm | 6 + t/lib/Moose/Meta/Attribute/Custom/Bar.pm | 10 + t/lib/Moose/Meta/Attribute/Custom/Foo.pm | 5 + t/lib/Moose/Meta/Attribute/Custom/Trait/Bar.pm | 10 + t/lib/Moose/Meta/Attribute/Custom/Trait/Foo.pm | 5 + t/lib/MyExporter.pm | 22 + t/lib/MyMetaclassRole.pm | 4 + t/lib/MyMooseA.pm | 7 + t/lib/MyMooseB.pm | 5 + t/lib/MyMooseObject.pm | 7 + t/lib/NoInlineAttribute.pm | 29 + .../ClassConsumesRoleConsumesOverloads.pm | 7 + t/lib/Overloading/ClassWithCombiningRole.pm | 7 + t/lib/Overloading/ClassWithOneRole.pm | 7 + t/lib/Overloading/CombiningClass.pm | 7 + t/lib/Overloading/CombiningRole.pm | 7 + t/lib/Overloading/RoleConsumesOverloads.pm | 7 + t/lib/Overloading/RoleWithOverloads.pm | 16 + t/lib/Overloading/RoleWithoutOverloads.pm | 5 + t/lib/OverloadingTests.pm | 47 + t/lib/Real/Package.pm | 7 + t/lib/Role/BreakOnLoad.pm | 8 + t/lib/Role/Child.pm | 8 + t/lib/Role/Interface.pm | 6 + t/lib/Role/Parent.pm | 7 + t/metaclasses/create_anon_with_required_attr.t | 86 + t/metaclasses/custom_attr_meta_as_role.t | 20 + t/metaclasses/custom_attr_meta_with_roles.t | 39 + t/metaclasses/easy_init_meta.t | 126 + t/metaclasses/export_with_prototype.t | 22 + t/metaclasses/exporter_also_with_trait.t | 35 + t/metaclasses/exporter_meta_lookup.t | 62 + t/metaclasses/exporter_sub_names.t | 47 + t/metaclasses/goto_moose_import.t | 80 + t/metaclasses/immutable_metaclass_compat_bug.t | 37 + t/metaclasses/meta_name.t | 73 + t/metaclasses/metaclass_compat.t | 304 + t/metaclasses/metaclass_compat_no_fixing_bug.t | 45 + t/metaclasses/metaclass_compat_role_conflicts.t | 63 + t/metaclasses/metaclass_parameterized_traits.t | 47 + t/metaclasses/metaclass_traits.t | 224 + t/metaclasses/metarole.t | 725 ++ t/metaclasses/metarole_combination.t | 238 + t/metaclasses/metarole_on_anon.t | 51 + t/metaclasses/metarole_w_metaclass_pm.t | 111 + t/metaclasses/metaroles_of_metaroles.t | 67 + t/metaclasses/moose_exporter.t | 677 ++ t/metaclasses/moose_exporter_trait_aliases.t | 88 + t/metaclasses/moose_for_meta.t | 76 + .../moose_nonmoose_metatrait_init_order.t | 30 + .../moose_nonmoose_moose_chain_init_meta.t | 24 + t/metaclasses/moose_w_metaclass.t | 54 + t/metaclasses/new_metaclass.t | 27 + t/metaclasses/new_object_BUILD.t | 19 + t/metaclasses/overloading.t | 480 ++ t/metaclasses/reinitialize.t | 320 + t/metaclasses/use_base_of_moose.t | 36 + t/moose_util/apply_roles.t | 71 + t/moose_util/create_alias.t | 102 + t/moose_util/ensure_all_roles.t | 62 + t/moose_util/method_mod_args.t | 31 + t/moose_util/moose_util.t | 43 + t/moose_util/moose_util_does_role.t | 92 + t/moose_util/moose_util_search_class_by_role.t | 41 + t/moose_util/resolve_alias.t | 77 + t/moose_util/with_traits.t | 50 + t/native_traits/array_coerce.t | 235 + t/native_traits/array_from_role.t | 44 + t/native_traits/array_subtypes.t | 264 + t/native_traits/array_trigger.t | 53 + t/native_traits/collection_with_roles.t | 122 + t/native_traits/custom_instance.t | 246 + t/native_traits/hash_coerce.t | 148 + t/native_traits/hash_subtypes.t | 204 + t/native_traits/hash_trigger.t | 54 + t/native_traits/remove_attribute.t | 48 + t/native_traits/shallow_clone.t | 42 + t/native_traits/trait_array.t | 740 ++ t/native_traits/trait_bool.t | 101 + t/native_traits/trait_code.t | 113 + t/native_traits/trait_counter.t | 170 + t/native_traits/trait_hash.t | 329 + t/native_traits/trait_number.t | 161 + t/native_traits/trait_string.t | 303 + ...ics_bankaccount_methodmodifiersandsubclassing.t | 154 + t/recipes/basics_binarytree_attributefeatures.t | 174 + t/recipes/basics_company_subtypes.t | 356 + .../basics_datetime_extendingnonmooseparent.t | 68 + t/recipes/basics_document_augmentandinner.t | 84 + .../basics_genome_overloadingsubtypesandcoercion.t | 219 + t/recipes/basics_http_subtypesandcoercion.t | 148 + t/recipes/basics_point_attributesandsubclassing.t | 251 + t/recipes/extending_debugging_baseclassrole.t | 59 + t/recipes/extending_mooseish_moosesugar.t | 66 + t/recipes/legacy_debugging_baseclassreplacement.t | 68 + t/recipes/legacy_labeled_attributemetaclass.t | 86 + t/recipes/meta_globref_instancemetaclass.t | 153 + t/recipes/meta_labeled_attributetrait.t | 84 + t/recipes/meta_privateorpublic_methodmetaclass.t | 109 + t/recipes/meta_table_metaclasstrait.t | 55 + t/recipes/roles_applicationtoinstance.t | 96 + t/recipes/roles_comparable_codereuse.t | 202 + t/recipes/roles_restartable_advancedcomposition.t | 118 + t/roles/anonymous_roles.t | 68 + t/roles/application_toclass.t | 75 + t/roles/apply_role.t | 227 + t/roles/build.t | 77 + t/roles/conflict_many_methods.t | 47 + t/roles/create_role.t | 39 + t/roles/create_role_subclass.t | 26 + t/roles/empty_method_modifiers_meta_bug.t | 29 + t/roles/extending_role_attrs.t | 184 + t/roles/free_anonymous_roles.t | 62 + t/roles/imported_required_method.t | 58 + t/roles/meta_role.t | 111 + t/roles/method_aliasing_in_composition.t | 206 + t/roles/method_exclusion_in_composition.t | 110 + t/roles/method_modifiers.t | 89 + t/roles/methods.t | 46 + t/roles/more_alias_and_exclude.t | 88 + t/roles/more_role_edge_cases.t | 255 + t/roles/new_meta_role.t | 18 + t/roles/overloading_combine_to_class.t | 33 + t/roles/overloading_combine_to_instance.t | 39 + t/roles/overloading_combine_to_role.t | 33 + t/roles/overloading_composition_errors.t | 156 + t/roles/overloading_remove_attributes_bug.t | 36 + t/roles/overloading_to_class.t | 66 + t/roles/overloading_to_instance.t | 31 + t/roles/overloading_to_role.t | 58 + t/roles/overriding.t | 214 + t/roles/reinitialize_anon_role.t | 30 + t/roles/role.t | 154 + t/roles/role_attr_application.t | 291 + t/roles/role_attribute_conflict.t | 28 + t/roles/role_attrs.t | 53 + t/roles/role_compose_requires.t | 132 + t/roles/role_composite.t | 84 + t/roles/role_composite_exclusion.t | 107 + t/roles/role_composition_attributes.t | 93 + t/roles/role_composition_conflict_detection.t | 44 + t/roles/role_composition_errors.t | 141 + t/roles/role_composition_method_mods.t | 86 + t/roles/role_composition_methods.t | 150 + t/roles/role_composition_override.t | 168 + t/roles/role_composition_req_methods.t | 123 + t/roles/role_conflict_detection.t | 595 ++ t/roles/role_conflict_edge_cases.t | 188 + t/roles/role_consumers.t | 54 + t/roles/role_exclusion.t | 119 + t/roles/role_exclusion_and_alias_bug.t | 67 + t/roles/role_for_combination.t | 45 + t/roles/roles_and_method_cloning.t | 77 + t/roles/roles_and_req_method_edge_cases.t | 277 + t/roles/roles_applied_in_create.t | 23 + t/roles/run_time_role_composition.t | 111 + t/roles/runtime_roles_and_attrs.t | 54 + t/roles/runtime_roles_and_nonmoose.t | 53 + t/roles/runtime_roles_w_params.t | 70 + t/roles/use_base_does.t | 42 + t/test_moose/test_moose.t | 10 + t/test_moose/test_moose_does_ok.t | 58 + t/test_moose/test_moose_has_attribute_ok.t | 45 + t/test_moose/test_moose_meta_ok.t | 29 + t/test_moose/with_immutable.t | 36 + .../exception_reflects_failed_constraint.t | 31 + t/todo_tests/immutable_n_around.t | 52 + t/todo_tests/moose_and_threads.t | 38 + t/todo_tests/replacing_super_methods.t | 42 + t/todo_tests/required_role_accessors.t | 57 + t/todo_tests/role_attr_methods_original_package.t | 45 + t/todo_tests/role_insertion_order.t | 41 + t/todo_tests/various_role_features.t | 271 + t/todo_tests/wrong-inner.t | 37 + t/type_constraints/advanced_type_creation.t | 95 + t/type_constraints/class_subtypes.t | 141 + t/type_constraints/class_type_constraint.t | 125 + t/type_constraints/coerced_parameterized_types.t | 55 + t/type_constraints/container_type_coercion.t | 63 + t/type_constraints/container_type_constraint.t | 70 + t/type_constraints/custom_parameterized_types.t | 83 + t/type_constraints/custom_type_errors.t | 45 + t/type_constraints/define_type_twice_throws.t | 23 + t/type_constraints/duck_type_handles.t | 45 + t/type_constraints/duck_types.t | 85 + t/type_constraints/enum.t | 85 + t/type_constraints/inlining.t | 197 + t/type_constraints/match_type_operator.t | 227 + t/type_constraints/maybe_type_constraint.t | 129 + t/type_constraints/misc_type_tests.t | 85 + t/type_constraints/name_conflicts.t | 112 + t/type_constraints/normalize_type_name.t | 148 + t/type_constraints/parameterize_from.t | 74 + t/type_constraints/role_type_constraint.t | 69 + t/type_constraints/subtype_auto_vivify_parent.t | 31 + t/type_constraints/subtyping_parameterized_types.t | 127 + t/type_constraints/subtyping_union_types.t | 108 + t/type_constraints/throw_error.t | 14 + .../type_coersion_on_lazy_attributes.t | 32 + t/type_constraints/type_names.t | 46 + t/type_constraints/type_notation_parser.t | 103 + t/type_constraints/types_and_undef.t | 108 + t/type_constraints/union_is_a_type_of.t | 49 + t/type_constraints/union_types.t | 195 + t/type_constraints/union_types_and_coercions.t | 181 + t/type_constraints/util_find_type_constraint.t | 34 + t/type_constraints/util_more_type_coercion.t | 130 + t/type_constraints/util_std_type_constraints.t | 1305 +++ t/type_constraints/util_type_coercion.t | 100 + t/type_constraints/util_type_constraints.t | 233 + t/type_constraints/util_type_constraints_export.t | 27 + t/type_constraints/util_type_reloading.t | 27 + t/type_constraints/with-specio.t | 204 + t/zzz-check-breaks.t | 98 + xs/Attribute.xs | 9 + xs/AttributeCore.xs | 18 + xs/Class.xs | 12 + xs/Generated.xs | 9 + xs/HasAttributes.xs | 9 + xs/HasMethods.xs | 88 + xs/Inlined.xs | 8 + xs/Instance.xs | 8 + xs/MOP.xs | 21 + xs/Method.xs | 23 + xs/Moose.xs | 170 + xs/Package.xs | 8 + xs/ToInstance.xs | 63 + xs/typemap | 17 + xt/author/authority.t | 15 + xt/author/debugger-duck_type.t | 17 + xt/author/eol.t | 969 +++ xt/author/memory_leaks.t | 239 + xt/author/no-tabs.t | 969 +++ xt/author/pod-coverage.t | 233 + xt/author/pod-spell.t | 382 + xt/author/test-my-dependents.t | 808 ++ xt/release/00-compile.t | 449 ++ xt/release/cpan-changes.t | 11 + xt/release/distmeta.t | 6 + xt/release/kwalitee.t | 9 + xt/release/mojibake.t | 12 + xt/release/pod-syntax.t | 6 + 1041 files changed, 143765 insertions(+) create mode 100644 Changes create mode 100644 Changes.Class-MOP create mode 100644 LICENSE create mode 100644 MANIFEST create mode 100644 META.json create mode 100644 META.yml create mode 100644 Makefile.PL create mode 100644 README.md create mode 100644 TODO create mode 100644 author/docGenerator.pl create mode 100755 author/extract-inline-tests create mode 100755 author/find-dupe-test-numbers create mode 100644 benchmarks/caf_vs_moose.pl create mode 100644 benchmarks/cmop/all.yml create mode 100755 benchmarks/cmop/foo.pl create mode 100644 benchmarks/cmop/lib/Bench/Accessor.pm create mode 100644 benchmarks/cmop/lib/Bench/Construct.pm create mode 100644 benchmarks/cmop/lib/Bench/Run.pm create mode 100644 benchmarks/cmop/lib/MOP/Immutable/Point.pm create mode 100644 benchmarks/cmop/lib/MOP/Immutable/Point3D.pm create mode 100644 benchmarks/cmop/lib/MOP/Installed/Point.pm create mode 100644 benchmarks/cmop/lib/MOP/Installed/Point3D.pm create mode 100644 benchmarks/cmop/lib/MOP/Point.pm create mode 100644 benchmarks/cmop/lib/MOP/Point3D.pm create mode 100644 benchmarks/cmop/lib/Plain/Point.pm create mode 100644 benchmarks/cmop/lib/Plain/Point3D.pm create mode 100755 benchmarks/cmop/loading-benchmark.pl create mode 100755 benchmarks/cmop/profile.pl create mode 100644 benchmarks/cmop/run_yml.pl create mode 100644 benchmarks/immutable.pl create mode 100644 benchmarks/lotsa-classes.pl create mode 100755 benchmarks/method_modifiers.pl create mode 100755 benchmarks/moose_bench.pl create mode 100644 benchmarks/simple_class.pl create mode 100644 benchmarks/simple_compile.pl create mode 100644 benchmarks/simple_constructor.pl create mode 100644 benchmarks/type_constraints.pl create mode 100644 benchmarks/type_constraints2.pl create mode 100644 bin/moose-outdated create mode 100644 dist.ini create mode 100644 doc/moosex-compile create mode 100644 inc/CheckAuthorDeps.pm create mode 100644 inc/CheckDelta.pm create mode 100644 inc/CheckReleaseType.pm create mode 100644 inc/Clean.pm create mode 100644 inc/ExtractInlineTests.pm create mode 100644 inc/GenerateDocs.pm create mode 100644 inc/GitUpToDate.pm create mode 100644 inc/MMHelper.pm create mode 100644 inc/MakeMaker.pm create mode 100644 inc/MyInline.pm create mode 100644 inc/SimpleAuthority.pm create mode 100644 inc/SimpleProvides.pm create mode 100644 inc/TestRelease.pm create mode 100644 lib/Class/MOP.pm create mode 100644 lib/Class/MOP/Attribute.pm create mode 100644 lib/Class/MOP/Class.pm create mode 100644 lib/Class/MOP/Class/Immutable/Trait.pm create mode 100644 lib/Class/MOP/Deprecated.pm create mode 100644 lib/Class/MOP/Instance.pm create mode 100644 lib/Class/MOP/Method.pm create mode 100644 lib/Class/MOP/Method/Accessor.pm create mode 100644 lib/Class/MOP/Method/Constructor.pm create mode 100644 lib/Class/MOP/Method/Generated.pm create mode 100644 lib/Class/MOP/Method/Inlined.pm create mode 100644 lib/Class/MOP/Method/Meta.pm create mode 100644 lib/Class/MOP/Method/Wrapped.pm create mode 100644 lib/Class/MOP/MiniTrait.pm create mode 100644 lib/Class/MOP/Mixin.pm create mode 100644 lib/Class/MOP/Mixin/AttributeCore.pm create mode 100644 lib/Class/MOP/Mixin/HasAttributes.pm create mode 100644 lib/Class/MOP/Mixin/HasMethods.pm create mode 100644 lib/Class/MOP/Mixin/HasOverloads.pm create mode 100644 lib/Class/MOP/Module.pm create mode 100644 lib/Class/MOP/Object.pm create mode 100644 lib/Class/MOP/Overload.pm create mode 100644 lib/Class/MOP/Package.pm create mode 100644 lib/Moose.pm create mode 100644 lib/Moose/Conflicts.pm create mode 100644 lib/Moose/Cookbook.pod create mode 100644 lib/Moose/Cookbook/Basics/BankAccount_MethodModifiersAndSubclassing.pod create mode 100644 lib/Moose/Cookbook/Basics/BinaryTree_AttributeFeatures.pod create mode 100644 lib/Moose/Cookbook/Basics/BinaryTree_BuilderAndLazyBuild.pod create mode 100644 lib/Moose/Cookbook/Basics/Company_Subtypes.pod create mode 100644 lib/Moose/Cookbook/Basics/DateTime_ExtendingNonMooseParent.pod create mode 100644 lib/Moose/Cookbook/Basics/Document_AugmentAndInner.pod create mode 100644 lib/Moose/Cookbook/Basics/Genome_OverloadingSubtypesAndCoercion.pod create mode 100644 lib/Moose/Cookbook/Basics/HTTP_SubtypesAndCoercion.pod create mode 100644 lib/Moose/Cookbook/Basics/Immutable.pod create mode 100644 lib/Moose/Cookbook/Basics/Person_BUILDARGSAndBUILD.pod create mode 100644 lib/Moose/Cookbook/Basics/Point_AttributesAndSubclassing.pod create mode 100644 lib/Moose/Cookbook/Extending/Debugging_BaseClassRole.pod create mode 100644 lib/Moose/Cookbook/Extending/ExtensionOverview.pod create mode 100644 lib/Moose/Cookbook/Extending/Mooseish_MooseSugar.pod create mode 100644 lib/Moose/Cookbook/Legacy/Debugging_BaseClassReplacement.pod create mode 100644 lib/Moose/Cookbook/Legacy/Labeled_AttributeMetaclass.pod create mode 100644 lib/Moose/Cookbook/Legacy/Table_ClassMetaclass.pod create mode 100644 lib/Moose/Cookbook/Meta/GlobRef_InstanceMetaclass.pod create mode 100644 lib/Moose/Cookbook/Meta/Labeled_AttributeTrait.pod create mode 100644 lib/Moose/Cookbook/Meta/PrivateOrPublic_MethodMetaclass.pod create mode 100644 lib/Moose/Cookbook/Meta/Table_MetaclassTrait.pod create mode 100644 lib/Moose/Cookbook/Meta/WhyMeta.pod create mode 100644 lib/Moose/Cookbook/Roles/ApplicationToInstance.pod create mode 100644 lib/Moose/Cookbook/Roles/Comparable_CodeReuse.pod create mode 100644 lib/Moose/Cookbook/Roles/Restartable_AdvancedComposition.pod create mode 100644 lib/Moose/Cookbook/Snack/Keywords.pod create mode 100644 lib/Moose/Cookbook/Snack/Types.pod create mode 100644 lib/Moose/Cookbook/Style.pod create mode 100644 lib/Moose/Deprecated.pm create mode 100644 lib/Moose/Exception.pm create mode 100644 lib/Moose/Exception/AccessorMustReadWrite.pm create mode 100644 lib/Moose/Exception/AddParameterizableTypeTakesParameterizableType.pm create mode 100644 lib/Moose/Exception/AddRoleTakesAMooseMetaRoleInstance.pm create mode 100644 lib/Moose/Exception/AddRoleToARoleTakesAMooseMetaRole.pm create mode 100644 lib/Moose/Exception/ApplyTakesABlessedInstance.pm create mode 100644 lib/Moose/Exception/AttachToClassNeedsAClassMOPClassInstanceOrASubclass.pm create mode 100644 lib/Moose/Exception/AttributeConflictInRoles.pm create mode 100644 lib/Moose/Exception/AttributeConflictInSummation.pm create mode 100644 lib/Moose/Exception/AttributeExtensionIsNotSupportedInRoles.pm create mode 100644 lib/Moose/Exception/AttributeIsRequired.pm create mode 100644 lib/Moose/Exception/AttributeMustBeAnClassMOPMixinAttributeCoreOrSubclass.pm create mode 100644 lib/Moose/Exception/AttributeNamesDoNotMatch.pm create mode 100644 lib/Moose/Exception/AttributeValueIsNotAnObject.pm create mode 100644 lib/Moose/Exception/AttributeValueIsNotDefined.pm create mode 100644 lib/Moose/Exception/AutoDeRefNeedsArrayRefOrHashRef.pm create mode 100644 lib/Moose/Exception/BadOptionFormat.pm create mode 100644 lib/Moose/Exception/BothBuilderAndDefaultAreNotAllowed.pm create mode 100644 lib/Moose/Exception/BuilderDoesNotExist.pm create mode 100644 lib/Moose/Exception/BuilderMethodNotSupportedForAttribute.pm create mode 100644 lib/Moose/Exception/BuilderMethodNotSupportedForInlineAttribute.pm create mode 100644 lib/Moose/Exception/BuilderMustBeAMethodName.pm create mode 100644 lib/Moose/Exception/CallingMethodOnAnImmutableInstance.pm create mode 100644 lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm create mode 100644 lib/Moose/Exception/CanExtendOnlyClasses.pm create mode 100644 lib/Moose/Exception/CanOnlyConsumeRole.pm create mode 100644 lib/Moose/Exception/CanOnlyWrapBlessedCode.pm create mode 100644 lib/Moose/Exception/CanReblessOnlyIntoASubclass.pm create mode 100644 lib/Moose/Exception/CanReblessOnlyIntoASuperclass.pm create mode 100644 lib/Moose/Exception/CannotAddAdditionalTypeCoercionsToUnion.pm create mode 100644 lib/Moose/Exception/CannotAddAsAnAttributeToARole.pm create mode 100644 lib/Moose/Exception/CannotApplyBaseClassRolesToRole.pm create mode 100644 lib/Moose/Exception/CannotAssignValueToReadOnlyAccessor.pm create mode 100644 lib/Moose/Exception/CannotAugmentIfLocalMethodPresent.pm create mode 100644 lib/Moose/Exception/CannotAugmentNoSuperMethod.pm create mode 100644 lib/Moose/Exception/CannotAutoDerefWithoutIsa.pm create mode 100644 lib/Moose/Exception/CannotAutoDereferenceTypeConstraint.pm create mode 100644 lib/Moose/Exception/CannotCalculateNativeType.pm create mode 100644 lib/Moose/Exception/CannotCallAnAbstractBaseMethod.pm create mode 100644 lib/Moose/Exception/CannotCallAnAbstractMethod.pm create mode 100644 lib/Moose/Exception/CannotCoerceAWeakRef.pm create mode 100644 lib/Moose/Exception/CannotCoerceAttributeWhichHasNoCoercion.pm create mode 100644 lib/Moose/Exception/CannotCreateHigherOrderTypeWithoutATypeParameter.pm create mode 100644 lib/Moose/Exception/CannotCreateMethodAliasLocalMethodIsPresent.pm create mode 100644 lib/Moose/Exception/CannotCreateMethodAliasLocalMethodIsPresentInClass.pm create mode 100644 lib/Moose/Exception/CannotDelegateLocalMethodIsPresent.pm create mode 100644 lib/Moose/Exception/CannotDelegateWithoutIsa.pm create mode 100644 lib/Moose/Exception/CannotFindDelegateMetaclass.pm create mode 100644 lib/Moose/Exception/CannotFindType.pm create mode 100644 lib/Moose/Exception/CannotFindTypeGivenToMatchOnType.pm create mode 100644 lib/Moose/Exception/CannotFixMetaclassCompatibility.pm create mode 100644 lib/Moose/Exception/CannotGenerateInlineConstraint.pm create mode 100644 lib/Moose/Exception/CannotInitializeMooseMetaRoleComposite.pm create mode 100644 lib/Moose/Exception/CannotInlineTypeConstraintCheck.pm create mode 100644 lib/Moose/Exception/CannotLocatePackageInINC.pm create mode 100644 lib/Moose/Exception/CannotMakeMetaclassCompatible.pm create mode 100644 lib/Moose/Exception/CannotOverrideALocalMethod.pm create mode 100644 lib/Moose/Exception/CannotOverrideBodyOfMetaMethods.pm create mode 100644 lib/Moose/Exception/CannotOverrideLocalMethodIsPresent.pm create mode 100644 lib/Moose/Exception/CannotOverrideNoSuperMethod.pm create mode 100644 lib/Moose/Exception/CannotRegisterUnnamedTypeConstraint.pm create mode 100644 lib/Moose/Exception/CannotUseLazyBuildAndDefaultSimultaneously.pm create mode 100644 lib/Moose/Exception/CircularReferenceInAlso.pm create mode 100644 lib/Moose/Exception/ClassDoesNotHaveInitMeta.pm create mode 100644 lib/Moose/Exception/ClassDoesTheExcludedRole.pm create mode 100644 lib/Moose/Exception/ClassNamesDoNotMatch.pm create mode 100644 lib/Moose/Exception/CloneObjectExpectsAnInstanceOfMetaclass.pm create mode 100644 lib/Moose/Exception/CodeBlockMustBeACodeRef.pm create mode 100644 lib/Moose/Exception/CoercingWithoutCoercions.pm create mode 100644 lib/Moose/Exception/CoercionAlreadyExists.pm create mode 100644 lib/Moose/Exception/CoercionNeedsTypeConstraint.pm create mode 100644 lib/Moose/Exception/ConflictDetectedInCheckRoleExclusions.pm create mode 100644 lib/Moose/Exception/ConflictDetectedInCheckRoleExclusionsInToClass.pm create mode 100644 lib/Moose/Exception/ConstructClassInstanceTakesPackageName.pm create mode 100644 lib/Moose/Exception/CouldNotCreateMethod.pm create mode 100644 lib/Moose/Exception/CouldNotCreateWriter.pm create mode 100644 lib/Moose/Exception/CouldNotEvalConstructor.pm create mode 100644 lib/Moose/Exception/CouldNotEvalDestructor.pm create mode 100644 lib/Moose/Exception/CouldNotFindTypeConstraintToCoerceFrom.pm create mode 100644 lib/Moose/Exception/CouldNotGenerateInlineAttributeMethod.pm create mode 100644 lib/Moose/Exception/CouldNotLocateTypeConstraintForUnion.pm create mode 100644 lib/Moose/Exception/CouldNotParseType.pm create mode 100644 lib/Moose/Exception/CreateMOPClassTakesArrayRefOfAttributes.pm create mode 100644 lib/Moose/Exception/CreateMOPClassTakesArrayRefOfSuperclasses.pm create mode 100644 lib/Moose/Exception/CreateMOPClassTakesHashRefOfMethods.pm create mode 100644 lib/Moose/Exception/CreateTakesArrayRefOfRoles.pm create mode 100644 lib/Moose/Exception/CreateTakesHashRefOfAttributes.pm create mode 100644 lib/Moose/Exception/CreateTakesHashRefOfMethods.pm create mode 100644 lib/Moose/Exception/DefaultToMatchOnTypeMustBeCodeRef.pm create mode 100644 lib/Moose/Exception/DelegationToAClassWhichIsNotLoaded.pm create mode 100644 lib/Moose/Exception/DelegationToARoleWhichIsNotLoaded.pm create mode 100644 lib/Moose/Exception/DelegationToATypeWhichIsNotAClass.pm create mode 100644 lib/Moose/Exception/DoesRequiresRoleName.pm create mode 100644 lib/Moose/Exception/EnumCalledWithAnArrayRefAndAdditionalArgs.pm create mode 100644 lib/Moose/Exception/EnumValuesMustBeString.pm create mode 100644 lib/Moose/Exception/ExtendsMissingArgs.pm create mode 100644 lib/Moose/Exception/HandlesMustBeAHashRef.pm create mode 100644 lib/Moose/Exception/IllegalInheritedOptions.pm create mode 100644 lib/Moose/Exception/IllegalMethodTypeToAddMethodModifier.pm create mode 100644 lib/Moose/Exception/IncompatibleMetaclassOfSuperclass.pm create mode 100644 lib/Moose/Exception/InitMetaRequiresClass.pm create mode 100644 lib/Moose/Exception/InitializeTakesUnBlessedPackageName.pm create mode 100644 lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm create mode 100644 lib/Moose/Exception/InstanceMustBeABlessedReference.pm create mode 100644 lib/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm create mode 100644 lib/Moose/Exception/InvalidArgumentToMethod.pm create mode 100644 lib/Moose/Exception/InvalidArgumentsToTraitAliases.pm create mode 100644 lib/Moose/Exception/InvalidBaseTypeGivenToCreateParameterizedTypeConstraint.pm create mode 100644 lib/Moose/Exception/InvalidHandleValue.pm create mode 100644 lib/Moose/Exception/InvalidHasProvidedInARole.pm create mode 100644 lib/Moose/Exception/InvalidNameForType.pm create mode 100644 lib/Moose/Exception/InvalidOverloadOperator.pm create mode 100644 lib/Moose/Exception/InvalidRoleApplication.pm create mode 100644 lib/Moose/Exception/InvalidTypeConstraint.pm create mode 100644 lib/Moose/Exception/InvalidTypeGivenToCreateParameterizedTypeConstraint.pm create mode 100644 lib/Moose/Exception/InvalidValueForIs.pm create mode 100644 lib/Moose/Exception/IsaDoesNotDoTheRole.pm create mode 100644 lib/Moose/Exception/IsaLacksDoesMethod.pm create mode 100644 lib/Moose/Exception/LazyAttributeNeedsADefault.pm create mode 100644 lib/Moose/Exception/Legacy.pm create mode 100644 lib/Moose/Exception/MOPAttributeNewNeedsAttributeName.pm create mode 100644 lib/Moose/Exception/MatchActionMustBeACodeRef.pm create mode 100644 lib/Moose/Exception/MessageParameterMustBeCodeRef.pm create mode 100644 lib/Moose/Exception/MetaclassIsAClassNotASubclassOfGivenMetaclass.pm create mode 100644 lib/Moose/Exception/MetaclassIsARoleNotASubclassOfGivenMetaclass.pm create mode 100644 lib/Moose/Exception/MetaclassIsNotASubclassOfGivenMetaclass.pm create mode 100644 lib/Moose/Exception/MetaclassMustBeASubclassOfMooseMetaClass.pm create mode 100644 lib/Moose/Exception/MetaclassMustBeASubclassOfMooseMetaRole.pm create mode 100644 lib/Moose/Exception/MetaclassMustBeDerivedFromClassMOPClass.pm create mode 100644 lib/Moose/Exception/MetaclassNotLoaded.pm create mode 100644 lib/Moose/Exception/MetaclassTypeIncompatible.pm create mode 100644 lib/Moose/Exception/MethodExpectedAMetaclassObject.pm create mode 100644 lib/Moose/Exception/MethodExpectsFewerArgs.pm create mode 100644 lib/Moose/Exception/MethodExpectsMoreArgs.pm create mode 100644 lib/Moose/Exception/MethodModifierNeedsMethodName.pm create mode 100644 lib/Moose/Exception/MethodNameConflictInRoles.pm create mode 100644 lib/Moose/Exception/MethodNameNotFoundInInheritanceHierarchy.pm create mode 100644 lib/Moose/Exception/MethodNameNotGiven.pm create mode 100644 lib/Moose/Exception/MustDefineAMethodName.pm create mode 100644 lib/Moose/Exception/MustDefineAnAttributeName.pm create mode 100644 lib/Moose/Exception/MustDefineAnOverloadOperator.pm create mode 100644 lib/Moose/Exception/MustHaveAtLeastOneValueToEnumerate.pm create mode 100644 lib/Moose/Exception/MustPassAHashOfOptions.pm create mode 100644 lib/Moose/Exception/MustPassAMooseMetaRoleInstanceOrSubclass.pm create mode 100644 lib/Moose/Exception/MustPassAPackageNameOrAnExistingClassMOPPackageInstance.pm create mode 100644 lib/Moose/Exception/MustPassEvenNumberOfArguments.pm create mode 100644 lib/Moose/Exception/MustPassEvenNumberOfAttributeOptions.pm create mode 100644 lib/Moose/Exception/MustProvideANameForTheAttribute.pm create mode 100644 lib/Moose/Exception/MustSpecifyAtleastOneMethod.pm create mode 100644 lib/Moose/Exception/MustSpecifyAtleastOneRole.pm create mode 100644 lib/Moose/Exception/MustSpecifyAtleastOneRoleToApplicant.pm create mode 100644 lib/Moose/Exception/MustSupplyAClassMOPAttributeInstance.pm create mode 100644 lib/Moose/Exception/MustSupplyADelegateToMethod.pm create mode 100644 lib/Moose/Exception/MustSupplyAMetaclass.pm create mode 100644 lib/Moose/Exception/MustSupplyAMooseMetaAttributeInstance.pm create mode 100644 lib/Moose/Exception/MustSupplyAnAccessorTypeToConstructWith.pm create mode 100644 lib/Moose/Exception/MustSupplyAnAttributeToConstructWith.pm create mode 100644 lib/Moose/Exception/MustSupplyArrayRefAsCurriedArguments.pm create mode 100644 lib/Moose/Exception/MustSupplyPackageNameAndName.pm create mode 100644 lib/Moose/Exception/NeedsTypeConstraintUnionForTypeCoercionUnion.pm create mode 100644 lib/Moose/Exception/NeitherAttributeNorAttributeNameIsGiven.pm create mode 100644 lib/Moose/Exception/NeitherClassNorClassNameIsGiven.pm create mode 100644 lib/Moose/Exception/NeitherRoleNorRoleNameIsGiven.pm create mode 100644 lib/Moose/Exception/NeitherTypeNorTypeNameIsGiven.pm create mode 100644 lib/Moose/Exception/NoAttributeFoundInSuperClass.pm create mode 100644 lib/Moose/Exception/NoBodyToInitializeInAnAbstractBaseClass.pm create mode 100644 lib/Moose/Exception/NoCasesMatched.pm create mode 100644 lib/Moose/Exception/NoConstraintCheckForTypeConstraint.pm create mode 100644 lib/Moose/Exception/NoDestructorClassSpecified.pm create mode 100644 lib/Moose/Exception/NoImmutableTraitSpecifiedForClass.pm create mode 100644 lib/Moose/Exception/NoParentGivenToSubtype.pm create mode 100644 lib/Moose/Exception/OnlyInstancesCanBeCloned.pm create mode 100644 lib/Moose/Exception/OperatorIsRequired.pm create mode 100644 lib/Moose/Exception/OverloadConflictInSummation.pm create mode 100644 lib/Moose/Exception/OverloadRequiresAMetaClass.pm create mode 100644 lib/Moose/Exception/OverloadRequiresAMetaMethod.pm create mode 100644 lib/Moose/Exception/OverloadRequiresAMetaOverload.pm create mode 100644 lib/Moose/Exception/OverloadRequiresAMethodNameOrCoderef.pm create mode 100644 lib/Moose/Exception/OverloadRequiresAnOperator.pm create mode 100644 lib/Moose/Exception/OverloadRequiresNamesForCoderef.pm create mode 100644 lib/Moose/Exception/OverrideConflictInComposition.pm create mode 100644 lib/Moose/Exception/OverrideConflictInSummation.pm create mode 100644 lib/Moose/Exception/PackageDoesNotUseMooseExporter.pm create mode 100644 lib/Moose/Exception/PackageNameAndNameParamsNotGivenToWrap.pm create mode 100644 lib/Moose/Exception/PackagesAndModulesAreNotCachable.pm create mode 100644 lib/Moose/Exception/ParameterIsNotSubtypeOfParent.pm create mode 100644 lib/Moose/Exception/ReferencesAreNotAllowedAsDefault.pm create mode 100644 lib/Moose/Exception/RequiredAttributeLacksInitialization.pm create mode 100644 lib/Moose/Exception/RequiredAttributeNeedsADefault.pm create mode 100644 lib/Moose/Exception/RequiredMethodsImportedByClass.pm create mode 100644 lib/Moose/Exception/RequiredMethodsNotImplementedByClass.pm create mode 100644 lib/Moose/Exception/Role/Attribute.pm create mode 100644 lib/Moose/Exception/Role/AttributeName.pm create mode 100644 lib/Moose/Exception/Role/Class.pm create mode 100644 lib/Moose/Exception/Role/EitherAttributeOrAttributeName.pm create mode 100644 lib/Moose/Exception/Role/Instance.pm create mode 100644 lib/Moose/Exception/Role/InstanceClass.pm create mode 100644 lib/Moose/Exception/Role/InvalidAttributeOptions.pm create mode 100644 lib/Moose/Exception/Role/Method.pm create mode 100644 lib/Moose/Exception/Role/ParamsHash.pm create mode 100644 lib/Moose/Exception/Role/Role.pm create mode 100644 lib/Moose/Exception/Role/RoleForCreate.pm create mode 100644 lib/Moose/Exception/Role/RoleForCreateMOPClass.pm create mode 100644 lib/Moose/Exception/Role/TypeConstraint.pm create mode 100644 lib/Moose/Exception/RoleDoesTheExcludedRole.pm create mode 100644 lib/Moose/Exception/RoleExclusionConflict.pm create mode 100644 lib/Moose/Exception/RoleNameRequired.pm create mode 100644 lib/Moose/Exception/RoleNameRequiredForMooseMetaRole.pm create mode 100644 lib/Moose/Exception/RolesDoNotSupportAugment.pm create mode 100644 lib/Moose/Exception/RolesDoNotSupportExtends.pm create mode 100644 lib/Moose/Exception/RolesDoNotSupportInner.pm create mode 100644 lib/Moose/Exception/RolesDoNotSupportRegexReferencesForMethodModifiers.pm create mode 100644 lib/Moose/Exception/RolesInCreateTakesAnArrayRef.pm create mode 100644 lib/Moose/Exception/RolesListMustBeInstancesOfMooseMetaRole.pm create mode 100644 lib/Moose/Exception/SingleParamsToNewMustBeHashRef.pm create mode 100644 lib/Moose/Exception/TriggerMustBeACodeRef.pm create mode 100644 lib/Moose/Exception/TypeConstraintCannotBeUsedForAParameterizableType.pm create mode 100644 lib/Moose/Exception/TypeConstraintIsAlreadyCreated.pm create mode 100644 lib/Moose/Exception/TypeParameterMustBeMooseMetaType.pm create mode 100644 lib/Moose/Exception/UnableToCanonicalizeHandles.pm create mode 100644 lib/Moose/Exception/UnableToCanonicalizeNonRolePackage.pm create mode 100644 lib/Moose/Exception/UnableToRecognizeDelegateMetaclass.pm create mode 100644 lib/Moose/Exception/UndefinedHashKeysPassedToMethod.pm create mode 100644 lib/Moose/Exception/UnionCalledWithAnArrayRefAndAdditionalArgs.pm create mode 100644 lib/Moose/Exception/UnionTakesAtleastTwoTypeNames.pm create mode 100644 lib/Moose/Exception/ValidationFailedForInlineTypeConstraint.pm create mode 100644 lib/Moose/Exception/ValidationFailedForTypeConstraint.pm create mode 100644 lib/Moose/Exception/WrapTakesACodeRefToBless.pm create mode 100644 lib/Moose/Exception/WrongTypeConstraintGiven.pm create mode 100644 lib/Moose/Exporter.pm create mode 100644 lib/Moose/Intro.pod create mode 100644 lib/Moose/Manual.pod create mode 100644 lib/Moose/Manual/Attributes.pod create mode 100644 lib/Moose/Manual/BestPractices.pod create mode 100644 lib/Moose/Manual/Classes.pod create mode 100644 lib/Moose/Manual/Concepts.pod create mode 100644 lib/Moose/Manual/Construction.pod create mode 100644 lib/Moose/Manual/Contributing.pod create mode 100644 lib/Moose/Manual/Delegation.pod create mode 100644 lib/Moose/Manual/Delta.pod create mode 100644 lib/Moose/Manual/Exceptions.pod create mode 100644 lib/Moose/Manual/Exceptions/Manifest.pod create mode 100644 lib/Moose/Manual/FAQ.pod create mode 100644 lib/Moose/Manual/MOP.pod create mode 100644 lib/Moose/Manual/MethodModifiers.pod create mode 100644 lib/Moose/Manual/MooseX.pod create mode 100644 lib/Moose/Manual/Resources.pod create mode 100644 lib/Moose/Manual/Roles.pod create mode 100644 lib/Moose/Manual/Support.pod create mode 100644 lib/Moose/Manual/Types.pod create mode 100644 lib/Moose/Manual/Unsweetened.pod create mode 100644 lib/Moose/Meta/Attribute.pm create mode 100644 lib/Moose/Meta/Attribute/Native.pm create mode 100644 lib/Moose/Meta/Attribute/Native/Trait.pm create mode 100644 lib/Moose/Meta/Attribute/Native/Trait/Array.pm create mode 100644 lib/Moose/Meta/Attribute/Native/Trait/Bool.pm create mode 100644 lib/Moose/Meta/Attribute/Native/Trait/Code.pm create mode 100644 lib/Moose/Meta/Attribute/Native/Trait/Counter.pm create mode 100644 lib/Moose/Meta/Attribute/Native/Trait/Hash.pm create mode 100644 lib/Moose/Meta/Attribute/Native/Trait/Number.pm create mode 100644 lib/Moose/Meta/Attribute/Native/Trait/String.pm create mode 100644 lib/Moose/Meta/Class.pm create mode 100644 lib/Moose/Meta/Class/Immutable/Trait.pm create mode 100644 lib/Moose/Meta/Instance.pm create mode 100644 lib/Moose/Meta/Method.pm create mode 100644 lib/Moose/Meta/Method/Accessor.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/accessor.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/clear.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/count.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/delete.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/elements.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/first.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/first_index.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/get.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/grep.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/insert.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/is_empty.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/join.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/map.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/natatime.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/push.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/reduce.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/set.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/shallow_clone.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/shift.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/shuffle.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/sort.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/splice.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Array/unshift.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Bool/not.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Bool/set.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Bool/toggle.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Bool/unset.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Code/execute.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Code/execute_method.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Collection.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Counter/dec.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Counter/inc.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Counter/reset.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Counter/set.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/clear.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/count.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/defined.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/elements.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/exists.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/kv.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/shallow_clone.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Hash/values.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Number/abs.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Number/add.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Number/div.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Number/mod.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Number/mul.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Number/set.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Number/sub.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Reader.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/append.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/chomp.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/chop.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/clear.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/inc.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/length.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/match.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/prepend.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/replace.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/String/substr.pm create mode 100644 lib/Moose/Meta/Method/Accessor/Native/Writer.pm create mode 100644 lib/Moose/Meta/Method/Augmented.pm create mode 100644 lib/Moose/Meta/Method/Constructor.pm create mode 100644 lib/Moose/Meta/Method/Delegation.pm create mode 100644 lib/Moose/Meta/Method/Destructor.pm create mode 100644 lib/Moose/Meta/Method/Meta.pm create mode 100644 lib/Moose/Meta/Method/Overridden.pm create mode 100644 lib/Moose/Meta/Mixin/AttributeCore.pm create mode 100644 lib/Moose/Meta/Object/Trait.pm create mode 100644 lib/Moose/Meta/Role.pm create mode 100644 lib/Moose/Meta/Role/Application.pm create mode 100644 lib/Moose/Meta/Role/Application/RoleSummation.pm create mode 100644 lib/Moose/Meta/Role/Application/ToClass.pm create mode 100644 lib/Moose/Meta/Role/Application/ToInstance.pm create mode 100644 lib/Moose/Meta/Role/Application/ToRole.pm create mode 100644 lib/Moose/Meta/Role/Attribute.pm create mode 100644 lib/Moose/Meta/Role/Composite.pm create mode 100644 lib/Moose/Meta/Role/Method.pm create mode 100644 lib/Moose/Meta/Role/Method/Conflicting.pm create mode 100644 lib/Moose/Meta/Role/Method/Required.pm create mode 100644 lib/Moose/Meta/TypeCoercion.pm create mode 100644 lib/Moose/Meta/TypeCoercion/Union.pm create mode 100644 lib/Moose/Meta/TypeConstraint.pm create mode 100644 lib/Moose/Meta/TypeConstraint/Class.pm create mode 100644 lib/Moose/Meta/TypeConstraint/DuckType.pm create mode 100644 lib/Moose/Meta/TypeConstraint/Enum.pm create mode 100644 lib/Moose/Meta/TypeConstraint/Parameterizable.pm create mode 100644 lib/Moose/Meta/TypeConstraint/Parameterized.pm create mode 100644 lib/Moose/Meta/TypeConstraint/Registry.pm create mode 100644 lib/Moose/Meta/TypeConstraint/Role.pm create mode 100644 lib/Moose/Meta/TypeConstraint/Union.pm create mode 100644 lib/Moose/Object.pm create mode 100644 lib/Moose/Role.pm create mode 100644 lib/Moose/Spec/Role.pod create mode 100644 lib/Moose/Unsweetened.pod create mode 100644 lib/Moose/Util.pm create mode 100644 lib/Moose/Util/MetaRole.pm create mode 100644 lib/Moose/Util/TypeConstraints.pm create mode 100644 lib/Moose/Util/TypeConstraints/Builtins.pm create mode 100644 lib/Test/Moose.pm create mode 100644 lib/metaclass.pm create mode 100644 lib/oose.pm create mode 100644 mop.c create mode 100644 mop.h create mode 100644 perltidyrc create mode 100644 ppport.h create mode 100644 t/00-report-prereqs.dd create mode 100644 t/00-report-prereqs.t create mode 100644 t/000_load.t create mode 100644 t/attributes/accessor_context.t create mode 100644 t/attributes/accessor_inlining.t create mode 100644 t/attributes/accessor_override_method.t create mode 100644 t/attributes/accessor_overwrite_warning.t create mode 100644 t/attributes/attr_dereference_test.t create mode 100644 t/attributes/attribute_accessor_generation.t create mode 100644 t/attributes/attribute_custom_metaclass.t create mode 100644 t/attributes/attribute_delegation.t create mode 100644 t/attributes/attribute_does.t create mode 100644 t/attributes/attribute_inherited_slot_specs.t create mode 100644 t/attributes/attribute_lazy_initializer.t create mode 100644 t/attributes/attribute_names.t create mode 100644 t/attributes/attribute_reader_generation.t create mode 100644 t/attributes/attribute_required.t create mode 100644 t/attributes/attribute_traits.t create mode 100644 t/attributes/attribute_traits_n_meta.t create mode 100644 t/attributes/attribute_traits_parameterized.t create mode 100644 t/attributes/attribute_traits_registered.t create mode 100644 t/attributes/attribute_triggers.t create mode 100644 t/attributes/attribute_type_unions.t create mode 100644 t/attributes/attribute_without_any_methods.t create mode 100644 t/attributes/attribute_writer_generation.t create mode 100644 t/attributes/bad_coerce.t create mode 100644 t/attributes/chained_coercion.t create mode 100644 t/attributes/clone_weak.t create mode 100644 t/attributes/default_class_role_types.t create mode 100644 t/attributes/default_undef.t create mode 100644 t/attributes/delegation_and_modifiers.t create mode 100644 t/attributes/delegation_arg_aliasing.t create mode 100644 t/attributes/delegation_target_not_loaded.t create mode 100644 t/attributes/illegal_options_for_inheritance.t create mode 100644 t/attributes/inherit_lazy_build.t create mode 100644 t/attributes/lazy_no_default.t create mode 100644 t/attributes/method_generation_rules.t create mode 100644 t/attributes/misc_attribute_coerce_lazy.t create mode 100644 t/attributes/misc_attribute_tests.t create mode 100644 t/attributes/more_attr_delegation.t create mode 100644 t/attributes/no_init_arg.t create mode 100644 t/attributes/no_slot_access.t create mode 100644 t/attributes/non_alpha_attr_names.t create mode 100644 t/attributes/numeric_defaults.t create mode 100644 t/attributes/trigger_and_coerce.t create mode 100644 t/attributes/type_constraint.t create mode 100644 t/basics/always_strict_warnings.t create mode 100644 t/basics/basic_class_setup.t create mode 100644 t/basics/buildargs.t create mode 100644 t/basics/buildargs_warning.t create mode 100644 t/basics/create.t create mode 100644 t/basics/create_anon.t create mode 100644 t/basics/deprecations.t create mode 100644 t/basics/destruction.t create mode 100644 t/basics/error_handling.t create mode 100644 t/basics/global-destruction-helper.pl create mode 100644 t/basics/global_destruction.t create mode 100644 t/basics/import_unimport.t create mode 100644 t/basics/inner_and_augment.t create mode 100644 t/basics/load_into_main.t create mode 100644 t/basics/method_modifier_with_regexp.t create mode 100644 t/basics/methods.t create mode 100644 t/basics/moose_object_does.t create mode 100644 t/basics/moose_respects_type_constraints.t create mode 100644 t/basics/override_and_foreign_classes.t create mode 100644 t/basics/override_augment_inner_super.t create mode 100644 t/basics/rebless.t create mode 100644 t/basics/require_superclasses.t create mode 100644 t/basics/super_and_override.t create mode 100644 t/basics/super_warns_on_args.t create mode 100644 t/basics/universal_methods_wrappable.t create mode 100644 t/basics/wrapped_method_cxt_propagation.t create mode 100644 t/bugs/DEMOLISHALL.t create mode 100644 t/bugs/DEMOLISHALL_shortcutted.t create mode 100644 t/bugs/DEMOLISH_eats_exceptions.t create mode 100644 t/bugs/DEMOLISH_eats_mini.t create mode 100644 t/bugs/DEMOLISH_fails_without_metaclass.t create mode 100644 t/bugs/Moose_Object_error.t create mode 100644 t/bugs/anon_method_metaclass.t create mode 100644 t/bugs/application_metarole_compat.t create mode 100644 t/bugs/apply_role_to_one_instance_only.t create mode 100644 t/bugs/attribute_trait_parameters.t create mode 100644 t/bugs/augment_recursion_bug.t create mode 100644 t/bugs/coerce_without_coercion.t create mode 100644 t/bugs/constructor_object_overload.t create mode 100644 t/bugs/create_anon_recursion.t create mode 100644 t/bugs/create_anon_role_pass.t create mode 100644 t/bugs/delete_sub_stash.t create mode 100644 t/bugs/handles_foreign_class_bug.t create mode 100644 t/bugs/immutable_metaclass_does_role.t create mode 100644 t/bugs/immutable_n_default_x2.t create mode 100644 t/bugs/inheriting_from_roles.t create mode 100644 t/bugs/inline_reader_bug.t create mode 100644 t/bugs/instance_application_role_args.t create mode 100644 t/bugs/lazybuild_required_undef.t create mode 100644 t/bugs/mark_as_methods_overloading_breakage.t create mode 100644 t/bugs/moose_exporter_false_circular_reference_rt_63818.t create mode 100644 t/bugs/moose_octal_defaults.t create mode 100644 t/bugs/native_trait_handles_bad_value.t create mode 100644 t/bugs/overloading_edge_cases.t create mode 100644 t/bugs/reader_precedence_bug.t create mode 100644 t/bugs/role_caller.t create mode 100644 t/bugs/subclass_use_base_bug.t create mode 100644 t/bugs/subtype_conflict_bug.t create mode 100644 t/bugs/subtype_quote_bug.t create mode 100644 t/bugs/super_recursion.t create mode 100644 t/bugs/traits_with_exporter.t create mode 100644 t/bugs/type_constraint_messages.t create mode 100644 t/cmop/ArrayBasedStorage_test.t create mode 100644 t/cmop/AttributesWithHistory_test.t create mode 100644 t/cmop/BinaryTree_test.t create mode 100644 t/cmop/C3MethodDispatchOrder_test.t create mode 100644 t/cmop/ClassEncapsulatedAttributes_test.t create mode 100644 t/cmop/Class_C3_compatibility.t create mode 100644 t/cmop/InsideOutClass_test.t create mode 100644 t/cmop/InstanceCountingClass_test.t create mode 100644 t/cmop/LazyClass_test.t create mode 100644 t/cmop/Perl6Attribute_test.t create mode 100644 t/cmop/RT_27329_fix.t create mode 100644 t/cmop/RT_39001_fix.t create mode 100644 t/cmop/RT_41255.t create mode 100644 t/cmop/add_attribute_alternate.t create mode 100644 t/cmop/add_method_debugmode.t create mode 100644 t/cmop/add_method_modifier.t create mode 100644 t/cmop/advanced_methods.t create mode 100644 t/cmop/anon_class.t create mode 100644 t/cmop/anon_class_create_init.t create mode 100644 t/cmop/anon_class_keep_alive.t create mode 100644 t/cmop/anon_class_leak.t create mode 100644 t/cmop/anon_class_removal.t create mode 100644 t/cmop/anon_packages.t create mode 100644 t/cmop/attribute.t create mode 100644 t/cmop/attribute_duplication.t create mode 100644 t/cmop/attribute_errors_and_edge_cases.t create mode 100644 t/cmop/attribute_get_read_write.t create mode 100644 t/cmop/attribute_initializer.t create mode 100644 t/cmop/attribute_introspection.t create mode 100644 t/cmop/attribute_non_alpha_name.t create mode 100644 t/cmop/attributes.t create mode 100644 t/cmop/basic.t create mode 100644 t/cmop/before_after_dollar_under.t create mode 100644 t/cmop/class_errors_and_edge_cases.t create mode 100644 t/cmop/class_is_pristine.t create mode 100644 t/cmop/class_precedence_list.t create mode 100644 t/cmop/constant_codeinfo.t create mode 100644 t/cmop/create_class.t create mode 100644 t/cmop/custom_instance.t create mode 100644 t/cmop/deprecated.t create mode 100644 t/cmop/get_code_info.t create mode 100644 t/cmop/immutable_custom_trait.t create mode 100644 t/cmop/immutable_metaclass.t create mode 100644 t/cmop/immutable_w_constructors.t create mode 100644 t/cmop/immutable_w_custom_metaclass.t create mode 100644 t/cmop/inline_and_dollar_at.t create mode 100644 t/cmop/inline_structor.t create mode 100644 t/cmop/insertion_order.t create mode 100644 t/cmop/instance.t create mode 100644 t/cmop/instance_inline.t create mode 100644 t/cmop/instance_metaclass_incompat.t create mode 100644 t/cmop/instance_metaclass_incompat_dyn.t create mode 100644 t/cmop/lib/ArrayBasedStorage.pm create mode 100644 t/cmop/lib/AttributesWithHistory.pm create mode 100644 t/cmop/lib/BinaryTree.pm create mode 100644 t/cmop/lib/C3MethodDispatchOrder.pm create mode 100644 t/cmop/lib/ClassEncapsulatedAttributes.pm create mode 100644 t/cmop/lib/InsideOutClass.pm create mode 100644 t/cmop/lib/InstanceCountingClass.pm create mode 100644 t/cmop/lib/LazyClass.pm create mode 100644 t/cmop/lib/MyMetaClass.pm create mode 100644 t/cmop/lib/MyMetaClass/Attribute.pm create mode 100644 t/cmop/lib/MyMetaClass/Instance.pm create mode 100644 t/cmop/lib/MyMetaClass/Method.pm create mode 100644 t/cmop/lib/MyMetaClass/Random.pm create mode 100644 t/cmop/lib/Perl6Attribute.pm create mode 100644 t/cmop/lib/SyntaxError.pm create mode 100644 t/cmop/load.t create mode 100644 t/cmop/magic.t create mode 100644 t/cmop/make_mutable.t create mode 100644 t/cmop/meta_method.t create mode 100644 t/cmop/meta_package.t create mode 100644 t/cmop/meta_package_extension.t create mode 100644 t/cmop/metaclass.t create mode 100644 t/cmop/metaclass_incompatibility.t create mode 100644 t/cmop/metaclass_incompatibility_dyn.t create mode 100644 t/cmop/metaclass_inheritance.t create mode 100644 t/cmop/metaclass_loads_classes.t create mode 100644 t/cmop/metaclass_reinitialize.t create mode 100644 t/cmop/method.t create mode 100644 t/cmop/method_modifiers.t create mode 100644 t/cmop/methods.t create mode 100644 t/cmop/modify_parent_method.t create mode 100644 t/cmop/new_and_clone_metaclasses.t create mode 100644 t/cmop/null_stash.t create mode 100644 t/cmop/numeric_defaults.t create mode 100644 t/cmop/package_variables.t create mode 100644 t/cmop/random_eval_bug.t create mode 100644 t/cmop/rebless_instance.t create mode 100644 t/cmop/rebless_instance_away.t create mode 100644 t/cmop/rebless_overload.t create mode 100644 t/cmop/rebless_with_extra_params.t create mode 100644 t/cmop/scala_style_mixin_composition.t create mode 100644 t/cmop/self_introspection.t create mode 100644 t/cmop/subclasses.t create mode 100644 t/cmop/subname.t create mode 100644 t/cmop/universal_methods.t create mode 100644 t/compat/composite_metaroles.t create mode 100644 t/compat/extends_nonmoose_that_isa_moose_with_metarole.t create mode 100644 t/compat/foreign_inheritence.t create mode 100644 t/compat/inc_hash.t create mode 100644 t/compat/module_refresh_compat.t create mode 100644 t/compat/moose_respects_base.t create mode 100644 t/examples/Child_Parent_attr_inherit.t create mode 100644 t/examples/example1.t create mode 100644 t/examples/example2.t create mode 100644 t/examples/example_Moose_POOP.t create mode 100644 t/examples/example_Protomoose.t create mode 100644 t/examples/example_w_DCS.t create mode 100644 t/examples/example_w_TestDeep.t create mode 100644 t/examples/record_set_iterator.t create mode 100644 t/exceptions/attribute.t create mode 100644 t/exceptions/class-mop-attribute.t create mode 100644 t/exceptions/class-mop-class-immutable-trait.t create mode 100644 t/exceptions/class-mop-class.t create mode 100644 t/exceptions/class-mop-method-accessor.t create mode 100644 t/exceptions/class-mop-method-constructor.t create mode 100644 t/exceptions/class-mop-method-generated.t create mode 100644 t/exceptions/class-mop-method-meta.t create mode 100644 t/exceptions/class-mop-method-wrapped.t create mode 100644 t/exceptions/class-mop-method.t create mode 100644 t/exceptions/class-mop-mixin-hasattributes.t create mode 100644 t/exceptions/class-mop-mixin-hasmethods.t create mode 100644 t/exceptions/class-mop-module.t create mode 100644 t/exceptions/class-mop-object.t create mode 100644 t/exceptions/class-mop-package.t create mode 100644 t/exceptions/class.t create mode 100644 t/exceptions/cmop.t create mode 100644 t/exceptions/exception-lazyattributeneedsadefault.t create mode 100644 t/exceptions/frame-leak.t create mode 100644 t/exceptions/meta-role.t create mode 100644 t/exceptions/metaclass.t create mode 100644 t/exceptions/moose-exporter.t create mode 100644 t/exceptions/moose-meta-attribute-native-traits.t create mode 100644 t/exceptions/moose-meta-class-immutable-trait.t create mode 100644 t/exceptions/moose-meta-method-accessor-native-array.t create mode 100644 t/exceptions/moose-meta-method-accessor-native-collection.t create mode 100644 t/exceptions/moose-meta-method-accessor-native-grep.t create mode 100644 t/exceptions/moose-meta-method-accessor-native-hash-set.t create mode 100644 t/exceptions/moose-meta-method-accessor-native-hash.t create mode 100644 t/exceptions/moose-meta-method-accessor-native-string-match.t create mode 100644 t/exceptions/moose-meta-method-accessor-native-string-replace.t create mode 100644 t/exceptions/moose-meta-method-accessor-native-string-substr.t create mode 100644 t/exceptions/moose-meta-method-accessor-native.t create mode 100644 t/exceptions/moose-meta-method-accessor.t create mode 100644 t/exceptions/moose-meta-method-augmented.t create mode 100644 t/exceptions/moose-meta-method-constructor.t create mode 100644 t/exceptions/moose-meta-method-delegation.t create mode 100644 t/exceptions/moose-meta-method-destructor.t create mode 100644 t/exceptions/moose-meta-method-overridden.t create mode 100644 t/exceptions/moose-meta-role-application-rolesummation.t create mode 100644 t/exceptions/moose-meta-role-application-toclass.t create mode 100644 t/exceptions/moose-meta-role-application-torole.t create mode 100644 t/exceptions/moose-meta-role-application.t create mode 100644 t/exceptions/moose-meta-role-attribute.t create mode 100644 t/exceptions/moose-meta-role-composite.t create mode 100644 t/exceptions/moose-meta-typecoercion-union.t create mode 100644 t/exceptions/moose-meta-typecoercion.t create mode 100644 t/exceptions/moose-meta-typeconstraint-enum.t create mode 100644 t/exceptions/moose-meta-typeconstraint-parameterizable.t create mode 100644 t/exceptions/moose-meta-typeconstraint-parameterized.t create mode 100644 t/exceptions/moose-meta-typeconstraint-registry.t create mode 100644 t/exceptions/moose-meta-typeconstraint.t create mode 100644 t/exceptions/moose-role.t create mode 100644 t/exceptions/moose-util-metarole.t create mode 100644 t/exceptions/moose-util-typeconstraints.t create mode 100644 t/exceptions/moose.t create mode 100644 t/exceptions/object.t create mode 100644 t/exceptions/overload.t create mode 100644 t/exceptions/rt-92818.t create mode 100644 t/exceptions/rt-94795.t create mode 100644 t/exceptions/stringify.t create mode 100644 t/exceptions/traits.t create mode 100644 t/exceptions/typeconstraints.t create mode 100644 t/exceptions/util.t create mode 100644 t/immutable/apply_roles_to_immutable.t create mode 100644 t/immutable/buildargs.t create mode 100644 t/immutable/constructor_is_not_moose.t create mode 100644 t/immutable/constructor_is_wrapped.t create mode 100644 t/immutable/default_values.t create mode 100644 t/immutable/definition_context.t create mode 100644 t/immutable/immutable_constructor_error.t create mode 100644 t/immutable/immutable_destroy.t create mode 100644 t/immutable/immutable_meta_class.t create mode 100644 t/immutable/immutable_metaclass_with_traits.t create mode 100644 t/immutable/immutable_moose.t create mode 100644 t/immutable/immutable_roundtrip.t create mode 100644 t/immutable/immutable_trigger_from_constructor.t create mode 100644 t/immutable/inline_close_over.t create mode 100644 t/immutable/inline_fallbacks.t create mode 100644 t/immutable/inlined_constructors_n_types.t create mode 100644 t/immutable/multiple_demolish_inline.t create mode 100644 t/lib/Bar.pm create mode 100644 t/lib/Bar7/Meta/Trait.pm create mode 100644 t/lib/Bar7/Meta/Trait2.pm create mode 100644 t/lib/Foo.pm create mode 100644 t/lib/Moose/Meta/Attribute/Custom/Bar.pm create mode 100644 t/lib/Moose/Meta/Attribute/Custom/Foo.pm create mode 100644 t/lib/Moose/Meta/Attribute/Custom/Trait/Bar.pm create mode 100644 t/lib/Moose/Meta/Attribute/Custom/Trait/Foo.pm create mode 100644 t/lib/MyExporter.pm create mode 100644 t/lib/MyMetaclassRole.pm create mode 100644 t/lib/MyMooseA.pm create mode 100644 t/lib/MyMooseB.pm create mode 100644 t/lib/MyMooseObject.pm create mode 100644 t/lib/NoInlineAttribute.pm create mode 100644 t/lib/Overloading/ClassConsumesRoleConsumesOverloads.pm create mode 100644 t/lib/Overloading/ClassWithCombiningRole.pm create mode 100644 t/lib/Overloading/ClassWithOneRole.pm create mode 100644 t/lib/Overloading/CombiningClass.pm create mode 100644 t/lib/Overloading/CombiningRole.pm create mode 100644 t/lib/Overloading/RoleConsumesOverloads.pm create mode 100644 t/lib/Overloading/RoleWithOverloads.pm create mode 100644 t/lib/Overloading/RoleWithoutOverloads.pm create mode 100644 t/lib/OverloadingTests.pm create mode 100644 t/lib/Real/Package.pm create mode 100644 t/lib/Role/BreakOnLoad.pm create mode 100644 t/lib/Role/Child.pm create mode 100644 t/lib/Role/Interface.pm create mode 100644 t/lib/Role/Parent.pm create mode 100644 t/metaclasses/create_anon_with_required_attr.t create mode 100644 t/metaclasses/custom_attr_meta_as_role.t create mode 100644 t/metaclasses/custom_attr_meta_with_roles.t create mode 100644 t/metaclasses/easy_init_meta.t create mode 100644 t/metaclasses/export_with_prototype.t create mode 100644 t/metaclasses/exporter_also_with_trait.t create mode 100644 t/metaclasses/exporter_meta_lookup.t create mode 100644 t/metaclasses/exporter_sub_names.t create mode 100644 t/metaclasses/goto_moose_import.t create mode 100644 t/metaclasses/immutable_metaclass_compat_bug.t create mode 100644 t/metaclasses/meta_name.t create mode 100644 t/metaclasses/metaclass_compat.t create mode 100644 t/metaclasses/metaclass_compat_no_fixing_bug.t create mode 100644 t/metaclasses/metaclass_compat_role_conflicts.t create mode 100644 t/metaclasses/metaclass_parameterized_traits.t create mode 100644 t/metaclasses/metaclass_traits.t create mode 100644 t/metaclasses/metarole.t create mode 100644 t/metaclasses/metarole_combination.t create mode 100644 t/metaclasses/metarole_on_anon.t create mode 100644 t/metaclasses/metarole_w_metaclass_pm.t create mode 100644 t/metaclasses/metaroles_of_metaroles.t create mode 100644 t/metaclasses/moose_exporter.t create mode 100644 t/metaclasses/moose_exporter_trait_aliases.t create mode 100644 t/metaclasses/moose_for_meta.t create mode 100644 t/metaclasses/moose_nonmoose_metatrait_init_order.t create mode 100644 t/metaclasses/moose_nonmoose_moose_chain_init_meta.t create mode 100644 t/metaclasses/moose_w_metaclass.t create mode 100644 t/metaclasses/new_metaclass.t create mode 100644 t/metaclasses/new_object_BUILD.t create mode 100644 t/metaclasses/overloading.t create mode 100644 t/metaclasses/reinitialize.t create mode 100644 t/metaclasses/use_base_of_moose.t create mode 100644 t/moose_util/apply_roles.t create mode 100644 t/moose_util/create_alias.t create mode 100644 t/moose_util/ensure_all_roles.t create mode 100644 t/moose_util/method_mod_args.t create mode 100644 t/moose_util/moose_util.t create mode 100644 t/moose_util/moose_util_does_role.t create mode 100644 t/moose_util/moose_util_search_class_by_role.t create mode 100644 t/moose_util/resolve_alias.t create mode 100644 t/moose_util/with_traits.t create mode 100644 t/native_traits/array_coerce.t create mode 100644 t/native_traits/array_from_role.t create mode 100644 t/native_traits/array_subtypes.t create mode 100644 t/native_traits/array_trigger.t create mode 100644 t/native_traits/collection_with_roles.t create mode 100644 t/native_traits/custom_instance.t create mode 100644 t/native_traits/hash_coerce.t create mode 100644 t/native_traits/hash_subtypes.t create mode 100644 t/native_traits/hash_trigger.t create mode 100644 t/native_traits/remove_attribute.t create mode 100644 t/native_traits/shallow_clone.t create mode 100644 t/native_traits/trait_array.t create mode 100644 t/native_traits/trait_bool.t create mode 100644 t/native_traits/trait_code.t create mode 100644 t/native_traits/trait_counter.t create mode 100644 t/native_traits/trait_hash.t create mode 100644 t/native_traits/trait_number.t create mode 100644 t/native_traits/trait_string.t create mode 100644 t/recipes/basics_bankaccount_methodmodifiersandsubclassing.t create mode 100644 t/recipes/basics_binarytree_attributefeatures.t create mode 100644 t/recipes/basics_company_subtypes.t create mode 100644 t/recipes/basics_datetime_extendingnonmooseparent.t create mode 100644 t/recipes/basics_document_augmentandinner.t create mode 100644 t/recipes/basics_genome_overloadingsubtypesandcoercion.t create mode 100644 t/recipes/basics_http_subtypesandcoercion.t create mode 100644 t/recipes/basics_point_attributesandsubclassing.t create mode 100644 t/recipes/extending_debugging_baseclassrole.t create mode 100644 t/recipes/extending_mooseish_moosesugar.t create mode 100644 t/recipes/legacy_debugging_baseclassreplacement.t create mode 100644 t/recipes/legacy_labeled_attributemetaclass.t create mode 100644 t/recipes/meta_globref_instancemetaclass.t create mode 100644 t/recipes/meta_labeled_attributetrait.t create mode 100644 t/recipes/meta_privateorpublic_methodmetaclass.t create mode 100644 t/recipes/meta_table_metaclasstrait.t create mode 100644 t/recipes/roles_applicationtoinstance.t create mode 100644 t/recipes/roles_comparable_codereuse.t create mode 100644 t/recipes/roles_restartable_advancedcomposition.t create mode 100644 t/roles/anonymous_roles.t create mode 100644 t/roles/application_toclass.t create mode 100644 t/roles/apply_role.t create mode 100644 t/roles/build.t create mode 100644 t/roles/conflict_many_methods.t create mode 100644 t/roles/create_role.t create mode 100644 t/roles/create_role_subclass.t create mode 100644 t/roles/empty_method_modifiers_meta_bug.t create mode 100644 t/roles/extending_role_attrs.t create mode 100644 t/roles/free_anonymous_roles.t create mode 100644 t/roles/imported_required_method.t create mode 100644 t/roles/meta_role.t create mode 100644 t/roles/method_aliasing_in_composition.t create mode 100644 t/roles/method_exclusion_in_composition.t create mode 100644 t/roles/method_modifiers.t create mode 100644 t/roles/methods.t create mode 100644 t/roles/more_alias_and_exclude.t create mode 100644 t/roles/more_role_edge_cases.t create mode 100644 t/roles/new_meta_role.t create mode 100644 t/roles/overloading_combine_to_class.t create mode 100644 t/roles/overloading_combine_to_instance.t create mode 100644 t/roles/overloading_combine_to_role.t create mode 100644 t/roles/overloading_composition_errors.t create mode 100644 t/roles/overloading_remove_attributes_bug.t create mode 100644 t/roles/overloading_to_class.t create mode 100644 t/roles/overloading_to_instance.t create mode 100644 t/roles/overloading_to_role.t create mode 100644 t/roles/overriding.t create mode 100644 t/roles/reinitialize_anon_role.t create mode 100644 t/roles/role.t create mode 100644 t/roles/role_attr_application.t create mode 100644 t/roles/role_attribute_conflict.t create mode 100644 t/roles/role_attrs.t create mode 100644 t/roles/role_compose_requires.t create mode 100644 t/roles/role_composite.t create mode 100644 t/roles/role_composite_exclusion.t create mode 100644 t/roles/role_composition_attributes.t create mode 100644 t/roles/role_composition_conflict_detection.t create mode 100644 t/roles/role_composition_errors.t create mode 100644 t/roles/role_composition_method_mods.t create mode 100644 t/roles/role_composition_methods.t create mode 100644 t/roles/role_composition_override.t create mode 100644 t/roles/role_composition_req_methods.t create mode 100644 t/roles/role_conflict_detection.t create mode 100644 t/roles/role_conflict_edge_cases.t create mode 100644 t/roles/role_consumers.t create mode 100644 t/roles/role_exclusion.t create mode 100644 t/roles/role_exclusion_and_alias_bug.t create mode 100644 t/roles/role_for_combination.t create mode 100644 t/roles/roles_and_method_cloning.t create mode 100644 t/roles/roles_and_req_method_edge_cases.t create mode 100644 t/roles/roles_applied_in_create.t create mode 100644 t/roles/run_time_role_composition.t create mode 100644 t/roles/runtime_roles_and_attrs.t create mode 100644 t/roles/runtime_roles_and_nonmoose.t create mode 100644 t/roles/runtime_roles_w_params.t create mode 100644 t/roles/use_base_does.t create mode 100644 t/test_moose/test_moose.t create mode 100644 t/test_moose/test_moose_does_ok.t create mode 100644 t/test_moose/test_moose_has_attribute_ok.t create mode 100644 t/test_moose/test_moose_meta_ok.t create mode 100644 t/test_moose/with_immutable.t create mode 100644 t/todo_tests/exception_reflects_failed_constraint.t create mode 100644 t/todo_tests/immutable_n_around.t create mode 100644 t/todo_tests/moose_and_threads.t create mode 100644 t/todo_tests/replacing_super_methods.t create mode 100644 t/todo_tests/required_role_accessors.t create mode 100644 t/todo_tests/role_attr_methods_original_package.t create mode 100644 t/todo_tests/role_insertion_order.t create mode 100644 t/todo_tests/various_role_features.t create mode 100644 t/todo_tests/wrong-inner.t create mode 100644 t/type_constraints/advanced_type_creation.t create mode 100644 t/type_constraints/class_subtypes.t create mode 100644 t/type_constraints/class_type_constraint.t create mode 100644 t/type_constraints/coerced_parameterized_types.t create mode 100644 t/type_constraints/container_type_coercion.t create mode 100644 t/type_constraints/container_type_constraint.t create mode 100644 t/type_constraints/custom_parameterized_types.t create mode 100644 t/type_constraints/custom_type_errors.t create mode 100644 t/type_constraints/define_type_twice_throws.t create mode 100644 t/type_constraints/duck_type_handles.t create mode 100644 t/type_constraints/duck_types.t create mode 100644 t/type_constraints/enum.t create mode 100644 t/type_constraints/inlining.t create mode 100644 t/type_constraints/match_type_operator.t create mode 100644 t/type_constraints/maybe_type_constraint.t create mode 100644 t/type_constraints/misc_type_tests.t create mode 100644 t/type_constraints/name_conflicts.t create mode 100644 t/type_constraints/normalize_type_name.t create mode 100644 t/type_constraints/parameterize_from.t create mode 100644 t/type_constraints/role_type_constraint.t create mode 100644 t/type_constraints/subtype_auto_vivify_parent.t create mode 100644 t/type_constraints/subtyping_parameterized_types.t create mode 100644 t/type_constraints/subtyping_union_types.t create mode 100644 t/type_constraints/throw_error.t create mode 100644 t/type_constraints/type_coersion_on_lazy_attributes.t create mode 100644 t/type_constraints/type_names.t create mode 100644 t/type_constraints/type_notation_parser.t create mode 100644 t/type_constraints/types_and_undef.t create mode 100644 t/type_constraints/union_is_a_type_of.t create mode 100644 t/type_constraints/union_types.t create mode 100644 t/type_constraints/union_types_and_coercions.t create mode 100644 t/type_constraints/util_find_type_constraint.t create mode 100644 t/type_constraints/util_more_type_coercion.t create mode 100644 t/type_constraints/util_std_type_constraints.t create mode 100644 t/type_constraints/util_type_coercion.t create mode 100644 t/type_constraints/util_type_constraints.t create mode 100644 t/type_constraints/util_type_constraints_export.t create mode 100644 t/type_constraints/util_type_reloading.t create mode 100644 t/type_constraints/with-specio.t create mode 100644 t/zzz-check-breaks.t create mode 100644 xs/Attribute.xs create mode 100644 xs/AttributeCore.xs create mode 100644 xs/Class.xs create mode 100644 xs/Generated.xs create mode 100644 xs/HasAttributes.xs create mode 100644 xs/HasMethods.xs create mode 100644 xs/Inlined.xs create mode 100644 xs/Instance.xs create mode 100644 xs/MOP.xs create mode 100644 xs/Method.xs create mode 100644 xs/Moose.xs create mode 100644 xs/Package.xs create mode 100644 xs/ToInstance.xs create mode 100644 xs/typemap create mode 100644 xt/author/authority.t create mode 100644 xt/author/debugger-duck_type.t create mode 100644 xt/author/eol.t create mode 100644 xt/author/memory_leaks.t create mode 100644 xt/author/no-tabs.t create mode 100644 xt/author/pod-coverage.t create mode 100644 xt/author/pod-spell.t create mode 100644 xt/author/test-my-dependents.t create mode 100644 xt/release/00-compile.t create mode 100644 xt/release/cpan-changes.t create mode 100644 xt/release/distmeta.t create mode 100644 xt/release/kwalitee.t create mode 100644 xt/release/mojibake.t create mode 100644 xt/release/pod-syntax.t diff --git a/Changes b/Changes new file mode 100644 index 0000000..8825d8e --- /dev/null +++ b/Changes @@ -0,0 +1,4593 @@ +Also see Moose::Manual::Delta for more details of, and workarounds +for, noteworthy changes. + +2.1405 2015-06-06 + + [BUG FIXES] + + - The native 'Array' trait 'sort' accessor now returns the number of + elements in scalar context, instead of the undefined value (or a + different, seemingly-random, value under 5.23.x). + +2.1404 2015-04-16 + + [BUG FIXES] + + - Add Sub::Identify to prereqs. (RT #101661) + - bump List::Util prereq to avoid a memory leak (RT#101124) + + [DOCUMENTATION] + + - Added section to Moose::Manual::Resources to list external links related + to Moose (RT #101993, Michael LaGrasta) + +2.1403 2014-12-07 + + [DOCUMENTATION] + + - Added a section to Moose::Manual::MethodModifiers illustrating how method + modifiers work with inheritance. (Andreas Koenig, RT #98940) + - Added docs to Moose.pm on the -meta_name import option. This addresses RT + #98488. + + [BUG FIXES] + + - Fix a test that fails on MSWin32 systems using nmake + - fix dev build compilation error when using MSVC (A. Sinan Unur) + + [OTHER] + + - the modules in the git repository now have a defined $VERSION, to make it + easier to test MooseX::* and other code under development. + +2.1402 2014-11-05 + + [BUG FIXES] + + - Fix a test that was trying to load Test::Exception instead of Test::Fatal. + (Michael Schout) + +2.1401 2014-11-03 + + [BUG FIXES] + + - The core overloading support interacted badly with + MooseX::MarkAsMethods. If you used MooseX::MarkAsMethods in a role that + provided overloading, then that overloading would not be properly applied + to consuming classes, leading to very weird errors of the form: + + Can't resolve method "???" overloading """" in package "Class2" ... + + Note that the problems that MooseX::MarkAsMethods fixes are no longer + present if you are using Moose 2.1400+ and namespace::autoclean 0.16+. We + encourage you to upgrade both of these modules and remove + MooseX::MarkAsMethods from your code base. + +2.1400 2014-10-31 + + [BUG FIXES] + + - Moose exception classes now stringify all stack frames, to avoid issues + in global destruction (see RT#99811) + +2.1307 2014-10-26 (TRIAL RELEASE) + + [ENHANCEMENTS] + + - Support added to Moose::Exporter for exporting subs by their fully + qualified name, as well as coderefs. This avoids internal breakage if some + other module has monkey-patched a sub to be exported and left it anonymous + (e.g. RT#88669). (Graham Knop, PR#84) + + [BUG FIXES] + + - Further refined the overloading fixes from 2.1306, fixing fallback + handling on older perl versions (Dave Rolsky, PR#85) + +2.1306 2014-10-25 (TRIAL RELEASE) + + [ENHANCEMENTS] + + - Rewrote overloading implementation to use a new Class::MOP::Overload + object. This object properly captures all overloading information. The + Class::MOP::Method::Overload class has been removed. (Dave Rolsky, PR#83) + + [BUG FIXES] + + - If a role had method-based overloading but did not actually implement the + specified method, its overloading was simply ignored when applying + overloading to other roles or classes. Reported by rjbs. RT #98531. + +2.1305 2014-10-22 (TRIAL RELEASE) + + [ENHANCEMENTS] + + - By default, exceptions thrown from inside Moose now remove most of the + Moose internals from their stack trace when stringifying. This makes for + much more readable error messages in most cases. Set the + MOOSE_FULL_EXCEPTION env var to true to get the complete stack trace. + +2.1304 2014-09-25 (TRIAL RELEASE) + + [BUG FIXES] + + - closed a memory leak in Moose exception objects where captured stack + trace frames would contain circular references to the exception objects + themselves (Graham Knop, PR#81) + +2.1303 2014-09-19 (TRIAL RELEASE) + + [TEST FIXES] + + - fix tests that fail on altered warning messages in perl 5.21.4 (RT#98987) + +2.1302 2014-08-19 (TRIAL RELEASE) + + [BUG FIXES] + + - When a role consumes another role and they differ in their overloading + fallback settings, the consuming role now silently wins instead of + throwing an exception. This is consistent with how other + role-consumes-role conflicts are handled. + - Fixed the docs for overloading conflicts to match reality. + +2.1301 2014-08-19 (TRIAL RELEASE) + + [BUG FIXES] + + - Conflict detection for overloading operators is now more correct. If a + class consumed two roles that both had identical overloading methods + (because they got them from some other role, for example), this caused an + error, but it shouldn't. GH #4. (rjbs) + - Similarly, when a role consumes another role, conflicts in overloading + operators are now silently resolved in favor of the consuming role, just + as they are with methods. Note that conflicts between the fallback setting + for roles are still an error. + +2.1300 2014-08-11 (TRIAL RELEASE) + + [ENHANCEMENTS] + + - Moose now has core support for overloading in roles. When a role with + overloading is applied to classes or other roles, the overloading settings + are transferred to the consumer. Conflicts between roles are treated much + like method conflicts. This obviates the need for + MooseX::Role::WithOverloading. If you are using + MooseX::Role::WithOverloading, upgrade to version 0.15+ and it will simply + become a no-op when used with this version of Moose. + + [OTHER] + + - The overloading info methods for roles and classes no longer treat + "fallback" as an overloaded op. Instead, there are new + get_overload_fallback_value() and set_overload_fallback_value() methods to + deal with this explicitly. This is arguably a bug fix. + +2.1213 2014-09-25 + + [BUG FIXES] + + - closed a memory leak in Moose exception objects where captured stack + trace frames would contain circular references to the exception objects + themselves (Graham Knop, PR#81) + +2.1212 2014-09-19 + + [TEST FIXES] + + - fix tests that fail on altered warning messages in perl 5.21.4 (RT#98987) + +2.1211 2014-08-11 + + [DOCUMENTATION] + + - Updated Changes and Moose::Manual::Delta to note when we started removing + lazy_build from docs. Also added a note in the Moose::Meta::Attribute docs + stating that use of this feature is discouraged. + - Added a pointer from the auto_deref feature to + Moose::Meta::Attribute::Native. This is often a better choice. + + [OTHER] + + - The subs installed by Moose::Exporter->setup_import_methods are now named + using Sub::Name (Dave Rolsky, RT#97572) + +2.1210 2014-07-03 + + [DOCUMENTATION] + + - Clarify that Moose::Exception exists for internal usage and that user + code is better off using the Throwable role or Throwable::Error superclass. + - Moose::Manual::Support policy clarified regarding legacy Perl versions + + [OTHER] + + - logic has been removed for an alpha branch of Test::Builder that will + never see the light of day, and will break with upcoming Test::Builder + changes (Exodist) + +2.1209 2014-06-04 + + [OTHER] + + - The is_anon method now always returns false when called on + Moose::Meta::Role::Composite objects. This isn't strictly right, but for + the purposes of Moose internals, where "is_anon" really means "needs to be + cleaned up", it's correct. This fixes warnings that were seen when using + recent Moose (2.1100+) and MooseX::Role::Parameterized roles as part of a + composite role. These warnings only appear with Perl 5.16 and earlier. + +2.1208 2014-06-01 + + [BUG FIXES] + + - fix implementation of throw_exception in internal Class::MOP traits, + caused by changes in 2.1207 (ether, RT#96112) + +2.1207 2014-05-26 + + [OTHER] + + - Fixed Specio support to work with the latest Specio (0.10). This version of + Specio no longer uses Moose internally. + - exceptions in Class::MOP no longer use Moose::Util, instead using their + own private implementation of throw_exception, to avoid needless premature + loading of Moose logic. + +2.1206 2014-05-14 + + [BUG FIXES] + + - exceptions should not throw other exceptions; fixes cases where exceptions + were reporting the wrong error (Upasana, RT#92818 and RT#94795) + + [OTHER] + + - prereqs needed strictly for building with Dist::Zilla have been moved from + develop requires to develop recommends, to simplify automated testing on + older perls that cannot install all Dist::Zilla components + - removed instances of metaobjects in exception classes where they're not + really required + +2.1205 2014-04-15 + + [ENHANCEMENTS] + + - new utility interface: Moose::Util::is_role + + [BUG FIXES] + + - better error message provided when trying to load a trait class that does + not exist in @INC (Upasana, RT#94731) + + [OTHER] + + - new test added, to run last, which runs `moose-outdated` as a possibly + more visible mechanism to provide important information to the user + (re RT#92780) + +2.1204 2014-02-06 + + [BUG FIXES] + + - bump minimum prereq needed for optional test using MooseX::NonMoose (which + broke with new Module::Runtime, see 2.1203), so users can install Moose + and pass tests before updating MooseX::NonMoose. + +2.1203 2014-02-06 + + [BUG FIXES] + + - bump prereq on Module::Runtime to properly detect when a module fails to + load, and fix how we call these subs (Zefram, RT#92770, RT#86394, RT#92791) + + [ENHANCEMENTS] + + - line numbers in shipped code are now almost the same (within 3) as the + repository source, for easier debugging + +2.1202 2014-01-19 + + [BUG FIXES] + + - string comparisons are now possible with Moose exceptions (RT#92232) + +2.1201 2014-01-11 + + [OTHER] + + - re-release to index pod files (Moose::Cookbook::*, Moose::Manual::* etc). + +2.1200 2014-01-06 + + [OTHER] + + - Releasing 2.1108 as stable (last stable release was 2.1005). + +2.1108 2014-01-04 (TRIAL RELEASE) + + [OTHER] + - fixed distribution manifest + - minor documentation and metadata updates + +2.1107 2013-11-29 (TRIAL RELEASE) + + [OTHER] + + - many additions to the list of conflicting modules (those that require + updates after installing Moose), reflecting recent API changes + - now failing early at build time, with a useful error message, if a + compiler is not available + +2.1106 2013-11-05 (TRIAL RELEASE) + + [BUG FIXES] + + - throw_error import cleaned from Moose::Object after use (doy) + - resolved new circular load issue between Moose::Util and Class::MOP (Kent + Fredric, RT#89713 and PR#42) + +2.1105 2013-10-30 (TRIAL RELEASE) + + [BUG FIXES] + + - legacy throw_error now takes multiple arguments, like confess does + (Karen Etheridge) + +2.1104 2013-10-29 (TRIAL RELEASE) + + [BUG FIXES] + + - Class::MOP::Object::_inline_throw_error is back, used by some MooseX + modules (Upasana) + +2.1103 2013-10-25 (TRIAL RELEASE) + + [BUG FIXES] + + - fix errors in last trial release relating to Moose::Error::Default, + Moose::Util::throw_error (Upasana) + +2.1102 2013-10-20 (TRIAL RELEASE) + + [BUG FIXES] + + - die if a role to consume can't be found -- this restores behaviour as in + 2.1005 (doy) + - fix test to accomodate Devel::PartialDump possibly not being installed + (Upasana) + +2.1101 2013-10-20 (TRIAL RELEASE) + + [ENHANCEMENTS] + + - Moose string exceptions have been replaced by Moose::Exception objects. See + Moose::Manual::Delta for details. + +2.1100 2013-09-07 (TRIAL RELEASE) + + [DEPRECATIONS] + + - Class::MOP::load_class, Class::MOP::is_class_loaded, and + Class::MOP::load_first_existing_class are now deprecated. See + Moose::Manual::Delta for details. + + - The non-arrayref forms of enum and duck_type have been deprecated. See + Moose::Manual::Delta for details. + + - Many deprecated features have now been removed: + - optimize_as for type constraints + - the "default is" and "default default" features for native delegations + - setting coerce => 1 on an attribute whose type constraint has no coercion + - the public version of Moose::Meta::Method::Destructor::initialize_body + + [ENHANCEMENTS] + + - Creating classes with Moose now always sets the appropriate entry in %INC, + even if it wasn't loaded from a file. This should make writing classes + inline easier, and will allow us to be more intelligent about figuring out + when classes are loaded in the future. See Moose::Manual::Delta for more + details. Note that this is slightly backwards-incompatible in some edge + cases. + + - Moose now uses Module::Runtime instead of Class::Load to load classes. This + means that there are no more issues with the weird heuristics that + Class::Load does to determine if a class was previously loaded (inheriting + from an empty package is now possible, for instance). See + Moose::Manual::Delta for more details. This is also slightly + backwards-incompatible in some edge cases. + +2.1005 2013-08-06 + + [ENHANCEMENTS] + + - add_method now accepts blessed subs (Graham Knop, PR#28) + + [BUG FIXES] + + - If a role consumed another role, we resolve method conflicts just like a + class consuming a role, but when metaclass compat tried to fix up + metaclass roles, we were putting all methods into one composite role and + allowing methods in the metaclass roles to conflict. Now we resolve them + as we should. (Jesse Luehrs, PR#27) + + - Some edge cases in tests with base.pm and non-existent module files are + handled more strictly (see also perl RT#118561) (Graham Knop, PR#25) + +2.1004 2013-07-26 + + [BUG FIXES] + + - 2.1003 was released with some bad metadata, which caused the prereq test + to fail. + +2.1003 2013-07-26 + + [OTHER] + + - Releasing 2.0901 as stable. + +2.0901 2013-06-21 (TRIAL RELEASE) + + [ENHANCEMENTS] + + - The with_immutable() sub from Test::Moose now passes a boolean value to + the code block containing tests indicating whether or not the classes have + been made immutable. This can make for nicer test descriptions. (Dave + Rolsky) + + - You can now use Specio types instead of Moose builtins or + MooseX::Types. However, this support is still experimental (as is Specio), + so use it with care. (Dave Rolsky) + +2.0900 2013-05-26 (TRIAL RELEASE) + + [API CHANGES] + + - Fixed the Num builtin type to reject NaN, Inf, numbers with whitespace, + and other questionable strings. The MooseX::Types::LaxNum distro + implements the old behavior. RT#70539 (Upasana) + +2.0802 2013-05-07 + + [ENHANCEMENTS] + + - fix incompatibilities with Test::Builder 1.005+ (Karen Etheridge) + - Moose::Manual::Contributing updated to reflect the change of primary + repository from git.moose.perl.org to github.com + +2.0801 2013-03-28 + + [BUG FIXES] + + - properly apply traits at compile time (error introduced in 2.0800, + RT#77974). (doy) + +2.0800 2013-03-27 + + [ENHANCEMENTS] + + - The super() subroutine now carps if you pass it arguments. These arguments + are always ignored, but we used to ignore them silently. RT #77383. + + - Roles can now override methods from other roles they consume directly, + without needing to manually exclude them (just like classes can). (mst) + + [BUG FIXES] + + - Fix false positive when checking for circular references for modules that + use the "also" parameter with Moose::Exporter. Reported by Jon + Swartz. Fixed by Matthew Wickline. RT #63818. + + - Fix memory leak in type unions. (Karen Etheridge) RT#83929. + + - Fix application of traits at compile time. (doy) RT#77974. + +2.0604 2012-09-19 + + [BUG FIXES] + + - Fix nonsensical error message for inlined accessors of required attributes. + (doy) + + - Stop trying to localize a lexical (blead now throws an error for this). RT + #79257, perl #114628. (sprout) + + [OTHER] + + - Depend on a version of Carp new enough to have caller_info. RT #79367. + (pshangov) + +2.0603 2012-06-28 + + [BUG FIXES] + + - Fix test failure in blead. RT #78085. + +2.0602 2012-05-07 + + [BUG FIXES] + + - Ensure that the Moose::Exporter-generated init_meta returns the same value + that it did previously. This isn't really a bug, since the return value has + never been tested or documented, but since the generated init_meta is + nothing more than a compatibility shim at this point, there's no reason to + not make it as compatible as possible. Reported by Moritz Onken. (doy) + + [DOCUMENTATION] + + - The lazy_build attribute feature was removed from + Moose::Manual::BestPractices. + +2.0601 2012-05-01 + + [BUG FIXES] + + - Fix init_meta order when multiple also packages are specified (this matters + when one of them is being used to actually initalize the metaclass, + typically with also => 'Moose'). Reported by Randy Stauner. (doy) + +2.0600 2012-04-29 + + [OTHER] + + - Releasing 2.0502 as stable. + +2.0502 2012-04-25 (TRIAL RELEASE) + + [OTHER] + + - The Test::DependentModules test now covers a much wider range of downstream + dependents (all of them in fact, for some definition of "all"). This should + allow us to track inadvertent backwards compatibility breakages much more + effectively. (doy) + + - A few test tweaks to avoid spurious failures. (doy) + +2.0501 2012-04-03 (TRIAL RELEASE) + + [BUG FIXES] + + - Avoid syntax errors on pre-5.14. (doy) + +2.0500 2012-04-03 (TRIAL RELEASE) + + [NEW FEATURES] + + - Class::MOP::Class now has methods for introspecting and modifying the + overloaded operators for a class. (doy) + + [ENHANCEMENTS] + + - The cookbook recipes have all been renamed. Instead of numbered recipes + (Basics::Recipe1), we now have descriptive names + (Basics::Point_AttributesAndSubclassing). This makes it easier for us to + add and remove recipes in the future, and makes it a little easier to + converse about them, since the name gives us some clue of what they + contain. + + [BUG FIXES] + + - Re-declaring a class_type or role_type constraint that has already been + declared now just returns the original type constraint, rather than + replacing the original constraint and ergo losing any coercions that were + on the original constraint. Fixes RT #73289. (t0m) + + - Moose::Exporter now calls init_meta methods in the correct order, when + multiple levels of 'also' parameters are specified. Reported by Rocco + Caputo. (doy, perigrin) + + - Moose::Exporter no longer generates init_meta methods in order to apply + metaroles, since the metaclass itself isn't guaranteed to exist yet at that + point. Metaroles are now applied at the end of import, after all + user-defined init_meta methods have been called. Fixes RT #51561. (doy) + + - Fixed a memory leak. This occurred when creating an anonymous + class. Immutabilizing an anonymous class still leaks memory due to a bug in + Eval::Closure (which should hopefully be fixed soon). Based on code and bug + report from Carlos Lima. RT #74650. + + - Fix a segfault when adding a method to a class which was defined in a + package which was deleted. (doy) + +2.0403 2012-04-03 + + [OTHER] + + - No changes, reupload to fix indexing. + +2.0402 2012-02-04 + + [OTHER] + + - Minor documentation fixes. + + - Fix test failure on blead (test was unnecessarily strict). Reported by + Nicholas Clark. (doy) + +2.0401 2011-11-17 + + [BUG FIXES] + + - Attributes with weak_ref now weaken their associated slot when they are + initialized through a lazy default or builder. Reported by tome. (doy) + +2.0400 2011-11-15 + + [OTHER] + + - No changes from 2.0302 (other than a few minor documentation tweaks). + +2.0302 2011-11-02 (TRIAL RELEASE) + + [BUG FIXES] + + - Fix test failure on 5.8. (Dave Rolsky) + + - Make make_immutable return value consistent and document it to be true. + (mst) + +2.0301 2011-10-21 (TRIAL RELEASE) + + [BUG FIXES] + + - Fix compilation on 5.8. Reported by ether. (doy) + + - A custom error class caused a warning when the class that used it was made + immutable. Reported by Maroš Kollár. RT #71514. (Dave Rolsky) + + [ENHANCEMENTS] + + - The enum type will now allow single value enumerations. Previously, two or + more values were required. (rjbs) + +2.0300 2011-09-23 (TRIAL RELEASE) + + [DEPRECATIONS] + + - The optimize_as option for type constraints has been deprecated. Use the + inline_as option to provide inlining code instead. (Dave Rolsky) + + [API CHANGES] + + - Methods to introspect a class's methods will now return methods defined in + UNIVERSAL (isa, can, etc.). This also means that you can wrap these + methods with method modifiers. RT #69839. Reported by Vyacheslav + Matyukhin. (Dave Rolsky) + + - The ->parent and ->parents method for a union now return the nearest + common ancestor of that union's component types. See Moose::Manual::Delta + for more details. (Dave Rolsky) + + - The ->parents method used to return an arrayref for union types, and a + list of one or more types for all other types. Now they all return + lists. (Dave Rolsky) + + - The ->is_subtype_of and ->is_a_type_of methods have changed their behavior + for union types. Previously, they returned true if any of their member + types returned true for a given type. Now, all of the member types must + return true. RT #67731. (Dave Rolsky) + + [ENHANCEMENTS] + + - The Moose::Exporter module now has a "meta_lookup" option when creating an + importer. This allows you to specify an alternate method for determining + the metaclass of a caller. This is useful for modules like + MooseX::Role::Parameterized which generate new metaclasses on the + fly. (sartak) + + - Added a Moose::Meta::Method->is_stub method. (Dave Rolsky) + + [BUG FIXES] + + - A subtype of a union type did not return the right results when you called + ->is_subtype_of or ->is_a_type_of on it. This has been fixed. RT + #70322. (Dave Rolsky) + + - An attribute accessor or delegation method can overwrite a stub method and + this will no longer throw an error. Reported by Mark-Jason Dominus. RT + #69988. (Dave Rolsky) + + - The error generated by unfulfilled method requirements during role + composition now mentions how to work around imported methods not being + recognized. Reported by Michael Schwern. RT #60583. (doy) + + - class_type and role_type will now throw errors if you attempt to use them + to override existing types, just like type and subtype have always done. + (doy) + + - Implicitly creating class or role types by using them as the 'isa' or + 'does' parameter to attribute construction will now register the type. This + means that it cannot later be redefined as something else. (doy) + + - $class_type->is_subtype_of no longer returns true if passed the name of the + class that the class type represents when the class type wasn't registered. + (doy) + + - Removing anonymous metaclasses prematurely no longer prevents reaping of + the associated stash. (doy) + + [OTHER] + + - The Class::MOP::load_class and Class::MOP::is_class_loaded subroutines are + no longer documented, and will cause a deprecation warning in the + future. Moose now uses Class::Load to provide this functionality, and you + should as well. (Dave Rolsky) + +2.0205 2011-09-06 + + [NEW FEATURES] + + - The Array and Hash native traits now provide a "shallow_clone" method, + which will return a reference to a new container with the same contents as + the attribute's reference. + + [ENHANCEMENTS] + + - Specifying an invalid value in a hashref 'handles' value now throws a + sensible error. Reported by Mark-Jason Dominus. RT #69990. (Dave + Rolsky) + + [BUG FIXES] + + - When specifying an attribute trait, passing options for the trait besides + -alias or -excludes caused a warning. However, passing other options is + totally valid when using MooseX::Role::Parameterized. Fixes RT + #70419. (sartak) + + - Allow regexp objects in duck_type constraints (to bring this in line with + the Object constraint). + +2.0204 2011-08-25 + + [BUG FIXES] + + - Validating duck_type type constraint turned out to work only by accident, + and only when not running under the debugger. This has been fixed. + (Florian Ragwitz) + + [OTHER] + + - Loosen the dependency on ExtUtils::ParseXS. + +2.0203 2011-08-23 + + [BUG FIXES] + + - is_class_loaded now properly detects packages which have a version object + in their $VERSION. + + - Fix XS compilation under blead. + +2.0202 2011-07-26 + + [BUG FIXES] + + - Be more consistent about how type constraint messages are handled. + +2.0201 2011-07-22 + + [BUG FIXES] + + - Moose::Util::does_role shouldn't call ->does on things that don't inherit + from Moose::Object. + + - Make ->does initialize the metaclass, so that calling it as a class method + on a class which sets up inheritance via some method other than extends + works properly (this fixes an issue with MooseX::Types). + + - Make Dist::CheckConflicts a runtime requirement, so moose-outdated always + works. + +2.0200 2011-07-18 + + [OTHER] + + - No changes from 2.0105 (other than a few minor documentation tweaks). + +2.0105 2011-06-27 (TRIAL RELEASE) + + [ENHANCEMENTS] + + - Moose::Util::does_role now respects overridden ->does methods. (doy) + +2.0104 2011-06-20 (TRIAL RELEASE) + + [OTHER] + + - Include changes from 2.0010. + +2.0103 2011-06-20 (TRIAL RELEASE) + + [DEPRECATIONS] + + - Several things that have been deprecated for a while have been removed. See + the 2.0000 section in Moose::Manual::Delta for details. + + [NEW FEATURES] + + - New Moose::Util::TypeConstraints::union function for creating union type + constraints without having to rely on the string type constraint parsing. + This also allows for creating unions of anonymous type constraints. + (kentnl) + + [OTHER] + + - Include changes from Moose 2.0009. + +2.0102 2011-06-18 (TRIAL RELEASE) + + [ENHANCEMENTS] + + - The native Array trait now has a 'first_index' method, which works just + like the version in List::MoreUtils. (Karen Etheridge) + + - Clean up some internal code to help out extensions. + + [OTHER] + + - Include changes from Moose 2.0008. + +2.0101 2011-06-06 (TRIAL RELEASE) + + [OTHER] + + - Various packaging issues. + +2.0100 2011-06-06 (TRIAL RELEASE) + + [DEPRECATIONS] + + - Using a hand-optimized type constraint is now deprecated. In keeping with + our release policy, this won't actually start warning until the 2.0200 + release. + + [NEW FEATURES] + + - Type constraints can now provide inlined versions, which should make + inlined code which uses type constraints (such as accessors) faster. This + replaces the existing hand-optimized constraint feature. (Dave Rolsky) + + [ENHANCEMENTS] + + - Remove a lot of cases where generated methods closed over meta objects. + Most simple cases should now only close over simple data types and + coderefs. This should make deparsing simpler. + +2.0010 2011-06-20 + + [BUG FIXES] + + - Fix regression in 2.0009 and 2.0103 when applying roles during init_meta in + an exporter that also re-exports Moose or Moose::Role. (t0m, ilmari) + +2.0009 2011-06-19 + + [BUG FIXES] + + - duck_type type constraints now report reasonable errors when given + something which isn't an instance of an object. (t0m) + + - Moose::Util::apply_all_roles now works even if the applicant is a non-Moose + class. (perigrin) + + - When an object is reblessed, triggers are called on attributes that are + set during the reblessing. (Karen Etheridge). + + [OTHER] + + - Better error message if Moose->init_meta is called with a 'metaclass' + option when that metaclass hasn't been loaded. (jasonmay) + +2.0008 2011-06-16 + + [BUG FIXES] + + - The 'accessor' native delegation for hashrefs now allows setting the value + to undef. (sugoik, doy) + + [ENHANCEMENTS] + + - Various generated methods have more useful context information. (doy) + +2.0007 2011-05-15 + + [BUG FIXES] + + - Make sure weak attributes remain weak when cloning. (doy, rafl) + +2.0006 2011-05-09 + + [BUG FIXES] + + - Revert the List::MoreUtils version bump, as it breaks backwards + compatibility. The dependency will be bumped with Moose 2.0200. + +2.0005 2011-05-09 + + [BUG FIXES] + + - Only sort the alias keys when determining caching. + +2.0004 2011-05-09 + + [BUG FIXES] + + - Bump the List::MoreUtils dep to avoid buggy behavior in old versions. + + - Sort the list of roles and the alias and excludes parameters when + determining caching, since their order doesn't matter. + +2.0003 2011-05-09 + + [BUG FIXES] + + - Applying multiple role objects (rather than role names) at once no longer + skips every other role. (rjbs) + + - Caching of anon classes now works more sanely in the presence of role + application parameters - alias and excludes options are taken into account, + and caching is disabled entirely if other parameters exist. Asking for + caching (instead of just not weakening) when parameters are given will + begin warning in Moose 2.0200. (doy, autarch) + +2.0002 2011-04-28 + + [ENHANCEMENTS] + + - Provide definition context information for constructors and destructors, so + that they will show up as something other than "generated method (unknown + origin)". Also, add the package that accessors are defined in to their + definition context. + + - Use Devel::PartialDump in type constraint error messages, if it is + installed. + + [BUG FIXES] + + - Stop hiding warnings produced by throwing errors in DEMOLISH methods. + + - The 'reset' native delegation for Counter attributes will now also respect + builders (previously, it only respected defaults). + +2.0001 2011-04-22 + + [ENHANCEMENTS] + + - Anonymous classes and roles now have a unified implementation in + Class::MOP::Package. This means that anonymous packages are now also + possible. (Shawn M Moore, doy) + + [BUG FIXES] + + - No longer call XSLoader from multiple places, as this causes issues on + older perls. (doy, ribasushi) + + - Moose::Meta::Role->create now accepts the 'roles' parameter, as it was + documented to. (Chris Weyl) + + - Depend on Eval::Closure 0.04, which fixes some issues in mod_perl + environments. (doy, mateu) + +2.0000 2011-04-11 + + [API CHANGES] + + - The RegexpRef type constraint now accepts regular expressions blessed into + other classes, such as those found in pluggable regexp engines. + Additionally the 'Object' constraint no longer rejects objects implemented + as a blessed regular expression. (David Leadbeater) + + [DOCUMENTATION] + + - The lazy_build attribute feature was mostly removed from the docs and is + no longer encouraged. + + [OTHER] + + - Moose::Manual::Support now explicitly states when major releases are + allowed to happen (January, April, July, or October). + +1.9906 2011-04-04 (TRIAL RELEASE) + + [OTHER] + + - Update conflicts list. + - Minor pod updates. + +1.9905 2011-03-28 (TRIAL RELEASE) + + [NEW FEATURES] + + - The Moose::Meta::Role::Attribute class now has an original_role method + which returns the role which first defined an attribute. See the docs for + details. (Dave Rolsky) + + - Moose::Util::MetaRole will make sure that the class to which you're + applying metaroles or base class roles can actually have them applied. If + not (it's not a Moose class, it has a non-Moose metaclass, etc.), then it + gives a useful error message. Previously, this would just end up dying in + the MetaRole code without a useful message. (Dave Rolsky) + + [BUG FIXES] + + - When a role had its own applied_attribute metaclass (usually from MetaRole + application), that metaclass would get lost when that role participated in + role composition. It was also lost if that role was consumed by some other + role. Both of these cases have been fixed. Attributes are always applied + with the applied_attribute metaclass of the role which originally defined + them. (Dave Rolsky) + +1.9904 2011-03-04 (TRIAL RELEASE) + + [BUG FIXES] + + - Reinitializing anonymous roles used to accidentally clear out the role's + stash in some circumstances. This is now fixed. (doy) + + - The Int type constraint now rejects integers with trailing newlines. + (Matthew Horsfall) + +1.9903 2011-02-28 (TRIAL RELEASE) + + [BUG FIXES] + + - Reverse the order that Moose::Exporter 'also' exports are dispatched. When + trying to re-export from a package that itself exported a modified set of + Moose sugar, you'd get the original Moose sugar instead of the overrides. + There are also now tests for this. (perigrin) + + - Don't initialize lazy attributes with defaults in the constructor (for + immutable classes). (mo) + + - When reinitializing meta objects for classes and roles, we failed to + preserve roles and role applications. This led to weird bugs. Many MooseX + modules end up reinitializing your class or role. (Dave Rolsky) + +1.9902 2011-01-03 (TRIAL RELEASE) + + [OTHER] + + - Fix generation of CCFLAGS. + + - Add a bit more Dist::Zilla functionality. + +1.9901 2011-01-03 (TRIAL RELEASE) + + [OTHER] + + - Fix some indexing issues. + + - Fix a few issues with the conflict checking stuff. + +1.9900 2011-01-01 (TRIAL RELEASE) + + [OTHER] + + - The entire Class::MOP distribution has been merged with Moose. In the + future, the Class::MOP code itself will be merged into Moose, and + eventually the Class::MOP namespace will disappear entirely. For the + current release, we have simply changed how Class::MOP is + distributed. (Dave Rolsky). + + - Switched to Dist::Zilla for development. However, we still have a minimal + Makefile.PL in the repository that can be used for development. (Dave + Rolsky) + + [API CHANGES] + + - Roles now have their own default attribute metaclass to use during + application to a class, rather than just using the class's + attribute_metaclass. This is also overridable via ::MetaRole, with the + applied_attribute key in the role_metaroles hashref (doy). + + - The internal code used to generate inlined methods (accessor, constructor, + etc.) has been massively rewritten. MooseX modules that do inlining will + almost certainly need to be updated as well. + + [ENHANCEMENTS] + + - We now load the roles needed for native delegations only as needed. This + speeds up the compilation time for Moose itself. (doy) + + +1.25 2011-04-01 + + [BUG FIXES] + + - Reinitializing anonymous roles used to accidentally clear out the role's + stash in some circumstances. This is now fixed. (doy) (backported from + 1.9904) + + +1.24 2011-02-22 + + [BUG FIXES] + + - Reverse the order that Moose::Exporter 'also' exports are dispatched. When + trying to re-export from a package that itself exported a modified set of + Moose sugar, you'd get the original Moose sugar instead of the overrides. + There are also now tests for this. (perigrin) (backported from 1.9903) + + +1.23 2011-02-13 + + [PACKAGING FIX] + + - The 1.22 release had a bad MANIFEST. This has been fixed. + + +1.22 2011-02-13 + + [BUG FIXES] + + - When reinitializing meta objects for classes and roles, we failed to + preserve roles and role applications. This led to weird bugs. Many MooseX + modules end up reinitializing your class or role. (Dave Rolsky) (backported + from 1.9903) + +1.21 2010-11-24 + + [ENHANCEMENTS] + + - The Support manual has been updated to reflect our new major/minor version + policy. (Chris Prather) + + - The Contributing manual has been updated to reflect workflow changes based + on this new support policy. (doy) + + [BUG FIXES] + + - The role attribute metaclass did not inherit from Class::MOP::Object, + which could cause errors when trying to resolve metaclass compatibility + issues. Reported by Daniel Ruoso. (doy) + + - The lazy_build feature was accidentally removed from all the docs. Now + it's listed in Moose.pm again. (Chris Prather) + +1.20 2010-11-19 + + [BUG FIXES] + + - When using native delegations, if an array or hash ref member failed a + type constraint check, Moose ended up erroring out with "Can't call method + "get_message" on unblessed reference" instead of generating a useful error + based on the failed type constraint. Reported by t0m. RT #63113. (Dave + Rolsky) + +1.19 2010-11-02 + + [BUG FIXES] + + - There was still one place in the code trying to load Test::Exception + instead of Test::Fatal. (Karen Etheridge) + + +1.18 2010-10-31 + + [ENHANCEMENTS] + + - Type constraint objects now have an assert_coerce method which will either + return a valid value or throw an error. (rjbs) + + - We now warn when an accessor for one attribute overwrites an accessor for + another attribute. RT #57510. (Dave Rolsky) + + [BUG FIXES] + + - The native Array and Hash delegation methods now coerce individual new + members if the _member type_ has a coercion. In other words, if the array + reference is defined as an ArrayRef[DateTime], and you've defined a + coercion from Int to DateTime, then pushing an integer via a delegation + method will coerce the integer to a DateTime object. Reported by Karen + Etheridge. RT #62351. (Dave Rolsky) + + - An attribute using native delegations did not always properly coerce and + type check a lazily set default value. (doy and Dave Rolsky) + + - Using a regexp to define delegations for a class which was not yet loaded + did not actually work, but did not explicitly fail. However, it caused an + error when the class was loaded later. Reported by Max Kanat-Alexander. RT + #60596. (Dave Rolsky) + + - Attempting to delegate to a class or role which is not yet loaded will now + throw an explicit error. (Dave Rolsky) + + - Attempting to set lazy_build in an inherited attribute was ignored. RT + #62057. (perigrin) + + [OTHER] + + - The Moose test suite now uses Test::Fatal instead of + Test::Exception. (rjbs) + +1.17 2010-10-19 + + [BUG FIXES] + + - Make native delegation inlining work with instance metaclasses where slot + access is an do {} block, like Kioku. This fixes the use of native + delegations together with Kioku. (Scott, doy) + +1.16 2010-10-18 + + [ENHANCEMENTS] + + - Almost every native delegation method which changes the attribute value + now has an explicitly documented return value. In general, this return + value matches what Perl would return for the same operation. (Dave Rolsky) + + - Lots of work on native delegation documentation, including documenting + what arguments each native delegation method allows or requires. (Dave + Rolsky) + + - Passing an odd number of args to ->new() now gives a more useful warning + than Perl's builtin warning. Suggested by Sir Robert Burbridge. (Dave + Rolsky) + + - Allow disabling stack traces by setting an environment variable. See + Moose::Error::Default for details. This feature is considered + experimental, and may change in a future release. (Marcus Ramberg) + + - The deprecation warning for using alias and excludes without a leading + dash now tells you the role being applied and what it was being applied + to. (mst). + + [BUG FIXES] + + - A number of native trait methods which expected strings as arguments did + not allow the empty string. This included Array->join, String->match, + String->replace, and String->substr. Reported by Whitney Jackson. RT + #61962. (Dave Rolsky) + + - 'no Moose' no longer inadvertently removes imports it didn't create + itself. RT #60013. (Florian Ragwitz, doy) + + - Roles now support passing an array reference of method names to method + modifier sugar functions. (doy) + + - Native traits no longer use optimized inlining routines if the instance + requests it (in particular, if inline_get_slot_value doesn't return + something that can be assigned to). This should fix issues with + KiokuDB::Class. (doy) + + - We now ignore all Class::MOP and Moose classes when determining what + package called a deprecated feature. This should make the deprecation + warnings saner, and make it possible to turn them off more easily. (Dave + Rolsky) + + - The deprecated "default is" warning no longer happens if the attribute has + any accessor method defined (accessor, reader, writer). Also, this warning + only happens when a method that was generated because of the "default is" + gets called, rather than when the attribute is defined. (Dave Rolsky) + + - The "default default" code for some native delegations no longer issues a + deprecation warning when the attribute is required or has a builder. (Dave + Rolsky) + + - Setting a "default default" caused a fatal error if you used the builder + or lazy_build options for the attribute. Reported by Kent Fredric. RT + #59613. (Dave Rolsky) + +1.15 2010-10-05 + + [API CHANGES] + + - Major changes to Native Traits, most of which make them act more like + "normal" attributes. This should be mostly compatible with existing code, + but see Moose::Manual::Delta for details. + + - A few native traits (String, Counter, Bool) provide default values of "is" + and "default" when you created an attribute. Allowing them to provide + these values is now deprecated. Supply the value yourself when creating + the attribute. + + - New option 'trait_aliases' for Moose::Exporter, which will allow you to + generate non-global aliases for your traits (and allow your users to + rename the aliases, etc). (doy) + + - 'use Moose' and 'use Moose::Role' now accept a '-meta_name' option, to + determine which name to install the 'meta' name under. Passing 'undef' + to this option will suppress generation of the meta method entirely. (doy) + + - Moose now warns if it overwrites an existing method named "meta" in your + class when you "use Moose". (doy) + + [ENHANCEMENTS] + + - Native Trait delegations are now all generated as inline code. This should + be much faster than the previous method of delegation. In the best case, + native trait methods will be very highly optimized. + + - Reinitializing a metaclass no longer removes the existing method and + attribute objects (it instead fixes them so they are correct for the + reinitialized metaclass). This should make the order of loading many + MooseX modules less of an issue. (doy) + + - The Moose::Manual docs have been revised and updated. (Dave Rolsky) + + [BUG FIXES] + + - If an attribute was weak, setting it to a non-ref value after the object + was constructed caused an error. Now we only call weaken when the new + value is a reference. + + - t/040_type_constraints/036_match_type_operator.t failed on 5.13.5+. Fixed + based on a patch from Andreas Koenig. + +1.14 2010-09-21 + + [BUG FIXES] + + - Work around what looks like a bug in List::MoreUtils::any. This bug caused + a weird error when defining the same union type twice, but only when using + MooseX::Types. Reported by Curtis Jewell. RT #61001. (Dave Rolsky) + +1.13 2010-09-13 + + [API CHANGES] + + - The deprecation warnings for alias and excludes are back, use -alias and + -excludes instead. (Dave Rolsky) + + [ENHANCEMENTS] + + - When composing one role into another and there is an attribute conflict, + the error message now includes the attribute name. Reported by Sam + Graham. RT #59985. (Dave Rolsky) + + - When a class is made immutable, the does_role method is overridden with a + much faster version that simply looks role names up in a hash. Code which + uses lots of role-based type constraints should be faster. (Dave Rolsky) + +1.12 2010-08-28 + + [BUG FIXES] + + - Fix the MANIFEST. Fixes RT #60831, reported by Alberto Simões. + +1.11 2010-08-27 + + [API CHANGES] + + - An attribute in a subclass can now override the value of "is". (doy) + + - The deprecation warnings for alias and excludes have been turned back off + for this release, to give other module authors a chance to tweak their + code. (Dave Rolsky) + + [BUG FIXES] + + - mro::get_linear_isa was being called as a function rather than a method, + which caused problems with Perl 5.8.x. (t0m) + + - Union types always created a type constraint, even if their constituent + constraints did not have any coercions. This bogus coercion always + returned undef, which meant that a union which included Undef as a member + always coerced bad values to undef. Reported by Eric Brine. RT + #58411. (Dave Rolsky) + + - Union types with coercions would always fall back to coercing the value to + undef (unintentionally). Now if all the coercions for a union type fail, + the value returned by the coercion is the original value that we attempted + to coerce. (Dave Rolsky). + +1.10 2010-08-22 + + [API CHANGES] + + - The long-deprecated alias and excludes options for role applications now + issue a deprecation warning. Use -alias and -excludes instead. (Dave + Rolsky) + + [BUG FIXES] + + - Inlined code no longer stringifies numeric attribute defaults. (vg, doy) + + - default => undef now works properly. (doy) + + - Enum type constraints now throw errors if their values are nonsensical. + (Sartak) + + [ENHANCEMENTS] + + - Optimizations that should help speed up compilation time (Dave Rolsky). + +1.09 2010-07-25 + + [API CHANGES] + + - You can no longer pass "coerce => 1" for an attribute unless its type + constraint has a coercion defined. Doing so will issue a deprecation + warning. (Dave Rolsky) + + - Previously, '+foo' only allowed a specific set of options to be + overridden, which made it impossible to change attribute options related + to extensions. Now we blacklist some options, and anything else is + allowed. (doy, Tuomas Jormola) + + - Most features which have been declared deprecated now issue a warning using + Moose::Deprecated. Warnings are issued once per calling package, not + repeatedly. See Moose::Deprecated for information on how you can shut + these warnings up entirely. Note that deprecated features will eventually + be removed, so shutting up the warnings may not be the best idea. (Dave + Rolsky) + + - Removed the long-deprecated Moose::Meta::Role->alias_method method. (Dave + Rolsky). + + [NEW FEATURES] + + - We no longer unimport strict and warnings when Moose, Moose::Role, or + Moose::Exporter are unimported. Doing this was broken if the user + explicitly loaded strict and warnings themself, and the results could be + generally surprising. We decided that it was best to err on the side of + safety and leave these on. Reported by David Wheeler. RT #58310. (Dave + Rolsky) + + - New with_traits helper function in Moose::Util. (doy) + + [BUG FIXES] + + - Accessors will no longer be inlined if the instance metaclass isn't + inlinable. (doy) + + - Use Perl 5.10's new recursive regex features, if possible, for the type + constraint parser. (doy, nothingmuch) + + [ENHANCEMENTS] + + - Attributes now warn if their accessors overwrite a locally defined + function (not just method). (doy) + + [OTHER] + + - Bump our required perl version to 5.8.3, since earlier versions fail tests + and aren't easily installable/testable. + +1.08 2010-06-15 + + [ENHANCEMENTS] + + - Refactored a small amount of Moose::Meta::Method::Constructor to allow it + to be overridden more easily (doy). + +1.07 2010-06-05 + + [BUG FIXES] + + - Fixed a minor metaclass compatibility fixing bug dealing with immutable + classes and non-class metaclass traits (doy, dougdude). + +1.06 2010-06-01 + + [NEW FEATURES] + + - Added '0+' overloading in Moose::Meta::TypeConstraint so that we can + more uniformly compare type constraints between 'classic' Moose type + constraints and MooseX::Types based type constraints. + +1.05 2010-05-20 + + [API CHANGES] + + - Packages and modules no longer have methods - this functionality was + moved back up into Moose::Meta::Class and Moose::Meta::Role individually + (through the Class::MOP::Mixin::HasMethods mixin) (doy). + + - BUILDALL is now called by Moose::Meta::Class::new_object, rather than by + Moose::Object::new. (doy) + + [NEW FEATURES] + + - strict and warnings are now unimported when Moose, Moose::Role, or + Moose::Exporter are unimported. (doy, Adam Kennedy) + + - Added a 'consumers' method to Moose::Meta::Role for finding all + classes/roles which consume the given role. (doy) + + [BUG FIXES] + + - Fix has '+attr' in Roles to explode immediately, rather than when the role + is applied to a class (t0m). + + - Fix type constraint validation messages to not include the string 'failed' + twice in the same sentence (Florian Ragwitz). + + - New type constraints will default to being unequal, rather than equal + (rjbs). + + - The tests no longer check for perl's behavior of clobbering $@, which has + been fixed in perl-5.13.1 (Florian Ragwitz). + + - Metaclass compatibility fixing has been completely rewritten, and should + be much more robust. (doy) + +1.04 2010-05-20 + + - This release was broken and has been deleted from CPAN shortly after its + upload. + +1.03 2010-05-06 + + [NEW FEATURES] + + - Allow specifying required versions when setting superclasses or applying + roles (Florian Ragwitz). + +1.02 2010-05-01 + + [BUG FIXES] + + - Stop the natatime method provided by the native Array trait from returning + an exhausted iterator when being called with a callback. (Florian Ragwitz) + + - Make Moose::Meta::TypeConstraint::Class correctly reject RegexpRefs. + (Florian Ragwitz) + + - Calling is_subtype_of on a Moose::Meta::TypeConstraint::Class with itself or + the class the TC represents as an argument incorrectly returned true. This + behavior is correct for is_type_of, not is_subtype_of. (Guillermo Roditi) + + - Use File::Temp for temp files created during tests. Previously, files were + written to the t/ dir, which could cause problems of the user running the + tests did not have write access to that directory.. (Chris Weyl, Ævar + Arnfjörð Bjarmason) + + - Pass role arguments along when applying roles to instances. (doy, lsm) + +1.01 2010-03-26 + + [NEW FEATURES] + + - The handles option now also accepts a role type constraint in addition to a + plain role name. (Florian Ragwitz) + + [OTHER] + + - Record the Sartak/doy debt properly in Changes (perigrin) + +1.00 2010-03-25 + + [BUG FIXES] + + - Moose::Meta::Attribute::Native::Trait::Code no longer creates reader + methods by default. (Florian Ragwitz) + + [DOCUMENTATION] + + - Improve various parts of the documentation and fix many typos. + (Dave Rolsky, Mateu Hunter, Graham Knop, Robin V, Jay Hannah, Jesse Luehrs) + + [OTHER] + + - Paid the $10 debt to doy from 0.80 2009-06-06 (Sartak) + +0.99 2010-03-08 + + [NEW FEATURES] + + - New method find_type_for in Moose::Meta::TypeConstraint::Union, for finding + which member of the union a given value validates for. (Cory Watson) + + [BUG FIXES] + + - DEMOLISH methods in mutable subclasses of immutable classes are now called + properly (Chia-liang Kao, Jesse Luehrs) + + [NEW DOCUMENTATION] + + - Added Moose::Manual::Support that defines the support, compatiblity, and + release policies for Moose. (Chris Prather) + +0.98 2010-02-10 + + [BUG FIXES] + + - An internals change in 0.97 broke role application to an instance in some + cases. The bug occurred when two different roles were applied to different + instances of the same class. (Rafael Kitover) + + +0.97 2010-02-09 + + [BUG FIXES] + + - Calling ->reinitialize on a cached anonymous class effectively uncached + the metaclass object, causing the metaclass to go out of scope + unexpectedly. This could easily happen at a distance by applying a + metarole to an anonymous class. (Dave Rolsky). + +0.96 2010-02-06 + + [NEW FEATURES] + + - ScalarRef is now a parameterized type. You can now specify a type + constraint for whatever the reference points to. (Closes RT#50857) + (Michael G. Schwern, Florian Ragwitz) + + [BUG FIXES] + + - ScalarRef now accepts references to other references. (Closes RT#50934) + (Michael G. Schwern) + +0.95 2010-02-04 + + [NEW FEATURES] + + - Moose::Meta::Attribute::Native::Trait::Code now provides execute_method as + a delegation option. This allows the code reference to be called as a + method on the object. (Florian Ragwitz) + + [ENHANCEMENTS] + + - Moose::Object::does no longer checks the entire inheritance tree, since + Moose::Meta::Class::does_role already does this. (doy) + + - Moose::Util::add_method_modifier (and subsequently the sugar functions + Moose::before, Moose::after, and Moose::around) can now accept arrayrefs, + with the same behavior as lists. Types other than arrayref and regexp + result in an error. (Dylan Hardison) + +0.94 2010-01-18 + + [API CHANGES] + + - Please see the changes listed for 0.93_01 and Moose::Manual::Delta. + + [ENHANCEMENTS] + + - Improved support for anonymous roles by changing various APIs to take + Moose::Meta::Role objects as well as role names. This included + + - Moose::Meta::Class->does_role + - Moose::Meta::Role->does_role + - Moose::Util::does_role + - Moose::Util::apply_all_roles + - Moose::Util::ensure_all_roles + - Moose::Util::search_class_by_role + + Requested by Shawn Moore. Addresses RT #51143 (and then some). (Dave Rolsky) + + [BUG FIXES] + + - Fix handling of non-alphanumeric attributes names like '@foo'. This should + work as long as the accessor method names are explicitly set to valid Perl + method names. Reported by Doug Treder. RT #53731. (Dave Rolsky) + + +0.93_03 2010-01-05 + + [BUG FIXES] + + - Portability fixes to our XS code so we compile with 5.8.8 and Visual + C++. Fixes RT #53391. Reported by Taro Nishino. (rafl) + + +0.93_02 2010-01-05 + + [BUG FIXES] + + - Depend on Class::MOP 0.97_01 so we can get useful results from CPAN + testers. (Dave Rolsky) + + +0.93_01 2010-01-04 + + [API CHANGES] + + See Moose::Manual::Delta for more details on backwards compatiblity issues. + + - Role attributes are now objects of the Moose::Meta::Role::Attribute + class. (Dave Rolsky). + + - There were major changes to how metaroles are applied. We now distinguish + between metaroles for classes vs those for roles. See the + Moose::Util::MetaRole docs for details. (Dave Rolsky) + + - The old MetaRole API has been deprecated, but will continue to + work. However, if you are applying an attribute metaclass role, this may + break because of the fact that roles now have an attribute metaclass + too. (Dave Rolsky) + + - Moose::Util::MetaRole::apply_metaclass_roles is now called + apply_metaroles. The old name is deprecated. (Dave Rolsky) + + - The unimport subs created by Moose::Exporter now clean up re-exported + functions like blessed and confess, unless the caller imported them from + somewhere else too. See Moose::Manua::Delta for backcompat details. (rafl) + + [ENHANCEMENTS AND BUG FIXES] + + - Changed the Str constraint to accept magic lvalue strings like one gets from + substr et al, again. (sorear) + + - Sped up the type constraint parsing regex. (Sam Vilain) + + - The Moose::Cookbook::Extending::Recipe2 recipe was broken. Fix suggested by + jrey. + + - Added Moose::Util::TypeConstraints exports when using oose.pm to allow + easier testing of TypeConstraints from the command line. (perigrin) + + - Added a with_immutable test function to Test::Moose, to run a block of tests + with and without certain classes being immutable. (doy) + + - We now use Module::Install extensions explicitly to avoid confusing errors + if they're not installed. We use Module::Install::AuthorRequires to stop + test extraction and general failures if you don't have the author side + dependencies installed. + + - Fixed a grammar error in Moose::Cookbook::Basics::Recipe4. rt.cpan.org + #51791. (Amir E. Aharoni) + + +0.93 2009-11-19 + - Moose::Object + - Calling $object->new() is no longer deprecated, and no longer + warns. (doy) + + - Moose::Meta::Role + - The get_attribute_map method is now deprecated. (Dave Rolsky) + + - Moose::Meta::Method::Delegation + - Preserve variable aliasing in @_ for delegated methods, so that + altering @_ affects the passed value. (doy) + + - Moose::Util::TypeConstraints + - Allow array refs for non-anonymous form of enum and duck_type, not + just anonymous. The non-arrayref forms may be removed in the + future. (doy) + - Changed Str constraint to not accept globs (*STDIN or *FOO). (chansen) + - Properly document Int being a subtype of Str. (doy) + + - Moose::Exporter + - Moose::Exporter using modules can now export their functions to the + main package. This applied to Moose and Moose::Role, among + others. (nothingmuch) + + - Moose::Meta::Attribute + - Don't remove attribute accessors we never installed, during + remove_accessors. (doy) + + - Moose::Meta::Attribute::Native::Trait::Array + - Don't bypass prototype checking when calling List::Util::first, to + avoid a segfault when it is called with a non-code argument. (doy) + + - Moose::Meta::Attribute::Native::Trait::Code + - Fix passing arguments to code execute helpers. (doy) + +0.92 2009-09-22 + - Moose::Util::TypeConstraints + - added the match_on_type operator (Stevan) + - added tests and docs for this (Stevan) + + - Moose::Meta::Class + - Metaclass compat fixing should already happen recursively, there's no + need to explicitly walk up the inheritance tree. (doy) + + - Moose::Meta::Attribute + - Add tests for set_raw_value and get_raw_value. (nothingmuch) + +0.91 2009-09-17 + - Moose::Object + - Don't import any functions, in order to avoid polluting our namespace + with things that can look like methods (blessed, try, etc) + (nothingmuch) + + - Moose::Meta::Method::Constructor + - The generated code needs to called Scalar::Util::blessed by its + fully-qualified name or else Perl can interpret the call to blessed as + an indirect method call. This broke Search::GIN, which in turn broke + KiokuDB. (nothingmuch) + +0.90 2009-09-15 + - Moose::Meta::Attribute::Native::Trait::Counter + - Moose::Meta::Attribute::Native::Trait::String + - For these two traits, an attribute which did not explicitly provide + methods to handles magically ended up delegating *all* the helper + methods. This has been removed. You must be explicit in your handles + declaration for all Native Traits. (Dave Rolsky) + + - Moose::Object + - DEMOLISHALL behavior has changed. If any DEMOLISH method dies, we make + sure to rethrow its error message. However, we also localize $@ before + this so that if all the DEMOLISH methods success, the value of $@ will + be preserved. (nothingmuch and Dave Rolsky) + - We now also localize $? during object destruction. (nothingmuch and + Dave Rolsky) + - The handling of DEMOLISH methods was broken for immutablized classes, + which were not receiving the value of + Devel::GlobalDestruction::in_global_destruction. + - These two fixes address some of RT #48271, reported by Zefram. + - This is all now documented in Moose::Manual::Construction. + - Calling $object->new() is now deprecated. A warning will be + issued. (perigrin) + + - Moose::Meta::Role + - Added more hooks to customize how roles are applied. The role + summation class, used to create composite roles, can now be changed + and/or have meta-roles applied to it. (rafl) + - The get_method_list method no longer explicitly excludes the "meta" + method. This was a hack that has been replaced by better hacks. (Dave + Rolsky) + + - Moose::Meta::Method::Delegation + - fixed delegated methods to make sure that any modifiers attached to + the accessor being delegated on will be called (Stevan) + - added tests for this (Stevan) + + - Moose::Meta::Class + - Moose no longer warns when a class that is being made immutable has + mutable ancestors. While in theory this is a good thing to warn about, + we found so many exceptions to this that doing this properly became + quite problematic. + +0.89_02 2009-09-10 + - Moose::Meta::Attribute::Native + - Fix Hash, which still had 'empty' instead of 'is_empty'. (hdp) + + - Moose::Meta::Attribute::Native::Trait::Array + - Added a number of functions from List::Util and List::MoreUtils, + including reduce, shuffle, uniq, and natatime. (doy) + + - Moose::Exporter + - This module will now generate an init_meta method for your exporting + class if you pass it options for + Moose::Util::MetaRole::apply_metaclass_roles or + apply_base_class_roles. This eliminates a lot of repetitive + boilerplate for typical MooseX modules. (doy). + - Documented the with_meta feature, which is a replacement for + with_caller. This feature was added by josh a while ago. + - The with_caller feature is now deprecated, but will not issue a + warning yet. (Dave Rolsky) + - If you try to wrap/export a subroutine which doesn't actually exist, + Moose::Exporter will warn you about this. (doy) + + - Moose::Meta::Role::Application::ToRole + - When a role aliased a method from another role, it was only getting + the new (aliased) name, not the original name. This differed from what + happens when a class aliases a role's methods. If you _only_ want the + aliased name, make sure to also exclue the original name. (Dave + Rolsky) + +0.89_01 2009-09-02 + - Moose::Meta::Attribute + - Added the currying syntax for delegation from AttributeHelpers to the + existing delegation API. (hdp) + + - Moose::Meta::Attribute::Native + - We have merged the functionality of MooseX::AttributeHelpers into the + Moose core with some API tweaks. You can continue to use + MooseX::AttributeHelpers, but it will not be maintained except + (perhaps) for critical bug fixes in the future. See + Moose::Manual::Delta for details. (hdp, jhannah, rbuels, Sartak, + perigrin, doy) + + - Moose::Error::Croak + - Moose::Error::Confess + - Clarify documentation on how to use different error-throwing + modules. (Curtis Jewell) + + - Moose + - Correct POD for builder to point to Recipe8, not 9. (gphat) + + - Moose::Exporter + - When a nonexistent sub name is passed to as_is, with_caller, or + with_meta, throw a warning and skip the exporting, rather than + installing a broken sub. (doy) + + - Moose::Meta::Class + - Moose now warns if you call C for a class with mutable + ancestors. (doy) + +0.89 2009-08-13 + - Moose::Manual::Attributes + - Clarify "is", include discussion of "bare". (Sartak) + + - Moose::Meta::Role::Method::Conflicting + - Moose::Meta::Role::Application::ToClass + - For the first set of roles involved in a conflict, report all + unresolved method conflicts, not just the first method. Fixes #47210 + reported by Ovid. (Sartak) + + - Moose::Meta::TypeConstraint + - Add assert_valid method to use a TypeConstraint for assertion (rjbs) + + - Moose::Exporter + - Make "use Moose -metaclass => 'Foo'" do alias resolution, like -traits + does. (doy) + - Allow specifying role options (alias, excludes, MXRP stuff) in the + arrayref passed to "use Moose -traits" (doy) + + - Moose::Util + - Add functions meta_class_alias and meta_attribute_alias for creating + aliases for class and attribute metaclasses and metatraits. (doy) + + - Moose::Meta::Attribute + - Moose::Meta::Method::Accessor + - A trigger now receives the old value as a second argument, if the + attribute had one. (Dave Rolsky) + + - Moose::Meta::Method::Constructor + - Fix a bug with $obj->new when $obj has stringify overloading. + Reported by Andrew Suffield [rt.cpan.org #47882] (Sartak) + - However, we will probably deprecate $obj->new, so please don't start + using it for new code! + + - Moose::Meta::Role::Application + - Moose::Meta::Role::Application::RoleSummation + - Rename alias and excludes to -alias and -excludes (but keep the old + names for now, for backcompat) (doy) + +0.88 2009-07-24 + - Moose::Manual::Contributing + - Re-write the Moose::Manual::Contributing document to reflect + the new layout and methods of work for the Git repository. All + work now should be done in topic branches and reviewed by a + core committer before being applied to master. All releases + are done by a cabal member and merged from master to + stable. This plan was devised by Yuval, blame him. (perigrin) + + - Moose::Meta::Role + - Create metaclass attributes for the different role application + classes. (rafl) + + - Moose::Util::MetaRole + - Allow applying roles to a meta role's role application + classes. (rafl) + + - Moose::Meta::Attribute + - Add weak_ref to allowed options for "has '+foo'" (mst) + + - Moose::Meta::Method::Accessor + - No longer uses inline_slot_access in accessors, to support + non-lvalue-based meta instances. (sorear) + +0.87 2009-07-07 + - Moose::Meta::Method::Delegation + - Once again allow class names as well as objects for + delegation. This was changed in 0.86. + +0.86 2009-07-03 + - Moose::Meta::Class::Immutable::Trait + - Fixes to work with the latest Class::MOP. + + - Moose::Meta::Method::Delegation + - Delegation now dies with a more useful error message if the + attribute's accessor returns something defined but + unblessed. (hdp) + +0.85 2009-06-26 + - Moose::Meta::Attribute + - The warning for 'no associated methods' is now split out into + the _check_associated_methods method, so that extensions can + safely call 'after install_accessors => ...'. This fixes a + warning from MooseX::AttributeHelpers. (hdp) + +0.84 2009-06-26 + - Moose::Role + - has now sets definition_context for attributes defined in + roles. (doy) + + - Moose::Meta::Attribute + - When adding an attribute to a metaclass, if the attribute has + no associated methods, it will give a deprecation + warning. (hdp) + - Methods generated by delegation were not being added to + associated_methods. (hdp) + - Attribute accessors (reader, writer, accessor, predicate, + clearer) now warn if they overwrite an existing method. (doy) + - Attribute constructors now warn very noisily about unknown (or + misspelled) arguments + + - Moose::Util::TypeConstraints + - Deprecated the totally useless Role type name, which just + checked if $object->can('does'). Note that this is _not_ the + same as a type created by calling role_type('RoleName'). + + - Moose::Util::TypeConstraints + - Moose::Meta::TypeConstraint::DuckType + - Reify duck type from a regular subtype into an actual class + (Sartak) + - Document this because Sartak did all my work for me + (perigrin) + + - Moose::Meta::Attribute + - Allow Moose::Meta::TypeConstraint::DuckType in handles, since + it is just a list of methods (Sartak) + + - Moose::Meta::Role + - The get_*_method_modifiers methods would die if the role had + no modifiers of the given type (Robert Buels). + +0.83 2009-06-23 + - Moose::Meta::Class + - Fix _construct_instance not setting the special __MOP__ object + key in instances of anon classes. (doy) + +0.82 2009-06-21 + - Moose::Manual::Types + - Mention MooseX::Types early to avoid users falling down the + string parsing rathole (mst) + + - Moose::Manual::MooseX + - Add warnings about class-level extensions and mention considering + using plain objects instead + +0.81 2009-06-07 + - Bumped our Class::MOP prereq to the latest version (0.85), since + that's what we need. + +0.80 2009-06-06 + - Moose::Manual::FAQ + - Add FAQ about the coercion change from 0.76 because it came up + three times today (perigrin) + - Win doy $10 dollars because Sartak didn't think anybody + would document this fast enough (perigrin) + + - Moose::Meta::Method::Destructor + - Inline a DESTROY method even if there are no DEMOLISH methods + to prevent unnecessary introspection in + Moose::Object::DEMOLISHALL + + - Moose::* + - A role's required methods are now represented by + Moose::Meta::Role::Method::Required objects. Conflicts are now + represented by Moose::Meta::Role::Method::Conflicting + objects. The benefit for end-users in that unresolved + conflicts generate different, more instructive, errors, + resolving Ovid's #44895. (Sartak) + + - Moose::Role + - Improve the error message of "extends" as suggested by Adam + Kennedy and confound (Sartak) + - Link to Moose::Manual::Roles from Moose::Role as we now have + excellent documentation (Adam Kennedy) + + - Tests + - Update test suite for subname change in Class::MOP + (nothingmuch) + - Add TODO test for infinite recursion in Moose::Meta::Class + (groditi) + +0.79 2009-05-13 + - Tests + - More fixes for Win32 problems. Reported by Robert Krimen. + + - Moose::Object + - The DEMOLISHALL method could still blow up in some cases + during global destruction. This method has been made more + resilient in the face of global destruction's random garbage + collection order. + + - Moose::Exporter + - If you "also" a module that isn't loaded, the error message + now acknowledges that (Sartak) + + - Moose + - When your ->meta method does not return a Moose::Meta::Class, + the error message gave the wrong output (Sartak) + +0.78 2009-05-12 + - Moose::Cookbook::FAQ and Moose::Cookbook::WTF + - Merged these documents into what is now Moose::Manual::FAQ + + - Moose::Unsweetened + - Moved to Moose::Manual::Unsweetened + + - Moose::Cookbook::Basics::Recipes 9-12 + - Renamed to be 8-11, since recipe 8 did not exist + + - Moose::Exporter + - Make Moose::Exporter import strict and warnings into packages + that use it (doy) + + - Moose::Object + - Fix DEMOLISHALL sometimes not being able to find DEMOLISH + methods during global destruction (doy) + + - Moose::Meta::Class + - Moose::Meta::Role::Application::ToClass + - Track the Role::Application objects created during class-role + consumption (Sartak) + + - Moose::Meta::Class + - Fix metaclass incompatibility errors when extending a vanilla perl + class which isa Moose class with a metaclass role applied (t0m) + + - Moose::Meta::Role + - Add a role-combination hook, _role_for_combination, for the + benefit of MooseX::Role::Parameterized (Sartak) + + - Tests + - Some tests were failing on Win32 because they explicit checked + warning output for newlines. Reported by Nickolay Platonov. + +0.77 2009-05-02 + - Moose::Meta::Role + - Add explicit use of Devel::GlobalDestruction and Sub::Name + (perigrin) + + - Moose::Object + - Pass a boolean to DEMOLISHALL and DEMOLISH indicating whether + or not we are currently in global destruction (doy) + - Add explicit use of Devel::GlobalDestruction and Sub::Name + (perigrin) + + - Moose::Cookbook::FAQ + - Reworked much of the existing content to be more useful to + modern Moose hackers (Sartak) + + - Makefile.PL + - Depend on Class::MOP 0.83 instead of 0.82_01. + +0.76 2009-04-27 + - Moose::Meta::TypeConstraint + - Do not run coercions in coerce() if the value already passes the type + constraint (hdp) + + - Moose::Meta::TypeConstraint::Class + - In validation error messages, specifically say that the value is not + an instance of the class. This should alleviate some frustrating + forgot-to-load-my-type bugs. rt.cpan.org #44639 (Sartak) + + - Moose::Meta::Role::Application::ToClass + - Revert the class-overrides-role warning in favor of a solution outside + of the Moose core (Sartak) + + - Tests + - Make Test::Output optional again, since it's only used in a few files + (Sartak) + +0.75_01 2009-04-23 + - Moose::Meta::Role::Application::ToClass + - Moose now warns about each class overriding methods from roles it + consumes (Sartak) + + - Tests + - Warnings tests have standardized on Test::Output which is now an + unconditionally dependency (Sartak) + + - Moose::Meta::Class + - Changes to immutabilization to work with Class::MOP 0.82_01+. + +0.75 2009-04-20 + - Moose + - Moose::Meta::Class + - Move validation of not inheriting from roles from Moose::extends to + Moose::Meta::Class::superclasses (doy) + + - Moose::Util + - add ensure_all_roles() function to encapsulate the common "apply this + role unless the object already does it" pattern (hdp) + + - Moose::Exporter + - Users can now select a different metaclass with the "-metaclass" + option to import, for classes and roles (Sartak) + + - Moose::Meta::Role + - Make method_metaclass an attr so that it can accept a metarole + application. (jdv) + +0.74 2009-04-07 + - Moose::Meta::Role + - Moose::Meta::Method::Destructor + - Include stack traces in the deprecation warnings. + (Florian Ragwitz) + + - Moose::Meta::Class + - Removed the long-deprecated _apply_all_roles method. + + - Moose::Meta::TypeConstraint + - Removed the long-deprecated union method. + + +0.73_02 2009-04-06 + - More deprecations and renamings + - Moose::Meta::Method::Constructor + - initialize_body => _initialize_body (this is always called + when an object is constructed) + + - Moose::Object + - The DEMOLISHALL method could throw an exception during global + destruction, meaning that your class's DEMOLISH methods would + not be properly called. Reported by t0m. + + - Moose::Meta::Method::Destructor + - Destructor inlining was totally broken by the change to the + is_needed method in 0.72_01. Now there is a test for this + feature, and it works again. + + - Moose::Util + - Bold the word 'not' in the POD for find_meta (t0m) + +0.73_01 2009-04-05 + - Moose::* + - Call user_class->meta in fewer places, with the eventual goal + of allowing the user to rename or exclude ->meta + altogether. Instead uses Class::MOP::class_of. (Sartak) + + - Moose::Meta::Method::Accessor + - If an attribute had a lazy default, and that value did not + pass the attribute's type constraint, it did not get the + message from the type constraint, instead using a generic + message. Test provided by perigrin. + + - Moose::Util::TypeConstraints + - Add duck_type keyword. It's sugar over making sure an object + can() a list of methods. This is easier than jrockway's + suggestion to fork all of CPAN. (perigrin) + - add tests and documentation (perigrin) + + - Moose + - Document the fact that init_meta() returns the target class's + metaclass object. (hdp) + + - Moose::Cookbook::Extending::Recipe1 + - Moose::Cookbook::Extending::Recipe2 + - Moose::Cookbook::Extending::Recipe3 + - Moose::Cookbook::Extending::Recipe4 + - Make init_meta() examples explicitly return the metaclass and + point out this fact. (hdp) + + - Moose::Cookbook::Basics::Recipe12 + - A new recipe, creating a custom meta-method class. + + - Moose::Cookbook::Meta::Recipe6 + - A new recipe, creating a custom meta-method class. + + - Moose::Meta::Class + - Moose::Meta::Method::Constructor + - Attribute triggers no longer receive the meta-attribute object + as an argument in any circumstance. Previously, triggers + called during instance construction were passed the + meta-attribute, but triggers called by normal accessors were + not. Fixes RT#44429, reported by Mark Swayne. (hdp) + + - Moose::Manual::Attributes + - Remove references to triggers receving the meta-attribute object as an + argument. (hdp) + + - Moose::Cookbook::FAQ + - Remove recommendation for deprecated Moose::Policy and + Moose::Policy::FollowPBP; recommend MooseX::FollowPBP + instead. (hdp) + + - Many methods have been renamed with a leading underscore, and a + few have been deprecated entirely. The methods with a leading + underscore are consider "internals only". People writing + subclasses or extensions to Moose should feel free to override + them, but they are not for "public" use. + + - Moose::Meta::Class + - check_metaclass_compatibility => _check_metaclass_compatibility + + - Moose::Meta::Method::Accessor + - initialize_body => _initialize_body (this is always called + when an object is constructed) + - /(generate_.*_method(?:_inline)?)/ => '_' . $1 + + - Moose::Meta::Method::Constructor + - initialize_body => _initialize_body (this is always called + when an object is constructed) + - /(generate_constructor_method(?:_inline)?)/ => '_' . $1 + - attributes => _attributes (now inherited from parent) + - meta_instance => _meta_instance (now inherited from parent) + + - Moose::Meta::Role + - alias_method is deprecated. Use add_method + +0.73 2009-03-27 + - No changes from 0.72_01. + +0.72_01 2009-03-26 + - Everything + - Almost every module has complete API documentation. A few + methods (and even whole classes) have been intentionally + excluded pending some rethinking of their APIs. + + - Moose::Util::TypeConstraints + - Calling subtype with a name as the only argument is now an + exception. If you want an anonymous subtype do: + + my $subtype = subtype as 'Foo'; + + - Moose::Cookbook::Meta::Recipe7 + - A new recipe, creating a custom meta-instance class. + + - Moose::Cookbook::Basics::Recipe5 + - Fix various typos and mistakes. Includes a patch from Radu + Greab. + + - Moose::Cookbook::Basics::Recipe9 + - Link to this recipe from Moose.pm's builder blurb + + - Moose::Exporter + - When wrapping a function with a prototype, Moose::Exporter now + makes sure the wrapped function still has the same + prototype. (Daisuke Maki) + + - Moose::Meta::Attribute + - Allow a subclass to set lazy_build for an inherited + attribute. (hdp) + + - Makefile.PL + - Explicitly depend on Data::OptList. We already had this dependency + via Sub::Exporter, but since we're using it directly we're + better off with it listed. (Sartak) + + - Moose::Meta::Method::Constructor + - Make it easier to subclass the inlining behaviour. (Ash + Berlin) + + - Moose::Manual::Delta + - Details significant changes in the history of Moose, along + with recommended workarounds. + + - Moose::Manual::Contributing + - Contributor's guide to Moose. + + - Moose::Meta::Method::Constructor + - The long-deprecated intialize_body method has been removed + (yes, spelled like that). + + - Moose::Meta::Method::Destructor + - This is_needed method is now always a class method. + + - Moose::Meta::Class + - Changes to the internals of how make_immutable works to match + changes in latest Class::MOP. + +0.72 2009-02-23 + - Moose::Object + - Moose::Meta::Method::Constructor + - A mutable class accepted Foo->new(undef) without complaint, + while an immutable class would blow up with an unhelpful + error. Now, in both cases we throw a helpful error + instead. Reported by doy. + +0.71_01 2009-02-22 + - Moose::Cookbook + - Hopefully fixed some POD errors in a few recipes that caused + them to display weird on search.cpan.org. + + - Moose::Util::TypeConstraints + - Calling type or subtype without the sugar helpers (as, where, + message) is now deprecated. + - The subtype function tried hard to guess what you meant, but + often got it wrong. For example: + + my $subtype = subtype as 'ArrayRef[Object]'; + + This caused an error in the past, but now works as you'd + expect. + + - Everywhere + - Make sure Moose.pm is loaded before calling + Moose->throw_error. This wasn't normally an issue, but could + bite you in weird cases. + +0.71 2009-02-19 + - Moose::Cookbook::Basics::Recipe11 + - A new recipe which demonstrates the use of BUILDARGS and + BUILD. (Dave Rolsky) + + - Moose::Cookbook::Roles::Recipe3 + - A new recipe, applying a role to an object instance. (Dave + Rolsky) + + - Moose::Exporter + - Allow overriding specific keywords from "also" packages. (doy) + + - Tests + - Replace hardcoded cookbook tests with Test::Inline to ensure + the tests match the actual code in the recipes. (Dave Rolsky) + + - Moose::Cookbook + - Working on the above turned up a number of little bugs in the + recipe code. (Dave Rolsky) + + - Moose::Util::TypeConstraints::Optimized + - Just use Class::MOP for the optimized ClassName check. (Dave + Rolsky) + +0.70 2009-02-14 + - Moose::Util::TypeConstraints + - Added the RoleName type (stevan) + - added tests for this (stevan) + + - Moose::Cookbook::Basics::Recipe3 + - Updated the before qw[left right] sub to be a little more + defensive about what it accepts (stevan) + - added more tests to t/000_recipies/basics/003_binary_tree.t + (stevan) + + - Moose::Object + - We now always call DEMOLISHALL, even if a class does not + define DEMOLISH. This makes sure that method modifiers on + DEMOLISHALL work as expected. (doy) + - added tests for this (EvanCarroll) + + - Moose::Util::MetaRole + - Accept roles for the wrapped_method_metaclass (rafl) + - added tests for this (rafl) + + - Moose::Meta::Attribute + - We no longer pass the meta-attribute object as a final + argument to triggers. This actually changed for inlined code a + while back, but the non-inlined version and the docs were + still out of date. + + - Tests + - Some tests tried to use Test::Warn 0.10, which had bugs. Now + they require 0.11. (Dave Rolsky) + + - Documentation + - Lots of small changes to the manual, cookbook, and + elsewhere. These were based on feedback from various + users, too many to list here. (Dave Rolsky) + +0.69 2009-02-12 + - Moose + - Make some keyword errors use throw_error instead of croak + since Moose::Exporter wraps keywords now (Sartak) + + - Moose::Cookbook::* + - Revised every recipe for style and clarity. Also moved some + documentation out of cookbook recipes and into Moose::Manual + pages. This work was funded as part of the Moose docs grant + from TPF. (Dave Rolsky) + + - Moose::Meta::Method::Delegation + - If the attribute doing the delegation was not populated, the + error message did not specify the attribute name + properly. (doy) + +0.68 2009-02-04 + - POD + - Many spelling, typo, and formatting fixes by daxim. + + - Moose::Manual::Attributes + - The NAME section in the POD used "Attribute" so search.cpan + didn't resolve links from other documents properly. + + - Moose::Meta::Method::Overriden + - Now properly spelled as Overridden. Thanks to daxim for + noticing this. + +0.67 2009-02-03 + - Moose::Manual::* + - Lots of little typo fixes and a few clarifications. Several + pages didn't have proper titles, and so weren't actually + visible on search.cpan.org. Thanks to hanekomu for a variety + of fixes and formatting improvements. + +0.66 2009-02-03 + - Moose::Manual + - This is a brand new, extensive manual for Moose. This aims to + provide a complete introduction to all of Moose's + features. This work was funded as part of the Moose docs grant + from TPF. (Dave Rolsky) + + - Moose::Meta::Attribute + - Added a delegation_metaclass method to replace a hard-coded + use of Moose::Meta::Method::Delegation. (Dave Rolsky) + + - Moose::Util::TypeConstraints + - If you created a subtype and passed a parent that Moose didn't + know about, it simply ignored the parent. Now it automatically + creates the parent as a class type. This may not be what you + want, but is less broken than before. (Dave Rolsky) + + - Moose::Util::TypeConstraints + - This module tried throw errors by calling Moose->throw_error, + but it did not ensure that Moose was loaded first. This could + cause very unhelpful errors when it tried to throw an error + before Moose was loaded. (Dave Rolsky) + + - Moose::Util::TypeConstraints + - You could declare a name with subtype such as "Foo!Bar" that + would be allowed, but if you used it in a parameterized type + such as "ArrayRef[Foo!Bar]" it wouldn't work. We now do some + vetting on names created via the sugar functions, so that they + can only contain alphanumerics, ":", and ".". (Dave Rolsky) + +0.65 2009-01-22 + - Moose and Moose::Meta::Method::Overridden + - If an overridden method called super(), and then the + superclass's method (not overridden) _also_ called super(), + Moose went into an endless recursion loop. Test provided by + Chris Prather. (Dave Rolsky) + + - Moose::Meta::TypeConstraint + - All methods are now documented. (gphat) + + - t/100_bugs/011_DEMOLISH_eats_exceptions.t + - Fixed some bogus failures that occurred because we tried to + validate filesystem paths in a very ad-hoc and + not-quite-correct way. (Dave Rolsky) + + - Moose::Util::TypeConstraints + - Added maybe_type to exports. See docs for details. (rjbs) + + - Moose + - Added Moose::Util::TypeConstraints to the SEE ALSO + section. (pjf) + + - Moose::Role + - Methods created via an attribute can now fulfill a "requires" + declaration for a role. (nothingmuch) + + - Moose::Meta::Method::* + - Stack traces from inlined code will now report its line and + file as being in your class, as opposed to in Moose + guts. (nothingmuch). + +0.64 2008-12-31 + - Moose::Meta::Method::Accessor + - Always inline predicate and clearer methods (Sartak) + + - Moose::Meta::Attribute + - Support for parameterized traits (Sartak) + - verify_against_type_constraint method to avoid duplication + and enhance extensibility (Sartak) + + - Moose::Meta::Class + - Tests (but no support yet) for parameterized traits (Sartak) + + - Moose + - Require Class::MOP 0.75+, which has the side effect of making + sure we work on Win32. (Dave Rolsky) + +0.63 2008-12-08 + - Moose::Unsweetened + - Some small grammar tweaks and bug fixes in non-Moose example + code. (Dave Rolsky) + +0.62_02 2008-12-05 + - Moose::Meta::Role::Application::ToClass + - When a class does not provide all of a role's required + methods, the error thrown now mentions all of the missing + methods, as opposed to just the first one found. Requested by + Curtis Poe (RT #41119). (Dave Rolsky) + + - Moose::Meta::Method::Constructor + - Moose will no longer inline a constructor for your class + unless it inherits its constructor from Moose::Object, and + will warn when it doesn't inline. If you want to force + inlining anyway, pass "replace_constructor => 1" to + make_immutable. Addresses RT #40968, reported by Jon + Swartz. (Dave Rolsky) + - The quoting of default values could be broken if the default + contained a single quote ('). Now we use quotemeta to escape + anything potentially dangerous in the defaults. (Dave Rolsky) + +0.62_01 2008-12-03 + - Moose::Object + - use the method->execute API for BUILDALL + and DEMOLISHALL (Sartak) + + - Moose::Util::TypeConstraints + - We now make all the type constraint meta classes immutable + before creating the default types provided by Moose. This + should make loading Moose a little faster. (Dave Rolsky) + +0.62 2008-11-26 + - Moose::Meta::Role::Application::ToClass + Moose::Meta::Role::Application::ToRole + - fixed issues where excluding and aliasing the + same methods for a single role did not work + right (worked just fine with multiple + roles) (stevan) + - added test for this (stevan) + + - Moose::Meta::Role::Application::RoleSummation + - fixed the error message when trying to compose + a role with a role it excludes (Sartak) + + - Moose::Exporter + - Catch another case where recursion caused the value + of $CALLER to be stamped on (t0m) + - added test for this (t0m) + + - Moose + - Remove the make_immutable keyword, which has been + deprecated since April. It breaks metaclasses that + use Moose without no Moose (Sartak) + + - Moose::Meta::Attribute + - Removing an attribute from a class now also removes delegation + (handles) methods installed for that attribute (t0m) + - added test for this (t0m) + + - Moose::Meta::Method::Constructor + - An attribute with a default that looked like a number (but was + really a string) would accidentally be treated as a number + when the constructor was made immutable (perigrin) + - added test for this (perigrin) + + - Moose::Meta::Role + - create method for constructing a role + dynamically (Sartak) + - added test for this (Sartak) + - anonymous roles! (Sartak) + - added test for this (Sartak) + + - Moose::Role + - more consistent error messages (Sartak) + + - Moose::Cookbook::Roles::Recipe1 + - attempt to explain why a role that just requires + methods is useful (Sartak) + +0.61 2008-11-07 + - Moose::Meta::Attribute + - When passing a role to handles, it will be loaded if necessary + (perigrin) + + - Moose::Meta::Class + - Method objects returned by get_method (and other methods) + Could end up being returned without an associated_metaclass + attribute. Removing get_method_map, which is provided by + Class::MOP::Class, fixed this. The Moose version did nothing + different from its parent except introduce a bug. (Dave Rolsky) + - added tests for this (jdv79) + + - Various + - Added a $VERSION to all .pm files which didn't have one. Fixes + RT #40049, reported by Adam Kennedy. (Dave Rolsky) + + - Moose::Cookbook::Basics::Recipe4 + - Moose::Cookbook::Basics::Recipe6 + - These files had spaces on the first line of the SYNOPSIS, as + opposed to a totally empty line. According to RT #40432, this + confuses POD parsers. (Dave Rolsky) + +0.60 2008-10-24 + - Moose::Exporter + - Passing "-traits" when loading Moose caused the Moose.pm + exports to be broken. Reported by t0m. (Dave Rolsky) + - Tests for this bug. (t0m) + + - Moose::Util + - Change resolve_metaclass alias to use the new + load_first_existing_class function. This makes it a lot + simpler, and also around 5 times faster. (t0m) + - Add caching to resolve_metaclass_alias, which gives an order + of magnitude speedup to things which repeatedly call the + Moose::Meta::Attribute->does method, notably MooseX::Storage + (t0m) + + - Moose::Util::TypeConstraint + - Put back the changes for parameterized constraints that + shouldn't have been removed in 0.59. We still cannot parse + them, but MooseX modules can create them in some other + way. See the 0.58 changes for more details. (jnapiorkowski) + - Changed the way subtypes are created so that the job is + delegated to a type constraint parent. This clears up some + hardcoded checking and should allow correct subtypes of + Moose::Meta::Type::Constraint. Don't rely on this new API too + much (create_child_type) because it may go away in the + future. (jnapiorkowski) + + - Moose::Meta::TypeConstraint::Union + - Type constraint names are sorted as strings, not numbers. + (jnapiorkowski) + + - Moose::Meta::TypeConstraint::Parameterizable + - New parameterize method. This can be used as a factory method + to make a new type constraint with a given parameterized + type. (jnapiorkowski) + - added tests (jnapiorkowski) + +0.59 2008-10-14 + - Moose + - Add abridged documentation for builder/default/initializer/ + predicate, and link to more details sections in + Class::MOP::Attribute. (t0m) + + - Moose::Util::TypeConstraints + - removed prototypes from all but the &-based stuff (mst) + + - Moose::Util::TypeConstraints + - Creating a anonymous subtype with both a constraint and a + message failed with a very unhelpful error, but should just + work. Reported by t0m. (Dave Rolsky) + + - Tests + - Some tests that used Test::Warn if it was available failed + with older versions of Test::Warn. Reported by Fayland. (Dave + Rolsky) + - Test firing behavior of triggers in relation to builder/default/ + lazy_build. (t0m) + - Test behavior of equals/is_a_type_of/is_a_subtype_of for all + kinds of supported type. (t0m) + + - Moose::Meta::Class + - In create(), do not pass "roles" option to the superclass + - added related test that creates an anon metaclass with + a required attribute + + - Moose::Meta::TypeConstraint::Class + - Moose::Meta::TypeConstraint::Role + - Unify behavior of equals/is_a_type_of/is_a_subtype_of with + other types (as per change in 0.55_02). (t0m) + + - Moose::Meta::TypeConstraint::Registry + - Fix warning when dealing with unknown type names (t0m) + + - Moose::Util::TypeConstraints + - Reverted changes from 0.58 related to handle parameterized + types. This caused random failures on BSD and Win32 systems, + apparently related to the regex engine. This means that Moose + can no longer parse structured type constraints like + ArrayRef[Int,Int] or HashRef[name=>Str]. This will be + supported in a slightly different way via MooseX::Types some + time in the future. (Dave Rolsky) + +0.58 2008-09-20 + !! This release has an incompatible change regarding !! + !! how roles add methods to a class !! + + - Roles and role application + ! Roles now add methods by calling add_method, not + alias_method. They make sure to always provide a method + object, which will be cloned internally. This means that it is + now possible to track the source of a method provided by a + role, and even follow its history through intermediate roles. + + This means that methods added by a role now show up when + looking at a class's method list/map. (Dave Rolsky) + + - Makefile.PL + - From this release on, we'll try to maintain a list of + conflicting modules, and warn you if you have one + installed. For example, this release conflicts with ... + - MooseX::Singleton <= 0.11 + - MooseX::Params::Validate <= 0.05 + - Fey::ORM <= 0.10 + + In general, we try to not break backwards compatibility for + most Moose users, but MooseX modules and other code which + extends Moose's metaclasses is often affected by very small + changes in the Moose internals. + + - Moose::Meta::Method::Delegation + - Moose::Meta::Attribute + - Delegation methods now have their own method class. (Dave + Rolsky) + + - Moose::Meta::TypeConstraint::Parameterizable + - Added a new method 'parameterize' which is basically a factory + for the containing constraint. This makes it easier to create + new types of parameterized constraints. (jnapiorkowski) + + - Moose::Meta::TypeConstraint::Union + - Changed the way Union types canonicalize their names to follow + the normalized TC naming rules, which means we strip all + whitespace. (jnapiorkowski) + + - Moose::Util::TypeConstraints + - Parameter and Union args are now sorted, this makes Int|Str + the same constraint as Str|Int. (jnapiorkowski) + - Changes to the way Union types are parsed to more correctly + stringify their names. (jnapiorkowski) + - When creating a parameterized type, we now use the new + parameterize method. (jnapiorkowski) + - Incoming type constraint strings are now normalized to remove + all whitespace differences. (jnapiorkowski) + - Changed the way we parse type constraint strings so that we now + match TC[Int,Int,...] and TC[name=>Str] as parameterized type + constraints. This lays the foundation for more flexible type + constraint implementations. + + - Tests and docs for all the above. (jnapiorkowski) + + - Moose::Exporter + - Moose + - Moose::Exporter will no longer remove a subroutine that the + exporting package re-exports. Moose re-exports the + Carp::confess function, among others. The reasoning is that we + cannot know whether you have also explicitly imported those + functions for your own use, so we err on the safe side and + always keep them. (Dave Rolsky) + - added tests for this (rafl) + + - Moose::Meta::Class + - Changes to how we fix metaclass compatibility that are much + too complicated to go into. The summary is that Moose is much + less likely to complain about metaclass incompatibility + now. In particular, if two metaclasses differ because + Moose::Util::MetaRole was used on the two corresponding + classes, then the difference in roles is reconciled for the + subclass's metaclass. (Dave Rolsky) + - Squashed an warning in _process_attribute (thepler) + + - Moose::Meta::Role + - throw exceptions (sooner) for invalid attribute names (thepler) + - added tests for this (thepler) + + - Moose::Util::MetaRole + - If you explicitly set a constructor or destructor class for a + metaclass object, and then applied roles to the metaclass, + that explicitly set class would be lost and replaced with the + default. + + - Moose::Meta::Class + - Moose::Meta::Attribute + - Moose::Meta::Method + - Moose + - Moose::Object + - Moose::Error::Default + - Moose::Error::Croak + - Moose::Error::Confess + - All instances of confess() changed to use overridable + C method. This method ultimately calls a class + constructor, and you can change the class being called. In + addition, errors now pass more information than just a string. + The default C behaves like C, so + the behavior is not visibly different for end users. + +0.57 2008-09-03 + - Moose::Intro + - A new bit of doc intended to introduce folks familiar with + "standard" Perl 5 OO to Moose concepts. (Dave Rolsky) + + - Moose::Unsweetened + - Shows examples of two classes, each done first with and then + without Moose. This makes a nice parallel to + Moose::Intro. (Dave Rolsky) + + - Moose::Util::TypeConstraints + - Fixed a bug in find_or_parse_type_constraint so that it + accepts a Moose::Meta::TypeConstraint object as the parent + type, not just a name (jnapiorkowski) + - added tests (jnapiorkowski) + + - Moose::Exporter + - If Sub::Name was not present, unimporting failed to actually + remove some sugar subs, causing test failures (Dave Rolsky) + +0.56 2008-09-01 + For those not following the series of dev releases, there are + several major changes in this release of Moose. + ! Moose::init_meta should now be called as a method. See the + docs for details. + + - Major performance improvements by nothingmuch. + + - New modules for extension writers, Moose::Exporter and + Moose::Util::MetaRole by Dave Rolsky. + + - Lots of doc improvements and additions, especially in the + cookbook sections. + + - Various bug fixes. + + - Removed all references to the experimental-but-no-longer-needed + Moose::Meta::Role::Application::ToMetaclassInstance. + + - Require Class::MOP 0.65. + +0.55_04 2008-08-30 + - Moose::Util::MetaRole + - Moose::Cookbook::Extending::Recipe2 + - This simplifies the application of roles to any meta class, as + well as the base object class. Reimplemented metaclass traits + using this module. (Dave Rolsky) + + - Moose::Cookbook::Extending::Recipe1 + - This a new recipe, an overview of various ways to write Moose + extensions (Dave Rolsky) + + - Moose::Cookbook::Extending::Recipe3 + - Moose::Cookbook::Extending::Recipe4 + - These used to be Extending::Recipe1 and Extending::Recipe2, + respectively. + +0.55_03 2008-08-29 + - No changes from 0.55_02 except increasing the Class::MOP + dependency to 0.64_07. + +0.55_02 2008-08-29 + - Makefile.PL and Moose.pm + - explicitly require Perl 5.8.0+ (Dave Rolsky) + + - Moose::Util::TypeConstraints + - Fix warnings from find_type_constraint if the type is not + found (t0m). + + - Moose::Meta::TypeConstraint + - Predicate methods (equals/is_a_type_of/is_subtype_of) now + return false if the type you specify cannot be found in the + type registry, rather than throwing an unhelpful and + coincidental exception. (t0m). + - added docs & test for this (t0m) + + - Moose::Meta::TypeConstraint::Registry + - add_type_constraint now throws an exception if a parameter is + not supplied (t0m). + - added docs & test for this (t0m) + + - Moose::Cookbook::FAQ + - Added a faq entry on the difference between "role" and "trait" + (t0m) + + - Moose::Meta::Role + - Fixed a bug that caused role composition to not see a required + method when that method was provided by another role being + composed at the same time. (Dave Rolsky) + - test and bug finding (tokuhirom) + +0.55_01 2008-08-20 + + !! Calling Moose::init_meta as a function is now !! + !! deprecated. Please see the Moose.pm docs for details. !! + + - Moose::Meta::Method::Constructor + - Fix inlined constructor so that values produced by default + or builder methods are coerced as required. (t0m) + - added test for this (t0m) + + - Moose::Meta::Attribute + - A lazy attribute with a default or builder did not attempt to + coerce the default value. The immutable code _did_ + coerce. (t0m) + - added test for this (t0m) + + - Moose::Exporter + - This is a new helper module for writing "Moose-alike" + modules. This should make the lives of MooseX module authors + much easier. (Dave Rolsky) + + - Moose + - Moose::Cookbook::Meta::Recipe5 + - Implemented metaclass traits (and wrote a recipe for it): + + use Moose -traits => 'Foo' + + This should make writing small Moose extensions a little + easier (Dave Rolsky) + + - Moose::Cookbook::Basics::Recipe1 + - Removed any examples of direct hashref access, and applied an + editorial axe to reduce verbosity. (Dave Rolsky) + + - Moose::Cookbook::Basics::Recipe1 + - Also applied an editorial axe here. (Dave Rolsky) + + - Moose + - Moose::Cookbook::Extending::Recipe1 + - Moose::Cookbook::Extending::Recipe2 + - Rewrote extending and embedding moose documentation and + recipes to use Moose::Exporter (Dave Rolsky) + + - Moose + - Moose::Role + - These two modules now warn when you load them from the main + package "main" package, because we will not export sugar to + main. Previously it just did nothing. (Dave Rolsky) + + - Moose::Role + - Now provide an init_meta method just like Moose.pm, and you + can call this to provide an alternate role metaclass. (Dave + Rolsky and nothingmuch) + - get_method_map now respects the package cache flag (nothingmuch) + + - Moose::Meta::Role + - Two new methods - add_method and wrap_method_body + (nothingmuch) + + - many modules + - Optimizations including allowing constructors to accept hash + refs, making many more classes immutable, and making + constructors immutable. (nothingmuch) + +0.55 2008-08-03 + - Moose::Meta::Attribute + - breaking down the way 'handles' methods are + created so that the process can be more easily + overridden by subclasses (stevan) + + - Moose::Meta::TypeConstraint + - fixing what is passed into a ->message with + the type constraints (RT #37569) + - added tests for this (Charles Alderman) + + - Moose::Util::TypeConstraints + - fix coerce to accept anon types like subtype can (mst) + + - Moose::Cookbook + - reorganized the recipes into sections - Basics, Roles, Meta, + Extending - and wrote abstracts for each section (Dave Rolsky) + + - Moose::Cookbook::Basics::Recipe10 + - A new recipe that demonstrates operator overloading + in combination with Moose. (bluefeet) + + - Moose::Cookbook::Meta::Recipe1 + - an introduction to what meta is and why you'd want to make + your own metaclass extensions (Dave Rolsky) + + - Moose::Cookbook::Meta::Recipe4 + - a very simple metaclass example (Dave Rolsky) + + - Moose::Cookbook::Extending::Recipe1 + - how to write a Moose-alike module to use your own object base + class (Dave Rolsky) + + - Moose::Cookbook::Extending::Recipe2 + - how to write modules with an API just like C (Dave + Rolsky) + + - all documentation + - Tons of fixes, both syntactical and grammatical (Dave + Rolsky, Paul Fenwick) + +0.54 2008-07-03 + ... this is not my day today ... + + - Moose::Meta::Attribute + - fixed legal_options_for_inheritance such that + clone_and_inherit options still works for + Class::MOP::Attribute objects and therefore + does not break MooseX::AttributeHelpers + (stevan) + +0.53 2008-07-03 + - Whoops, I guess I should run 'make manifest' before + actually releasing the module. No actual changes + in this release, except the fact that it includes + the changes that I didn't include in the last + release. (stevan--) + +0.52 2008-07-03 + - Moose + - added "FEATURE REQUESTS" section to the Moose docs + to properly direct people (stevan) (RT #34333) + - making 'extends' croak if it is passed a Role since + this is not ever something you want to do + (fixed by stevan, found by obra) + - added tests for this (stevan) + + - Moose::Object + - adding support for DOES (as in UNIVERSAL::DOES) + (nothingmuch) + - added test for this + + - Moose::Meta::Attribute + - added legal_options_for_inheritance (wreis) + - added tests for this (wreis) + + - Moose::Cookbook::Snacks::* + - removed some of the unfinished snacks that should + not have been released yet. Added some more examples + to the 'Keywords' snack. (stevan) + + - Moose::Cookbook::Style + - added general Moose "style guide" of sorts to the + cookbook (nothingmuch) (RT #34335) + + - t/ + - added more BUILDARGS tests (stevan) + +0.51 2008-06-26 + - Moose::Role + - add unimport so "no Moose::Role" actually does + something (sartak) + + - Moose::Meta::Role::Application::ToRole + - when RoleA did RoleB, and RoleA aliased a method from RoleB in + order to provide its own implementation, that method still got + added to the list of required methods for consumers of + RoleB. Now an aliased method is only added to the list of + required methods if the role doing the aliasing does not + provide its own implementation. See Recipe 11 for an example + of all this. (Dave Rolsky) + - added tests for this + + - Moose::Meta::Method::Constructor + - when a single argument that wasn't a hashref was provided to + an immutabilized constructor, the error message was very + unhelpful, as opposed to the non-immutable error. Reported by + dew. (Dave Rolsky) + - added test for this (Dave Rolsky) + + - Moose::Meta::Attribute + - added support for meta_attr->does("ShortAlias") (sartak) + - added tests for this (sartak) + - moved the bulk of the `handles` handling to the new + install_delegation method (Stevan) + + - Moose::Object + - Added BUILDARGS, a new step in new() + + - Moose::Meta::Role::Application::RoleSummation + - fix typos no one ever sees (sartak) + + - Moose::Util::TypeConstraints + - Moose::Meta::TypeConstraint + - Moose::Meta::TypeCoercion + - Attempt to work around the ??{ } vs. threads issue + (not yet fixed) + - Some null_constraint optimizations + +0.50 2008-06-12 + - Fixed a version number issue by bumping all modules + to 0.50. + +0.49 2008-06-12 + !! This version now approx. 20-25% !! + !! faster with new Class::MOP 0.59 !! + + - Moose::Meta::Attribute + - fixed how the is => (ro|rw) works with + custom defined reader, writer and accessor + options. + - added docs for this (TODO). + - added tests for this (Thanks to Penfold) + - added the custom attribute alias for regular + Moose attributes which is "Moose" + - fix builder and default both being used + (groditi) + + - Moose + Moose::Meta::Class + Moose::Meta::Attribute + Moose::Meta::Role + Moose::Meta::Role::Composite + Moose::Util::TypeConstraints + - switched usage of reftype to ref because + it is much faster + + - Moose::Meta::Role + - changing add_package_symbol to use the new + HASH ref form + + - Moose::Object + - fixed how DEMOLISHALL is called so that it + can be overrided in subclasses (thanks to Sartak) + - added test for this (thanks to Sartak) + + - Moose::Util::TypeConstraints + - move the ClassName type check code to + Class::MOP::is_class_loaded (thanks to Sartak) + + - Moose::Cookbook::Recipe11 + - add tests for this (thanks to tokuhirom) + +0.48 2008-05-29 + (early morning release engineering)-- + + - fixing the version in Moose::Meta::Method::Destructor + which was causing the indexer to choke + +0.47 2008-05-29 + (late night release engineering)-- + + - fixing the version is META.yml, no functional + changes in this release + +0.46 2008-05-28 + !! This version now approx. 20-25% !! + !! faster with new Class::MOP 0.57 !! + + - Moose::Meta::Class + - some optimizations of the &initialize method + since it is called so often by &meta + + - Moose::Meta::Class + Moose::Meta::Role + - now use the get_all_package_symbols from the + updated Class::MOP, test suite is now 10 seconds + faster + + - Moose::Meta::Method::Destructor + - is_needed can now also be called as a class + method for immutablization to check if the + destructor object even needs to be created + at all + + - Moose::Meta::Method::Destructor + Moose::Meta::Method::Constructor + - added more descriptive error message to help + keep people from wasting time tracking an error + that is easily fixed by upgrading. + +0.45 2008-05-24 + - Moose + - Because of work in Class::MOP 0.57, all + XS based functionality is now optional + and a Pure Perl version is supplied + - the CLASS_MOP_NO_XS environment variable + can now be used to force non-XS versions + to always be used + - several of the packages have been tweaked + to take care of this, mostly we added + support for the package_name and name + variables in all the Method metaclasses + - before/around/after method modifiers now + support regexp matching of names + (thanks to Takatoshi Kitano) + - tests added for this + - NOTE: this only works for classes, it + is currently not supported in roles, + but, ... patches welcome + - All usage of Carp::confess have been replaced + by Carp::croak in the "keyword" functions since + the stack trace is usually not helpful + + - Moose::Role + - All usage of Carp::confess have been replaced + by Carp::croak in the "keyword" functions since + the stack trace is usually not helpful + - The 'has' keyword for roles now accepts the + same array ref form that Moose.pm does + (has [qw/foo bar/] => (is => 'rw', ...)) + - added test for this + + - Moose::Meta::Attribute + - trigger on a ro-attribute is no longer an + error, as it's useful to trigger off of the + constructor + + - Moose::Meta::Class + - added same 'add_package_symbol' fix as in + Class::MOP 0.57 + + - Moose::Util + - does_role now handles non-Moose classes + more gracefully + - added tests for this + - added the 'add_method_modifier' function + (thanks to Takatoshi Kitano) + + - Moose::Util::TypeConstraints + - subtypes of parameterizable types now are + themselves parameterizable types + + - Moose::Meta::Method::Constructor + - fixed bug where trigger was not being + called by the inlined immutable + constructors + - added test for this (thanks to Caelum) + + - Moose::Meta::Role::Application::ToInstance + - now uses the metaclass of the instance + (if possible) to create the anon-class + (thanks Jonathan Rockway) + + - Moose::Cookbook::Recipe22 + - added the meta-attribute trait recipe + (thanks to Sartak) + + - t/ + - fixed hash-ordering test bug that was + causing occasional cpantester failures + - renamed the t/000_recipe/*.t tests to be + more descriptive (thanks to Sartak) + +0.44 2008-05-10 + - Moose + - made make_immutable warning cluck to + show where the error is (thanks mst) + + - Moose::Object + - BUILDALL and DEMOLISHALL now call + ->body when looping through the + methods, to avoid the overloaded + method call. + - fixed issue where DEMOLISHALL was + eating the $@ values, and so not + working correctly, it still kind of + eats them, but so does vanilla perl + - added tests for this + + - Moose::Cookbook::Recipe7 + - added new recipe for immutable + functionality (thanks Dave Rolsky) + + - Moose::Cookbook::Recipe9 + - added new recipe for builder and + lazy_build (thanks Dave Rolsky) + + - Moose::Cookbook::Recipe11 + - added new recipe for method aliasing + and exclusion with Roles (thanks Dave Rolsky) + + - t/ + - fixed Win32 test failure (thanks spicyjack) + + ~ removed Build.PL and Module::Build compat + since Module::Install has done that. + +0.43 2008-04-30 + - NOTE TO SELF: + drink more coffee before + doing release engineering + + - whoops, forgot to do the smolder tests, + and we broke some of the custom meta-attr + modules. This fixes that. + +0.42 2008-04-28 + - some bad tests slipped by, nothing else + changed in this release (cpantesters++) + + - upped the Class::MOP dependency to 0.55 + since we have tests which need the C3 + support + +0.41 2008-04-28 + ~~ numerous documentation updates ~~ + + - Changed all usage of die to Carp::croak for better + error reporting (initial patch by Tod Hagan) + + ** IMPORTANT NOTE ** + - the make_immutable keyword is now deprecated, don't + use it in any new code and please fix your old code + as well. There will be 2 releases, and then it will + be removed. + + - Moose + Moose::Role + Moose::Meta::Class + - refactored the way inner and super work to avoid + any method/@ISA cache penalty (nothingmuch) + + - Moose::Meta::Class + - fixing &new_object to make sure trigger gets the + coerced value (spotted by Charles Alderman on the + mailing list) + - added test for this + + - Moose::Meta::Method::Constructor + - immutable classes which had non-lazy attributes were calling + the default generating sub twice in the constructor. (bug + found by Jesse Luehrs, fixed by Dave Rolsky) + - added tests for this (Dave Rolsky) + - fix typo in initialize_body method (nothingmuch) + + - Moose::Meta::Method::Destructor + - fix typo in initialize_body method (nothingmuch) + + - Moose::Meta::Method::Overriden + Moose::Meta::Method::Augmented + - moved the logic for these into their own + classes (nothingmuch) + + - Moose::Meta::Attribute + - inherited attributes may now be extended without + restriction on the type ('isa', 'does') (Sartak) + - added tests for this (Sartak) + - when an attribute property is malformed (such as lazy without + a default), give the name of the attribute in the error + message (Sartak) + - added the &applied_traits and &has_applied_traits methods + to allow introspection of traits + - added tests for this + - moved 'trait' and 'metaclass' argument handling to here from + Moose::Meta::Class + - clone_and_inherit_options now handles 'trait' and 'metaclass' (has + '+foo' syntax) (nothingmuch) + - added tests for this (t0m) + + - Moose::Object + - localize $@ inside DEMOLISHALL to avoid it + eating $@ (found by Ernesto) + - added test for this (thanks to Ernesto) + + - Moose::Util::TypeConstraints + - &find_type_constraint now DWIMs when given an + type constraint object or name (nothingmuch) + - &find_or_create_type_constraint superseded with a number of more + specific functions: + - find_or_create_{isa,does}_type_constraint + - find_or_parse_type_constraint + + - Moose::Meta::TypeConstraint + Moose::Meta::TypeConstraint::Class + Moose::Meta::TypeConstraint::Role + Moose::Meta::TypeConstraint::Enum + Moose::Meta::TypeConstraint::Union + Moose::Meta::TypeConstraint::Parameterized + - added the &equals method for comparing two type + constraints (nothingmuch) + - added tests for this (nothingmuch) + + - Moose::Meta::TypeConstraint + - add the &parents method, which is just an alias to &parent. + Useful for polymorphism with TC::{Class,Role,Union} (nothingmuch) + + - Moose::Meta::TypeConstraint::Class + - added the class attribute for introspection purposes + (nothingmuch) + - added tests for this + + - Moose::Meta::TypeConstraint::Enum + Moose::Meta::TypeConstraint::Role + - broke these out into their own classes (nothingmuch) + + - Moose::Cookbook::Recipe* + - fixed references to test file locations in the POD + and updated up some text for new Moose features + (Sartak) + + - Moose::Util + - Added &resolve_metaclass_alias, a helper function for finding an actual + class for a short name (e.g. in the traits list) + +0.40 2008-03-14 + - I hate Pod::Coverage + +0.39 2008-03-14 + - Moose + - documenting the use of '+name' with attributes + that come from recently composed roles. It makes + sense, people are using it, and so why not just + officially support it. + - fixing the 'extends' keyword so that it will not + trigger Ovid's bug (http://use.perl.org/~Ovid/journal/35763) + + - oose + - added the perl -Moose=+Class::Name feature to allow + monkeypatching of classes in one liners + + - Moose::Util + - fixing the 'apply_all_roles' keyword so that it will not + trigger Ovid's bug (http://use.perl.org/~Ovid/journal/35763) + + - Moose::Meta::Class + - added ->create method which now supports roles (thanks to jrockway) + - added tests for this + - added ->create_anon_class which now supports roles and caching of + the results (thanks to jrockway) + - added tests for this + - made ->does_role a little more forgiving when it is + checking a Class::MOP era metaclasses. + + - Moose::Meta::Role::Application::ToInstance + - it is now possible to pass extra params to be used when + a role is applied to an the instance (rebless_params) + - added tests for this + + - Moose::Util::TypeConstraints + - class_type now accepts an optional second argument for a + custom message. POD anotated accordingly (groditi) + - added tests for this + - it is now possible to make anon-enums by passing 'enum' an + ARRAY ref instead of the $name => @values. Everything else + works as before. + - added tests for this + + - t/ + - making test for using '+name' on attributes consumed + from a role, it works and makes sense too. + + - Moose::Meta::Attribute + - fix handles so that it doesn't return nothing + when the method cannot be found, not sure why + it ever did this originally, this means we now + have slightly better support for AUTOLOADed + objects + - added more delegation tests + - adding ->does method to this so as to better + support traits and their introspection. + - added tests for this + + - Moose::Object + - localizing the Data::Dumper configurations so + that it does not pollute others (RT #33509) + - made ->does a little more forgiving when it is + passed Class::MOP era metaclasses. + +0.38 2008-02-15 + - Moose::Meta::Attribute + - fixed initializer to correctly do + type checking and coercion in the + callback + - added tests for this + + - t/ + - fixed some finicky tests (thanks to konobi) + +0.37 2008-02-14 + - Moose + - fixed some details in Moose::init_meta + and its superclass handling (thanks thepler) + - added tests for this (thanks thepler) + - 'has' now dies if you don't pass in name + value pairs + - added the 'make_immutable' keyword as a shortcut + to make_immutable + + - Moose::Meta::Class + Moose::Meta::Method::Constructor + Moose::Meta::Attribute + - making (init_arg => undef) work here too + (thanks to nothingmuch) + + - Moose::Meta::Attribute + Moose::Meta::Method::Constructor + Moose::Meta::Method::Accessor + - make lazy attributes respect attr initializers (rjbs) + - added tests for this + + - Moose::Util::TypeConstraints + Moose::Util::TypeConstraints::OptimizedConstraints + Moose::Meta::TypeConstraints + Moose::Meta::Attribute + Moose::Meta::Method::Constructor + Moose::Meta::Method::Accessor + - making type errors use the + assigned message (thanks to Sartak) + - added tests for this + + - Moose::Meta::Method::Destructor + - making sure DESTROY gets inlined properly + with successive DEMOLISH calls (thanks to manito) + + - Moose::Meta::Attribute + Moose::Meta::Method::Accessor + - fixed handling of undef with type constraints + (thanks to Ernesto) + - added tests for this + + - Moose::Util + - added &get_all_init_args and &get_all_attribute_values + (thanks to Sartak and nothingmuch) + +0.36 2008-01-26 + - Moose::Role + Moose::Meta::Attribute + - role type tests now support when roles are + applied to non-Moose classes (found by ash) + - added tests for this (thanks to ash) + - couple extra tests to boost code coverage + + - Moose::Meta::Method::Constructor + - improved fix for handling Class::MOP attributes + - added test for this + + - Moose::Meta::Class + - handled the add_attribute($attribute_meta_object) + case correctly + - added test for this + +0.35 2008-01-22 + - Moose::Meta::Method::Constructor + - fix to make sure even Class::MOP attributes + are handled correctly (Thanks to Dave Rolsky) + - added test for this (also Dave Rolsky) + + - Moose::Meta::Class + - improved error message on _apply_all_roles, + you should now use Moose::Util::apply_all_roles + and you shouldnt have been using a _ prefixed + method in the first place ;) + +0.34 2008-01-21 + ~~~ more misc. doc. fixes ~~~ + ~~ updated copyright dates ~~ + + Moose is now a postmodern object system :) + - (see the POD for details) + + - <> + - this release contains a major reworking and + cleanup of the role system + - 100% backwards compat. + - Role application now restructured into seperate + classes based on type of applicants + - Role summation (combining of more than one role) + is much cleaner and anon-classes are no longer + used in this process + - new Composite role metaclass + - runtime application of roles to instances + is now more efficient and re-uses generated + classes when applicable + + - <> + - methods can now be excluded from a given role + during composition + - methods can now be aliased to another name (and + still retain the original as well) + + - Moose::Util::TypeConstraints::OptimizedConstraints + - added this module (see above) + + - Moose::Meta::Class + - fixed the &_process_attribute method to be called + by &add_attribute, so that the API is now correct + + - Moose::Meta::Method::Accessor + - fixed bug when passing a list of values to + an accessor would get (incorrectly) ignored. + Thanks to Sartak for finding this ;) + - added tests for this (Sartak again) + + - Moose::Meta::Method::Accessor + Moose::Meta::Method::Constructor + Moose::Meta::Attribute + Moose::Meta::TypeConstraint + Moose::Meta::TypeCoercion + - lots of cleanup of such things as: + - generated methods + - type constraint handling + - error handling/messages + (thanks to nothingmuch) + + - Moose::Meta::TypeConstraint::Parameterizable + - added this module to support the refactor + in Moose::Meta::TypeConstraint::Parameterized + + - Moose::Meta::TypeConstraint::Parameterized + - refactored how these types are handled so they + are more generic and not confined to ArrayRef + and HashRef only + + - t/ + - shortened some file names for better VMS support (RT #32381) + +0.33 2007-12-14 + !! Moose now loads 2 x faster !! + !! with new Class::MOP 0.49 !! + + ++ new oose.pm module to make command line + Moose-ness easier (see POD docs for more) + + - Moose::Meta::Class + - Moose::Meta::Role + - several tweaks to take advantage of the + new method map caching in Class::MOP + + - Moose::Meta::TypeConstraint::Parameterized + - allow subtypes of ArrayRef and HashRef to + be used as a container (sartak) + - added tests for this + - basic support for coercion to ArrayRef and + HashRef for containers (sartak) + - added tests for this + + - Moose::Meta::TypeCoercion + - coercions will now create subtypes as needed + so you can now add coercions to parameterized + types without having to explictly define them + - added tests for this + + - Moose::Meta::Method::Accessor + - allow subclasses to decide whether we need + to copy the value into a new variable (sartak) + +0.32 2007-12-04 + - Moose::Util::TypeConstraints + - fixing how subtype aliases of unions work + they should inherit the parent's coercion + - added tests for this + - you can now define multiple coercions on + a single type at different times instead of + having to do it all in one place + - added tests for this + + - Moose::Meta::TypeConstraint + - there is now a default constraint of sub { 1 } + instead of Moose::Util::TypeConstraints setting + this for us + + - Moose::Meta::TypeCoercion + - Moose::Meta::TypeCoercion::Union + - added the &has_coercion_for_type and + &add_type_coercions methods to support the + new features above (although you cannot add + more type coercions for Union types) + +0.31 2007-11-26 + - Moose::Meta::Attribute + - made the +attr syntax handle extending types with + parameters. So "has '+foo' => (isa => 'ArrayRef[Int]')" + now works if the original foo is an ArrayRef. + - added tests for this. + - delegation now works even if the attribute does not + have a reader method using the get_read_method_ref + method from Class::MOP::Attribute. + - added tests for this + - added docs for this + + - Moose::Util::TypeConstraints + - passing no "additional attribute info" to + &find_or_create_type_constraint will no longer + attempt to create an __ANON__ type for you, + instead it will just return undef. + - added docs for this + +0.30 2007-11-23 + - Moose::Meta::Method::Constructor + -builder related bug in inlined constructor. (groditi) + + - Moose::Meta::Method::Accessor + - genereate unnecessary calls to predicates and refactor + code generation for runtime speed (groditi) + + - Moose::Util::TypeConstraints + - fix ClassName constraint to introspect symbol table (mst) + - added more tests for this (mst) + - fixed it so that subtype 'Foo' => as 'HashRef[Int]' ... + with work correctly. + - added tests for this + + - Moose::Cookbook + - adding the link to Recipie 11 (written by Sartak) + - adding test for SYNOPSIS code + + - t/ + - New tests for builder bug. Upon instantiation, if an + attribute had a builder, no value and was not lazy the + builder default was not getting run, oops. (groditi) + +0.29 2007-11-13 + - Moose::Meta::Attribute + - Fix error message on missing builder method (groditi) + + - Moose::Meta::Method::Accessor + - Fix error message on missing builder method (groditi) + + - t/ + - Add test to check for the correct error message when + builder method is missing (groditi) + +0.28 2007-11-13 + - 0.27 packaged incorrectly (groditi) + +0.27 2007-11-13 + - Moose::Meta::Attribute + - Added support for the new builder option (groditi) + - Added support for lazy_build option (groditi) + - Changed slot initialization for predicate changes (groditi) + + - Moose::Meta::Method::Accessor + - Added support for lazy_build option (groditi) + - Fix inline methods to work with corrected predicate + behavior (groditi) + + - Moose::Meta::Method::Constructor + - Added support for lazy_build option (groditi) + + - t/ + - tests for builder and lazy_build (groditi) + + - fixing some misc. bits in the docs that + got mentioned on CPAN Forum & perlmonks + + - Moose::Meta::Role + - fixed how required methods are handled + when they encounter overriden or modified + methods from a class (thanks to confound). + - added tests for this + + - Moose::Util::TypeConstraint + - fixed the type notation parser so that + the | always creates a union and so is + no longer a valid type char (thanks to + konobi, mugwump and #moose for working + this one out.) + - added more tests for this + +0.26 2007-09-27 + == New Features == + + - Parameterized Types + We now support parameterized collection types, such as: + ArrayRef[Int] # array or integers + HashRef[Object] # a hash with object values + They can also be nested: + ArrayRef[HashRef[RegexpRef]] # an array of hashes with regex values + And work with the type unions as well: + ArrayRef[Int | Str] # array of integers of strings + + - Better Framework Extendability + Moose.pm is now "extendable" such that it is now much + easier to extend the framework and add your own keywords + and customizations. See the "EXTENDING AND EMBEDDING MOOSE" + section of the Moose.pm docs. + + - Moose Snacks! + In an effort to begin documenting some of the various + details of Moose as well as some common idioms, we have + created Moose::Cookbook::Snacks as a place to find + small (easily digestable) nuggets of Moose code. + + ==== + ~ Several doc updates/cleanup thanks to castaway ~ + + - converted build system to use Module::Install instead of + Module::Build (thanks to jrockway) + + - Moose + - added all the meta classes to the immutable list and + set it to inline the accessors + - fix import to allow Sub::Exporter like { into => } + and { into_level => } (perigrin) + - exposed and documented init_meta() to allow better + embedding and extending of Moose (perigrin) + + - t/ + - complete re-organization of the test suite + - added some new tests as well + - finally re-enabled the Moose::POOP test since + the new version of DBM::Deep now works again + (thanks rob) + + - Moose::Meta::Class + - fixed very odd and very nasty recursion bug with + inner/augment (mst) + - added tests for this (eilara) + + - Moose::Meta::Attribute + Moose::Meta::Method::Constructor + Moose::Meta::Method::Accessor + - fixed issue with overload::Overloaded getting called + on non-blessed items. (RT #29269) + - added tests for this + + - Moose::Meta::Method::Accessor + - fixed issue with generated accessor code making + assumptions about hash based classes (thanks to dexter) + + - Moose::Coookbook::Snacks + - these are bits of documentation, not quite as big as + Recipes but which have no clear place in the module docs. + So they are Snacks! (horray for castaway++) + + - Moose::Cookbook::Recipe4 + - updated it to use the new ArrayRef[MyType] construct + - updated the accompanying test as well + + +++ Major Refactor of the Type Constraint system +++ + +++ with new features added as well +++ + + - Moose::Util::TypeConstraint + - no longer uses package variable to keep track of + the type constraints, now uses the an instance of + Moose::Meta::TypeConstraint::Registry to do it + - added more sophisticated type notation parsing + (thanks to mugwump) + - added tests for this + + - Moose::Meta::TypeConstraint + - some minor adjustments to make subclassing easier + - added the package_defined_in attribute so that we + can track where the type constraints are created + + - Moose::Meta::TypeConstraint::Union + - this is now been refactored to be a subclass of + Moose::Meta::TypeConstraint + + - Moose::Meta::TypeCoercion::Union + - this has been added to service the newly refactored + Moose::Meta::TypeConstraint::Union and is itself + a subclass of Moose::Meta::TypeCoercion + + - Moose::Meta::TypeConstraint::Parameterized + - added this module (taken from MooseX::AttributeHelpers) + to help construct nested collection types + - added tests for this + + - Moose::Meta::TypeConstraint::Registry + - added this class to keep track of type constraints + +0.25 2007-08-13 + - Moose + - Documentation update to reference Moose::Util::TypeConstraints + under 'isa' in 'has' for how to define a new type + (thanks to shlomif). + + - Moose::Meta::Attribute + - required attributes now will no longer accept undef + from the constructor, even if there is a default and lazy + - added tests for this + - default subroutines must return a value which passes the + type constraint + - added tests for this + + - Moose::Meta::Attribute + - Moose::Meta::Method::Constructor + - Moose::Meta::Method::Accessor + - type-constraint tests now handle overloaded objects correctly + in the error message + - added tests for this (thanks to EvanCarroll) + + - Moose::Meta::TypeConstraint::Union + - added (has_)hand_optimized_constraint to this class so that + it behaves as the regular Moose::Meta::TypeConstraint does. + + - Moose::Meta::Role + - large refactoring of this code + - added several more tests + - tests for subtle conflict resolition issues + added, but not currently running + (thanks to kolibre) + + - Moose::Cookbook::Recipe7 + - added new recipe for augment/inner functionality + (still in progress) + - added test for this + + - Moose::Spec::Role + - a formal definition of roles (still in progress) + + - Moose::Util + - utilities for easier working with Moose classes + - added tests for these + + - Test::Moose + - This contains Moose specific test functions + - added tests for these + +0.24 2007-07-03 + ~ Some doc updates/cleanup ~ + + - Moose::Meta::Attribute + - added support for roles to be given as parameters + to the 'handles' option. + - added tests and docs for this + - the has '+foo' attribute form now accepts changes to + the lazy option, and the addition of a handles option + (but not changing the handles option) + - added tests and docs for this + + - Moose::Meta::Role + - required methods are now fetched using find_method_by_name + so that required methods can come from superclasses + - adjusted tests for this + +0.23 2007-06-18 + - Moose::Meta::Method::Constructor + - fix inlined constructor for hierarchy with multiple BUILD methods (mst) + - Moose::Meta::Class + - Modify make_immutable to work with the new Class::MOP immutable + mechanism + POD + very basic test (groditi) + - Moose::Meta::Attribute + - Fix handles to use goto() so that caller() comes out properly on + the other side (perigrin) + +0.22 2007-05-31 + - Moose::Util::TypeConstraints + - fix for prototype undeclared issue when Moose::Util::TypeConstraints + loaded before consumers (e.g. Moose::Meta::Attribute) by predeclaring + prototypes for functions + - added the ClassName type constraint, this checks for strings + which will respond true to ->isa(UNIVERSAL). + - added tests and docs for this + - subtyping just in name now works correctly by making the + default for where be { 1 } + - added test for this + + - Moose::Meta::Method::Accessor + - coerce and lazy now work together correctly, thanks to + merlyn for finding this bug + - tests added for this + - fix reader presedence bug in Moose::Meta::Attribute + tests + + - Moose::Object + - Foo->new(undef) now gets ignored, it is assumed you meant to pass + a HASH-ref and missed. This produces better error messages then + having it die cause undef is not a HASH. + - added tests for this + +0.21 2007-05-03 + - Moose + - added SUPER_SLOT and INNER_SLOT class hashes to support unimport + - modified unimport to remove super and inner along with the rest + - altered unimport tests to handle this + + - Moose::Role + - altered super export to populate SUPER_SLOT + + - Moose::Meta::Class + - altered augment and override modifier application to use *_SLOT + - modified tests for these to unimport one test class each to test + + - Moose::Meta::Role + - fixed issue where custom attribute metaclasses + where not handled correctly in roles + - added tests for this + + - Moose::Meta::Class + - fixed issue where extending metaclasses with + roles would blow up. Thanks to Aankhen`` for + finding this insidious error, and it's solution. + + ~~ lots of spelling and grammer fixes in the docs, + many many thanks to rlb3 and Aankhen for these :) + +0.20 2007-04-06 + >> I messed up the SKIP logic in one test + so this release is just to fix that. + + - Moose + - 'has' now also accepts an ARRAY ref + to create multiple attrs (see docs) + (thanks to konobi for this) + - added tests and docs + +0.19 2007-04-05 + ~~ More documentation updates ~~ + + - Moose::Util::TypeConstraints + - 'type' now supports messages as well + thanks to phaylon for finding this + - added tests for this + - added &list_all_type_constraints and + &list_all_builtin_type_constraints + functions to facilitate introspection. + + - Moose::Meta::Attribute + - fixed regexp 'handles' declarations + to build the list of delegated methods + correctly (and not override important + things like &new) thanks to ashleyb + for finding this + - added tests and docs for this + - added the 'documentation' attributes + so that you can actually document your + attributes and inspect them through the + meta-object. + - added tests and docs for this + + - Moose::Meta::Class + - when loading custom attribute metaclasses + it will first look in for the class in the + Moose::Meta::Attribute::Custom::$name, and + then default to just loading $name. + - added tests and docs for this + + - Moose::Meta::TypeConstraint + - type constraints now stringify to their names. + - added test for this + + - misc. + - added tests to assure we work with Module::Refresh + - added stricter test skip logic in the Moose POOP + test, ask Rob Kinyon why. + - *cough* DBM::Deep 1.0 backwards compatibility sucks *cough* ;) + +0.18 2007-03-10 + ~~ Many, many documentation updates ~~ + + - misc. + - We now use Class::MOP::load_class to + load all classes. + - added tests to show types and subtypes + working with Declare::Constraints::Simple + and Test::Deep as constraint engines. + +0.18_001 2006-11-26 + !! You must have Class::MOP 0.37_001 !! + !! for this developer release to work !! + + This release was primarily adding the immutable + feature to Moose. An immutable class is one which + you promise not to alter. When you set the class + as immutable it will perform various bits of + memoization and inline certain part of the code + (constructors, destructors and accessors). This + minimizes (and in some cases totally eliminates) + one of Moose's biggest performance hits. This + feature is not on by default, and is 100% optional. + It has several configurable bits as well, so you + can pick and choose to your specific needs. + + The changes involved in this were fairly wide and + highly specific, but 100% backwards compatible, so + I am not going to enumerate them here. If you are + truely interested in what was changed, please do + a diff :) + +0.17 2006-11-14 + - Moose::Meta::Method::Accessor + - bugfix for read-only accessors which + are have a type constraint and lazy. + Thanks to chansen for finding it. + +0.16 2006-11-14 + ++ NOTE ++ + There are some speed improvements in this release, + but they are only the begining, so stay tuned. + + - Moose::Object + - BUILDALL and DEMOLISHALL no longer get + called unless they actually need to be. + This gave us a signifigant speed boost + for the cases when there is no BUILD or + DEMOLISH method present. + + - Moose::Util::TypeConstraints + - Moose::Meta::TypeConstraint + - added an 'optimize_as' option to the + type constraint, which allows for a + hand optimized version of the type + constraint to be used when possible. + - Any internally created type constraints + now provide an optimized version as well. + +0.15 2006-11-05 + ++ NOTE ++ + This version of Moose *must* have Class::MOP 0.36 in order + to work correctly. A number of small internal tweaks have + been made in order to be compatible with that release. + + - Moose::Util::TypeConstraints + - added &unimport so that you can clean out + your class namespace of these exported + keywords + + - Moose::Meta::Class + - fixed minor issue which occasionally + comes up during global destruction + (thanks omega) + - moved Moose::Meta::Method::Overriden into + its own file. + + - Moose::Meta::Role + - moved Moose::Meta::Role::Method into + its own file. + + - Moose::Meta::Attribute + - changed how we do type checks so that + we reduce the overall cost, but still + retain correctness. + *** API CHANGE *** + - moved accessor generation methods to + Moose::Meta::Method::Accessor to + conform to the API changes from + Class::MOP 0.36 + + - Moose::Meta::TypeConstraint + - changed how constraints are compiled + so that we do less recursion and more + iteration. This makes the type check + faster :) + - moved Moose::Meta::TypeConstraint::Union + into its own file + + - Moose::Meta::Method::Accessor + - created this from methods formerly found in + Moose::Meta::Attribute + + - Moose::Meta::Role::Method + - moved this from Moose::Meta::Role + + - Moose::Meta::Method::Overriden + - moved this from Moose::Meta::Class + + - Moose::Meta::TypeConstraint::Union + - moved this from Moose::Meta::TypeConstraint + +0.14 2006-10-09 + + - Moose::Meta::Attribute + - fixed lazy attributes which were not getting + checked with the type constraint (thanks ashley) + - added tests for this + - removed the over-enthusiastic DWIMery of the + automatic ArrayRef and HashRef defaults, it + broke predicates in an ugly way. + - removed tests for this + +0.13 2006-09-30 + ++ NOTE ++ + This version of Moose *must* have Class::MOP 0.35 in order + to work correctly. A number of small internal tweaks have + been made in order to be compatible with that release. + + - Moose + - Removed the use of UNIVERSAL::require to be a better + symbol table citizen and remove a dependency + (thanks Adam Kennedy) + + **~~ removed experimental & undocumented feature ~~** + - commented out the 'method' and 'self' keywords, see the + comments for more info. + + - Moose::Cookbook + - added a FAQ and WTF files to document frequently + asked questions and common problems + + - Moose::Util::TypeConstraints + - added GlobRef and FileHandle type constraint + - added tests for this + + - Moose::Meta::Attribute + - if your attribute 'isa' ArrayRef of HashRef, and you have + not explicitly set a default, then make the default DWIM. + This will also work for subtypes of ArrayRef and HashRef + as well. + - you can now auto-deref subtypes of ArrayRef or HashRef too. + - new test added for this (thanks to ashley) + + - Moose::Meta::Role + - added basic support for runtime role composition + but this is still *highly experimental*, so feedback + is much appreciated :) + - added tests for this + + - Moose::Meta::TypeConstraint + - the type constraint now handles the coercion process + through delegation, this is to support the coercion + of unions + + - Moose::Meta::TypeConstraint::Union + - it is now possible for coercions to be performed + on a type union + - added tests for this (thanks to konobi) + + - Moose::Meta::TypeCoercion + - properly capturing error when type constraint + is not found + + - Build.PL + - Scalar::Util 1.18 is bad on Win32, so temporarily + only require version 1.17 for Win32 and cygwin. + (thanks Adam Kennedy) + +0.12 2006-09-01 + - Moose::Cookbook + - Recipe5 (subtypes & coercion) has been written + + - Moose + - fixed "bad meta" error message to be more descriptive + - fixed &unimport to not remove the &inner and &super + keywords because we need to localize them. + - fixed number of spelling/grammer issues, thanks Theory :) + + **~~ experimental & undocumented feature ~~** + - added the method and self keywords, they are basically + just sugar, and they may not stay around. + + - Moose::Object + - added &dump method to easily Data::Dumper + an object + + - Moose::Meta::TypeConstraint + - added the &is_a_type_of method to check both the current + and the subtype of a method (similar to &isa with classes) + + - Moose::Meta::Role + - this is now a subclass of Class::MOP::Module, and no longer + creates the _role_meta ugliness of before. + - fixed tests to reflect this change + +0.11 2006-07-12 + - 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 2006-07-06 + - Moose + - improved error message when loading modules so + it is less confusing when you load a role. + - added &calculate_all_roles method to + Moose::Meta::Class and Moose::Meta::Role + + NOTE: + This module has been tested against Class::MOP 0.30 + but it does not yet utilize the optimizations + it makes available. Stay tuned for that ;) + +0.09_03 2006-06-23 + ++ DEVELOPER RELEASE ++ + - Moose + - 'use strict' and 'use warnings' are no longer + needed in Moose classes, Moose itself will + turn them on for you. + - added tests for this + - moved code from exported subs to private methods + in Moose::Meta::Class + + - Moose::Role + - as with Moose, strict and warnings are + automatically turned on for you. + - added tests for this + + - Moose::Meta::Role + - now handles an edge case for override errors + - added tests for this + - added some more edge case tests + +0.09_02 2006-05-16 + ++ DEVELOPER RELEASE ++ + - Moose + - added prototypes to the exported subs + - updated docs + + - Moose::Role + - added prototypes to the exported subs + - updated docs + + - Moose::Util::TypeConstraints + - cleaned up prototypes for the subs + - updated docs + +0.09_01 2006-05-12 + ++ DEVELOPER RELEASE ++ + - This release works in combination with + Class::MOP 0.29_01, it is a developer + release because it uses the a new + instance sub-protocol and a fairly + complete Role implementation. It has + not yet been optimized, so it slower + the the previous CPAN version. This + release also lacks good updated docs, + the official release will have updated docs. + + - Moose + - refactored the keyword exports + - 'with' now checks Role validaity and + accepts more than one Role at a time + - 'extends' makes metaclass adjustments as + needed to ensure metaclass compatibility + + - Moose::Role + - refactored the keyword exports + - 'with' now checks Role validaity and + accepts more than one Role at a time + + - Moose::Util::TypeConstraints + - added the 'enum' keyword for simple + string enumerations which can be used as + type constraints + - see example of usage in t/202_example.t + + - Moose::Object + - more careful checking of params to new() + + - Moose::Meta::Role + - much work done on the role composition + - many new tests for conflict detection + and composition edge cases + - not enough documentation, I suggest + looking at the tests + + - Moose::Meta::Instance + - added new Instance metaclass to support + the new Class::MOP instance protocol + + - Moose::Meta::Class + - some small changes to support the new + instance protocol + - some small additions to support Roles + + - Moose::Meta::Attribute + - some improvements to the accessor generation code + by nothingmuch + - some small changes to support the new + instance protocol + - (still somewhat) experimental delegation support + with the 'handles' option + - added several tests for this + - no docs for this yet + +0.05 2006-04-27 + - Moose + - keywords are now exported with Sub::Exporter + thanks to chansen for this commit + - has keyword now takes a 'metaclass' option + to support custom attribute meta-classes + on a per-attribute basis + - added tests for this + - the 'has' keyword not accepts inherited slot + specifications (has '+foo'). This is still an + experimental feature and probably not finished + see t/038_attribute_inherited_slot_specs.t for + more details, or ask about it on #moose + - added tests for this + + - Moose::Role + - keywords are now exported with Sub::Exporter + + - Moose::Utils::TypeConstraints + - reorganized the type constraint hierarchy, thanks + to nothingmuch and chansen for his help and advice + on this + - added some tests for this + - keywords are now exported with Sub::Exporter + thanks to chansen for this commit + + - Moose::Meta::Class + - due to changes in Class::MOP, we had to change + construct_instance (for the better) + + - Moose::Meta::Attribute + - due to changes in Class::MOP, we had to add the + initialize_instance_slot method (it's a good thing) + + - Moose::Meta::TypeConstraint + - added type constraint unions + - added tests for this + - added the is_subtype_of predicate method + - added tests for this + +0.04 2006-04-16 + - Moose::Role + - Roles can now consume other roles + - added tests for this + - Roles can specify required methods now with + the requires() keyword + - added tests for this + + - Moose::Meta::Role + - ripped out much of it's guts ,.. much cleaner now + - added required methods and correct handling of + them in apply() for both classes and roles + - added tests for this + - no longer adds a does() method to consuming classes + it relys on the one in Moose::Object + - added roles attribute and some methods to support + roles consuming roles + + - Moose::Meta::Attribute + - added support for triggers on attributes + - added tests for this + - added support for does option on an attribute + - added tests for this + + - Moose::Meta::Class + - added support for attribute triggers in the + object construction + - added tests for this + + - Moose + - Moose no longer creates a subtype for your class + if a subtype of the same name already exists, this + should DWIM in 99.9999% of all cases + + - Moose::Util::TypeConstraints + - fixed bug where incorrect subtype conflicts were + being reported + - added test for this + + - Moose::Object + - this class can now be extended with 'use base' if + you need it, it properly loads the metaclass class now + - added test for this + +0.03_02 2006-04-12 + - Moose + - you must now explictly use Moose::Util::TypeConstraints + it no longer gets exported for you automatically + + - Moose::Object + - new() now accepts hash-refs as well as key/value lists + - added does() method to check for Roles + - added tests for this + + - Moose::Meta::Class + - added roles attribute along with the add_role() and + does_role() methods + - added tests for this + + - Moose::Meta::Role + - now adds a does() method to consuming classes + which tests the class's hierarchy for roles + - added tests for this + +0.03_01 2006-04-10 + - Moose::Cookbook + - added new Role recipe (no content yet, only code) + + - Moose + - added 'with' keyword for Role support + - added test and docs for this + - fixed subtype quoting bug + - added test for this + + - Moose::Role + - Roles for Moose + - added test and docs + + - Moose::Util::TypeConstraints + - added the message keyword to add custom + error messages to type constraints + + - Moose::Meta::Role + - the meta role to support Moose::Role + - added tests and docs + + - Moose::Meta::Class + - moved a number of things from Moose.pm + to here, they should have been here + in the first place + + - Moose::Meta::Attribute + - moved the attribute option macros here + instead of putting them in Moose.pm + + - Moose::Meta::TypeConstraint + - added the message attributes and the + validate method + - added tests and docs for this + +0.03 2006-03-30 + - Moose::Cookbook + - added the Moose::Cookbook with 5 recipes, + describing all the stuff Moose can do. + + - Moose + - fixed an issue with &extends super class loading + it now captures errors and deals with inline + packages correctly (bug found by mst, solution + stolen from alias) + - added super/override & inner/augment features + - added tests and docs for these + + - Moose::Object + - BUILDALL now takes a reference of the %params + that are passed to &new, and passes that to + each BUILD as well. + + - Moose::Util::TypeConstraints + - Type constraints now survive runtime reloading + - added test for this + + - Moose::Meta::Class + - fixed the way attribute defaults are handled + during instance construction (bug found by chansen) + + - Moose::Meta::Attribute + - read-only attributes now actually enforce their + read-only-ness (this corrected in Class::MOP as + well) + +0.02 2006-03-21 + - Moose + - many more tests, fixing some bugs and + edge cases + - &extends now loads the base module with + UNIVERSAL::require + - added UNIVERSAL::require to the + dependencies list + ** API CHANGES ** + - each new Moose class will also create + and register a subtype of Object which + correspond to the new Moose class. + - the 'isa' option in &has now only + accepts strings, and will DWIM in + almost all cases + + - Moose::Util::TypeConstraints + - added type coercion features + - added tests for this + - added support for this in attributes + and instance construction + ** API CHANGES ** + - type construction no longer creates a + function, it registers the type instead. + - added several functions to get the + registered types + + - Moose::Object + - BUILDALL and DEMOLISHALL were broken + because of a mis-named hash key, Whoops :) + + - Moose::Meta::Attribute + - adding support for coercion in the + autogenerated accessors + + - Moose::Meta::Class + - adding support for coercion in the + instance construction + + - Moose::Meta::TypeConstraint + - Moose::Meta::TypeCoercion + - type constraints and coercions are now + full fledges meta-objects + +0.01 2006-03-15 + - Moooooooooooooooooose!!! diff --git a/Changes.Class-MOP b/Changes.Class-MOP new file mode 100644 index 0000000..df209b5 --- /dev/null +++ b/Changes.Class-MOP @@ -0,0 +1,1800 @@ +After 1.12, Class::MOP was merged into the Moose distribution, and is no +longer released separately. + +1.12 Mon, Jan 3, 2011 + + * Remove usage of undocumented Package::Stash APIs from the tests. This + prevents the tests from failing on Package::Stash >= 0.18. + +1.11 Sun, Oct 31, 2010 + + [ENHANCEMENTS] + + * Replace use of Test::Exception with Test::Fatal. (Karen Etheridge and Dave + Rolsky) + +1.10 Mon, Oct 18, 2010 + + [BUG FIXES] + + * Lots of fixes for edge cases with anon classes. (doy) + +1.09 Tue, Oct 5, 2010 + + [ENHANCEMENTS] + + * It's now possible to tell Class::MOP::Class->create and the metaclass + pragma to not install a 'meta' method into classes they manipulate, + or to install one under a different name. (doy) + + * Reinitializing a metaclass no longer removes the existing method and + attribute objects (it instead fixes them so they are correct for the + reinitialized metaclass). (doy) + + * All 'meta' methods created by Class::MOP are now of the class + Class::MOP::Method::Meta. This is overridable at the metaclass layer. (doy) + + [OTHER] + + * Use get_or_add_package_symbol when we intend for it to autovivify, in + preparation for changes in Package::Stash. (doy) + + * We now use Module::Install::AuthorRequires to force authors to run all + tests, just like we do for Moose. (sartak) + +1.08 Mon, Sep 13, 2010 + + [BUG FIXES] + + * The get_method_list and _get_local_methods methods blew up in the face + of subroutine stubs. (Goro Fuji) + +1.07 Tue, Aug 25, 2010 + + [BUG FIXES] + + * Fix a mysterious error reported by Piers Cawley. The error showed up as + "Can't use an undefined value as a symbol reference at + /usr/local/lib/perl/5.10.1/Class/MOP/Mixin/HasMethods.pm line 167." (Dave + Rolsky) + +1.06 Sun, Aug 23, 2010 + + [BUG FIXES] + + * Version 1.05 no longer reported constants as methods, except with Perl + 5.8.x, and doing so in 5.8.x caused test failures. Constants are now + _expected_ to be reported as methods, and we explicitly test this. (Dave + Rolsky) + +1.05 Sun, Aug 22, 2010 + + [ENHANCEMENTS] + + * Refactorings and improvements to how defaults are handled, particularly + for inlined code (doy). + + * Optimizations that should help speed up compilation time (Dave Rolsky). + +1.04 Tue, Jul 25, 2010 + + [ENHANCEMENTS] + + * Class::MOP::Deprecated now uses Package::DeprecationManager + internally. Deprecation warnings are now only issued once for each calling + package, which cuts down on noise. When importing Class::MOP::Deprecated, + the request API version should now be passed in the "-api_version" + flag. However, the old "-compatible" flag will continue to work. (Dave + Rolsky) + +1.03 Sat, Jun 5, 2010 + + [ENHANCEMENTS] + + * Make CMOP::Package a thin wrapper around Package::Stash (doy). + +1.02 Thu, May 20, 2010 + + [API CHANGES] + + * Packages and modules no longer have methods - this functionality was + moved back up into Class::MOP::Class (doy). + + [ENHANCEMENTS] + + * Metaclass incompatibility checking now checks all metaclass types. (doy) + + * Class::MOP can now do simple metaclass incompatibility fixing: if your + class's metaclass is a subclass of your parent class's metaclass, it will + just use the parent class's metaclass directly. (doy) + +1.01 Thu, May 6, 2010 + + [NEW FEATURES] + + * is_class_loaded, load_class and load_first_existing_class now allow + specifying a minimum required version (Florian Ragwitz). + + [BUG FIXES] + + * The __INSTANCE__ parameter to Class::MOP::Class::new_object now enforces + that the passed in reference is blessed into the correct class (by dying if + it's not) (doy, jhallock). + +1.00 Thu, Mar 25, 2010 + + [GRRR< FUCKING STEVAN@] + + * Re-release 0.99 as 1.00. + +0.99 Thu, Mar 25, 2010 + + [DOCUMENTATION] + + * Fix typo in Class::MOP::Attribute (Franck Cuny). + +0.98 Mon, Jan 18, 2010 + + [ENHANCEMENTS] + + * Added Class::MOP::Class->rebless_instance_back, which does the inverse of + rebless_instance (doy, rafl). + +0.97_01 Mon, Jan 4, 2010 + + [ENHANCEMENTS] + + * Internal refactorings to move shared behavior into new "mixin" classes. This + made adding some new features to Moose much easier. (Dave Rolsky) + +0.97 Fri, Dec 18, 2009 + * No code changes, just packaging fixes to make this distro installable. + +0.96 Fri, Dec 18, 2009 + * tests + - Fixed t/082_get_code_info.t so it passes with bleadperl. (Dave Rolsky) + - Add XS & C files to no tabs check (Dave Rolsky) + - Convert all tests to done_testing. (Florian Ragwitz) + +0.95 Wed, Nov 19, 2009 + * Class::MOP + - Make is_class_loaded without any arguments fail loudly + (Florian Ragwitz). + - Make load_class throw more standard error messages when loading single + modules (nothingmuch). + + * Class::MOP::Package + - Stop add_method from behaving differently under the debugger + (Florian Ragwitz). + + * Class::MOP::Class + * Class::MOP::Package + - Any method which takes a method name as an argument now allows names + which are false (like "0"), but the name must be defined and not be an + empty string. (Dave Rolsky) + + * Class::MOP::Class + - Deprecated get_attribute_map as a public method. You can use a + combination of get_attribute_list and get_attribute instead. (Dave + Rolsky) + +0.94 Tue, Sep 22, 2009 + * Class::MOP::Attribute + - Introduce set_raw_value and get_raw_value, side effect free variants + of {get,set}_value. These don't do anything useful in Class::MOP but + have different behavior that set_value and get_value for Moose + attributes. (nothingmuch) + +0.93 Tue, Sep 15, 2009 + * Class::MOP + - The load_class function just returns true, since it's return value was + confusing (either a metaclass object or a class name). It either loads + a class or dies trying. In the future, this may change to not return + anything, since there's no point in checking its return + value. Addresses RT #45883. (Dave Rolsky) + + * Class::MOP::Class::Trait::Immutable + - When throwing an error because of an immutable method, include that + method's name. Addresses RT #49680. (Shawn M Moore) + + * Class::MOP::Package + - Adding the same sub reference to multiple packages failed to update + the method map properly. RT #48985. Reported by Paul Mooney. (Dave + Rolsky) + - The get_method_map method is now private (and called as + _full_method_map or _method_map). The public version is available as a + deprecated method. (Dave Rolsky) + +0.92_01 Thu, Sep 10, 2009 + * Class::MOP::Package + - Backwards compatibility tweaks to XS for 5.8.1. (Goro Fuji) + + * Class::MOP + - Make sure XS code handles magical scalars correctly. (Goro Fuji) + + * Class::MOP::Class + - Documented the immutable_options method, which is useful if you need + to make a class mutable temporarily, and then nede to restore + immutability. (Dave Rolsky) + + * Many modules + - Deprecated features have been moved to their own module, + Class::MOP::Deprecated, for easier deprecation management. (Goro Fuji) + +0.92 Thu Aug 13, 2009 + * Class::MOP::Class + * Class::MOP::Package + - Move get_method_map and its various scaffolding into Package. (hdp) + + * Class::MOP::Method + - Allow Class::MOP::Method->wrap to take a Class::MOP::Method object as + the first argument, rather than just a coderef. (doy) + + * Class::MOP::Attribute + * Class::MOP::Class + - Allow attribute names to be false (while still requiring them to be + defined). (rafl) + +0.91 Wed Jul 29, 2009 + * Class::MOP::Method::Wrapped + - Fixing variable usage issues with the patch from previous + version, not properly using lexicals in the for + loops. (stevan) + +0.90 Tue Jul 21, 2009 + Japan Perl Association has sponsored Goro Fuji to improve startup + performance of Class::MOP and Moose. These enhancements may break + backwards compatibility if you're doing (or using) complex + metaprogramming, so, as always, test your code! + http://blog.perlassociation.org/2009/07/jpa-sponsors-moose-class-mop-work.html + + * Class::MOP::Class + * XS + - Anonymous classes were not completely destroyed when they went + out of scope, leading to a memory leak. RT #47480. (Goro + Fuji). + + * Class::MOP::Class + - The get_method, has_method, and add_method methods no longer + use get_method_map. Method objects are instantiated + lazily. This significantly improves Class::MOP's load + time. (Goro Fuji) + + * All classes + - Inline fewer metaclass-level constructors since the ones we + have are perfectly fine. This reduces the number of string + evals. (Goro Fuji) + + * Class::MOP::Method::Wrapped + - If a method modifier set $_, this caused the modifier to blow + up, because of some weird internals. (Jeremy Stashewsky) + +0.89 Fri Jul 3, 2009 + * Class::MOP::Class + * Class::MOP::Class::Immutable::Trait + - Made the Trait act like a role with a bunch of "around" + modifiers, rather than sticking it in the inheritance + hierarchy. This fixes various problems that caused with + metaclass compatibility, which broke Fey::ORM. + + * Class::MOP::Method + - Allow a blessed code reference as the method body. Fixes a + problem interaction with MooseX::Types. (ash) + + * Class::MOP::Instance + - add inline version of rebless_instance_structure. (doy) + - change inline_slot_access to use single quotes (gphat) + +0.88 Tue, Jun 23, 2009 + * Class::MOP::Class + - Moved the __INSTANCE__ parameter to _construct_instance from + Moose to here. (doy) + - Fixed some issues involving metaclasses of metaclasses and + immutability. (doy) + +0.87 Sun, Jun 21, 2009 + * Various + - Made sure to always local-ize $@ and $SIG{__DIE__} before + calling an eval. Fixes RT #45973. + + * Class::MOP::Class + - Synced docs about immutability with the current reality (which + changed back in 0.82_01) + - Removed the immutable_transformer method, which had been + returning undef since 0.82_01 anyway. + + * Tests + - Got rid of tests which needed Moose and improved testing of + constructor/destructor inlining warnings. Fixes RT #47119. + +0.86 Tue, Jun 16, 2009 + * Class::MOP::Class + - If you redefined a subroutine at runtime and then wrapped it + with a method modifier, the modifier could in some cases wrap + the original version of the subroutine. Fixes RT #46957. + + * Class::MOP::Class + - make_immutable issues a warning instead of overriding an + existing DESTROY method (Dylan William Hardison). Fixes RT + #46854. + +0.85 Sat, Jun 6, 2009 + * Class::MOP::Attribute + - Allow default values to be Class::MOP::Methods. (Florian + Ragwitz) + - Test the above. (Rhesa Rozendaal) + - Tweak original commit so the intent matches the accepted + behavior (Nicholas Perez) + + * Class::MOP + - Localize $SIG{__DIE__} inside _try_load_one_class (Sartak) + + * Class::MOP::Class + - Add direct_subclasses method (Sartak) + - Tests for subclasses and direct_subclasses (Sartak) + - subname is no longer used unconditionally in add_method, but + only if the code reference's name is '__ANON__' (nothingmuch) + - Add a hook for _superclasses_updated (Sartak) + + * Class::MOP::Method + - Remove long, old warning about possibly outdated modules + (Sartak) + +0.84 Tue, May 12, 2009 + * Makefile.PL + - Depend on Text::Exception 0.27 to avoid failing tests ond old + versions (rafl) + + * Class::MOP + - Made is_class_loaded a little stricter. It was reporting that + a class was loaded if it merely had an @ISA variable in its + stash. Now it checks that the @ISA var has elements in it. + - Deprecate in_global_destruction and subname re-exporting + (perigrin & Sartak) + + * Class::MOP::Class + - Explicitly use Devel::GlobalDestruction and Sub::Name + (perigrin) + + * Class::MOP::Package + - Disable prototype mismatch warnings for add_package_symbol. + (Florian Ragwitz) + * Tests + - Add test for finding methods from $meta->name->meta before immutable, + (t0m) + +0.83 Mon, April 27, 2009 + * Class::MOP::Class + - Fix segfault when calling get_method_map on a metaclass for an empty + package (doy) + +0.82_02 Fri, April 24, 2009 + * Class::MOP::Method::Inlined + - Don't inline if the expected method is not defined at all (happens with + e.g. Moose::Object::_new is the expected method due to an overridden + name) + * Tests + - Some tests were trying to load Class::MOP::Immutable, which + was removed in 0.82_01. + +0.82_01 Thu, April 23, 2009 + * Class::MOP::Immutable (and others) + - Refactor the immutability system to use a pre-defined class + for the immutable metaclass of Class::MOP::Class::Immutable::$class + - Rather than generating methods into this class every time, use + a Trait (basic mixin) to supply the cached methods + - Remove the hack that returns the mutable metaclass for + metacircularity in order to provide consistent meta-metaclasses + for the Moose compatibility handling code + (mst broke it, nothingmuch fixed it) + +0.82 Mon, April 20, 2009 + * Various + - The deprecation wrappers for some renamed methods were not + passing arguments to the new method. (nothingmuch) + + * Class::MOP::Immutable + - Warn during immutablization if the local class provides its own + constructor, to parallel the warning in Moose when a superclass + provides its own constructor (doy) + +0.81 Tue, April 7, 2009 + * Class::MOP + * Class::MOP::Class + * Class::MOP::Instance + * Class::MOP::Attribute + * Class::MOP::Method::Accessor + * Class::MOP::Method::Constructor + - Include stack traces in the deprecation warnings introduced in + 0.80_01. (Florian Ragwitz) + + * MOP.xs + - Avoid c compiler warnings by declaring some unused function + arguments. (Florian Ragwitz) + +0.80_01 Sun, April 5, 2009 + * Makefile.PL + - Make sure to preserve any compiler flags already defined in + Config.pm. Patch by Vincent Pit. RT #44739. + + * Many methods have been renamed with a leading underscore, and a + few have been deprecated entirely. The methods with a leading + underscore are considered "internals only". People writing + subclasses or extensions to Class::MOP should feel free to + override them, but they are not for "public" use. + + - Class::MOP::Class + - construct_class_instance => _construct_class_instance (use new_object) + - construct_instance => _construct_instance (use new_object) + - check_metaclass_compatibility => _check_metaclass_compatibility + - create_meta_instance => _create_meta_instance (use get_meta_instance) + - clone_instance => _clone_instance (use clone_object) + - compute_all_applicable_methods is deprecated, use get_all_methods + - compute_all_applicable_attributes is deprecated, use get_all_attributes + + - Class::MOP::Instance + - bless_instance_structure is deprecated and will be removed + in a future release + + - Class::MOP::Module + - create has been renamed to _instantiate_module. This method + does not construct an object, it evals some code that + creates the relevant package in Perl's symbol table. + + - Class::MOP::Method::Accessor + - initialize_body => _initialize_body (this is always called + when an object is constructed) + - /(generate_.*_method(?:_inline)?)/ => '_' . $1 + + - Class::MOP::Method::Constructor + - initialize_body => _initialize_body (this is always called + when an object is constructed) + - /(generate_constructor_method(?:_inline)?)/ => '_' . $1 + - attributes => _attributes + - meta_instance => _meta_instance + +0.80 Wed, April 1, 2009 + * Class::MOP::* + - Call user_class->meta in fewer places, with the eventual goal + of allowing the user to rename or exclude ->meta + altogether. Instead uses Class::MOP::class_of. (Sartak) + + * Class::MOP + - New class_of function that should be used to retrieve a + metaclass. This is unlike get_metaclass_by_name in that it + accepts instances, not just class names. (Sartak) + + * Class::MOP + - load_first_existing_class didn't actually load the first + existing class; instead, it loaded the first existing and + compiling class. It now throws an error if a class exists (in + @INC) but fails to compile. (hdp) + + * Class::MOP + * Class::MOP::Class + - we had some semi-buggy code that purported to provide a + HAS_ISAREV based on whether mro had get_isarev (due to an + oversight, it always returned 1). Since mro and MRO::Compat + have always had get_isarev, HAS_ISAREV was pointless. This + insight simplified the subclasses method by deleting the + pure-perl fallback. HAS_ISAREV is now deprecated. (Sartak) + +0.79 Fri, March 29, 2009 + * No changes from 0.78_02. + +0.78_02 Thu, March 26, 2009 + * Class::MOP::Class + * Class::MOP::Immutable + - A big backwards-incompatible refactoring of the Immutable API, + and the make_immutable/make_mutable pieces of the Class + API. The core __PACKAGE__->meta->make_immutable API remains + the same, however, so this should only affect the most + guts-digging code. + + * XS code + - The XS code used a macro, XSPROTO, that's only in 5.10.x. This + has been fixed to be backwards compatible with 5.8.x. + + * Class::MOP::Class + - Add a hook for rebless_instance_away (Sartak) + - Use blessed instead of ref to get an instance's class name + in rebless_instance. (Sartak) + +0.78_01 Wed, March 18, 2009 + * Class::MOP::* + - Revised and reorganized all of the API documentation. All + classes now have (more or less) complete API documentation. + + * Class::MOP::Class + * Class::MOP::Instance + - Reblessing into a package that supports overloading wasn't + properly adding overload magic to the object due to a bug + in (at least) 5.8.8. We now use $_[1] directly which seems + to set the magic properly. (Sartak) + + * Class::MOP::Attribute + - The process_accessors method is now private. A public alias + exists (and will stick around for a few releases), but it + warns that calling the public method is deprecated. + + * Class::MOP::Method::Generated + - Removed the new and _new methods, since this is an abstract + base class, and all existing subclasses implement their own + constructors. + + * MOP.xs + - Stop is_class_loaded from thinking a class is loaded if it + only has an empty GV (Florian Ragwitz). + - Add a test for this (Yappo). + - Refactor get_all_package_symbols to allow short-circuiting + (Florian Ragwitz). + - Use this in is_class_loaded (Florian Ragwitz). + - Stop segfaulting when trying to get the name from a sub that's + still being compiled (Florian Ragwitz). + - Add tests for this (Florian Ragwitz). + - Prefix all public symbols with "mop_" (Florian Ragwitz). + - Clean up and simplify prehashing of hash keys (Florian Ragwitz). + - Simplify creating simple xs reader methods (Florian Ragwitz). + - Make everything compile with c++ compilers (Florian Ragwitz). + - Upgrade ppport.h from 3.14 to 3.17 (Florian Ragwitz). + + * Tests + - Remove optional test plans for tests depending on Sub::Name as + we have a hard dependency on Sub::Name anyway (Florian Ragwitz). + + * Makefile.PL + - Rebuild all c code if mop.h has changed (Florian Ragwitz) + +0.78 Mon, February 23, 2009 + * No changes from 0.77_01 + +0.77_01 Sun, February 22, 2009 + * Everything + - This package now requires its XS components. Not using + Sub::Name lead to different behavior and bugginess in the pure + Perl version of the code. A Moose test would fail when run + against the pure Perl version of this code. + + * Class::MOP::Instance + - The inline_* methods now quote attribute names themselves, and + don't expect to receive a quoted value. + + +0.77 Sat, February 14, 2009 + * MOP.xs + - Avoid assertion errors on debugging perls in is_class_loaded + (Florian Ragwitz) + + * Class::MOP + - Fixed various corner cases where is_class_loaded incorrectly + returned true for a class that wasn't really loaded. (Dave + Rolsky) + + * Class::MOP::Class + - Add get_all_method_names (Sartak) + - Add a wrapped_method_metaclass attribute (Florian Ragwitz) + + * Class::MOP::Package + - Disable deprecated get_all_package_symbols in list + context. (Florian Ragwitz) + + * Makefile.PL + - Make sure we generate a BSD-compatible Makefile (Florian + Ragwitz) + + * Class::MOP::Class + - The misspelled "check_metaclass_compatability" method we've + kept around for backwards compat_i_bility will be removed in a + near future release. You've been warned. + +0.76 Thu, January 22, 2009 + * Class::MOP::Method::Generated + - Added new private methods to support code generation, which + are being used by Moose and can be used by MooseX + authors. (mst) + - Generated methods are now generated with a #line directive + reflecting the source of the generated method. (nothingmuch) + + * Class::MOP::Class + - Clarified documentation of methods that return + Class::MOP::Method objects. (doy) + + * Class::MOP + - Clarified documentation of the metaclass cache methods. (Sartak) + + * Tests + - Add test showing how the xs Class::MOP::is_class_loaded can + be made to operate differently to the pure perl version (t0m) + +0.75 Wed, December 31, 2008 + * Class::MOP::Class + - A class that was made immutable and then mutable could end up + sharing an immutable transformer object + (Class::MOP::Immutable) with other classes, leading to all + sorts of odd bugs. Reported by t0m. (Dave Rolsky) + +0.74 Tue, December 25, 2008 + * MOP.xs + - Add an xs implementation of Class::MOP::is_class_loaded (closes + RT#41862). Based on a patch by Goro Fuji. (Florian Ragwitz) + - Changed internals to make prehashing of hash keys easier and less + error-prone. (Florian Ragwitz) + * Class::MOP::Class + - Fix documentation to show that around modifiers happen on both + sides of the modified method. (Dave Rolsky) + +0.73 Tue, December 16, 2008 + * MOP.xs + - Don't use Perl_mro_meta_init. It's not part of the public perl + api. Fixes failures to build on Win32 (RT #41750). (Florian + Ragwitz) + * t/082_get_code_info.t + - Add $^P &= ~0x200; (per Ovid's suggestion) in order to not + munger anonymous subs when under -d and so making the tests + succeed in that case. + +0.72 Mon, December 8, 2008 + * Class::MOP::Package + - Pass options to _new, so subclass' attributes can be + initialized (Sartak) + * Class::MOP::Method + - In the docs, indicate that package_name and name are required + when calling ->wrap (Stefan O'Rear) + +0.71_02 Fri, December 5, 2008 + * Class::MOP::Immutable + - Added a new attribute, inlined_constructor, which is true if + the constructor was inlined. + * Class::MOP::Package + - Make get_all_package_symbols return a hash ref in scalar + context and deprecate calling it in list context with a + warning. (Florian Ragwitz) + * MOP.xs + - Various improvements and refactoring, making things more robust and + easier to maintain. (Florian Ragwitz) + +0.71_01 Wed, December 3, 2008 + * Class::MOP::Method + - Add an "execute" method to invoke the body so + we can avoid using the coderef overload (Sartak) + * Class::MOP::Immutable + - When we memoize methods, get their results lazily + to remove some compile-time cost (Sartak) + - Small speedup from eliminating several method + calls (Sartak) + * Class::MOP::Class + - Some small internal tweaks to try to reduce the number of + times we call get_method_map when bootstrapping the MOP. This + might make loading Class::MOP (and Moose) a little + faster. (Dave Rolsky) + - Implemented an optional XS version of get_method_map. Mostly + taken from a patch by Goro Fuji (rt.cpan.org #41080), with + help form Florian Ragwitz. (Dave Rolsky) + - Make the behaviour of of get_all_package_symbols (and + therefore get_method_map) consistent for stub methods. Report + and test by Goro Fuji (rt.cpan.org #41255). (Florian Ragwitz) + +0.71 Wed November 26, 2008 + * Class::MOP::Class + * Class::MOP::Module + - Actual package creation has moved upward from + Class to Module so that Moose roles can share + the code (Sartak) + +0.70_01 Mon, November 19, 2008 + * Class::MOP + - Fixes for failures with blead (Florian Ragwitz) + - Silenced compiler warnings (Florian Ragwitz) + +0.70 Fri, November 14, 2008 + * Class::MOP + - Fixed an odd corner case where the XS version of + get_all_package_symbols could cause a segfault. This only + happened with inlined constants in Perl 5.10.0 (Florian + Ragwitz) + +0.69 Fri, November 7, 2008 + * Class::MOP::Method::Wrapped + - Added introspection methods for method modifiers (Dave Rolsky) + + +0.68 Fri October 24, 2008 + * Class::MOP + - Make load_class require by file name instead of module name. + This stops confusing error messages when loading '__PACKAGE__'. + (Florian Ragwitz) + - Add load_one_class_of function to enable you to load one of a + list of classes, rather than having to call load_class multiple + times in an eval. (t0m) + +0.67 Tue October 14, 2008 + * Class::MOP::Class + - Call a method on the class after setting the superclass list + so that we can get Perl to detect cycles before MRO::Compat + spirals into an infinite loop (sartak) + - Reported by Schwern, [rt.cpan.org #39001] + - In create(), pass unused options on to initialize() + - added test for this + +0.66 Sat September 20, 2008 + !! This release has an incompatible change regarding !! + introspection of a class's method with Class::MOP::Class !! + + * Tests and XS + - We (us maintainers) now run all tests with XS and then without + XS, which should help us catch skew between the XS/pure Perl + code. (Dave Rolsky) + + * Class::MOP::Class + ! The alias_method method has been deprecated. It now simply + calls add_method instead. There is no distinction between + aliased methods and "real" methods. + + This means that methods added via alias_method now show up as + part of the class's method list/map. This is a backwards + incompatible change, but seems unlikely to break any + code. Famous last words. (Dave Rolsky) + + * Class::MOP::Class + - Fixed the spelling of "compatibility", but we still have a + "check_metaclass_compatability" method for backwards + compatibility. + +0.65 Mon September 1, 2008 + For those not following the series of dev releases, the changes + from 0.64 from 0.65 can mostly be summed up as a lot performance + improvements by nothingmuch, including new optional XS versions of + some methods. Also, Class::MOP now works _without_ any XS modules, + for sad systems without a compiler. + + * Class::MOP::Method + - Added name and package_name XS accessors, and make sure all + the XS and Perl versions work the same way. (Dave Rolsky) + + * MOP.xs + - The XS versions of various methods just returned undef when + called class methods, rather than dying like the pure Perl + versions. (Dave Rolsky) + +0.64_07 Fri August 29, 2008 + * Class::MOP + - Silenced warnings that managed to break Moose tests when XS + was loaded. (Dave Rolsky) + - Some XS versions of methods were ignored because of typos in + MOP.xs. (Dave Rolsky) + +0.64_06 Mon August 25, 2008 + * Class::MOP (MOP.xs) + - Another MS VC++ fix, cannot declare a variable in the middle + of a scope (Taro Nishino). + +0.64_05 Sun August 24, 2008 + * Class::MOP + - None of the dev releases actually loaded the XS properly, but + we silently fell back to the pure Perl version of the + code. (Dave Rolsky) + + * Class::MOP (MOP.xs) + - Replaced some code that used functions not available on Visual + C++ with some Perl XS API bits (Dave Rolsky). + +0.64_04 Sat August 23, 2008 + * Class::MOP::Class + - Workaround a bug in 5.8.1's goto sub (nothingmuch) + + * pod.t and pod_coveraget.t + - These are no longer shipped with the tarball because of bogus + failures from CPAN testers. (Dave Rolsky) + +0.64_03 Thu August 21, 2008 + * Class::MOP::Package + - Some (legit) code was misparsed by earlier 5.8.x + releases. (nothingmuch) + + * Class::MOP + - Fix a constant in void context warning (nothingmuch) + +0.64_02 Thu August 21, 2008 + * Makefile.PL and Class::MOP + - Explicitly require Perl 5.8.0+ (Dave Rolsky) + + * Makefile.PL + - Add missing prereqs that got lost in the switch away from + Module::Install. + + * Class::MOP::Instance + - New method - get_all_attributes (nothingmuch) + +0.64_01 Wed August 20, 2008 + * Makefile.PL + - We now check to see if you have a compiler. If you don't, the + module installs without some XS bits, but will work the same + as with XS. This should make it easier to install on platforms + without a compiler (like Windows). (Dave Rolsky) + + * many modules + - Perl 6 style attribute naming replaced with sane style ('methods', not + '%!methods'). These changes should not impact any existing API uses. + (nothingmuch). + + * many modules + - Quite a number of optimizations based on profiling, including + allowing constructors to take hash references instead of + hashes, duplicating some frequently used code in XS, and + making constructors immutable. These changes should not impact + any existing API uses. (nothingmuch) + + * Many modules + - Constructors now respect the meta attributes of their subclasses, + facilitating MOP extensibility. More related changes will happen in the + next several releases. (nothingmuch) + + * Class::MOP::Class + - New method - get_all_methods, replaces the deprecated + compute_all_applicable_methods. get_all_attributes provided for + consistency (nothingmuch) + - New method - wrap_method was refactored out of get_method_map + (nothingmuch) + - New API for meta instance invalidation - invalidate_meta_instance, + invalidate_meta_instances, add_dependent_meta_instance, + remove_dependent_meta_instance, called automatically when attribute + definitions change and allows notification of dependent subclasses. + (nothingmuch) + +0.64 Sun August 3, 2008 + * Class::MOP::Immutable + - fixing subtle edge case in immutable when you + call ->meta (stevan) + - clean up option processing (nothingmuch) + + * Class::MOP::Instance + - inlined initialize slot didn't match + non-inlined (nothingmuch) + +0.63 Mon July 7, 2008 + * Class::MOP + - load_class will initialize a metaclass even if + the class is already loaded (sartak) + - load_class now returns the metaclass instance + instead of just 1 (sartak) + + * elsewhere + - better error messages (sartak and Dave Rolsky) + +0.62 Wed June 18, 2008 + - in is_class_loaded, recognize scalar references (as opposed to globs) in + the symbol table as methods (these are optimized constant subs) + +0.61 Fri. June 13, 2008 + - Okay, lets give this another try and see if PAUSE + recognizes it correct this time. + +0.60 Thurs. Jun 12, 2008 + - Fixed a version number issue by bumping all modules + to 0.60. + +0.59 Thurs. Jun 12, 2008 + !! Several fixes resulting in yet another 25-30% speedup !! + + * Class::MOP::Class + - now stores the instance of the instance + metaclass to avoid needless recomputation + and deletes it when the cache is blown + - introduce methods to query Class::MOP::Class for + the options used to make it immutable as well as + the proper immutable transformer. (groditi) + + * Class::MOP::Package + - {add, has, get, remove}_package_symbol all + now accept a HASH ref argument as well as the + string. All internal usages now use the HASH + ref version. + + * Class::MOP + - MOP.xs does sanity checks on the coderef + to avoid a segfault + - is_class_loaded check now uses code that + was improved in Moose's ClassName type + check (Sartak) + - nonsensical (undef, empty, reference) class + names now throw a more direct error in + load_class (Sartak) + - tests for this and other aspects of + load_class (Sartak) + + * Class::MOP + Class::MOP::Class + Class::MOP::Method + Class::MOP::Method::Wrapped + Class::MOP::Attribute + - switched usage of reftype to ref because + it is much faster + +0.58 Thurs. May 29, 2008 + (late night release engineering)-- + + - fixing the version is META.yml, no functional + changes in this release + +0.57 Wed. May 28, 2008 + !! Several speedups resulting in 20-25% speedups !! + || (thanks to konobi, groditi, mst & CataMoose) !! + + * Class::MOP::Class + - made get_method_map use list_all_package_symbols + instead of manually grabbing each symbol + - streamlining &initialize somewhat, since it gets + called so much + + * Class::MOP::Package + - made {get, has}_package_symbol not call + &namespace so much + - inlining a few calls to &name with + direct HASH access key access + - added get_all_package_symbols to fetch + a HASH of items based on a type filter + similar to list_all_package_symbols + - added tests for this + + * Class::MOP::Method + Class::MOP::Method::Constructor + Class::MOP::Method::Generated + Class::MOP::Method::Accessor + - added more descriptive error message to help + keep people from wasting time tracking an error + that is easily fixed by upgrading. + + * Class::MOP::Immutable + - Don't inline a destructor unless the user actually + needs one + - added tests for this + +0.56 Saturday, May 24, 2008 + * Class::MOP + - we now get the &check_package_cache_flag + function from MRO::Compat + - All XS based functionality now has a + Pure Perl alternative + - the CLASS_MOP_NO_XS environment variable + can now be used to force non-XS versions + to always be used + + * Class::MOP::Attribute + - add has_read_method and has_write_method + - get_{read,write}_method_ref now wraps the + anon-sub ref in the method metaclass when + possible + - added tests for this + + * Class::MOP::Immutable + - added the ability to "wrap" methods when + making the class immutable + + * Class::MOP::Class + - now handling the edge case of ->meta->identifier + dying by wrapping add_package_symbol to specifically + allow for it to work. + - added tests for this + + * Class::MOP::Attribute + Class::MOP::Class + Class::MOP::Immutable + - any time a method meta object is constructed + we make sure to pass the correct package and + method name information + + * Class::MOP::Method + Class::MOP::Method::Wrapped + Class::MOP::Method::Generated + Class::MOP::Method::Accessor + Class::MOP::Method::Consructor + - the &wrap constructor method now requires that a + 'package_name' and 'name' attribute are passed. This + is to help support the no-XS version, and will + throw an error if these are not supplied. + - all these classes are now bootstrapped properly + and now store the package_name and name attributes + correctly as well + + ~ Build.PL has been removed since the + Module::Install support has been removed + +0.55 Mon. April 28, 2008 + - All classes now have proper C3 MRO support + - added MRO::Compat as a dependency to allow + for the C3 MRO support to Just Work in all + perl versions + + * Class::MOP::Class + - rebless_instance now returns the instance + it has just blessed, this is mostly to + facilitate chaining + - set the attr correctly in rebless_instance + when it has no init_arg + - tweaked &linear_isa and &class_precedence_list + to support c3 classes. + +0.54 Fri. March, 14, 2008 + * Class::MOP + metaclass.pm + - making sure that load_class never gets + passed a value from @_ or $_ to squash + Ovid's bug (http://use.perl.org/~Ovid/journal/35763) + + * Class::MOP::Class + - make_{immutable,mutable} now return 1 + (cause Sartak asked) + - improved error handling in ->create method + - rebless_instance now takes extra params which + will be used to populate values + - added tests for this + + * Class::MOP::Object + - localizing the Data::Dumper configurations so + that it does not pollute others (RT #33509) + + * Class::MOP::Class + Class::MOP::Package + Class::MOP::Module + Class::MOP::Method + Class::MOP::Attribute + - these classes no longer define their own ->meta, + but instead just inherit from Class::MOP::Object + + * Class::MOP::Instance + Class::MOP::Immutable + - these classes now inherit from Class::MOP::Object + + * t/ + - fixed the filename length on several + test files so we install on VMS better + (RT #32295) + - fixed incorrect use of catdir when it + should be catfile (RT #32385) + +0.53 Thurs. Feb. 14, 1008 + ~~ several doc. fixes and updates ~~ + + * Class::MOP::Class + Class::MOP::Method::Constructor + Class::MOP::Attribute + - making init_arg accept an undefined value + to indicate that no constructor args can + be passed (thanks to nothingmuch) + - added tests for this + - added attribute initializer attribute (rjbs) + + * Class::MOP. + - making this use the new init_arg => undef + feature instead of the silly hack from + before (thanks to nothingmuch) + +0.52 Tues. Jan. 22, 2008 + * Class::MOP::Class + - fixed bug in rebless_instance + (discovered by ash) + + * Class::MOP::Method::Constructor + - removed assumptions about the existence of + a &meta method + +0.51 Mon. Jan. 14, 2008 + ~~~ some misc. doc. fixes ~~~ + ~~ updated copyright dates ~~ + + * Class::MOP + - now sets the IS_RUNNING_ON_5_10 + constant so that we can take advantage + of some of the nice bits of 5.10 + + * Class::MOP::Class + - uses the IS_RUNNING_ON_5_10 flag to + optimize the &linearized_isa method + and avoid the hack/check for circular + inheritence in &class_precedence_list + - added rebless_instance method (Sartak) + - added tests for this + + * Class::MOP::Immutable + - the immutable class now keeps track of + the transformer which immutablized it + + * Class::MOP::Instance + - added rebless_instance_structure method (Sartak) + - added tests for this + +0.50 Fri. Dec. 21, 2007 + * Class::MOP::Class + - fixed bug in immutable to make sure that + transformation arguments are saved + correctly (mst) + - added tests for this + + * Class::MOP::Immutable + - fixed a bug (see above) + + * Class::MOP::Attribute + - some doc updates + +0.49 Fri. Dec. 14, 2007 + !! Class::MOP now loads 2 x faster !! + !! with XS speedups (thanks konobi) !! + + * Class::MOP + - removed the dependency on B + - added two XS functions (thanks konobi) + - get_code_info($code) which replaces all + the B fiddling we were doing with + faster/leaner XS level fiddling + - check_package_cache_flag($pkg_name) which + returns the PL_sub_generation variable to + be used to help manage method caching. + + NOTE: + In 5.10 or greater this will actually + use the mro::get_pkg_gen instead to give + even more accurate caching information. + blblack++ for that stuff :) + + * Class::MOP::Class + - added the &subclasses method (thanks rlb) + - added the update_package_cache_flag and + reset_package_cache_flag which help keep + track of when we need to re-fetch the + method map. + - Several small improvements to take advantage + of the new method map caching features + +0.48 Mon. Nov. 26, 2007 + * Class::MOP::Attribute + - fixed get_read/write_method to handle the + HASH ref case, which makes the + get_read/write_method_ref handle it too. + - added more tests for this + +0.47 Sat. Nov. 24, 2007 + * Class::MOP::Attribute + - fixed misspelling in get_write_method_ref + - added more tests for this + +0.46 Fri. Nov. 23, 2007 + * Class::MOP::Class + - added the linearized_isa method instead of constantly + pruning duplicate classes (this will be even more + useful in the 5.10-compat version coming soon) + + * Class::MOP::Attribute + - added the get_read_method_ref and get_write_method_ref + methods which allow you to retrieve a CODE ref which + can always be used to read or write an attribute. + +0.45 Thurs. Nov. 13, 2007 + * Class::MOP::Attribute + - Fix error message on confess (groditi) + +0.44 Thurs. Nov. 13, 2007 + - Apparently I didn't make dist correctly (groditi) + +0.43 Thurs. Nov. 13, 2007 + * Class::MOP + - Add support for the 'builder' attribute (groditi) + + * Class::MOP::Class + - optimise metaclass-already-exists check in + construct_class_instance (groditi) + - duplicate check into initialize to save a + call through (groditi) + + * Class::MOP::Attribute + - Add support for the 'builder' attribute (groditi) + - Make predicates check for the existence of a value, not whether + it is defined (groditi) + + * Class::MOP::Instance + - Make predicates check for the existence of a value, not whether + it is defined (groditi) + + * Class::MOP::Method::Accessor + - made this a subclass of Class::MOP::Method::Generated + - removed the relevant attributes + + * Class::MOP::Method::Constructor + - fixed the cached values we had to be more sane + - made this a subclass of Class::MOP::Method::Generated + - fixed generated constructor so it properly handles + subclasses now. + - added tests for this + - added the option to allow for both inlined and + non-inlined constructors. + - Update inlined methods for builder and predicate changes (groditi) + + * Class::MOP::Method::Generated + - added this class as an abstract base for the + Class::MOP::Method::{Constructor,Accessor} classes + - added tests for this + + *t/ + - Alter tests (005, 014 020, 021) for new builder addition (groditi) + - Tests for new predicate behavior (and corrections to old tests) (groditi) + + *examples/ + - Update ArrayRef based class example to work with predicate changes + +0.42 Mon. July 16, 2007 + !!! Horray for mst, he fixed it !!! + + * Class::MOP::Package + - alter symbol table handling to deal with 5.8.x and 5.9.x + + * t/ + - Get rid of the crappy workaround from 0.40/41 + +0.41 Sun. July 15, 2007 + * t/ + Arghh!!! My TODO test didn't work, so I handle + it manually now so that people can use this + with 5.9.5/bleadperl without issue. + +0.40 Tues, July 3, 2007 + * t/ + ~ marked a test in 003_methods.t as TODO + for perl 5.9.5 (this test is irrelvant to + the module functioning on 5.9.5 for the most + part anyway) + +0.39 Mon. June 18, 2007 + * Class::MOP::Immutable + - added make_metaclass_mutable + docs (groditi) + - removed unused variable + - added create_immutable_transformer + necessary for sane overloading of immutable behavior + - tests for this (groditi) + + * Class::MOP::Class + - Immutability can now be undone, + added make_mutable + tests + docs (groditi) + - Massive changes to the way Immutable is done + for details see comments next to make_immutable + This fixes a bug where custom metaclasses broke + when made immutable. We are now keeping one immutable + metaclass instance per metaclass instead of just one + to prevent isa hierarchy corruption. Memory use will go + up, but I suspect it will be neglible. + - New tests added for this behavior. (groditi) + +0.38 Thurs. May 31, 2007 + ~~ More documentation updates ~~ + + * Class::MOP::Package + - we now deal with stub methods properly + - added tests for this + - fixed some tests failing on 5.9.5 (thanks blblack) + + * Class::MOP::Attribute + - added get_read_method and get_write_method + thanks to groditi for this code, tests + and docs. + - added tests and POD for this + + * Class::MOP::Class + - fixed RT issue #27329, clone object now + handles undef values correctly. + - added tests for this + - Corrected anon-class handling so that they + will not get reaped when instances still + exist which need to reference them. This is + the correct behavior, hopefully this is an + obscure enough feature that there are not too + many work arounds out in the wild. + - added tests for this by groditi + - updated docs to explain this + + * metaclass + - load custom metaclasses automatically (thanks groditi) + - added tests for this behavior + +0.37 Sat. March 10, 2007 + ~~ Many, many documentation updates ~~ + + * Class::MOP + - added &load_class and &is_class_loaded + - added tests and docs for these + + * Class::MOP::Attribute + - default now checks the instance with defined to + avoid setting off bool-overloads (found by Carl Franks) + +0.37_002 + * /t + - bad name in a test, causing meaningless failuress. + No other changes. + +0.37_001 + + ~~ GLOBAL CHANGES ~~ + - All attribute names are now consistent and follow Perl 6 + style (prefixed with the sigil, and ! as the twigil for + private attrs). This should not affect any code, unless + you broke encapsulation, in which case, it is your problem + anyway. + + !! Class::MOP::Class::Immutable has been removed + + * Class::MOP::Method::Constructor + - this has been moved out of Class::MOP::Class::Immutable + and is a proper subclass of Class::MOP::Method now. + + * Class::MOP::Class + - this module now uses Class::MOP::Immutable for the + immutable transformation instead of + Class::MOP::Class::Immutable. + + + Class::MOP::Immutable + - this module now controls the transformation from a mutable + to an immutable version of the class. Docs for this will + be coming eventually. + + +0.36 Sun. Nov. 5, 2006 + * Class::MOP::Class + - added a few 'no warnings' lines to keep annoying + (and meaningless) warnings from chirping during + global destruction. + + * Class::MOP + - some more bootstrapping is now done on the new + classes + + * Class::MOP::Class::Immutable + *** API CHANGE *** + - constructor generation is now handled by + the Class::MOP::Method::Constructor class + + * Class::MOP::Method::Constructor + - created this to handle constructor generation + in Class::MOP::Class::Immutable + + * Class::MOP::Attribute + *** API CHANGE *** + - attributes now delegate to the + Class::MOP::Method::Accessor to generate + accessors + + * Class::MOP::Method::Accessor + - all accessor generation functions from + Class::MOP::Attribute have been moved here + +0.35 Sat. Sept. 30, 2006 + + * scripts/class_browser.pl + - initial prototype of a class browser, more + on this to come. Comments and patches are + very much welcome. + + * Class::MOP + - All Class::MOP::* accessors are no longer + re-generated in the bootstrap, instead + they are aliased from the originals + - fixed tests to reflect + - added Class::MOP::Method (and its subclasses) + to the bootstrap + - adjusted tests for this + - added the Class::MOP::Instance attributes + to the bootstrap + + * Class::MOP::Method + *** API CHANGE *** + - methods are no longer blessed CODE refs + but are actual objects which can be CODE-ified + - adjusted tests to compensate + - adjusted docs for this + + * Class::MOP::Class + - changed how methods are dealt with to + encapsulate most of the work into the + &get_method_map method + - made several adjustments for the change + in Class::MOP::Method + - &add_attribute now checks if you are adding + a duplicate name, and properly removes the + old one before installing the new one + - added tests for this + - adjusted docs for this + + * Class::MOP::Class::Immutable + - added caching of &get_method_map + - fixed issue with &get_package_symbol + - cleaned up the methods that die (patch by David Wheeler) + + * Class::MOP::Package + - added filtering capabilities to + &list_all_package_symbols + +0.34 Sat. Aug. 26, 2006 + * Class::MOP::Class + - added the %:methods attribute, which like + the $:version and such just actually goes + to the symbol table to get it's stuff. + However, it makes the MOP more complete. + ** API CHANGE ** + - The &create method now requires that all + but the package name now is passed in as + named parameters. See docs for more info. + - updated docs and tests for this + + * Class::MOP::Object + - added &dump method to easily Data::Dumper + an object + + * Class::MOP + - cleaned up the initialization of attributes + which do not store things in the instance + - added the %:methods attribute definition to + the bootstrap + + ~ lots of misc. test cleanup + +0.33 Sat. Aug. 19, 2006 + * Class::MOP::Class + - moved the metaclass cache out of here + and it is now in Class::MOP itself. + + * Class::MOP + - moved all the metaclass cache stuff here + - fixed all tests for this + + * Class::MOP::Attribute + - reference values (other than CODE refs) + are no longer allowed for defaults + - added tests for this + + * Class::MOP::Package + - fixed an issue with perl 5.8.1 and how it deals + with symbol tables. The namespace hash is now + always reloaded from the symbol table. + + ~ lots of misc. documentation cleanup + +0.32 Sat. Aug. 12, 2006 + + added Class::MOP::Object so that the + metamodel is more complete (and closer + to what Perl 6 will probably be). + + * Class::MOP::Package + - refactored entire class, this is now + the primary gateway between the metaclass + and the Perl 5 symbol table + - added many tests for this + - this class is now a subclass of + Class::MOP::Object + - added some tests to reflect this + + * Class::MOP::Class + - refactored all symbol table access to + use Class::MOP::Package methods instead + + * Class::MOP::Module + - adding the $:version attribute in the bootstrap + so that Module has a version as an attribute + - see comment in Class::MOP for details + - added the $:authority attribute to this module + as well as an &identifier method, to bring us + ever closer to Perl 6 goodness + - I have added $AUTHORITY to all the modules + - added tests for this + + * Class::MOP::Instance + - added &deinitialize_slot for removing slots + from an instance + - added tests for this + + * Class::MOP::Attribute + - added support for &deinitialize_slot for removing + slots from an instance + - added tests for this + +0.31 Sat. July 15, 2006 + + * Class::MOP::Class + - added &find_method_by_name to locate a method + anywhere within the class hierarchy + + * Class::MOP::Attribute + - added &set_value and &get_value for getting + the value of the attribute for a particular + instance. + +0.30 Wed. July 5, 2006 + --------------------------------------- + This is the first version of Class::MOP + to introduce the immutable features which + will be used for optimizating the MOP. + This support should still be considered + experimental, but moving towards stability. + --------------------------------------- + + * Created Class::MOP::Class::Immutable + + * Created the Class::MOP::Package and + Class::MOP::Module classes to more + closely conform to Perl 6's meta-model + + * Class::MOP::Class + - now inherits from Class::MOP::Module + - several methods moved to ::Module and + ::Package and now inherited + - added tests for this + + * Class::MOP::Instance + - added an is_inlinable method to allow other + classes to check before they attempt to optimize. + - added an inline_create_instance to inline + instance creation (of course) + + ** API CHANGE ** + - the Class::MOP::Class::*_package_variable + methods are all now methods of Class::MOP::Package + and called *_package_symbol instead. This is + because they are now more general purpose symbol + table manipulation methods. + +0.29_02 Thurs. June 22, 2006 + ++ DEVELOPER RELEASE ++ + * Class::MOP::Class + - small change in &create so that it behaves + properly when inherited + - small fix to &clone_instance + +0.29_01 Fri. May 12, 2006 + ++ DEVELOPER RELEASE ++ + - This release works in combination with + Moose 0.09_01, it is a developer release + because it introduces a new instance + sub-protocol and has not yet been + optimized. + + * Class::MOP::Class + - anon-classes are now properly garbage collected + - added tests for this + - improved method modifier wrapping + + * Class::MOP::Instance + - added new instance protocol + - added tests for this + - changed all relevant modules and examples + - Class::MOP::Class + - Class::MOP::Attribute + - examples/* + + * metaclass + - you no longer need to specify the metaclass + itself, if it is not there, Class::MOP::Class + is just assumed + - updated tests for this + + * examples/ + - added ArrayBasedStorage example to show + instance storage using ARRAY refs instead of + HASH refs. + - added tests for this + - InsideOutClass is totally revised using the + new instance protocol + - added more tests for this + +0.26 Mon. April 24, 2006 + * Class::MOP::Class + - added find_attribute_by_name method + - added tests and docs for this + - some small optimizations + + * Class::MOP::Attribute + - some small optimizations + +0.25 Thurs. April 20, 2006 + * Class::MOP::Class + - added create_anon_class for creating anonymous classes + - added tests for this + - added get_all_metaclasses, get_all_metaclass_names + and get_all_metaclass_instances method to allow + access to all the cached metaclass objects. + - attribute slot initialization is now the responsibility + of the attribute itself, and construct_instance now + delegates appropriately + + * Class::MOP::Attribute + - attribute slot initialization is now the responsibility + of the attribute itself, so we added a method for it + called initialize_instance_slot + + * examples/ + - adjusted all the examples to use the new attribute + initialize_instance_slot method + +0.24 Tues. April 11, 2006 + * Class::MOP::Class + - cleaned up how the before/after/around method + modifiers get named with Sub::Name + +0.23 Thurs. March 30, 2006 + * Class::MOP::Class + - fixed the way attribute defaults are handled + during instance construction (bug found by chansen) + + * Class::MOP::Attribute + - read-only accessors ('reader') will now die if + passed more than one argument (attempting to write + to them basically) + - added tests for this + - adjusted all /example files to comply + +0.22 Mon. March 20, 2006 + * Class::MOP::Class + - localized $@ in the *_package_variable functions + because otherwise, it does ugly things in Moose. + - added test case for this + +0.21 Wed. March 15, 2006 + * Class::MOP::Class + - fixed issue where metaclasses are reaped from + our cache in global destruction, and so are not + available in DESTORY calls + +0.20 Thurs. March 2, 2006 + - removed the dependency for Clone since + we no longer to deep-cloning by default. + + * Class::MOP::Method + - added &package_name, &name and + &fully_qualified_name methods, some of + which were formerly private subs in + Class::MOP::Class + + * Class::MOP::Method::Wrapped + - allows for a method to be wrapped with + before, after and around modifiers + - added tests and docs for this feature + + * Class::MOP::Class + - improved &get_package_symbol + - &version and &superclasses now use it + - methods are now blessed into Class::MOP::Method + whenever possible + - added methods to install CLOS-style method modifiers + - &add_before_method_modifier + - &add_after_method_modifier + - &add_around_method_modifier + - added tests and docs for these + - added &find_next_method_by_name which finds the + equivalent of SUPER::method_name + +0.12 Thurs. Feb 23, 2006 + - reduced the dependency on B, no need to always + have the latest + + * examples/ + - added docs to the C3 method dispatch order test + - fixed missing Algorithm::C3 dependency by making + the test skip if it is not installed + +0.11 Mon Feb. 20, 2006 + * examples/ + - added example of changing method dispatch order to C3 + + * Class::MOP::Class + - changed how clone_instance behaves, it now only does a + shallow clone (see docs for more details) + - added docs and tests + +0.10 Tues Feb. 14, 2006 + ** This release was mostly about writing more tests and + cleaning out old and dusty code, the MOP should now + be considered "ready to use". + + - adding more tests to get coverage up a little higher, + mostly testing errors and edge cases. + - test coverage is now at 99% + + * Class::MOP + - no longer optionally exports to UNIVERSAL::meta or + creates a custom metaclass generator, use the + metaclass pragma instead. + + * Class::MOP::Class + - fixed a number of minor issues which came up in the + error/edge-case tests + + * Class::MOP::Attribute + - fixed a number of minor issues which came up in the + error/edge-case tests + + * examples/ + - fixing the AttributesWithHistory example, it was broken. + +0.06 Thurs Feb. 9, 2006 + * metaclass + - adding new metaclass pragma to make setting up the + metaclass a little more straightforward + + * Class::MOP + - clean up bootstrapping to include more complete + attribute definitions for Class::MOP::Class and + Class::MOP::Attribute (accessors, readers, writers, + etc.) ... it is redundant, but is useful meta-info + to have around. + + * Class::MOP::Class + - fixing minor meta-circularity issue with &meta, it + is now more useful for subclasses + - added &get_attribute_map as an accessor for the + hash of attribute meta objects + - &compute_all_applicable_attributes now just returns + the attribute meta-object, rather than the HASH ref + since all the same info can be gotten from the + attribute meta-object itself + - updated docs & tests to reflect + - added &clone_instance method which does a deep clone + of the instance structure created by &construct_instance + - added docs & tests for this + - added Clone as a dependency + - added &new_object and &clone_object convience methods to + return blessed new or cloned instances + - they handle Class::MOP::Class singletons correctly too + - added docs & tests for this + - cleaned up the &constuct_class_instance so that it behaves + more like &construct_instance (and managed the singletons too) + - added the &check_metaclass_compatibility method to make sure + that metaclasses are upward and downward compatible. + - added tests and docs for this + + * examples/ + - adjusting code to use the &Class::MOP::Class::meta + fix detailed above + - adjusting code to use the metaclass pragma + +0.05 Sat Feb. 4, 2006 + * Class::MOP::Class + - added the &attribute_metaclass and &method_metaclass + attributes which contain a metaclass name to use for + attributes/methods respectively + + * Class::MOP + - bootstrap additional attributes for Class::MOP::Class + + * examples/ + - adjusted the example code and tests to use the new + &attribute_metaclass feature of Class::MOP::Class + - added new example: + - LazyClass + +0.04 Fri Feb. 3, 2006 + * Class::MOP::Class + - some documentation suggestions from #perl6 + + * Class::MOP::Attribute + - improved error messages + + * examples/ + - added new examples: + - AttributesWithHistory + - ClassEncapsultedAttributes + +0.03 Fri Feb. 3, 2006 + - converted to Module::Build instead of EU::MM + + * Class::MOP::Attribute + - refactored method generation code + - attributes are now associated with class directly + + * examples/ + - refactored the InsideOut example to take advantage + of the Class::MOP::Attribute refactoring + - changed example files to .pod files and hide thier + package names from PAUSE (I don't want to own these + namespaces really, they are just examples) + +0.02 Thurs Feb. 2, 2006 + - moving examples from t/lib/* to examples/* + - adding POD documentation to the examples + +0.01 Thurs Feb. 2, 2006 + - Initial release diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ba07d77 --- /dev/null +++ b/LICENSE @@ -0,0 +1,379 @@ +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +Terms of the Perl programming language system itself + +a) the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any + later version, or +b) the "Artistic License" + +--- The GNU General Public License, Version 1, February 1989 --- + +This software is Copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software, licensed under: + + The GNU General Public License, Version 1, February 1989 + + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + 7. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! + + +--- The Artistic License 1.0 --- + +This software is Copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software, licensed under: + + The Artistic License 1.0 + +The Artistic License + +Preamble + +The intent of this document is to state the conditions under which a Package +may be copied, such that the Copyright Holder maintains some semblance of +artistic control over the development of the package, while giving the users of +the package the right to use and distribute the Package in a more-or-less +customary fashion, plus the right to make reasonable modifications. + +Definitions: + + - "Package" refers to the collection of files distributed by the Copyright + Holder, and derivatives of that collection of files created through + textual modification. + - "Standard Version" refers to such a Package if it has not been modified, + or has been modified in accordance with the wishes of the Copyright + Holder. + - "Copyright Holder" is whoever is named in the copyright or copyrights for + the package. + - "You" is you, if you're thinking about copying or distributing this Package. + - "Reasonable copying fee" is whatever you can justify on the basis of media + cost, duplication charges, time of people involved, and so on. (You will + not be required to justify it to the Copyright Holder, but only to the + computing community at large as a market that must bear the fee.) + - "Freely Available" means that no fee is charged for the item itself, though + there may be fees involved in handling the item. It also means that + recipients of the item may redistribute it under the same conditions they + received it. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications derived +from the Public Domain or from the Copyright Holder. A Package modified in such +a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided that +you insert a prominent notice in each changed file stating how and when you +changed that file, and provided that you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or an + equivalent medium, or placing the modifications on a major archive site + such as ftp.uu.net, or by allowing the Copyright Holder to include your + modifications in the Standard Version of the Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict with + standard executables, which must also be provided, and provide a separate + manual page for each non-standard executable that clearly documents how it + differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or executable +form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where to + get the Standard Version. + + b) accompany the distribution with the machine-readable source of the Package + with your modifications. + + c) accompany any non-standard executables with their corresponding Standard + Version executables, giving the non-standard executables non-standard + names, and clearly documenting the differences in manual pages (or + equivalent), together with instructions on where to get the Standard + Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of this +Package. You may charge any fee you choose for support of this Package. You +may not charge a fee for this Package itself. However, you may distribute this +Package in aggregate with other (possibly commercial) programs as part of a +larger (possibly commercial) software distribution provided that you do not +advertise this Package as a product of your own. + +6. The scripts and library files supplied as input to or produced as output +from the programs of this Package do not automatically fall under the copyright +of this Package, but belong to whomever generated them, and may be sold +commercially, and may be aggregated with this Package. + +7. C or perl subroutines supplied by you and linked into this Package shall not +be considered part of this Package. + +8. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The End + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..dae485e --- /dev/null +++ b/MANIFEST @@ -0,0 +1,1042 @@ +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.037. +Changes +Changes.Class-MOP +LICENSE +MANIFEST +META.json +META.yml +Makefile.PL +README.md +TODO +author/docGenerator.pl +author/extract-inline-tests +author/find-dupe-test-numbers +benchmarks/caf_vs_moose.pl +benchmarks/cmop/all.yml +benchmarks/cmop/foo.pl +benchmarks/cmop/lib/Bench/Accessor.pm +benchmarks/cmop/lib/Bench/Construct.pm +benchmarks/cmop/lib/Bench/Run.pm +benchmarks/cmop/lib/MOP/Immutable/Point.pm +benchmarks/cmop/lib/MOP/Immutable/Point3D.pm +benchmarks/cmop/lib/MOP/Installed/Point.pm +benchmarks/cmop/lib/MOP/Installed/Point3D.pm +benchmarks/cmop/lib/MOP/Point.pm +benchmarks/cmop/lib/MOP/Point3D.pm +benchmarks/cmop/lib/Plain/Point.pm +benchmarks/cmop/lib/Plain/Point3D.pm +benchmarks/cmop/loading-benchmark.pl +benchmarks/cmop/profile.pl +benchmarks/cmop/run_yml.pl +benchmarks/immutable.pl +benchmarks/lotsa-classes.pl +benchmarks/method_modifiers.pl +benchmarks/moose_bench.pl +benchmarks/simple_class.pl +benchmarks/simple_compile.pl +benchmarks/simple_constructor.pl +benchmarks/type_constraints.pl +benchmarks/type_constraints2.pl +bin/moose-outdated +dist.ini +doc/moosex-compile +inc/CheckAuthorDeps.pm +inc/CheckDelta.pm +inc/CheckReleaseType.pm +inc/Clean.pm +inc/ExtractInlineTests.pm +inc/GenerateDocs.pm +inc/GitUpToDate.pm +inc/MMHelper.pm +inc/MakeMaker.pm +inc/MyInline.pm +inc/SimpleAuthority.pm +inc/SimpleProvides.pm +inc/TestRelease.pm +lib/Class/MOP.pm +lib/Class/MOP/Attribute.pm +lib/Class/MOP/Class.pm +lib/Class/MOP/Class/Immutable/Trait.pm +lib/Class/MOP/Deprecated.pm +lib/Class/MOP/Instance.pm +lib/Class/MOP/Method.pm +lib/Class/MOP/Method/Accessor.pm +lib/Class/MOP/Method/Constructor.pm +lib/Class/MOP/Method/Generated.pm +lib/Class/MOP/Method/Inlined.pm +lib/Class/MOP/Method/Meta.pm +lib/Class/MOP/Method/Wrapped.pm +lib/Class/MOP/MiniTrait.pm +lib/Class/MOP/Mixin.pm +lib/Class/MOP/Mixin/AttributeCore.pm +lib/Class/MOP/Mixin/HasAttributes.pm +lib/Class/MOP/Mixin/HasMethods.pm +lib/Class/MOP/Mixin/HasOverloads.pm +lib/Class/MOP/Module.pm +lib/Class/MOP/Object.pm +lib/Class/MOP/Overload.pm +lib/Class/MOP/Package.pm +lib/Moose.pm +lib/Moose/Conflicts.pm +lib/Moose/Cookbook.pod +lib/Moose/Cookbook/Basics/BankAccount_MethodModifiersAndSubclassing.pod +lib/Moose/Cookbook/Basics/BinaryTree_AttributeFeatures.pod +lib/Moose/Cookbook/Basics/BinaryTree_BuilderAndLazyBuild.pod +lib/Moose/Cookbook/Basics/Company_Subtypes.pod +lib/Moose/Cookbook/Basics/DateTime_ExtendingNonMooseParent.pod +lib/Moose/Cookbook/Basics/Document_AugmentAndInner.pod +lib/Moose/Cookbook/Basics/Genome_OverloadingSubtypesAndCoercion.pod +lib/Moose/Cookbook/Basics/HTTP_SubtypesAndCoercion.pod +lib/Moose/Cookbook/Basics/Immutable.pod +lib/Moose/Cookbook/Basics/Person_BUILDARGSAndBUILD.pod +lib/Moose/Cookbook/Basics/Point_AttributesAndSubclassing.pod +lib/Moose/Cookbook/Extending/Debugging_BaseClassRole.pod +lib/Moose/Cookbook/Extending/ExtensionOverview.pod +lib/Moose/Cookbook/Extending/Mooseish_MooseSugar.pod +lib/Moose/Cookbook/Legacy/Debugging_BaseClassReplacement.pod +lib/Moose/Cookbook/Legacy/Labeled_AttributeMetaclass.pod +lib/Moose/Cookbook/Legacy/Table_ClassMetaclass.pod +lib/Moose/Cookbook/Meta/GlobRef_InstanceMetaclass.pod +lib/Moose/Cookbook/Meta/Labeled_AttributeTrait.pod +lib/Moose/Cookbook/Meta/PrivateOrPublic_MethodMetaclass.pod +lib/Moose/Cookbook/Meta/Table_MetaclassTrait.pod +lib/Moose/Cookbook/Meta/WhyMeta.pod +lib/Moose/Cookbook/Roles/ApplicationToInstance.pod +lib/Moose/Cookbook/Roles/Comparable_CodeReuse.pod +lib/Moose/Cookbook/Roles/Restartable_AdvancedComposition.pod +lib/Moose/Cookbook/Snack/Keywords.pod +lib/Moose/Cookbook/Snack/Types.pod +lib/Moose/Cookbook/Style.pod +lib/Moose/Deprecated.pm +lib/Moose/Exception.pm +lib/Moose/Exception/AccessorMustReadWrite.pm +lib/Moose/Exception/AddParameterizableTypeTakesParameterizableType.pm +lib/Moose/Exception/AddRoleTakesAMooseMetaRoleInstance.pm +lib/Moose/Exception/AddRoleToARoleTakesAMooseMetaRole.pm +lib/Moose/Exception/ApplyTakesABlessedInstance.pm +lib/Moose/Exception/AttachToClassNeedsAClassMOPClassInstanceOrASubclass.pm +lib/Moose/Exception/AttributeConflictInRoles.pm +lib/Moose/Exception/AttributeConflictInSummation.pm +lib/Moose/Exception/AttributeExtensionIsNotSupportedInRoles.pm +lib/Moose/Exception/AttributeIsRequired.pm +lib/Moose/Exception/AttributeMustBeAnClassMOPMixinAttributeCoreOrSubclass.pm +lib/Moose/Exception/AttributeNamesDoNotMatch.pm +lib/Moose/Exception/AttributeValueIsNotAnObject.pm +lib/Moose/Exception/AttributeValueIsNotDefined.pm +lib/Moose/Exception/AutoDeRefNeedsArrayRefOrHashRef.pm +lib/Moose/Exception/BadOptionFormat.pm +lib/Moose/Exception/BothBuilderAndDefaultAreNotAllowed.pm +lib/Moose/Exception/BuilderDoesNotExist.pm +lib/Moose/Exception/BuilderMethodNotSupportedForAttribute.pm +lib/Moose/Exception/BuilderMethodNotSupportedForInlineAttribute.pm +lib/Moose/Exception/BuilderMustBeAMethodName.pm +lib/Moose/Exception/CallingMethodOnAnImmutableInstance.pm +lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm +lib/Moose/Exception/CanExtendOnlyClasses.pm +lib/Moose/Exception/CanOnlyConsumeRole.pm +lib/Moose/Exception/CanOnlyWrapBlessedCode.pm +lib/Moose/Exception/CanReblessOnlyIntoASubclass.pm +lib/Moose/Exception/CanReblessOnlyIntoASuperclass.pm +lib/Moose/Exception/CannotAddAdditionalTypeCoercionsToUnion.pm +lib/Moose/Exception/CannotAddAsAnAttributeToARole.pm +lib/Moose/Exception/CannotApplyBaseClassRolesToRole.pm +lib/Moose/Exception/CannotAssignValueToReadOnlyAccessor.pm +lib/Moose/Exception/CannotAugmentIfLocalMethodPresent.pm +lib/Moose/Exception/CannotAugmentNoSuperMethod.pm +lib/Moose/Exception/CannotAutoDerefWithoutIsa.pm +lib/Moose/Exception/CannotAutoDereferenceTypeConstraint.pm +lib/Moose/Exception/CannotCalculateNativeType.pm +lib/Moose/Exception/CannotCallAnAbstractBaseMethod.pm +lib/Moose/Exception/CannotCallAnAbstractMethod.pm +lib/Moose/Exception/CannotCoerceAWeakRef.pm +lib/Moose/Exception/CannotCoerceAttributeWhichHasNoCoercion.pm +lib/Moose/Exception/CannotCreateHigherOrderTypeWithoutATypeParameter.pm +lib/Moose/Exception/CannotCreateMethodAliasLocalMethodIsPresent.pm +lib/Moose/Exception/CannotCreateMethodAliasLocalMethodIsPresentInClass.pm +lib/Moose/Exception/CannotDelegateLocalMethodIsPresent.pm +lib/Moose/Exception/CannotDelegateWithoutIsa.pm +lib/Moose/Exception/CannotFindDelegateMetaclass.pm +lib/Moose/Exception/CannotFindType.pm +lib/Moose/Exception/CannotFindTypeGivenToMatchOnType.pm +lib/Moose/Exception/CannotFixMetaclassCompatibility.pm +lib/Moose/Exception/CannotGenerateInlineConstraint.pm +lib/Moose/Exception/CannotInitializeMooseMetaRoleComposite.pm +lib/Moose/Exception/CannotInlineTypeConstraintCheck.pm +lib/Moose/Exception/CannotLocatePackageInINC.pm +lib/Moose/Exception/CannotMakeMetaclassCompatible.pm +lib/Moose/Exception/CannotOverrideALocalMethod.pm +lib/Moose/Exception/CannotOverrideBodyOfMetaMethods.pm +lib/Moose/Exception/CannotOverrideLocalMethodIsPresent.pm +lib/Moose/Exception/CannotOverrideNoSuperMethod.pm +lib/Moose/Exception/CannotRegisterUnnamedTypeConstraint.pm +lib/Moose/Exception/CannotUseLazyBuildAndDefaultSimultaneously.pm +lib/Moose/Exception/CircularReferenceInAlso.pm +lib/Moose/Exception/ClassDoesNotHaveInitMeta.pm +lib/Moose/Exception/ClassDoesTheExcludedRole.pm +lib/Moose/Exception/ClassNamesDoNotMatch.pm +lib/Moose/Exception/CloneObjectExpectsAnInstanceOfMetaclass.pm +lib/Moose/Exception/CodeBlockMustBeACodeRef.pm +lib/Moose/Exception/CoercingWithoutCoercions.pm +lib/Moose/Exception/CoercionAlreadyExists.pm +lib/Moose/Exception/CoercionNeedsTypeConstraint.pm +lib/Moose/Exception/ConflictDetectedInCheckRoleExclusions.pm +lib/Moose/Exception/ConflictDetectedInCheckRoleExclusionsInToClass.pm +lib/Moose/Exception/ConstructClassInstanceTakesPackageName.pm +lib/Moose/Exception/CouldNotCreateMethod.pm +lib/Moose/Exception/CouldNotCreateWriter.pm +lib/Moose/Exception/CouldNotEvalConstructor.pm +lib/Moose/Exception/CouldNotEvalDestructor.pm +lib/Moose/Exception/CouldNotFindTypeConstraintToCoerceFrom.pm +lib/Moose/Exception/CouldNotGenerateInlineAttributeMethod.pm +lib/Moose/Exception/CouldNotLocateTypeConstraintForUnion.pm +lib/Moose/Exception/CouldNotParseType.pm +lib/Moose/Exception/CreateMOPClassTakesArrayRefOfAttributes.pm +lib/Moose/Exception/CreateMOPClassTakesArrayRefOfSuperclasses.pm +lib/Moose/Exception/CreateMOPClassTakesHashRefOfMethods.pm +lib/Moose/Exception/CreateTakesArrayRefOfRoles.pm +lib/Moose/Exception/CreateTakesHashRefOfAttributes.pm +lib/Moose/Exception/CreateTakesHashRefOfMethods.pm +lib/Moose/Exception/DefaultToMatchOnTypeMustBeCodeRef.pm +lib/Moose/Exception/DelegationToAClassWhichIsNotLoaded.pm +lib/Moose/Exception/DelegationToARoleWhichIsNotLoaded.pm +lib/Moose/Exception/DelegationToATypeWhichIsNotAClass.pm +lib/Moose/Exception/DoesRequiresRoleName.pm +lib/Moose/Exception/EnumCalledWithAnArrayRefAndAdditionalArgs.pm +lib/Moose/Exception/EnumValuesMustBeString.pm +lib/Moose/Exception/ExtendsMissingArgs.pm +lib/Moose/Exception/HandlesMustBeAHashRef.pm +lib/Moose/Exception/IllegalInheritedOptions.pm +lib/Moose/Exception/IllegalMethodTypeToAddMethodModifier.pm +lib/Moose/Exception/IncompatibleMetaclassOfSuperclass.pm +lib/Moose/Exception/InitMetaRequiresClass.pm +lib/Moose/Exception/InitializeTakesUnBlessedPackageName.pm +lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm +lib/Moose/Exception/InstanceMustBeABlessedReference.pm +lib/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm +lib/Moose/Exception/InvalidArgumentToMethod.pm +lib/Moose/Exception/InvalidArgumentsToTraitAliases.pm +lib/Moose/Exception/InvalidBaseTypeGivenToCreateParameterizedTypeConstraint.pm +lib/Moose/Exception/InvalidHandleValue.pm +lib/Moose/Exception/InvalidHasProvidedInARole.pm +lib/Moose/Exception/InvalidNameForType.pm +lib/Moose/Exception/InvalidOverloadOperator.pm +lib/Moose/Exception/InvalidRoleApplication.pm +lib/Moose/Exception/InvalidTypeConstraint.pm +lib/Moose/Exception/InvalidTypeGivenToCreateParameterizedTypeConstraint.pm +lib/Moose/Exception/InvalidValueForIs.pm +lib/Moose/Exception/IsaDoesNotDoTheRole.pm +lib/Moose/Exception/IsaLacksDoesMethod.pm +lib/Moose/Exception/LazyAttributeNeedsADefault.pm +lib/Moose/Exception/Legacy.pm +lib/Moose/Exception/MOPAttributeNewNeedsAttributeName.pm +lib/Moose/Exception/MatchActionMustBeACodeRef.pm +lib/Moose/Exception/MessageParameterMustBeCodeRef.pm +lib/Moose/Exception/MetaclassIsAClassNotASubclassOfGivenMetaclass.pm +lib/Moose/Exception/MetaclassIsARoleNotASubclassOfGivenMetaclass.pm +lib/Moose/Exception/MetaclassIsNotASubclassOfGivenMetaclass.pm +lib/Moose/Exception/MetaclassMustBeASubclassOfMooseMetaClass.pm +lib/Moose/Exception/MetaclassMustBeASubclassOfMooseMetaRole.pm +lib/Moose/Exception/MetaclassMustBeDerivedFromClassMOPClass.pm +lib/Moose/Exception/MetaclassNotLoaded.pm +lib/Moose/Exception/MetaclassTypeIncompatible.pm +lib/Moose/Exception/MethodExpectedAMetaclassObject.pm +lib/Moose/Exception/MethodExpectsFewerArgs.pm +lib/Moose/Exception/MethodExpectsMoreArgs.pm +lib/Moose/Exception/MethodModifierNeedsMethodName.pm +lib/Moose/Exception/MethodNameConflictInRoles.pm +lib/Moose/Exception/MethodNameNotFoundInInheritanceHierarchy.pm +lib/Moose/Exception/MethodNameNotGiven.pm +lib/Moose/Exception/MustDefineAMethodName.pm +lib/Moose/Exception/MustDefineAnAttributeName.pm +lib/Moose/Exception/MustDefineAnOverloadOperator.pm +lib/Moose/Exception/MustHaveAtLeastOneValueToEnumerate.pm +lib/Moose/Exception/MustPassAHashOfOptions.pm +lib/Moose/Exception/MustPassAMooseMetaRoleInstanceOrSubclass.pm +lib/Moose/Exception/MustPassAPackageNameOrAnExistingClassMOPPackageInstance.pm +lib/Moose/Exception/MustPassEvenNumberOfArguments.pm +lib/Moose/Exception/MustPassEvenNumberOfAttributeOptions.pm +lib/Moose/Exception/MustProvideANameForTheAttribute.pm +lib/Moose/Exception/MustSpecifyAtleastOneMethod.pm +lib/Moose/Exception/MustSpecifyAtleastOneRole.pm +lib/Moose/Exception/MustSpecifyAtleastOneRoleToApplicant.pm +lib/Moose/Exception/MustSupplyAClassMOPAttributeInstance.pm +lib/Moose/Exception/MustSupplyADelegateToMethod.pm +lib/Moose/Exception/MustSupplyAMetaclass.pm +lib/Moose/Exception/MustSupplyAMooseMetaAttributeInstance.pm +lib/Moose/Exception/MustSupplyAnAccessorTypeToConstructWith.pm +lib/Moose/Exception/MustSupplyAnAttributeToConstructWith.pm +lib/Moose/Exception/MustSupplyArrayRefAsCurriedArguments.pm +lib/Moose/Exception/MustSupplyPackageNameAndName.pm +lib/Moose/Exception/NeedsTypeConstraintUnionForTypeCoercionUnion.pm +lib/Moose/Exception/NeitherAttributeNorAttributeNameIsGiven.pm +lib/Moose/Exception/NeitherClassNorClassNameIsGiven.pm +lib/Moose/Exception/NeitherRoleNorRoleNameIsGiven.pm +lib/Moose/Exception/NeitherTypeNorTypeNameIsGiven.pm +lib/Moose/Exception/NoAttributeFoundInSuperClass.pm +lib/Moose/Exception/NoBodyToInitializeInAnAbstractBaseClass.pm +lib/Moose/Exception/NoCasesMatched.pm +lib/Moose/Exception/NoConstraintCheckForTypeConstraint.pm +lib/Moose/Exception/NoDestructorClassSpecified.pm +lib/Moose/Exception/NoImmutableTraitSpecifiedForClass.pm +lib/Moose/Exception/NoParentGivenToSubtype.pm +lib/Moose/Exception/OnlyInstancesCanBeCloned.pm +lib/Moose/Exception/OperatorIsRequired.pm +lib/Moose/Exception/OverloadConflictInSummation.pm +lib/Moose/Exception/OverloadRequiresAMetaClass.pm +lib/Moose/Exception/OverloadRequiresAMetaMethod.pm +lib/Moose/Exception/OverloadRequiresAMetaOverload.pm +lib/Moose/Exception/OverloadRequiresAMethodNameOrCoderef.pm +lib/Moose/Exception/OverloadRequiresAnOperator.pm +lib/Moose/Exception/OverloadRequiresNamesForCoderef.pm +lib/Moose/Exception/OverrideConflictInComposition.pm +lib/Moose/Exception/OverrideConflictInSummation.pm +lib/Moose/Exception/PackageDoesNotUseMooseExporter.pm +lib/Moose/Exception/PackageNameAndNameParamsNotGivenToWrap.pm +lib/Moose/Exception/PackagesAndModulesAreNotCachable.pm +lib/Moose/Exception/ParameterIsNotSubtypeOfParent.pm +lib/Moose/Exception/ReferencesAreNotAllowedAsDefault.pm +lib/Moose/Exception/RequiredAttributeLacksInitialization.pm +lib/Moose/Exception/RequiredAttributeNeedsADefault.pm +lib/Moose/Exception/RequiredMethodsImportedByClass.pm +lib/Moose/Exception/RequiredMethodsNotImplementedByClass.pm +lib/Moose/Exception/Role/Attribute.pm +lib/Moose/Exception/Role/AttributeName.pm +lib/Moose/Exception/Role/Class.pm +lib/Moose/Exception/Role/EitherAttributeOrAttributeName.pm +lib/Moose/Exception/Role/Instance.pm +lib/Moose/Exception/Role/InstanceClass.pm +lib/Moose/Exception/Role/InvalidAttributeOptions.pm +lib/Moose/Exception/Role/Method.pm +lib/Moose/Exception/Role/ParamsHash.pm +lib/Moose/Exception/Role/Role.pm +lib/Moose/Exception/Role/RoleForCreate.pm +lib/Moose/Exception/Role/RoleForCreateMOPClass.pm +lib/Moose/Exception/Role/TypeConstraint.pm +lib/Moose/Exception/RoleDoesTheExcludedRole.pm +lib/Moose/Exception/RoleExclusionConflict.pm +lib/Moose/Exception/RoleNameRequired.pm +lib/Moose/Exception/RoleNameRequiredForMooseMetaRole.pm +lib/Moose/Exception/RolesDoNotSupportAugment.pm +lib/Moose/Exception/RolesDoNotSupportExtends.pm +lib/Moose/Exception/RolesDoNotSupportInner.pm +lib/Moose/Exception/RolesDoNotSupportRegexReferencesForMethodModifiers.pm +lib/Moose/Exception/RolesInCreateTakesAnArrayRef.pm +lib/Moose/Exception/RolesListMustBeInstancesOfMooseMetaRole.pm +lib/Moose/Exception/SingleParamsToNewMustBeHashRef.pm +lib/Moose/Exception/TriggerMustBeACodeRef.pm +lib/Moose/Exception/TypeConstraintCannotBeUsedForAParameterizableType.pm +lib/Moose/Exception/TypeConstraintIsAlreadyCreated.pm +lib/Moose/Exception/TypeParameterMustBeMooseMetaType.pm +lib/Moose/Exception/UnableToCanonicalizeHandles.pm +lib/Moose/Exception/UnableToCanonicalizeNonRolePackage.pm +lib/Moose/Exception/UnableToRecognizeDelegateMetaclass.pm +lib/Moose/Exception/UndefinedHashKeysPassedToMethod.pm +lib/Moose/Exception/UnionCalledWithAnArrayRefAndAdditionalArgs.pm +lib/Moose/Exception/UnionTakesAtleastTwoTypeNames.pm +lib/Moose/Exception/ValidationFailedForInlineTypeConstraint.pm +lib/Moose/Exception/ValidationFailedForTypeConstraint.pm +lib/Moose/Exception/WrapTakesACodeRefToBless.pm +lib/Moose/Exception/WrongTypeConstraintGiven.pm +lib/Moose/Exporter.pm +lib/Moose/Intro.pod +lib/Moose/Manual.pod +lib/Moose/Manual/Attributes.pod +lib/Moose/Manual/BestPractices.pod +lib/Moose/Manual/Classes.pod +lib/Moose/Manual/Concepts.pod +lib/Moose/Manual/Construction.pod +lib/Moose/Manual/Contributing.pod +lib/Moose/Manual/Delegation.pod +lib/Moose/Manual/Delta.pod +lib/Moose/Manual/Exceptions.pod +lib/Moose/Manual/Exceptions/Manifest.pod +lib/Moose/Manual/FAQ.pod +lib/Moose/Manual/MOP.pod +lib/Moose/Manual/MethodModifiers.pod +lib/Moose/Manual/MooseX.pod +lib/Moose/Manual/Resources.pod +lib/Moose/Manual/Roles.pod +lib/Moose/Manual/Support.pod +lib/Moose/Manual/Types.pod +lib/Moose/Manual/Unsweetened.pod +lib/Moose/Meta/Attribute.pm +lib/Moose/Meta/Attribute/Native.pm +lib/Moose/Meta/Attribute/Native/Trait.pm +lib/Moose/Meta/Attribute/Native/Trait/Array.pm +lib/Moose/Meta/Attribute/Native/Trait/Bool.pm +lib/Moose/Meta/Attribute/Native/Trait/Code.pm +lib/Moose/Meta/Attribute/Native/Trait/Counter.pm +lib/Moose/Meta/Attribute/Native/Trait/Hash.pm +lib/Moose/Meta/Attribute/Native/Trait/Number.pm +lib/Moose/Meta/Attribute/Native/Trait/String.pm +lib/Moose/Meta/Class.pm +lib/Moose/Meta/Class/Immutable/Trait.pm +lib/Moose/Meta/Instance.pm +lib/Moose/Meta/Method.pm +lib/Moose/Meta/Method/Accessor.pm +lib/Moose/Meta/Method/Accessor/Native.pm +lib/Moose/Meta/Method/Accessor/Native/Array.pm +lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm +lib/Moose/Meta/Method/Accessor/Native/Array/accessor.pm +lib/Moose/Meta/Method/Accessor/Native/Array/clear.pm +lib/Moose/Meta/Method/Accessor/Native/Array/count.pm +lib/Moose/Meta/Method/Accessor/Native/Array/delete.pm +lib/Moose/Meta/Method/Accessor/Native/Array/elements.pm +lib/Moose/Meta/Method/Accessor/Native/Array/first.pm +lib/Moose/Meta/Method/Accessor/Native/Array/first_index.pm +lib/Moose/Meta/Method/Accessor/Native/Array/get.pm +lib/Moose/Meta/Method/Accessor/Native/Array/grep.pm +lib/Moose/Meta/Method/Accessor/Native/Array/insert.pm +lib/Moose/Meta/Method/Accessor/Native/Array/is_empty.pm +lib/Moose/Meta/Method/Accessor/Native/Array/join.pm +lib/Moose/Meta/Method/Accessor/Native/Array/map.pm +lib/Moose/Meta/Method/Accessor/Native/Array/natatime.pm +lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm +lib/Moose/Meta/Method/Accessor/Native/Array/push.pm +lib/Moose/Meta/Method/Accessor/Native/Array/reduce.pm +lib/Moose/Meta/Method/Accessor/Native/Array/set.pm +lib/Moose/Meta/Method/Accessor/Native/Array/shallow_clone.pm +lib/Moose/Meta/Method/Accessor/Native/Array/shift.pm +lib/Moose/Meta/Method/Accessor/Native/Array/shuffle.pm +lib/Moose/Meta/Method/Accessor/Native/Array/sort.pm +lib/Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm +lib/Moose/Meta/Method/Accessor/Native/Array/splice.pm +lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm +lib/Moose/Meta/Method/Accessor/Native/Array/unshift.pm +lib/Moose/Meta/Method/Accessor/Native/Bool/not.pm +lib/Moose/Meta/Method/Accessor/Native/Bool/set.pm +lib/Moose/Meta/Method/Accessor/Native/Bool/toggle.pm +lib/Moose/Meta/Method/Accessor/Native/Bool/unset.pm +lib/Moose/Meta/Method/Accessor/Native/Code/execute.pm +lib/Moose/Meta/Method/Accessor/Native/Code/execute_method.pm +lib/Moose/Meta/Method/Accessor/Native/Collection.pm +lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm +lib/Moose/Meta/Method/Accessor/Native/Counter/dec.pm +lib/Moose/Meta/Method/Accessor/Native/Counter/inc.pm +lib/Moose/Meta/Method/Accessor/Native/Counter/reset.pm +lib/Moose/Meta/Method/Accessor/Native/Counter/set.pm +lib/Moose/Meta/Method/Accessor/Native/Hash.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/clear.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/count.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/defined.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/elements.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/exists.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/kv.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/shallow_clone.pm +lib/Moose/Meta/Method/Accessor/Native/Hash/values.pm +lib/Moose/Meta/Method/Accessor/Native/Number/abs.pm +lib/Moose/Meta/Method/Accessor/Native/Number/add.pm +lib/Moose/Meta/Method/Accessor/Native/Number/div.pm +lib/Moose/Meta/Method/Accessor/Native/Number/mod.pm +lib/Moose/Meta/Method/Accessor/Native/Number/mul.pm +lib/Moose/Meta/Method/Accessor/Native/Number/set.pm +lib/Moose/Meta/Method/Accessor/Native/Number/sub.pm +lib/Moose/Meta/Method/Accessor/Native/Reader.pm +lib/Moose/Meta/Method/Accessor/Native/String/append.pm +lib/Moose/Meta/Method/Accessor/Native/String/chomp.pm +lib/Moose/Meta/Method/Accessor/Native/String/chop.pm +lib/Moose/Meta/Method/Accessor/Native/String/clear.pm +lib/Moose/Meta/Method/Accessor/Native/String/inc.pm +lib/Moose/Meta/Method/Accessor/Native/String/length.pm +lib/Moose/Meta/Method/Accessor/Native/String/match.pm +lib/Moose/Meta/Method/Accessor/Native/String/prepend.pm +lib/Moose/Meta/Method/Accessor/Native/String/replace.pm +lib/Moose/Meta/Method/Accessor/Native/String/substr.pm +lib/Moose/Meta/Method/Accessor/Native/Writer.pm +lib/Moose/Meta/Method/Augmented.pm +lib/Moose/Meta/Method/Constructor.pm +lib/Moose/Meta/Method/Delegation.pm +lib/Moose/Meta/Method/Destructor.pm +lib/Moose/Meta/Method/Meta.pm +lib/Moose/Meta/Method/Overridden.pm +lib/Moose/Meta/Mixin/AttributeCore.pm +lib/Moose/Meta/Object/Trait.pm +lib/Moose/Meta/Role.pm +lib/Moose/Meta/Role/Application.pm +lib/Moose/Meta/Role/Application/RoleSummation.pm +lib/Moose/Meta/Role/Application/ToClass.pm +lib/Moose/Meta/Role/Application/ToInstance.pm +lib/Moose/Meta/Role/Application/ToRole.pm +lib/Moose/Meta/Role/Attribute.pm +lib/Moose/Meta/Role/Composite.pm +lib/Moose/Meta/Role/Method.pm +lib/Moose/Meta/Role/Method/Conflicting.pm +lib/Moose/Meta/Role/Method/Required.pm +lib/Moose/Meta/TypeCoercion.pm +lib/Moose/Meta/TypeCoercion/Union.pm +lib/Moose/Meta/TypeConstraint.pm +lib/Moose/Meta/TypeConstraint/Class.pm +lib/Moose/Meta/TypeConstraint/DuckType.pm +lib/Moose/Meta/TypeConstraint/Enum.pm +lib/Moose/Meta/TypeConstraint/Parameterizable.pm +lib/Moose/Meta/TypeConstraint/Parameterized.pm +lib/Moose/Meta/TypeConstraint/Registry.pm +lib/Moose/Meta/TypeConstraint/Role.pm +lib/Moose/Meta/TypeConstraint/Union.pm +lib/Moose/Object.pm +lib/Moose/Role.pm +lib/Moose/Spec/Role.pod +lib/Moose/Unsweetened.pod +lib/Moose/Util.pm +lib/Moose/Util/MetaRole.pm +lib/Moose/Util/TypeConstraints.pm +lib/Moose/Util/TypeConstraints/Builtins.pm +lib/Test/Moose.pm +lib/metaclass.pm +lib/oose.pm +mop.c +mop.h +perltidyrc +ppport.h +t/00-report-prereqs.dd +t/00-report-prereqs.t +t/000_load.t +t/attributes/accessor_context.t +t/attributes/accessor_inlining.t +t/attributes/accessor_override_method.t +t/attributes/accessor_overwrite_warning.t +t/attributes/attr_dereference_test.t +t/attributes/attribute_accessor_generation.t +t/attributes/attribute_custom_metaclass.t +t/attributes/attribute_delegation.t +t/attributes/attribute_does.t +t/attributes/attribute_inherited_slot_specs.t +t/attributes/attribute_lazy_initializer.t +t/attributes/attribute_names.t +t/attributes/attribute_reader_generation.t +t/attributes/attribute_required.t +t/attributes/attribute_traits.t +t/attributes/attribute_traits_n_meta.t +t/attributes/attribute_traits_parameterized.t +t/attributes/attribute_traits_registered.t +t/attributes/attribute_triggers.t +t/attributes/attribute_type_unions.t +t/attributes/attribute_without_any_methods.t +t/attributes/attribute_writer_generation.t +t/attributes/bad_coerce.t +t/attributes/chained_coercion.t +t/attributes/clone_weak.t +t/attributes/default_class_role_types.t +t/attributes/default_undef.t +t/attributes/delegation_and_modifiers.t +t/attributes/delegation_arg_aliasing.t +t/attributes/delegation_target_not_loaded.t +t/attributes/illegal_options_for_inheritance.t +t/attributes/inherit_lazy_build.t +t/attributes/lazy_no_default.t +t/attributes/method_generation_rules.t +t/attributes/misc_attribute_coerce_lazy.t +t/attributes/misc_attribute_tests.t +t/attributes/more_attr_delegation.t +t/attributes/no_init_arg.t +t/attributes/no_slot_access.t +t/attributes/non_alpha_attr_names.t +t/attributes/numeric_defaults.t +t/attributes/trigger_and_coerce.t +t/attributes/type_constraint.t +t/basics/always_strict_warnings.t +t/basics/basic_class_setup.t +t/basics/buildargs.t +t/basics/buildargs_warning.t +t/basics/create.t +t/basics/create_anon.t +t/basics/deprecations.t +t/basics/destruction.t +t/basics/error_handling.t +t/basics/global-destruction-helper.pl +t/basics/global_destruction.t +t/basics/import_unimport.t +t/basics/inner_and_augment.t +t/basics/load_into_main.t +t/basics/method_modifier_with_regexp.t +t/basics/methods.t +t/basics/moose_object_does.t +t/basics/moose_respects_type_constraints.t +t/basics/override_and_foreign_classes.t +t/basics/override_augment_inner_super.t +t/basics/rebless.t +t/basics/require_superclasses.t +t/basics/super_and_override.t +t/basics/super_warns_on_args.t +t/basics/universal_methods_wrappable.t +t/basics/wrapped_method_cxt_propagation.t +t/bugs/DEMOLISHALL.t +t/bugs/DEMOLISHALL_shortcutted.t +t/bugs/DEMOLISH_eats_exceptions.t +t/bugs/DEMOLISH_eats_mini.t +t/bugs/DEMOLISH_fails_without_metaclass.t +t/bugs/Moose_Object_error.t +t/bugs/anon_method_metaclass.t +t/bugs/application_metarole_compat.t +t/bugs/apply_role_to_one_instance_only.t +t/bugs/attribute_trait_parameters.t +t/bugs/augment_recursion_bug.t +t/bugs/coerce_without_coercion.t +t/bugs/constructor_object_overload.t +t/bugs/create_anon_recursion.t +t/bugs/create_anon_role_pass.t +t/bugs/delete_sub_stash.t +t/bugs/handles_foreign_class_bug.t +t/bugs/immutable_metaclass_does_role.t +t/bugs/immutable_n_default_x2.t +t/bugs/inheriting_from_roles.t +t/bugs/inline_reader_bug.t +t/bugs/instance_application_role_args.t +t/bugs/lazybuild_required_undef.t +t/bugs/mark_as_methods_overloading_breakage.t +t/bugs/moose_exporter_false_circular_reference_rt_63818.t +t/bugs/moose_octal_defaults.t +t/bugs/native_trait_handles_bad_value.t +t/bugs/overloading_edge_cases.t +t/bugs/reader_precedence_bug.t +t/bugs/role_caller.t +t/bugs/subclass_use_base_bug.t +t/bugs/subtype_conflict_bug.t +t/bugs/subtype_quote_bug.t +t/bugs/super_recursion.t +t/bugs/traits_with_exporter.t +t/bugs/type_constraint_messages.t +t/cmop/ArrayBasedStorage_test.t +t/cmop/AttributesWithHistory_test.t +t/cmop/BinaryTree_test.t +t/cmop/C3MethodDispatchOrder_test.t +t/cmop/ClassEncapsulatedAttributes_test.t +t/cmop/Class_C3_compatibility.t +t/cmop/InsideOutClass_test.t +t/cmop/InstanceCountingClass_test.t +t/cmop/LazyClass_test.t +t/cmop/Perl6Attribute_test.t +t/cmop/RT_27329_fix.t +t/cmop/RT_39001_fix.t +t/cmop/RT_41255.t +t/cmop/add_attribute_alternate.t +t/cmop/add_method_debugmode.t +t/cmop/add_method_modifier.t +t/cmop/advanced_methods.t +t/cmop/anon_class.t +t/cmop/anon_class_create_init.t +t/cmop/anon_class_keep_alive.t +t/cmop/anon_class_leak.t +t/cmop/anon_class_removal.t +t/cmop/anon_packages.t +t/cmop/attribute.t +t/cmop/attribute_duplication.t +t/cmop/attribute_errors_and_edge_cases.t +t/cmop/attribute_get_read_write.t +t/cmop/attribute_initializer.t +t/cmop/attribute_introspection.t +t/cmop/attribute_non_alpha_name.t +t/cmop/attributes.t +t/cmop/basic.t +t/cmop/before_after_dollar_under.t +t/cmop/class_errors_and_edge_cases.t +t/cmop/class_is_pristine.t +t/cmop/class_precedence_list.t +t/cmop/constant_codeinfo.t +t/cmop/create_class.t +t/cmop/custom_instance.t +t/cmop/deprecated.t +t/cmop/get_code_info.t +t/cmop/immutable_custom_trait.t +t/cmop/immutable_metaclass.t +t/cmop/immutable_w_constructors.t +t/cmop/immutable_w_custom_metaclass.t +t/cmop/inline_and_dollar_at.t +t/cmop/inline_structor.t +t/cmop/insertion_order.t +t/cmop/instance.t +t/cmop/instance_inline.t +t/cmop/instance_metaclass_incompat.t +t/cmop/instance_metaclass_incompat_dyn.t +t/cmop/lib/ArrayBasedStorage.pm +t/cmop/lib/AttributesWithHistory.pm +t/cmop/lib/BinaryTree.pm +t/cmop/lib/C3MethodDispatchOrder.pm +t/cmop/lib/ClassEncapsulatedAttributes.pm +t/cmop/lib/InsideOutClass.pm +t/cmop/lib/InstanceCountingClass.pm +t/cmop/lib/LazyClass.pm +t/cmop/lib/MyMetaClass.pm +t/cmop/lib/MyMetaClass/Attribute.pm +t/cmop/lib/MyMetaClass/Instance.pm +t/cmop/lib/MyMetaClass/Method.pm +t/cmop/lib/MyMetaClass/Random.pm +t/cmop/lib/Perl6Attribute.pm +t/cmop/lib/SyntaxError.pm +t/cmop/load.t +t/cmop/magic.t +t/cmop/make_mutable.t +t/cmop/meta_method.t +t/cmop/meta_package.t +t/cmop/meta_package_extension.t +t/cmop/metaclass.t +t/cmop/metaclass_incompatibility.t +t/cmop/metaclass_incompatibility_dyn.t +t/cmop/metaclass_inheritance.t +t/cmop/metaclass_loads_classes.t +t/cmop/metaclass_reinitialize.t +t/cmop/method.t +t/cmop/method_modifiers.t +t/cmop/methods.t +t/cmop/modify_parent_method.t +t/cmop/new_and_clone_metaclasses.t +t/cmop/null_stash.t +t/cmop/numeric_defaults.t +t/cmop/package_variables.t +t/cmop/random_eval_bug.t +t/cmop/rebless_instance.t +t/cmop/rebless_instance_away.t +t/cmop/rebless_overload.t +t/cmop/rebless_with_extra_params.t +t/cmop/scala_style_mixin_composition.t +t/cmop/self_introspection.t +t/cmop/subclasses.t +t/cmop/subname.t +t/cmop/universal_methods.t +t/compat/composite_metaroles.t +t/compat/extends_nonmoose_that_isa_moose_with_metarole.t +t/compat/foreign_inheritence.t +t/compat/inc_hash.t +t/compat/module_refresh_compat.t +t/compat/moose_respects_base.t +t/examples/Child_Parent_attr_inherit.t +t/examples/example1.t +t/examples/example2.t +t/examples/example_Moose_POOP.t +t/examples/example_Protomoose.t +t/examples/example_w_DCS.t +t/examples/example_w_TestDeep.t +t/examples/record_set_iterator.t +t/exceptions/attribute.t +t/exceptions/class-mop-attribute.t +t/exceptions/class-mop-class-immutable-trait.t +t/exceptions/class-mop-class.t +t/exceptions/class-mop-method-accessor.t +t/exceptions/class-mop-method-constructor.t +t/exceptions/class-mop-method-generated.t +t/exceptions/class-mop-method-meta.t +t/exceptions/class-mop-method-wrapped.t +t/exceptions/class-mop-method.t +t/exceptions/class-mop-mixin-hasattributes.t +t/exceptions/class-mop-mixin-hasmethods.t +t/exceptions/class-mop-module.t +t/exceptions/class-mop-object.t +t/exceptions/class-mop-package.t +t/exceptions/class.t +t/exceptions/cmop.t +t/exceptions/exception-lazyattributeneedsadefault.t +t/exceptions/frame-leak.t +t/exceptions/meta-role.t +t/exceptions/metaclass.t +t/exceptions/moose-exporter.t +t/exceptions/moose-meta-attribute-native-traits.t +t/exceptions/moose-meta-class-immutable-trait.t +t/exceptions/moose-meta-method-accessor-native-array.t +t/exceptions/moose-meta-method-accessor-native-collection.t +t/exceptions/moose-meta-method-accessor-native-grep.t +t/exceptions/moose-meta-method-accessor-native-hash-set.t +t/exceptions/moose-meta-method-accessor-native-hash.t +t/exceptions/moose-meta-method-accessor-native-string-match.t +t/exceptions/moose-meta-method-accessor-native-string-replace.t +t/exceptions/moose-meta-method-accessor-native-string-substr.t +t/exceptions/moose-meta-method-accessor-native.t +t/exceptions/moose-meta-method-accessor.t +t/exceptions/moose-meta-method-augmented.t +t/exceptions/moose-meta-method-constructor.t +t/exceptions/moose-meta-method-delegation.t +t/exceptions/moose-meta-method-destructor.t +t/exceptions/moose-meta-method-overridden.t +t/exceptions/moose-meta-role-application-rolesummation.t +t/exceptions/moose-meta-role-application-toclass.t +t/exceptions/moose-meta-role-application-torole.t +t/exceptions/moose-meta-role-application.t +t/exceptions/moose-meta-role-attribute.t +t/exceptions/moose-meta-role-composite.t +t/exceptions/moose-meta-typecoercion-union.t +t/exceptions/moose-meta-typecoercion.t +t/exceptions/moose-meta-typeconstraint-enum.t +t/exceptions/moose-meta-typeconstraint-parameterizable.t +t/exceptions/moose-meta-typeconstraint-parameterized.t +t/exceptions/moose-meta-typeconstraint-registry.t +t/exceptions/moose-meta-typeconstraint.t +t/exceptions/moose-role.t +t/exceptions/moose-util-metarole.t +t/exceptions/moose-util-typeconstraints.t +t/exceptions/moose.t +t/exceptions/object.t +t/exceptions/overload.t +t/exceptions/rt-92818.t +t/exceptions/rt-94795.t +t/exceptions/stringify.t +t/exceptions/traits.t +t/exceptions/typeconstraints.t +t/exceptions/util.t +t/immutable/apply_roles_to_immutable.t +t/immutable/buildargs.t +t/immutable/constructor_is_not_moose.t +t/immutable/constructor_is_wrapped.t +t/immutable/default_values.t +t/immutable/definition_context.t +t/immutable/immutable_constructor_error.t +t/immutable/immutable_destroy.t +t/immutable/immutable_meta_class.t +t/immutable/immutable_metaclass_with_traits.t +t/immutable/immutable_moose.t +t/immutable/immutable_roundtrip.t +t/immutable/immutable_trigger_from_constructor.t +t/immutable/inline_close_over.t +t/immutable/inline_fallbacks.t +t/immutable/inlined_constructors_n_types.t +t/immutable/multiple_demolish_inline.t +t/lib/Bar.pm +t/lib/Bar7/Meta/Trait.pm +t/lib/Bar7/Meta/Trait2.pm +t/lib/Foo.pm +t/lib/Moose/Meta/Attribute/Custom/Bar.pm +t/lib/Moose/Meta/Attribute/Custom/Foo.pm +t/lib/Moose/Meta/Attribute/Custom/Trait/Bar.pm +t/lib/Moose/Meta/Attribute/Custom/Trait/Foo.pm +t/lib/MyExporter.pm +t/lib/MyMetaclassRole.pm +t/lib/MyMooseA.pm +t/lib/MyMooseB.pm +t/lib/MyMooseObject.pm +t/lib/NoInlineAttribute.pm +t/lib/Overloading/ClassConsumesRoleConsumesOverloads.pm +t/lib/Overloading/ClassWithCombiningRole.pm +t/lib/Overloading/ClassWithOneRole.pm +t/lib/Overloading/CombiningClass.pm +t/lib/Overloading/CombiningRole.pm +t/lib/Overloading/RoleConsumesOverloads.pm +t/lib/Overloading/RoleWithOverloads.pm +t/lib/Overloading/RoleWithoutOverloads.pm +t/lib/OverloadingTests.pm +t/lib/Real/Package.pm +t/lib/Role/BreakOnLoad.pm +t/lib/Role/Child.pm +t/lib/Role/Interface.pm +t/lib/Role/Parent.pm +t/metaclasses/create_anon_with_required_attr.t +t/metaclasses/custom_attr_meta_as_role.t +t/metaclasses/custom_attr_meta_with_roles.t +t/metaclasses/easy_init_meta.t +t/metaclasses/export_with_prototype.t +t/metaclasses/exporter_also_with_trait.t +t/metaclasses/exporter_meta_lookup.t +t/metaclasses/exporter_sub_names.t +t/metaclasses/goto_moose_import.t +t/metaclasses/immutable_metaclass_compat_bug.t +t/metaclasses/meta_name.t +t/metaclasses/metaclass_compat.t +t/metaclasses/metaclass_compat_no_fixing_bug.t +t/metaclasses/metaclass_compat_role_conflicts.t +t/metaclasses/metaclass_parameterized_traits.t +t/metaclasses/metaclass_traits.t +t/metaclasses/metarole.t +t/metaclasses/metarole_combination.t +t/metaclasses/metarole_on_anon.t +t/metaclasses/metarole_w_metaclass_pm.t +t/metaclasses/metaroles_of_metaroles.t +t/metaclasses/moose_exporter.t +t/metaclasses/moose_exporter_trait_aliases.t +t/metaclasses/moose_for_meta.t +t/metaclasses/moose_nonmoose_metatrait_init_order.t +t/metaclasses/moose_nonmoose_moose_chain_init_meta.t +t/metaclasses/moose_w_metaclass.t +t/metaclasses/new_metaclass.t +t/metaclasses/new_object_BUILD.t +t/metaclasses/overloading.t +t/metaclasses/reinitialize.t +t/metaclasses/use_base_of_moose.t +t/moose_util/apply_roles.t +t/moose_util/create_alias.t +t/moose_util/ensure_all_roles.t +t/moose_util/method_mod_args.t +t/moose_util/moose_util.t +t/moose_util/moose_util_does_role.t +t/moose_util/moose_util_search_class_by_role.t +t/moose_util/resolve_alias.t +t/moose_util/with_traits.t +t/native_traits/array_coerce.t +t/native_traits/array_from_role.t +t/native_traits/array_subtypes.t +t/native_traits/array_trigger.t +t/native_traits/collection_with_roles.t +t/native_traits/custom_instance.t +t/native_traits/hash_coerce.t +t/native_traits/hash_subtypes.t +t/native_traits/hash_trigger.t +t/native_traits/remove_attribute.t +t/native_traits/shallow_clone.t +t/native_traits/trait_array.t +t/native_traits/trait_bool.t +t/native_traits/trait_code.t +t/native_traits/trait_counter.t +t/native_traits/trait_hash.t +t/native_traits/trait_number.t +t/native_traits/trait_string.t +t/recipes/basics_bankaccount_methodmodifiersandsubclassing.t +t/recipes/basics_binarytree_attributefeatures.t +t/recipes/basics_company_subtypes.t +t/recipes/basics_datetime_extendingnonmooseparent.t +t/recipes/basics_document_augmentandinner.t +t/recipes/basics_genome_overloadingsubtypesandcoercion.t +t/recipes/basics_http_subtypesandcoercion.t +t/recipes/basics_point_attributesandsubclassing.t +t/recipes/extending_debugging_baseclassrole.t +t/recipes/extending_mooseish_moosesugar.t +t/recipes/legacy_debugging_baseclassreplacement.t +t/recipes/legacy_labeled_attributemetaclass.t +t/recipes/meta_globref_instancemetaclass.t +t/recipes/meta_labeled_attributetrait.t +t/recipes/meta_privateorpublic_methodmetaclass.t +t/recipes/meta_table_metaclasstrait.t +t/recipes/roles_applicationtoinstance.t +t/recipes/roles_comparable_codereuse.t +t/recipes/roles_restartable_advancedcomposition.t +t/roles/anonymous_roles.t +t/roles/application_toclass.t +t/roles/apply_role.t +t/roles/build.t +t/roles/conflict_many_methods.t +t/roles/create_role.t +t/roles/create_role_subclass.t +t/roles/empty_method_modifiers_meta_bug.t +t/roles/extending_role_attrs.t +t/roles/free_anonymous_roles.t +t/roles/imported_required_method.t +t/roles/meta_role.t +t/roles/method_aliasing_in_composition.t +t/roles/method_exclusion_in_composition.t +t/roles/method_modifiers.t +t/roles/methods.t +t/roles/more_alias_and_exclude.t +t/roles/more_role_edge_cases.t +t/roles/new_meta_role.t +t/roles/overloading_combine_to_class.t +t/roles/overloading_combine_to_instance.t +t/roles/overloading_combine_to_role.t +t/roles/overloading_composition_errors.t +t/roles/overloading_remove_attributes_bug.t +t/roles/overloading_to_class.t +t/roles/overloading_to_instance.t +t/roles/overloading_to_role.t +t/roles/overriding.t +t/roles/reinitialize_anon_role.t +t/roles/role.t +t/roles/role_attr_application.t +t/roles/role_attribute_conflict.t +t/roles/role_attrs.t +t/roles/role_compose_requires.t +t/roles/role_composite.t +t/roles/role_composite_exclusion.t +t/roles/role_composition_attributes.t +t/roles/role_composition_conflict_detection.t +t/roles/role_composition_errors.t +t/roles/role_composition_method_mods.t +t/roles/role_composition_methods.t +t/roles/role_composition_override.t +t/roles/role_composition_req_methods.t +t/roles/role_conflict_detection.t +t/roles/role_conflict_edge_cases.t +t/roles/role_consumers.t +t/roles/role_exclusion.t +t/roles/role_exclusion_and_alias_bug.t +t/roles/role_for_combination.t +t/roles/roles_and_method_cloning.t +t/roles/roles_and_req_method_edge_cases.t +t/roles/roles_applied_in_create.t +t/roles/run_time_role_composition.t +t/roles/runtime_roles_and_attrs.t +t/roles/runtime_roles_and_nonmoose.t +t/roles/runtime_roles_w_params.t +t/roles/use_base_does.t +t/test_moose/test_moose.t +t/test_moose/test_moose_does_ok.t +t/test_moose/test_moose_has_attribute_ok.t +t/test_moose/test_moose_meta_ok.t +t/test_moose/with_immutable.t +t/todo_tests/exception_reflects_failed_constraint.t +t/todo_tests/immutable_n_around.t +t/todo_tests/moose_and_threads.t +t/todo_tests/replacing_super_methods.t +t/todo_tests/required_role_accessors.t +t/todo_tests/role_attr_methods_original_package.t +t/todo_tests/role_insertion_order.t +t/todo_tests/various_role_features.t +t/todo_tests/wrong-inner.t +t/type_constraints/advanced_type_creation.t +t/type_constraints/class_subtypes.t +t/type_constraints/class_type_constraint.t +t/type_constraints/coerced_parameterized_types.t +t/type_constraints/container_type_coercion.t +t/type_constraints/container_type_constraint.t +t/type_constraints/custom_parameterized_types.t +t/type_constraints/custom_type_errors.t +t/type_constraints/define_type_twice_throws.t +t/type_constraints/duck_type_handles.t +t/type_constraints/duck_types.t +t/type_constraints/enum.t +t/type_constraints/inlining.t +t/type_constraints/match_type_operator.t +t/type_constraints/maybe_type_constraint.t +t/type_constraints/misc_type_tests.t +t/type_constraints/name_conflicts.t +t/type_constraints/normalize_type_name.t +t/type_constraints/parameterize_from.t +t/type_constraints/role_type_constraint.t +t/type_constraints/subtype_auto_vivify_parent.t +t/type_constraints/subtyping_parameterized_types.t +t/type_constraints/subtyping_union_types.t +t/type_constraints/throw_error.t +t/type_constraints/type_coersion_on_lazy_attributes.t +t/type_constraints/type_names.t +t/type_constraints/type_notation_parser.t +t/type_constraints/types_and_undef.t +t/type_constraints/union_is_a_type_of.t +t/type_constraints/union_types.t +t/type_constraints/union_types_and_coercions.t +t/type_constraints/util_find_type_constraint.t +t/type_constraints/util_more_type_coercion.t +t/type_constraints/util_std_type_constraints.t +t/type_constraints/util_type_coercion.t +t/type_constraints/util_type_constraints.t +t/type_constraints/util_type_constraints_export.t +t/type_constraints/util_type_reloading.t +t/type_constraints/with-specio.t +t/zzz-check-breaks.t +xs/Attribute.xs +xs/AttributeCore.xs +xs/Class.xs +xs/Generated.xs +xs/HasAttributes.xs +xs/HasMethods.xs +xs/Inlined.xs +xs/Instance.xs +xs/MOP.xs +xs/Method.xs +xs/Moose.xs +xs/Package.xs +xs/ToInstance.xs +xs/typemap +xt/author/authority.t +xt/author/debugger-duck_type.t +xt/author/eol.t +xt/author/memory_leaks.t +xt/author/no-tabs.t +xt/author/pod-coverage.t +xt/author/pod-spell.t +xt/author/test-my-dependents.t +xt/release/00-compile.t +xt/release/cpan-changes.t +xt/release/distmeta.t +xt/release/kwalitee.t +xt/release/mojibake.t +xt/release/pod-syntax.t diff --git a/META.json b/META.json new file mode 100644 index 0000000..e3cb289 --- /dev/null +++ b/META.json @@ -0,0 +1,2575 @@ +{ + "abstract" : "A postmodern object system for Perl 5", + "author" : [ + "Stevan Little ", + "Dave Rolsky ", + "Jesse Luehrs ", + "Shawn M Moore ", + "יובל קוג'מן (Yuval Kogman) ", + "Karen Etheridge ", + "Florian Ragwitz ", + "Hans Dieter Pearcey ", + "Chris Prather ", + "Matt S Trout " + ], + "dynamic_config" : 0, + "generated_by" : "Dist::Zilla version 5.037, CPAN::Meta::Converter version 2.150001", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : 2 + }, + "name" : "Moose", + "no_index" : { + "directory" : [ + "author", + "benchmarks", + "doc", + "inc" + ], + "namespace" : [ + "Class::MOP::Mixin", + "Moose::Meta::Method::Accessor::Native", + "Moose::Meta::Mixin" + ], + "package" : [ + "Class::MOP::Class::Immutable::Trait", + "Class::MOP::Deprecated", + "Class::MOP::MiniTrait", + "Class::MOP::Mixin", + "Moose::Deprecated", + "Moose::Meta::Attribute::Native::Trait", + "Moose::Meta::Class::Immutable::Trait", + "Moose::Meta::Method::Accessor::Native", + "Moose::Meta::Object::Trait", + "Moose::Util::TypeConstraints::Builtins" + ] + }, + "prereqs" : { + "configure" : { + "requires" : { + "Dist::CheckConflicts" : "0.02", + "ExtUtils::CBuilder" : "0.27", + "ExtUtils::MakeMaker" : "0", + "File::Spec" : "0" + } + }, + "develop" : { + "requires" : { + "Algorithm::C3" : "0", + "Class::Load" : "0.07", + "DBM::Deep" : "1.003", + "Data::Visitor" : "0", + "DateTime" : "0", + "DateTime::Calendar::Mayan" : "0", + "DateTime::Format::MySQL" : "0", + "Declare::Constraints::Simple" : "0", + "ExtUtils::MakeMaker::Dist::Zilla::Develop" : "0", + "File::Find::Rule" : "0", + "File::Spec" : "0", + "HTTP::Headers" : "0", + "IO::File" : "0", + "IO::Handle" : "0", + "IO::String" : "0", + "IPC::Open3" : "0", + "Locale::US" : "0", + "Module::CPANTS::Analyse" : "0.92", + "Module::Refresh" : "0", + "MooseX::MarkAsMethods" : "0", + "MooseX::NonMoose" : "0", + "PadWalker" : "0", + "Params::Coerce" : "0", + "Regexp::Common" : "0", + "SUPER" : "1.10", + "Specio" : "0.10", + "Test::CPAN::Changes" : "0.19", + "Test::CPAN::Meta" : "0", + "Test::Deep" : "0", + "Test::EOL" : "0", + "Test::Inline" : "0", + "Test::Kwalitee" : "1.21", + "Test::LeakTrace" : "0", + "Test::Memory::Cycle" : "0", + "Test::More" : "0.94", + "Test::NoTabs" : "0", + "Test::Output" : "0", + "Test::Pod" : "1.41", + "Test::Pod::Coverage" : "1.04", + "Test::Spelling" : "0", + "URI" : "0", + "blib" : "0" + }, + "suggests" : { + "CPAN::Meta::Requirements" : "0", + "Carp" : "1.22", + "Class::Load" : "0.09", + "Class::Load::XS" : "0.01", + "Data::OptList" : "0.107", + "Devel::GlobalDestruction" : "0", + "Devel::OverloadInfo" : "0.002", + "Devel::StackTrace" : "1.33", + "Dist::Zilla" : "5", + "Dist::Zilla::Plugin::BumpVersionAfterRelease" : "0", + "Dist::Zilla::Plugin::CheckChangesHasContent" : "0", + "Dist::Zilla::Plugin::CheckVersionIncrement" : "0", + "Dist::Zilla::Plugin::ConfirmRelease" : "0", + "Dist::Zilla::Plugin::Conflicts" : "0.16", + "Dist::Zilla::Plugin::CopyFilesFromRelease" : "0", + "Dist::Zilla::Plugin::EnsurePrereqsInstalled" : "0.003", + "Dist::Zilla::Plugin::ExecDir" : "0", + "Dist::Zilla::Plugin::FileFinder::ByName" : "0", + "Dist::Zilla::Plugin::FileFinder::Filter" : "0", + "Dist::Zilla::Plugin::Git::Check" : "0", + "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch" : "0", + "Dist::Zilla::Plugin::Git::Commit" : "0", + "Dist::Zilla::Plugin::Git::Contributors" : "0", + "Dist::Zilla::Plugin::Git::Describe" : "0.004", + "Dist::Zilla::Plugin::Git::GatherDir" : "0", + "Dist::Zilla::Plugin::Git::Push" : "0", + "Dist::Zilla::Plugin::Git::Remote::Check" : "0", + "Dist::Zilla::Plugin::Git::Tag" : "0", + "Dist::Zilla::Plugin::License" : "0", + "Dist::Zilla::Plugin::MakeMaker::Awesome" : "0", + "Dist::Zilla::Plugin::Manifest" : "0", + "Dist::Zilla::Plugin::MetaConfig" : "0", + "Dist::Zilla::Plugin::MetaJSON" : "0", + "Dist::Zilla::Plugin::MetaNoIndex" : "0", + "Dist::Zilla::Plugin::MetaProvides::Package" : "1.15000002", + "Dist::Zilla::Plugin::MetaResources" : "0", + "Dist::Zilla::Plugin::MetaTests" : "0", + "Dist::Zilla::Plugin::MetaYAML" : "0", + "Dist::Zilla::Plugin::MojibakeTests" : "0", + "Dist::Zilla::Plugin::NextRelease" : "5.033", + "Dist::Zilla::Plugin::PodSyntaxTests" : "0", + "Dist::Zilla::Plugin::Prereqs" : "0", + "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0", + "Dist::Zilla::Plugin::PromptIfStale" : "0", + "Dist::Zilla::Plugin::RewriteVersion" : "0", + "Dist::Zilla::Plugin::Run::AfterRelease" : "0", + "Dist::Zilla::Plugin::RunExtraTests" : "0", + "Dist::Zilla::Plugin::ShareDir" : "0", + "Dist::Zilla::Plugin::SurgicalPodWeaver" : "0.0023", + "Dist::Zilla::Plugin::Test::CPAN::Changes" : "0", + "Dist::Zilla::Plugin::Test::CheckBreaks" : "0", + "Dist::Zilla::Plugin::Test::Compile" : "2.037", + "Dist::Zilla::Plugin::Test::EOL" : "0.14", + "Dist::Zilla::Plugin::Test::Kwalitee" : "0", + "Dist::Zilla::Plugin::Test::NoTabs" : "0", + "Dist::Zilla::Plugin::Test::ReportPrereqs" : "0", + "Dist::Zilla::Plugin::TestRelease" : "0", + "Dist::Zilla::Plugin::UploadToCPAN" : "0", + "Dist::Zilla::Util::AuthorDeps" : "5.021", + "Eval::Closure" : "0.04", + "ExtUtils::CBuilder" : "0.27", + "File::Find::Rule" : "0", + "File::Spec" : "0", + "File::pushd" : "0", + "IPC::System::Simple" : "0", + "List::MoreUtils" : "0.28", + "List::Util" : "1.35", + "MRO::Compat" : "0.05", + "Module::Runtime" : "0.014", + "Module::Runtime::Conflicts" : "0.002", + "Package::DeprecationManager" : "0.11", + "Package::Stash" : "0.32", + "Package::Stash::XS" : "0.24", + "Params::Util" : "1.00", + "Path::Tiny" : "0", + "Scalar::Util" : "1.19", + "Sub::Exporter" : "0.980", + "Sub::Identify" : "0", + "Sub::Name" : "0.05", + "Task::Weaken" : "0", + "Test::Deep" : "0", + "Test::Inline" : "0", + "Test::Inline::Extract" : "0", + "Try::Tiny" : "0.17", + "parent" : "0.223", + "perl" : "v5.8.3", + "strict" : "1.03", + "warnings" : "1.03" + } + }, + "runtime" : { + "requires" : { + "Carp" : "1.22", + "Class::Load" : "0.09", + "Class::Load::XS" : "0.01", + "Data::OptList" : "0.107", + "Devel::GlobalDestruction" : "0", + "Devel::OverloadInfo" : "0.002", + "Devel::StackTrace" : "1.33", + "Dist::CheckConflicts" : "0.02", + "Eval::Closure" : "0.04", + "List::MoreUtils" : "0.28", + "List::Util" : "1.35", + "MRO::Compat" : "0.05", + "Module::Runtime" : "0.014", + "Module::Runtime::Conflicts" : "0.002", + "Package::DeprecationManager" : "0.11", + "Package::Stash" : "0.32", + "Package::Stash::XS" : "0.24", + "Params::Util" : "1.00", + "Scalar::Util" : "1.19", + "Sub::Exporter" : "0.980", + "Sub::Identify" : "0", + "Sub::Name" : "0.05", + "Task::Weaken" : "0", + "Try::Tiny" : "0.17", + "parent" : "0.223", + "perl" : "v5.8.3", + "strict" : "1.03", + "warnings" : "1.03" + }, + "suggests" : { + "Devel::PartialDump" : "0.14" + } + }, + "test" : { + "recommends" : { + "CPAN::Meta" : "2.120900" + }, + "requires" : { + "CPAN::Meta::Check" : "0.007", + "CPAN::Meta::Requirements" : "0", + "ExtUtils::MakeMaker" : "0", + "File::Spec" : "0", + "Test::CleanNamespaces" : "0.13", + "Test::Fatal" : "0.001", + "Test::More" : "0.88", + "Test::Requires" : "0.05", + "Test::Warnings" : "0.016" + } + } + }, + "provides" : { + "Class::MOP" : { + "file" : "lib/Class/MOP.pm", + "version" : "2.1405" + }, + "Class::MOP::Attribute" : { + "file" : "lib/Class/MOP/Attribute.pm", + "version" : "2.1405" + }, + "Class::MOP::Class" : { + "file" : "lib/Class/MOP/Class.pm", + "version" : "2.1405" + }, + "Class::MOP::Instance" : { + "file" : "lib/Class/MOP/Instance.pm", + "version" : "2.1405" + }, + "Class::MOP::Method" : { + "file" : "lib/Class/MOP/Method.pm", + "version" : "2.1405" + }, + "Class::MOP::Method::Accessor" : { + "file" : "lib/Class/MOP/Method/Accessor.pm", + "version" : "2.1405" + }, + "Class::MOP::Method::Constructor" : { + "file" : "lib/Class/MOP/Method/Constructor.pm", + "version" : "2.1405" + }, + "Class::MOP::Method::Generated" : { + "file" : "lib/Class/MOP/Method/Generated.pm", + "version" : "2.1405" + }, + "Class::MOP::Method::Inlined" : { + "file" : "lib/Class/MOP/Method/Inlined.pm", + "version" : "2.1405" + }, + "Class::MOP::Method::Meta" : { + "file" : "lib/Class/MOP/Method/Meta.pm", + "version" : "2.1405" + }, + "Class::MOP::Method::Wrapped" : { + "file" : "lib/Class/MOP/Method/Wrapped.pm", + "version" : "2.1405" + }, + "Class::MOP::Module" : { + "file" : "lib/Class/MOP/Module.pm", + "version" : "2.1405" + }, + "Class::MOP::Object" : { + "file" : "lib/Class/MOP/Object.pm", + "version" : "2.1405" + }, + "Class::MOP::Overload" : { + "file" : "lib/Class/MOP/Overload.pm", + "version" : "2.1405" + }, + "Class::MOP::Package" : { + "file" : "lib/Class/MOP/Package.pm", + "version" : "2.1405" + }, + "Moose" : { + "file" : "lib/Moose.pm", + "version" : "2.1405" + }, + "Moose::Cookbook" : { + "file" : "lib/Moose/Cookbook.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::BankAccount_MethodModifiersAndSubclassing" : { + "file" : "lib/Moose/Cookbook/Basics/BankAccount_MethodModifiersAndSubclassing.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::BinaryTree_AttributeFeatures" : { + "file" : "lib/Moose/Cookbook/Basics/BinaryTree_AttributeFeatures.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::BinaryTree_BuilderAndLazyBuild" : { + "file" : "lib/Moose/Cookbook/Basics/BinaryTree_BuilderAndLazyBuild.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::Company_Subtypes" : { + "file" : "lib/Moose/Cookbook/Basics/Company_Subtypes.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::DateTime_ExtendingNonMooseParent" : { + "file" : "lib/Moose/Cookbook/Basics/DateTime_ExtendingNonMooseParent.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::Document_AugmentAndInner" : { + "file" : "lib/Moose/Cookbook/Basics/Document_AugmentAndInner.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::Genome_OverloadingSubtypesAndCoercion" : { + "file" : "lib/Moose/Cookbook/Basics/Genome_OverloadingSubtypesAndCoercion.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::HTTP_SubtypesAndCoercion" : { + "file" : "lib/Moose/Cookbook/Basics/HTTP_SubtypesAndCoercion.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::Immutable" : { + "file" : "lib/Moose/Cookbook/Basics/Immutable.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::Person_BUILDARGSAndBUILD" : { + "file" : "lib/Moose/Cookbook/Basics/Person_BUILDARGSAndBUILD.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Basics::Point_AttributesAndSubclassing" : { + "file" : "lib/Moose/Cookbook/Basics/Point_AttributesAndSubclassing.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Extending::Debugging_BaseClassRole" : { + "file" : "lib/Moose/Cookbook/Extending/Debugging_BaseClassRole.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Extending::ExtensionOverview" : { + "file" : "lib/Moose/Cookbook/Extending/ExtensionOverview.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Extending::Mooseish_MooseSugar" : { + "file" : "lib/Moose/Cookbook/Extending/Mooseish_MooseSugar.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Legacy::Debugging_BaseClassReplacement" : { + "file" : "lib/Moose/Cookbook/Legacy/Debugging_BaseClassReplacement.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Legacy::Labeled_AttributeMetaclass" : { + "file" : "lib/Moose/Cookbook/Legacy/Labeled_AttributeMetaclass.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Legacy::Table_ClassMetaclass" : { + "file" : "lib/Moose/Cookbook/Legacy/Table_ClassMetaclass.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Meta::GlobRef_InstanceMetaclass" : { + "file" : "lib/Moose/Cookbook/Meta/GlobRef_InstanceMetaclass.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Meta::Labeled_AttributeTrait" : { + "file" : "lib/Moose/Cookbook/Meta/Labeled_AttributeTrait.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Meta::PrivateOrPublic_MethodMetaclass" : { + "file" : "lib/Moose/Cookbook/Meta/PrivateOrPublic_MethodMetaclass.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Meta::Table_MetaclassTrait" : { + "file" : "lib/Moose/Cookbook/Meta/Table_MetaclassTrait.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Meta::WhyMeta" : { + "file" : "lib/Moose/Cookbook/Meta/WhyMeta.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Roles::ApplicationToInstance" : { + "file" : "lib/Moose/Cookbook/Roles/ApplicationToInstance.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Roles::Comparable_CodeReuse" : { + "file" : "lib/Moose/Cookbook/Roles/Comparable_CodeReuse.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Roles::Restartable_AdvancedComposition" : { + "file" : "lib/Moose/Cookbook/Roles/Restartable_AdvancedComposition.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Snack::Keywords" : { + "file" : "lib/Moose/Cookbook/Snack/Keywords.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Snack::Types" : { + "file" : "lib/Moose/Cookbook/Snack/Types.pod", + "version" : "2.1405" + }, + "Moose::Cookbook::Style" : { + "file" : "lib/Moose/Cookbook/Style.pod", + "version" : "2.1405" + }, + "Moose::Exception" : { + "file" : "lib/Moose/Exception.pm", + "version" : "2.1405" + }, + "Moose::Exception::AccessorMustReadWrite" : { + "file" : "lib/Moose/Exception/AccessorMustReadWrite.pm", + "version" : "2.1405" + }, + "Moose::Exception::AddParameterizableTypeTakesParameterizableType" : { + "file" : "lib/Moose/Exception/AddParameterizableTypeTakesParameterizableType.pm", + "version" : "2.1405" + }, + "Moose::Exception::AddRoleTakesAMooseMetaRoleInstance" : { + "file" : "lib/Moose/Exception/AddRoleTakesAMooseMetaRoleInstance.pm", + "version" : "2.1405" + }, + "Moose::Exception::AddRoleToARoleTakesAMooseMetaRole" : { + "file" : "lib/Moose/Exception/AddRoleToARoleTakesAMooseMetaRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::ApplyTakesABlessedInstance" : { + "file" : "lib/Moose/Exception/ApplyTakesABlessedInstance.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttachToClassNeedsAClassMOPClassInstanceOrASubclass" : { + "file" : "lib/Moose/Exception/AttachToClassNeedsAClassMOPClassInstanceOrASubclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttributeConflictInRoles" : { + "file" : "lib/Moose/Exception/AttributeConflictInRoles.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttributeConflictInSummation" : { + "file" : "lib/Moose/Exception/AttributeConflictInSummation.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttributeExtensionIsNotSupportedInRoles" : { + "file" : "lib/Moose/Exception/AttributeExtensionIsNotSupportedInRoles.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttributeIsRequired" : { + "file" : "lib/Moose/Exception/AttributeIsRequired.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttributeMustBeAnClassMOPMixinAttributeCoreOrSubclass" : { + "file" : "lib/Moose/Exception/AttributeMustBeAnClassMOPMixinAttributeCoreOrSubclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttributeNamesDoNotMatch" : { + "file" : "lib/Moose/Exception/AttributeNamesDoNotMatch.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttributeValueIsNotAnObject" : { + "file" : "lib/Moose/Exception/AttributeValueIsNotAnObject.pm", + "version" : "2.1405" + }, + "Moose::Exception::AttributeValueIsNotDefined" : { + "file" : "lib/Moose/Exception/AttributeValueIsNotDefined.pm", + "version" : "2.1405" + }, + "Moose::Exception::AutoDeRefNeedsArrayRefOrHashRef" : { + "file" : "lib/Moose/Exception/AutoDeRefNeedsArrayRefOrHashRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::BadOptionFormat" : { + "file" : "lib/Moose/Exception/BadOptionFormat.pm", + "version" : "2.1405" + }, + "Moose::Exception::BothBuilderAndDefaultAreNotAllowed" : { + "file" : "lib/Moose/Exception/BothBuilderAndDefaultAreNotAllowed.pm", + "version" : "2.1405" + }, + "Moose::Exception::BuilderDoesNotExist" : { + "file" : "lib/Moose/Exception/BuilderDoesNotExist.pm", + "version" : "2.1405" + }, + "Moose::Exception::BuilderMethodNotSupportedForAttribute" : { + "file" : "lib/Moose/Exception/BuilderMethodNotSupportedForAttribute.pm", + "version" : "2.1405" + }, + "Moose::Exception::BuilderMethodNotSupportedForInlineAttribute" : { + "file" : "lib/Moose/Exception/BuilderMethodNotSupportedForInlineAttribute.pm", + "version" : "2.1405" + }, + "Moose::Exception::BuilderMustBeAMethodName" : { + "file" : "lib/Moose/Exception/BuilderMustBeAMethodName.pm", + "version" : "2.1405" + }, + "Moose::Exception::CallingMethodOnAnImmutableInstance" : { + "file" : "lib/Moose/Exception/CallingMethodOnAnImmutableInstance.pm", + "version" : "2.1405" + }, + "Moose::Exception::CallingReadOnlyMethodOnAnImmutableInstance" : { + "file" : "lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm", + "version" : "2.1405" + }, + "Moose::Exception::CanExtendOnlyClasses" : { + "file" : "lib/Moose/Exception/CanExtendOnlyClasses.pm", + "version" : "2.1405" + }, + "Moose::Exception::CanOnlyConsumeRole" : { + "file" : "lib/Moose/Exception/CanOnlyConsumeRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::CanOnlyWrapBlessedCode" : { + "file" : "lib/Moose/Exception/CanOnlyWrapBlessedCode.pm", + "version" : "2.1405" + }, + "Moose::Exception::CanReblessOnlyIntoASubclass" : { + "file" : "lib/Moose/Exception/CanReblessOnlyIntoASubclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::CanReblessOnlyIntoASuperclass" : { + "file" : "lib/Moose/Exception/CanReblessOnlyIntoASuperclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotAddAdditionalTypeCoercionsToUnion" : { + "file" : "lib/Moose/Exception/CannotAddAdditionalTypeCoercionsToUnion.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotAddAsAnAttributeToARole" : { + "file" : "lib/Moose/Exception/CannotAddAsAnAttributeToARole.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotApplyBaseClassRolesToRole" : { + "file" : "lib/Moose/Exception/CannotApplyBaseClassRolesToRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotAssignValueToReadOnlyAccessor" : { + "file" : "lib/Moose/Exception/CannotAssignValueToReadOnlyAccessor.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotAugmentIfLocalMethodPresent" : { + "file" : "lib/Moose/Exception/CannotAugmentIfLocalMethodPresent.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotAugmentNoSuperMethod" : { + "file" : "lib/Moose/Exception/CannotAugmentNoSuperMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotAutoDerefWithoutIsa" : { + "file" : "lib/Moose/Exception/CannotAutoDerefWithoutIsa.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotAutoDereferenceTypeConstraint" : { + "file" : "lib/Moose/Exception/CannotAutoDereferenceTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotCalculateNativeType" : { + "file" : "lib/Moose/Exception/CannotCalculateNativeType.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotCallAnAbstractBaseMethod" : { + "file" : "lib/Moose/Exception/CannotCallAnAbstractBaseMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotCallAnAbstractMethod" : { + "file" : "lib/Moose/Exception/CannotCallAnAbstractMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotCoerceAWeakRef" : { + "file" : "lib/Moose/Exception/CannotCoerceAWeakRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotCoerceAttributeWhichHasNoCoercion" : { + "file" : "lib/Moose/Exception/CannotCoerceAttributeWhichHasNoCoercion.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotCreateHigherOrderTypeWithoutATypeParameter" : { + "file" : "lib/Moose/Exception/CannotCreateHigherOrderTypeWithoutATypeParameter.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotCreateMethodAliasLocalMethodIsPresent" : { + "file" : "lib/Moose/Exception/CannotCreateMethodAliasLocalMethodIsPresent.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotCreateMethodAliasLocalMethodIsPresentInClass" : { + "file" : "lib/Moose/Exception/CannotCreateMethodAliasLocalMethodIsPresentInClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotDelegateLocalMethodIsPresent" : { + "file" : "lib/Moose/Exception/CannotDelegateLocalMethodIsPresent.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotDelegateWithoutIsa" : { + "file" : "lib/Moose/Exception/CannotDelegateWithoutIsa.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotFindDelegateMetaclass" : { + "file" : "lib/Moose/Exception/CannotFindDelegateMetaclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotFindType" : { + "file" : "lib/Moose/Exception/CannotFindType.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotFindTypeGivenToMatchOnType" : { + "file" : "lib/Moose/Exception/CannotFindTypeGivenToMatchOnType.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotFixMetaclassCompatibility" : { + "file" : "lib/Moose/Exception/CannotFixMetaclassCompatibility.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotGenerateInlineConstraint" : { + "file" : "lib/Moose/Exception/CannotGenerateInlineConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotInitializeMooseMetaRoleComposite" : { + "file" : "lib/Moose/Exception/CannotInitializeMooseMetaRoleComposite.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotInlineTypeConstraintCheck" : { + "file" : "lib/Moose/Exception/CannotInlineTypeConstraintCheck.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotLocatePackageInINC" : { + "file" : "lib/Moose/Exception/CannotLocatePackageInINC.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotMakeMetaclassCompatible" : { + "file" : "lib/Moose/Exception/CannotMakeMetaclassCompatible.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotOverrideALocalMethod" : { + "file" : "lib/Moose/Exception/CannotOverrideALocalMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotOverrideBodyOfMetaMethods" : { + "file" : "lib/Moose/Exception/CannotOverrideBodyOfMetaMethods.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotOverrideLocalMethodIsPresent" : { + "file" : "lib/Moose/Exception/CannotOverrideLocalMethodIsPresent.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotOverrideNoSuperMethod" : { + "file" : "lib/Moose/Exception/CannotOverrideNoSuperMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotRegisterUnnamedTypeConstraint" : { + "file" : "lib/Moose/Exception/CannotRegisterUnnamedTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::CannotUseLazyBuildAndDefaultSimultaneously" : { + "file" : "lib/Moose/Exception/CannotUseLazyBuildAndDefaultSimultaneously.pm", + "version" : "2.1405" + }, + "Moose::Exception::CircularReferenceInAlso" : { + "file" : "lib/Moose/Exception/CircularReferenceInAlso.pm", + "version" : "2.1405" + }, + "Moose::Exception::ClassDoesNotHaveInitMeta" : { + "file" : "lib/Moose/Exception/ClassDoesNotHaveInitMeta.pm", + "version" : "2.1405" + }, + "Moose::Exception::ClassDoesTheExcludedRole" : { + "file" : "lib/Moose/Exception/ClassDoesTheExcludedRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::ClassNamesDoNotMatch" : { + "file" : "lib/Moose/Exception/ClassNamesDoNotMatch.pm", + "version" : "2.1405" + }, + "Moose::Exception::CloneObjectExpectsAnInstanceOfMetaclass" : { + "file" : "lib/Moose/Exception/CloneObjectExpectsAnInstanceOfMetaclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::CodeBlockMustBeACodeRef" : { + "file" : "lib/Moose/Exception/CodeBlockMustBeACodeRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::CoercingWithoutCoercions" : { + "file" : "lib/Moose/Exception/CoercingWithoutCoercions.pm", + "version" : "2.1405" + }, + "Moose::Exception::CoercionAlreadyExists" : { + "file" : "lib/Moose/Exception/CoercionAlreadyExists.pm", + "version" : "2.1405" + }, + "Moose::Exception::CoercionNeedsTypeConstraint" : { + "file" : "lib/Moose/Exception/CoercionNeedsTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::ConflictDetectedInCheckRoleExclusions" : { + "file" : "lib/Moose/Exception/ConflictDetectedInCheckRoleExclusions.pm", + "version" : "2.1405" + }, + "Moose::Exception::ConflictDetectedInCheckRoleExclusionsInToClass" : { + "file" : "lib/Moose/Exception/ConflictDetectedInCheckRoleExclusionsInToClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::ConstructClassInstanceTakesPackageName" : { + "file" : "lib/Moose/Exception/ConstructClassInstanceTakesPackageName.pm", + "version" : "2.1405" + }, + "Moose::Exception::CouldNotCreateMethod" : { + "file" : "lib/Moose/Exception/CouldNotCreateMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::CouldNotCreateWriter" : { + "file" : "lib/Moose/Exception/CouldNotCreateWriter.pm", + "version" : "2.1405" + }, + "Moose::Exception::CouldNotEvalConstructor" : { + "file" : "lib/Moose/Exception/CouldNotEvalConstructor.pm", + "version" : "2.1405" + }, + "Moose::Exception::CouldNotEvalDestructor" : { + "file" : "lib/Moose/Exception/CouldNotEvalDestructor.pm", + "version" : "2.1405" + }, + "Moose::Exception::CouldNotFindTypeConstraintToCoerceFrom" : { + "file" : "lib/Moose/Exception/CouldNotFindTypeConstraintToCoerceFrom.pm", + "version" : "2.1405" + }, + "Moose::Exception::CouldNotGenerateInlineAttributeMethod" : { + "file" : "lib/Moose/Exception/CouldNotGenerateInlineAttributeMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::CouldNotLocateTypeConstraintForUnion" : { + "file" : "lib/Moose/Exception/CouldNotLocateTypeConstraintForUnion.pm", + "version" : "2.1405" + }, + "Moose::Exception::CouldNotParseType" : { + "file" : "lib/Moose/Exception/CouldNotParseType.pm", + "version" : "2.1405" + }, + "Moose::Exception::CreateMOPClassTakesArrayRefOfAttributes" : { + "file" : "lib/Moose/Exception/CreateMOPClassTakesArrayRefOfAttributes.pm", + "version" : "2.1405" + }, + "Moose::Exception::CreateMOPClassTakesArrayRefOfSuperclasses" : { + "file" : "lib/Moose/Exception/CreateMOPClassTakesArrayRefOfSuperclasses.pm", + "version" : "2.1405" + }, + "Moose::Exception::CreateMOPClassTakesHashRefOfMethods" : { + "file" : "lib/Moose/Exception/CreateMOPClassTakesHashRefOfMethods.pm", + "version" : "2.1405" + }, + "Moose::Exception::CreateTakesArrayRefOfRoles" : { + "file" : "lib/Moose/Exception/CreateTakesArrayRefOfRoles.pm", + "version" : "2.1405" + }, + "Moose::Exception::CreateTakesHashRefOfAttributes" : { + "file" : "lib/Moose/Exception/CreateTakesHashRefOfAttributes.pm", + "version" : "2.1405" + }, + "Moose::Exception::CreateTakesHashRefOfMethods" : { + "file" : "lib/Moose/Exception/CreateTakesHashRefOfMethods.pm", + "version" : "2.1405" + }, + "Moose::Exception::DefaultToMatchOnTypeMustBeCodeRef" : { + "file" : "lib/Moose/Exception/DefaultToMatchOnTypeMustBeCodeRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::DelegationToAClassWhichIsNotLoaded" : { + "file" : "lib/Moose/Exception/DelegationToAClassWhichIsNotLoaded.pm", + "version" : "2.1405" + }, + "Moose::Exception::DelegationToARoleWhichIsNotLoaded" : { + "file" : "lib/Moose/Exception/DelegationToARoleWhichIsNotLoaded.pm", + "version" : "2.1405" + }, + "Moose::Exception::DelegationToATypeWhichIsNotAClass" : { + "file" : "lib/Moose/Exception/DelegationToATypeWhichIsNotAClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::DoesRequiresRoleName" : { + "file" : "lib/Moose/Exception/DoesRequiresRoleName.pm", + "version" : "2.1405" + }, + "Moose::Exception::EnumCalledWithAnArrayRefAndAdditionalArgs" : { + "file" : "lib/Moose/Exception/EnumCalledWithAnArrayRefAndAdditionalArgs.pm", + "version" : "2.1405" + }, + "Moose::Exception::EnumValuesMustBeString" : { + "file" : "lib/Moose/Exception/EnumValuesMustBeString.pm", + "version" : "2.1405" + }, + "Moose::Exception::ExtendsMissingArgs" : { + "file" : "lib/Moose/Exception/ExtendsMissingArgs.pm", + "version" : "2.1405" + }, + "Moose::Exception::HandlesMustBeAHashRef" : { + "file" : "lib/Moose/Exception/HandlesMustBeAHashRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::IllegalInheritedOptions" : { + "file" : "lib/Moose/Exception/IllegalInheritedOptions.pm", + "version" : "2.1405" + }, + "Moose::Exception::IllegalMethodTypeToAddMethodModifier" : { + "file" : "lib/Moose/Exception/IllegalMethodTypeToAddMethodModifier.pm", + "version" : "2.1405" + }, + "Moose::Exception::IncompatibleMetaclassOfSuperclass" : { + "file" : "lib/Moose/Exception/IncompatibleMetaclassOfSuperclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::InitMetaRequiresClass" : { + "file" : "lib/Moose/Exception/InitMetaRequiresClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::InitializeTakesUnBlessedPackageName" : { + "file" : "lib/Moose/Exception/InitializeTakesUnBlessedPackageName.pm", + "version" : "2.1405" + }, + "Moose::Exception::InstanceBlessedIntoWrongClass" : { + "file" : "lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::InstanceMustBeABlessedReference" : { + "file" : "lib/Moose/Exception/InstanceMustBeABlessedReference.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidArgPassedToMooseUtilMetaRole" : { + "file" : "lib/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidArgumentToMethod" : { + "file" : "lib/Moose/Exception/InvalidArgumentToMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidArgumentsToTraitAliases" : { + "file" : "lib/Moose/Exception/InvalidArgumentsToTraitAliases.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidBaseTypeGivenToCreateParameterizedTypeConstraint" : { + "file" : "lib/Moose/Exception/InvalidBaseTypeGivenToCreateParameterizedTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidHandleValue" : { + "file" : "lib/Moose/Exception/InvalidHandleValue.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidHasProvidedInARole" : { + "file" : "lib/Moose/Exception/InvalidHasProvidedInARole.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidNameForType" : { + "file" : "lib/Moose/Exception/InvalidNameForType.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidOverloadOperator" : { + "file" : "lib/Moose/Exception/InvalidOverloadOperator.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidRoleApplication" : { + "file" : "lib/Moose/Exception/InvalidRoleApplication.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidTypeConstraint" : { + "file" : "lib/Moose/Exception/InvalidTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidTypeGivenToCreateParameterizedTypeConstraint" : { + "file" : "lib/Moose/Exception/InvalidTypeGivenToCreateParameterizedTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::InvalidValueForIs" : { + "file" : "lib/Moose/Exception/InvalidValueForIs.pm", + "version" : "2.1405" + }, + "Moose::Exception::IsaDoesNotDoTheRole" : { + "file" : "lib/Moose/Exception/IsaDoesNotDoTheRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::IsaLacksDoesMethod" : { + "file" : "lib/Moose/Exception/IsaLacksDoesMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::LazyAttributeNeedsADefault" : { + "file" : "lib/Moose/Exception/LazyAttributeNeedsADefault.pm", + "version" : "2.1405" + }, + "Moose::Exception::Legacy" : { + "file" : "lib/Moose/Exception/Legacy.pm", + "version" : "2.1405" + }, + "Moose::Exception::MOPAttributeNewNeedsAttributeName" : { + "file" : "lib/Moose/Exception/MOPAttributeNewNeedsAttributeName.pm", + "version" : "2.1405" + }, + "Moose::Exception::MatchActionMustBeACodeRef" : { + "file" : "lib/Moose/Exception/MatchActionMustBeACodeRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::MessageParameterMustBeCodeRef" : { + "file" : "lib/Moose/Exception/MessageParameterMustBeCodeRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::MetaclassIsAClassNotASubclassOfGivenMetaclass" : { + "file" : "lib/Moose/Exception/MetaclassIsAClassNotASubclassOfGivenMetaclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::MetaclassIsARoleNotASubclassOfGivenMetaclass" : { + "file" : "lib/Moose/Exception/MetaclassIsARoleNotASubclassOfGivenMetaclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::MetaclassIsNotASubclassOfGivenMetaclass" : { + "file" : "lib/Moose/Exception/MetaclassIsNotASubclassOfGivenMetaclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::MetaclassMustBeASubclassOfMooseMetaClass" : { + "file" : "lib/Moose/Exception/MetaclassMustBeASubclassOfMooseMetaClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::MetaclassMustBeASubclassOfMooseMetaRole" : { + "file" : "lib/Moose/Exception/MetaclassMustBeASubclassOfMooseMetaRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::MetaclassMustBeDerivedFromClassMOPClass" : { + "file" : "lib/Moose/Exception/MetaclassMustBeDerivedFromClassMOPClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::MetaclassNotLoaded" : { + "file" : "lib/Moose/Exception/MetaclassNotLoaded.pm", + "version" : "2.1405" + }, + "Moose::Exception::MetaclassTypeIncompatible" : { + "file" : "lib/Moose/Exception/MetaclassTypeIncompatible.pm", + "version" : "2.1405" + }, + "Moose::Exception::MethodExpectedAMetaclassObject" : { + "file" : "lib/Moose/Exception/MethodExpectedAMetaclassObject.pm", + "version" : "2.1405" + }, + "Moose::Exception::MethodExpectsFewerArgs" : { + "file" : "lib/Moose/Exception/MethodExpectsFewerArgs.pm", + "version" : "2.1405" + }, + "Moose::Exception::MethodExpectsMoreArgs" : { + "file" : "lib/Moose/Exception/MethodExpectsMoreArgs.pm", + "version" : "2.1405" + }, + "Moose::Exception::MethodModifierNeedsMethodName" : { + "file" : "lib/Moose/Exception/MethodModifierNeedsMethodName.pm", + "version" : "2.1405" + }, + "Moose::Exception::MethodNameConflictInRoles" : { + "file" : "lib/Moose/Exception/MethodNameConflictInRoles.pm", + "version" : "2.1405" + }, + "Moose::Exception::MethodNameNotFoundInInheritanceHierarchy" : { + "file" : "lib/Moose/Exception/MethodNameNotFoundInInheritanceHierarchy.pm", + "version" : "2.1405" + }, + "Moose::Exception::MethodNameNotGiven" : { + "file" : "lib/Moose/Exception/MethodNameNotGiven.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustDefineAMethodName" : { + "file" : "lib/Moose/Exception/MustDefineAMethodName.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustDefineAnAttributeName" : { + "file" : "lib/Moose/Exception/MustDefineAnAttributeName.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustDefineAnOverloadOperator" : { + "file" : "lib/Moose/Exception/MustDefineAnOverloadOperator.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustHaveAtLeastOneValueToEnumerate" : { + "file" : "lib/Moose/Exception/MustHaveAtLeastOneValueToEnumerate.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustPassAHashOfOptions" : { + "file" : "lib/Moose/Exception/MustPassAHashOfOptions.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustPassAMooseMetaRoleInstanceOrSubclass" : { + "file" : "lib/Moose/Exception/MustPassAMooseMetaRoleInstanceOrSubclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustPassAPackageNameOrAnExistingClassMOPPackageInstance" : { + "file" : "lib/Moose/Exception/MustPassAPackageNameOrAnExistingClassMOPPackageInstance.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustPassEvenNumberOfArguments" : { + "file" : "lib/Moose/Exception/MustPassEvenNumberOfArguments.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustPassEvenNumberOfAttributeOptions" : { + "file" : "lib/Moose/Exception/MustPassEvenNumberOfAttributeOptions.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustProvideANameForTheAttribute" : { + "file" : "lib/Moose/Exception/MustProvideANameForTheAttribute.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSpecifyAtleastOneMethod" : { + "file" : "lib/Moose/Exception/MustSpecifyAtleastOneMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSpecifyAtleastOneRole" : { + "file" : "lib/Moose/Exception/MustSpecifyAtleastOneRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSpecifyAtleastOneRoleToApplicant" : { + "file" : "lib/Moose/Exception/MustSpecifyAtleastOneRoleToApplicant.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSupplyAClassMOPAttributeInstance" : { + "file" : "lib/Moose/Exception/MustSupplyAClassMOPAttributeInstance.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSupplyADelegateToMethod" : { + "file" : "lib/Moose/Exception/MustSupplyADelegateToMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSupplyAMetaclass" : { + "file" : "lib/Moose/Exception/MustSupplyAMetaclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSupplyAMooseMetaAttributeInstance" : { + "file" : "lib/Moose/Exception/MustSupplyAMooseMetaAttributeInstance.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSupplyAnAccessorTypeToConstructWith" : { + "file" : "lib/Moose/Exception/MustSupplyAnAccessorTypeToConstructWith.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSupplyAnAttributeToConstructWith" : { + "file" : "lib/Moose/Exception/MustSupplyAnAttributeToConstructWith.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSupplyArrayRefAsCurriedArguments" : { + "file" : "lib/Moose/Exception/MustSupplyArrayRefAsCurriedArguments.pm", + "version" : "2.1405" + }, + "Moose::Exception::MustSupplyPackageNameAndName" : { + "file" : "lib/Moose/Exception/MustSupplyPackageNameAndName.pm", + "version" : "2.1405" + }, + "Moose::Exception::NeedsTypeConstraintUnionForTypeCoercionUnion" : { + "file" : "lib/Moose/Exception/NeedsTypeConstraintUnionForTypeCoercionUnion.pm", + "version" : "2.1405" + }, + "Moose::Exception::NeitherAttributeNorAttributeNameIsGiven" : { + "file" : "lib/Moose/Exception/NeitherAttributeNorAttributeNameIsGiven.pm", + "version" : "2.1405" + }, + "Moose::Exception::NeitherClassNorClassNameIsGiven" : { + "file" : "lib/Moose/Exception/NeitherClassNorClassNameIsGiven.pm", + "version" : "2.1405" + }, + "Moose::Exception::NeitherRoleNorRoleNameIsGiven" : { + "file" : "lib/Moose/Exception/NeitherRoleNorRoleNameIsGiven.pm", + "version" : "2.1405" + }, + "Moose::Exception::NeitherTypeNorTypeNameIsGiven" : { + "file" : "lib/Moose/Exception/NeitherTypeNorTypeNameIsGiven.pm", + "version" : "2.1405" + }, + "Moose::Exception::NoAttributeFoundInSuperClass" : { + "file" : "lib/Moose/Exception/NoAttributeFoundInSuperClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::NoBodyToInitializeInAnAbstractBaseClass" : { + "file" : "lib/Moose/Exception/NoBodyToInitializeInAnAbstractBaseClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::NoCasesMatched" : { + "file" : "lib/Moose/Exception/NoCasesMatched.pm", + "version" : "2.1405" + }, + "Moose::Exception::NoConstraintCheckForTypeConstraint" : { + "file" : "lib/Moose/Exception/NoConstraintCheckForTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::NoDestructorClassSpecified" : { + "file" : "lib/Moose/Exception/NoDestructorClassSpecified.pm", + "version" : "2.1405" + }, + "Moose::Exception::NoImmutableTraitSpecifiedForClass" : { + "file" : "lib/Moose/Exception/NoImmutableTraitSpecifiedForClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::NoParentGivenToSubtype" : { + "file" : "lib/Moose/Exception/NoParentGivenToSubtype.pm", + "version" : "2.1405" + }, + "Moose::Exception::OnlyInstancesCanBeCloned" : { + "file" : "lib/Moose/Exception/OnlyInstancesCanBeCloned.pm", + "version" : "2.1405" + }, + "Moose::Exception::OperatorIsRequired" : { + "file" : "lib/Moose/Exception/OperatorIsRequired.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverloadConflictInSummation" : { + "file" : "lib/Moose/Exception/OverloadConflictInSummation.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverloadRequiresAMetaClass" : { + "file" : "lib/Moose/Exception/OverloadRequiresAMetaClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverloadRequiresAMetaMethod" : { + "file" : "lib/Moose/Exception/OverloadRequiresAMetaMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverloadRequiresAMetaOverload" : { + "file" : "lib/Moose/Exception/OverloadRequiresAMetaOverload.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverloadRequiresAMethodNameOrCoderef" : { + "file" : "lib/Moose/Exception/OverloadRequiresAMethodNameOrCoderef.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverloadRequiresAnOperator" : { + "file" : "lib/Moose/Exception/OverloadRequiresAnOperator.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverloadRequiresNamesForCoderef" : { + "file" : "lib/Moose/Exception/OverloadRequiresNamesForCoderef.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverrideConflictInComposition" : { + "file" : "lib/Moose/Exception/OverrideConflictInComposition.pm", + "version" : "2.1405" + }, + "Moose::Exception::OverrideConflictInSummation" : { + "file" : "lib/Moose/Exception/OverrideConflictInSummation.pm", + "version" : "2.1405" + }, + "Moose::Exception::PackageDoesNotUseMooseExporter" : { + "file" : "lib/Moose/Exception/PackageDoesNotUseMooseExporter.pm", + "version" : "2.1405" + }, + "Moose::Exception::PackageNameAndNameParamsNotGivenToWrap" : { + "file" : "lib/Moose/Exception/PackageNameAndNameParamsNotGivenToWrap.pm", + "version" : "2.1405" + }, + "Moose::Exception::PackagesAndModulesAreNotCachable" : { + "file" : "lib/Moose/Exception/PackagesAndModulesAreNotCachable.pm", + "version" : "2.1405" + }, + "Moose::Exception::ParameterIsNotSubtypeOfParent" : { + "file" : "lib/Moose/Exception/ParameterIsNotSubtypeOfParent.pm", + "version" : "2.1405" + }, + "Moose::Exception::ReferencesAreNotAllowedAsDefault" : { + "file" : "lib/Moose/Exception/ReferencesAreNotAllowedAsDefault.pm", + "version" : "2.1405" + }, + "Moose::Exception::RequiredAttributeLacksInitialization" : { + "file" : "lib/Moose/Exception/RequiredAttributeLacksInitialization.pm", + "version" : "2.1405" + }, + "Moose::Exception::RequiredAttributeNeedsADefault" : { + "file" : "lib/Moose/Exception/RequiredAttributeNeedsADefault.pm", + "version" : "2.1405" + }, + "Moose::Exception::RequiredMethodsImportedByClass" : { + "file" : "lib/Moose/Exception/RequiredMethodsImportedByClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::RequiredMethodsNotImplementedByClass" : { + "file" : "lib/Moose/Exception/RequiredMethodsNotImplementedByClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::Attribute" : { + "file" : "lib/Moose/Exception/Role/Attribute.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::AttributeName" : { + "file" : "lib/Moose/Exception/Role/AttributeName.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::Class" : { + "file" : "lib/Moose/Exception/Role/Class.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::EitherAttributeOrAttributeName" : { + "file" : "lib/Moose/Exception/Role/EitherAttributeOrAttributeName.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::Instance" : { + "file" : "lib/Moose/Exception/Role/Instance.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::InstanceClass" : { + "file" : "lib/Moose/Exception/Role/InstanceClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::InvalidAttributeOptions" : { + "file" : "lib/Moose/Exception/Role/InvalidAttributeOptions.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::Method" : { + "file" : "lib/Moose/Exception/Role/Method.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::ParamsHash" : { + "file" : "lib/Moose/Exception/Role/ParamsHash.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::Role" : { + "file" : "lib/Moose/Exception/Role/Role.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::RoleForCreate" : { + "file" : "lib/Moose/Exception/Role/RoleForCreate.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::RoleForCreateMOPClass" : { + "file" : "lib/Moose/Exception/Role/RoleForCreateMOPClass.pm", + "version" : "2.1405" + }, + "Moose::Exception::Role::TypeConstraint" : { + "file" : "lib/Moose/Exception/Role/TypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::RoleDoesTheExcludedRole" : { + "file" : "lib/Moose/Exception/RoleDoesTheExcludedRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::RoleExclusionConflict" : { + "file" : "lib/Moose/Exception/RoleExclusionConflict.pm", + "version" : "2.1405" + }, + "Moose::Exception::RoleNameRequired" : { + "file" : "lib/Moose/Exception/RoleNameRequired.pm", + "version" : "2.1405" + }, + "Moose::Exception::RoleNameRequiredForMooseMetaRole" : { + "file" : "lib/Moose/Exception/RoleNameRequiredForMooseMetaRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::RolesDoNotSupportAugment" : { + "file" : "lib/Moose/Exception/RolesDoNotSupportAugment.pm", + "version" : "2.1405" + }, + "Moose::Exception::RolesDoNotSupportExtends" : { + "file" : "lib/Moose/Exception/RolesDoNotSupportExtends.pm", + "version" : "2.1405" + }, + "Moose::Exception::RolesDoNotSupportInner" : { + "file" : "lib/Moose/Exception/RolesDoNotSupportInner.pm", + "version" : "2.1405" + }, + "Moose::Exception::RolesDoNotSupportRegexReferencesForMethodModifiers" : { + "file" : "lib/Moose/Exception/RolesDoNotSupportRegexReferencesForMethodModifiers.pm", + "version" : "2.1405" + }, + "Moose::Exception::RolesInCreateTakesAnArrayRef" : { + "file" : "lib/Moose/Exception/RolesInCreateTakesAnArrayRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::RolesListMustBeInstancesOfMooseMetaRole" : { + "file" : "lib/Moose/Exception/RolesListMustBeInstancesOfMooseMetaRole.pm", + "version" : "2.1405" + }, + "Moose::Exception::SingleParamsToNewMustBeHashRef" : { + "file" : "lib/Moose/Exception/SingleParamsToNewMustBeHashRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::TriggerMustBeACodeRef" : { + "file" : "lib/Moose/Exception/TriggerMustBeACodeRef.pm", + "version" : "2.1405" + }, + "Moose::Exception::TypeConstraintCannotBeUsedForAParameterizableType" : { + "file" : "lib/Moose/Exception/TypeConstraintCannotBeUsedForAParameterizableType.pm", + "version" : "2.1405" + }, + "Moose::Exception::TypeConstraintIsAlreadyCreated" : { + "file" : "lib/Moose/Exception/TypeConstraintIsAlreadyCreated.pm", + "version" : "2.1405" + }, + "Moose::Exception::TypeParameterMustBeMooseMetaType" : { + "file" : "lib/Moose/Exception/TypeParameterMustBeMooseMetaType.pm", + "version" : "2.1405" + }, + "Moose::Exception::UnableToCanonicalizeHandles" : { + "file" : "lib/Moose/Exception/UnableToCanonicalizeHandles.pm", + "version" : "2.1405" + }, + "Moose::Exception::UnableToCanonicalizeNonRolePackage" : { + "file" : "lib/Moose/Exception/UnableToCanonicalizeNonRolePackage.pm", + "version" : "2.1405" + }, + "Moose::Exception::UnableToRecognizeDelegateMetaclass" : { + "file" : "lib/Moose/Exception/UnableToRecognizeDelegateMetaclass.pm", + "version" : "2.1405" + }, + "Moose::Exception::UndefinedHashKeysPassedToMethod" : { + "file" : "lib/Moose/Exception/UndefinedHashKeysPassedToMethod.pm", + "version" : "2.1405" + }, + "Moose::Exception::UnionCalledWithAnArrayRefAndAdditionalArgs" : { + "file" : "lib/Moose/Exception/UnionCalledWithAnArrayRefAndAdditionalArgs.pm", + "version" : "2.1405" + }, + "Moose::Exception::UnionTakesAtleastTwoTypeNames" : { + "file" : "lib/Moose/Exception/UnionTakesAtleastTwoTypeNames.pm", + "version" : "2.1405" + }, + "Moose::Exception::ValidationFailedForInlineTypeConstraint" : { + "file" : "lib/Moose/Exception/ValidationFailedForInlineTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::ValidationFailedForTypeConstraint" : { + "file" : "lib/Moose/Exception/ValidationFailedForTypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Exception::WrapTakesACodeRefToBless" : { + "file" : "lib/Moose/Exception/WrapTakesACodeRefToBless.pm", + "version" : "2.1405" + }, + "Moose::Exception::WrongTypeConstraintGiven" : { + "file" : "lib/Moose/Exception/WrongTypeConstraintGiven.pm", + "version" : "2.1405" + }, + "Moose::Exporter" : { + "file" : "lib/Moose/Exporter.pm", + "version" : "2.1405" + }, + "Moose::Intro" : { + "file" : "lib/Moose/Intro.pod", + "version" : "2.1405" + }, + "Moose::Manual" : { + "file" : "lib/Moose/Manual.pod", + "version" : "2.1405" + }, + "Moose::Manual::Attributes" : { + "file" : "lib/Moose/Manual/Attributes.pod", + "version" : "2.1405" + }, + "Moose::Manual::BestPractices" : { + "file" : "lib/Moose/Manual/BestPractices.pod", + "version" : "2.1405" + }, + "Moose::Manual::Classes" : { + "file" : "lib/Moose/Manual/Classes.pod", + "version" : "2.1405" + }, + "Moose::Manual::Concepts" : { + "file" : "lib/Moose/Manual/Concepts.pod", + "version" : "2.1405" + }, + "Moose::Manual::Construction" : { + "file" : "lib/Moose/Manual/Construction.pod", + "version" : "2.1405" + }, + "Moose::Manual::Contributing" : { + "file" : "lib/Moose/Manual/Contributing.pod", + "version" : "2.1405" + }, + "Moose::Manual::Delegation" : { + "file" : "lib/Moose/Manual/Delegation.pod", + "version" : "2.1405" + }, + "Moose::Manual::Delta" : { + "file" : "lib/Moose/Manual/Delta.pod", + "version" : "2.1405" + }, + "Moose::Manual::Exceptions" : { + "file" : "lib/Moose/Manual/Exceptions.pod", + "version" : "2.1405" + }, + "Moose::Manual::Exceptions::Manifest" : { + "file" : "lib/Moose/Manual/Exceptions/Manifest.pod", + "version" : "2.1405" + }, + "Moose::Manual::FAQ" : { + "file" : "lib/Moose/Manual/FAQ.pod", + "version" : "2.1405" + }, + "Moose::Manual::MOP" : { + "file" : "lib/Moose/Manual/MOP.pod", + "version" : "2.1405" + }, + "Moose::Manual::MethodModifiers" : { + "file" : "lib/Moose/Manual/MethodModifiers.pod", + "version" : "2.1405" + }, + "Moose::Manual::MooseX" : { + "file" : "lib/Moose/Manual/MooseX.pod", + "version" : "2.1405" + }, + "Moose::Manual::Resources" : { + "file" : "lib/Moose/Manual/Resources.pod", + "version" : "2.1405" + }, + "Moose::Manual::Roles" : { + "file" : "lib/Moose/Manual/Roles.pod", + "version" : "2.1405" + }, + "Moose::Manual::Support" : { + "file" : "lib/Moose/Manual/Support.pod", + "version" : "2.1405" + }, + "Moose::Manual::Types" : { + "file" : "lib/Moose/Manual/Types.pod", + "version" : "2.1405" + }, + "Moose::Manual::Unsweetened" : { + "file" : "lib/Moose/Manual/Unsweetened.pod", + "version" : "2.1405" + }, + "Moose::Meta::Attribute" : { + "file" : "lib/Moose/Meta/Attribute.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Custom::Moose" : { + "file" : "lib/Moose/Meta/Attribute.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Native" : { + "file" : "lib/Moose/Meta/Attribute/Native.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Native::Trait::Array" : { + "file" : "lib/Moose/Meta/Attribute/Native/Trait/Array.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Native::Trait::Bool" : { + "file" : "lib/Moose/Meta/Attribute/Native/Trait/Bool.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Native::Trait::Code" : { + "file" : "lib/Moose/Meta/Attribute/Native/Trait/Code.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Native::Trait::Counter" : { + "file" : "lib/Moose/Meta/Attribute/Native/Trait/Counter.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Native::Trait::Hash" : { + "file" : "lib/Moose/Meta/Attribute/Native/Trait/Hash.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Native::Trait::Number" : { + "file" : "lib/Moose/Meta/Attribute/Native/Trait/Number.pm", + "version" : "2.1405" + }, + "Moose::Meta::Attribute::Native::Trait::String" : { + "file" : "lib/Moose/Meta/Attribute/Native/Trait/String.pm", + "version" : "2.1405" + }, + "Moose::Meta::Class" : { + "file" : "lib/Moose/Meta/Class.pm", + "version" : "2.1405" + }, + "Moose::Meta::Instance" : { + "file" : "lib/Moose/Meta/Instance.pm", + "version" : "2.1405" + }, + "Moose::Meta::Method" : { + "file" : "lib/Moose/Meta/Method.pm", + "version" : "2.1405" + }, + "Moose::Meta::Method::Accessor" : { + "file" : "lib/Moose/Meta/Method/Accessor.pm", + "version" : "2.1405" + }, + "Moose::Meta::Method::Augmented" : { + "file" : "lib/Moose/Meta/Method/Augmented.pm", + "version" : "2.1405" + }, + "Moose::Meta::Method::Constructor" : { + "file" : "lib/Moose/Meta/Method/Constructor.pm", + "version" : "2.1405" + }, + "Moose::Meta::Method::Delegation" : { + "file" : "lib/Moose/Meta/Method/Delegation.pm", + "version" : "2.1405" + }, + "Moose::Meta::Method::Destructor" : { + "file" : "lib/Moose/Meta/Method/Destructor.pm", + "version" : "2.1405" + }, + "Moose::Meta::Method::Meta" : { + "file" : "lib/Moose/Meta/Method/Meta.pm", + "version" : "2.1405" + }, + "Moose::Meta::Method::Overridden" : { + "file" : "lib/Moose/Meta/Method/Overridden.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role" : { + "file" : "lib/Moose/Meta/Role.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Application" : { + "file" : "lib/Moose/Meta/Role/Application.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Application::RoleSummation" : { + "file" : "lib/Moose/Meta/Role/Application/RoleSummation.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Application::ToClass" : { + "file" : "lib/Moose/Meta/Role/Application/ToClass.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Application::ToInstance" : { + "file" : "lib/Moose/Meta/Role/Application/ToInstance.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Application::ToRole" : { + "file" : "lib/Moose/Meta/Role/Application/ToRole.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Attribute" : { + "file" : "lib/Moose/Meta/Role/Attribute.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Composite" : { + "file" : "lib/Moose/Meta/Role/Composite.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Method" : { + "file" : "lib/Moose/Meta/Role/Method.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Method::Conflicting" : { + "file" : "lib/Moose/Meta/Role/Method/Conflicting.pm", + "version" : "2.1405" + }, + "Moose::Meta::Role::Method::Required" : { + "file" : "lib/Moose/Meta/Role/Method/Required.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeCoercion" : { + "file" : "lib/Moose/Meta/TypeCoercion.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeCoercion::Union" : { + "file" : "lib/Moose/Meta/TypeCoercion/Union.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint" : { + "file" : "lib/Moose/Meta/TypeConstraint.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint::Class" : { + "file" : "lib/Moose/Meta/TypeConstraint/Class.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint::DuckType" : { + "file" : "lib/Moose/Meta/TypeConstraint/DuckType.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint::Enum" : { + "file" : "lib/Moose/Meta/TypeConstraint/Enum.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint::Parameterizable" : { + "file" : "lib/Moose/Meta/TypeConstraint/Parameterizable.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint::Parameterized" : { + "file" : "lib/Moose/Meta/TypeConstraint/Parameterized.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint::Registry" : { + "file" : "lib/Moose/Meta/TypeConstraint/Registry.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint::Role" : { + "file" : "lib/Moose/Meta/TypeConstraint/Role.pm", + "version" : "2.1405" + }, + "Moose::Meta::TypeConstraint::Union" : { + "file" : "lib/Moose/Meta/TypeConstraint/Union.pm", + "version" : "2.1405" + }, + "Moose::Object" : { + "file" : "lib/Moose/Object.pm", + "version" : "2.1405" + }, + "Moose::Role" : { + "file" : "lib/Moose/Role.pm", + "version" : "2.1405" + }, + "Moose::Spec::Role" : { + "file" : "lib/Moose/Spec/Role.pod", + "version" : "2.1405" + }, + "Moose::Unsweetened" : { + "file" : "lib/Moose/Unsweetened.pod", + "version" : "2.1405" + }, + "Moose::Util" : { + "file" : "lib/Moose/Util.pm", + "version" : "2.1405" + }, + "Moose::Util::MetaRole" : { + "file" : "lib/Moose/Util/MetaRole.pm", + "version" : "2.1405" + }, + "Moose::Util::TypeConstraints" : { + "file" : "lib/Moose/Util/TypeConstraints.pm", + "version" : "2.1405" + }, + "Test::Moose" : { + "file" : "lib/Test/Moose.pm", + "version" : "2.1405" + }, + "metaclass" : { + "file" : "lib/metaclass.pm", + "version" : "2.1405" + }, + "oose" : { + "file" : "lib/oose.pm", + "version" : "2.1405" + } + }, + "release_status" : "stable", + "resources" : { + "bugtracker" : { + "mailto" : "bug-moose@rt.cpan.org", + "web" : "https://rt.cpan.org/Dist/Display.html?Name=Moose" + }, + "homepage" : "http://moose.perl.org/", + "repository" : { + "type" : "git", + "url" : "git://github.com/moose/Moose.git", + "web" : "https://github.com/moose/Moose" + }, + "x_IRC" : "irc://irc.perl.org/#moose", + "x_MailingList" : "http://lists.perl.org/list/moose.html" + }, + "version" : "2.1405", + "x_Dist_Zilla" : { + "perl" : { + "version" : "5.020002" + }, + "plugins" : [ + { + "class" : "Dist::Zilla::Plugin::EnsurePrereqsInstalled", + "name" : "EnsurePrereqsInstalled", + "version" : "0.008" + }, + { + "class" : "Dist::Zilla::Plugin::Git::GatherDir", + "config" : { + "Dist::Zilla::Plugin::GatherDir" : { + "exclude_filename" : [ + "Makefile.PL", + "LICENSE" + ], + "exclude_match" : [ + "^t/recipes/(?!basics_genome_overloadingsubtypesandcoercion)" + ], + "follow_symlinks" : "0", + "include_dotfiles" : "0", + "prefix" : "", + "prune_directory" : [], + "root" : "." + }, + "Dist::Zilla::Plugin::Git::GatherDir" : { + "include_untracked" : "0" + } + }, + "name" : "Git::GatherDir", + "version" : "2.034" + }, + { + "class" : "Dist::Zilla::Plugin::MetaYAML", + "name" : "MetaYAML", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::MetaJSON", + "name" : "MetaJSON", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::License", + "name" : "License", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::ExecDir", + "name" : "ExecDir", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::ShareDir", + "name" : "ShareDir", + "version" : "5.037" + }, + { + "class" : "inc::MakeMaker", + "config" : { + "Dist::Zilla::Role::TestRunner" : { + "default_jobs" : "9" + } + }, + "name" : "=inc::MakeMaker", + "version" : null + }, + { + "class" : "Dist::Zilla::Plugin::Manifest", + "name" : "Manifest", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::MetaConfig", + "name" : "MetaConfig", + "version" : "5.037" + }, + { + "class" : "inc::SimpleAuthority", + "name" : "=inc::SimpleAuthority", + "version" : null + }, + { + "class" : "Dist::Zilla::Plugin::MetaResources", + "name" : "MetaResources", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FileFinder::ByName", + "name" : "PodModules", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FileFinder::Filter", + "name" : "ModulesSansPod", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FileFinder::Filter", + "name" : "VersionedModules", + "version" : "5.037" + }, + { + "class" : "inc::SimpleProvides", + "name" : "=inc::SimpleProvides", + "version" : null + }, + { + "class" : "Dist::Zilla::Plugin::MetaProvides::Package", + "config" : { + "Dist::Zilla::Plugin::MetaProvides::Package" : { + "finder" : [ + "ModulesSansPod" + ], + "finder_objects" : [ + { + "class" : "Dist::Zilla::Plugin::FileFinder::Filter", + "name" : "ModulesSansPod", + "version" : "5.037" + } + ] + }, + "Dist::Zilla::Role::MetaProvider::Provider" : { + "inherit_missing" : "1", + "inherit_version" : "1", + "meta_noindex" : "1" + } + }, + "name" : "MetaProvides::Package", + "version" : "2.003001" + }, + { + "class" : "Dist::Zilla::Plugin::MetaNoIndex", + "name" : "MetaNoIndex", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Contributors", + "config" : { + "Dist::Zilla::Plugin::Git::Contributors" : { + "include_authors" : "0", + "include_releaser" : "1", + "order_by" : "name", + "paths" : [] + } + }, + "name" : "Git::Contributors", + "version" : "0.011" + }, + { + "class" : "Dist::Zilla::Plugin::SurgicalPodWeaver", + "config" : { + "Dist::Zilla::Plugin::PodWeaver" : { + "finder" : [ + ":InstallModules", + ":ExecFiles" + ], + "plugins" : [ + { + "class" : "Pod::Weaver::Plugin::EnsurePod5", + "name" : "@CorePrep/EnsurePod5", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Plugin::H1Nester", + "name" : "@CorePrep/H1Nester", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Plugin::SingleEncoding", + "name" : "@Default/SingleEncoding", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Name", + "name" : "@Default/Name", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Version", + "name" : "@Default/Version", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Region", + "name" : "@Default/prelude", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Generic", + "name" : "SYNOPSIS", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Generic", + "name" : "DESCRIPTION", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Generic", + "name" : "OVERVIEW", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "ATTRIBUTES", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "METHODS", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Collect", + "name" : "FUNCTIONS", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Leftovers", + "name" : "@Default/Leftovers", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Region", + "name" : "@Default/postlude", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Authors", + "name" : "@Default/Authors", + "version" : "4.011" + }, + { + "class" : "Pod::Weaver::Section::Legal", + "name" : "@Default/Legal", + "version" : "4.011" + } + ] + } + }, + "name" : "SurgicalPodWeaver", + "version" : "0.0023" + }, + { + "class" : "Dist::Zilla::Plugin::RewriteVersion", + "name" : "RewriteVersion", + "version" : "0.009" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Describe", + "name" : "Git::Describe", + "version" : "0.005" + }, + { + "class" : "inc::ExtractInlineTests", + "name" : "=inc::ExtractInlineTests", + "version" : null + }, + { + "class" : "Dist::Zilla::Plugin::PromptIfStale", + "config" : { + "Dist::Zilla::Plugin::PromptIfStale" : { + "check_all_plugins" : "1", + "check_all_prereqs" : "1", + "modules" : [], + "phase" : "release", + "skip" : [] + } + }, + "name" : "PromptIfStale", + "version" : "0.044" + }, + { + "class" : "Dist::Zilla::Plugin::Test::EOL", + "config" : { + "Dist::Zilla::Plugin::Test::EOL" : { + "filename" : "xt/author/eol.t", + "finder" : [ + ":InstallModules", + ":ExecFiles", + ":TestFiles" + ], + "trailing_whitespace" : "1" + } + }, + "name" : "Test::EOL", + "version" : "0.18" + }, + { + "class" : "Dist::Zilla::Plugin::PodSyntaxTests", + "name" : "PodSyntaxTests", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Test::NoTabs", + "config" : { + "Dist::Zilla::Plugin::Test::NoTabs" : { + "filename" : "xt/author/no-tabs.t", + "finder" : [ + ":InstallModules", + ":ExecFiles", + ":TestFiles" + ] + } + }, + "name" : "Test::NoTabs", + "version" : "0.15" + }, + { + "class" : "Dist::Zilla::Plugin::MetaTests", + "name" : "MetaTests", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Kwalitee", + "config" : { + "Dist::Zilla::Plugin::Test::Kwalitee" : { + "filename" : "xt/release/kwalitee.t", + "skiptest" : [ + "use_strict" + ] + } + }, + "name" : "Test::Kwalitee", + "version" : "2.11" + }, + { + "class" : "Dist::Zilla::Plugin::MojibakeTests", + "name" : "MojibakeTests", + "version" : "0.7" + }, + { + "class" : "Dist::Zilla::Plugin::RunExtraTests", + "config" : { + "Dist::Zilla::Role::TestRunner" : { + "default_jobs" : "9" + } + }, + "name" : "RunExtraTests", + "version" : "0.027" + }, + { + "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", + "name" : "Test::ReportPrereqs", + "version" : "0.021" + }, + { + "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", + "name" : "Test::CPAN::Changes", + "version" : "0.009" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Compile", + "config" : { + "Dist::Zilla::Plugin::Test::Compile" : { + "bail_out_on_fail" : "1", + "fail_on_warning" : "author", + "fake_home" : "0", + "filename" : "xt/release/00-compile.t", + "module_finder" : [ + ":InstallModules" + ], + "needs_display" : "0", + "phase" : "develop", + "script_finder" : [ + ":ExecFiles" + ], + "skips" : [ + "^Class::MOP::Attribute$", + "^Class::MOP::Class$", + "^Class::MOP::Method::Accessor$", + "^Class::MOP::Method::Constructor$", + "^Class::MOP::Method::Inlined$", + "^Class::MOP::Method::Wrapped$", + "^Class::MOP::Mixin::HasAttributes$", + "^Class::MOP::Module$", + "^Class::MOP::Package$", + "^Moose::Meta::Attribute$", + "^Moose::Meta::Attribute::Native$", + "^Moose::Meta::Mixin::AttributeCore$", + "^Moose::Meta::Role::Attribute$", + "^Moose::Meta::TypeConstraint::Class$", + "^Moose::Meta::TypeConstraint::DuckType$", + "^Moose::Meta::TypeConstraint::Enum$", + "^Moose::Meta::TypeConstraint::Parameterizable$", + "^Moose::Meta::TypeConstraint::Parameterized$", + "^Moose::Meta::TypeConstraint::Role$", + "^Moose::Meta::TypeConstraint::Union$" + ] + } + }, + "name" : "Test::Compile", + "version" : "2.053" + }, + { + "class" : "inc::CheckReleaseType", + "name" : "=inc::CheckReleaseType", + "version" : null + }, + { + "class" : "Dist::Zilla::Plugin::CheckVersionIncrement", + "name" : "CheckVersionIncrement", + "version" : "0.121750" + }, + { + "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", + "name" : "CheckChangesHasContent", + "version" : "0.008" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "runtime", + "type" : "requires" + } + }, + "name" : "Prereqs", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "test", + "type" : "requires" + } + }, + "name" : "TestRequires", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "configure", + "type" : "requires" + } + }, + "name" : "ConfigureRequires", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", + "name" : "Prereqs::AuthorDeps", + "version" : "0.004" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "develop", + "type" : "requires" + } + }, + "name" : "DevelopRequires", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "runtime", + "type" : "suggests" + } + }, + "name" : "RuntimeSuggests", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Conflicts", + "name" : "Conflicts", + "version" : "0.17" + }, + { + "class" : "Dist::Zilla::Plugin::Test::CheckBreaks", + "config" : { + "Dist::Zilla::Plugin::Test::CheckBreaks" : { + "conflicts_module" : "Moose::Conflicts" + }, + "Dist::Zilla::Role::ModuleMetadata" : { + "Module::Metadata" : "1.000026", + "version" : "0.002" + } + }, + "name" : "Test::CheckBreaks", + "version" : "0.012" + }, + { + "class" : "inc::CheckAuthorDeps", + "name" : "=inc::CheckAuthorDeps", + "version" : null + }, + { + "class" : "inc::CheckDelta", + "name" : "=inc::CheckDelta", + "version" : null + }, + { + "class" : "inc::GitUpToDate", + "name" : "=inc::GitUpToDate", + "version" : null + }, + { + "class" : "Dist::Zilla::Plugin::Git::Remote::Check", + "name" : "Git::Remote::Check", + "version" : "0.1.2" + }, + { + "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", + "config" : { + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "Git::CheckFor::CorrectBranch", + "version" : "0.013" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Check", + "config" : { + "Dist::Zilla::Plugin::Git::Check" : { + "untracked_files" : "die" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [], + "allow_dirty_match" : [], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "Git::Check", + "version" : "2.034" + }, + { + "class" : "Dist::Zilla::Plugin::TestRelease", + "name" : "TestRelease", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::UploadToCPAN", + "name" : "UploadToCPAN", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", + "config" : { + "Dist::Zilla::Plugin::CopyFilesFromRelease" : { + "filename" : [ + "Changes", + "LICENSE" + ], + "match" : [] + } + }, + "name" : "CopyFilesFromRelease", + "version" : "0.005" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Commit", + "config" : { + "Dist::Zilla::Plugin::Git::Commit" : { + "add_files_in" : [], + "commit_msg" : "%N-%v%t%n%n%c", + "time_zone" : "local" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [ + "Changes", + "LICENSE" + ], + "allow_dirty_match" : [], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "release snapshot", + "version" : "2.034" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Tag", + "config" : { + "Dist::Zilla::Plugin::Git::Tag" : { + "branch" : null, + "signed" : 0, + "tag" : "2.1405", + "tag_format" : "%v", + "tag_message" : "%v%t", + "time_zone" : "local" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "Git::Tag", + "version" : "2.034" + }, + { + "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease", + "name" : "BumpVersionAfterRelease", + "version" : "0.009" + }, + { + "class" : "Dist::Zilla::Plugin::NextRelease", + "name" : "NextRelease", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Commit", + "config" : { + "Dist::Zilla::Plugin::Git::Commit" : { + "add_files_in" : [], + "commit_msg" : "increment version after release", + "time_zone" : "local" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [ + "Changes" + ], + "allow_dirty_match" : [ + "(?^u:^lib/.*\\.pm$)" + ], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "increment version", + "version" : "2.034" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Push", + "config" : { + "Dist::Zilla::Plugin::Git::Push" : { + "push_to" : [ + "origin" + ], + "remotes_must_exist" : 1 + }, + "Dist::Zilla::Role::Git::Repo" : { + "repo_root" : "." + } + }, + "name" : "Git::Push", + "version" : "2.034" + }, + { + "class" : "Dist::Zilla::Plugin::Run::AfterRelease", + "config" : { + "Dist::Zilla::Plugin::Run::Role::Runner" : { + "fatal_errors" : 1, + "quiet" : 0, + "run" : [ + "git checkout master", + "git merge --ff-only stable/2.14", + "git push" + ] + } + }, + "name" : "Run::AfterRelease", + "version" : "0.038" + }, + { + "class" : "inc::GenerateDocs", + "name" : "=inc::GenerateDocs", + "version" : null + }, + { + "class" : "inc::Clean", + "name" : "=inc::Clean", + "version" : null + }, + { + "class" : "Dist::Zilla::Plugin::ConfirmRelease", + "name" : "ConfirmRelease", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":InstallModules", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":IncModules", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":TestFiles", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":ExecFiles", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":ShareFiles", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":MainModule", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":AllFiles", + "version" : "5.037" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":NoFiles", + "version" : "5.037" + } + ], + "zilla" : { + "class" : "Dist::Zilla::Dist::Builder", + "config" : { + "is_trial" : "0" + }, + "version" : "5.037" + } + }, + "x_authority" : "cpan:STEVAN", + "x_breaks" : { + "Catalyst" : "<= 5.90049999", + "Config::MVP" : "<= 2.200004", + "Devel::REPL" : "<= 1.003020", + "Dist::Zilla::Plugin::Git" : "<= 2.016", + "Fey" : "<= 0.36", + "Fey::ORM" : "<= 0.42", + "File::ChangeNotify" : "<= 0.15", + "HTTP::Throwable" : "<= 0.017", + "KiokuDB" : "<= 0.51", + "Markdent" : "<= 0.16", + "Mason" : "<= 2.18", + "MooseX::ABC" : "<= 0.05", + "MooseX::Aliases" : "<= 0.08", + "MooseX::AlwaysCoerce" : "<= 0.13", + "MooseX::App" : "<= 1.22", + "MooseX::Attribute::Deflator" : "<= 2.1.7", + "MooseX::Attribute::Dependent" : "<= 1.1.0", + "MooseX::Attribute::Prototype" : "<= 0.10", + "MooseX::AttributeHelpers" : "<= 0.22", + "MooseX::AttributeIndexes" : "<= 1.0.0", + "MooseX::AttributeInflate" : "<= 0.02", + "MooseX::CascadeClearing" : "<= 0.03", + "MooseX::ClassAttribute" : "<= 0.26", + "MooseX::Constructor::AllErrors" : "<= 0.021", + "MooseX::Declare" : "<= 0.35", + "MooseX::FollowPBP" : "<= 0.02", + "MooseX::Getopt" : "<= 0.56", + "MooseX::InstanceTracking" : "<= 0.04", + "MooseX::LazyRequire" : "<= 0.06", + "MooseX::Meta::Attribute::Index" : "<= 0.04", + "MooseX::Meta::Attribute::Lvalue" : "<= 0.05", + "MooseX::Method::Signatures" : "<= 0.44", + "MooseX::MethodAttributes" : "<= 0.22", + "MooseX::NonMoose" : "<= 0.24", + "MooseX::Object::Pluggable" : "<= 0.0011", + "MooseX::POE" : "<= 0.214", + "MooseX::Params::Validate" : "<= 0.05", + "MooseX::PrivateSetters" : "<= 0.03", + "MooseX::Role::Cmd" : "<= 0.06", + "MooseX::Role::Parameterized" : "<= 1.00", + "MooseX::Role::WithOverloading" : "<= 0.14", + "MooseX::Runnable" : "<= 0.03", + "MooseX::Scaffold" : "<= 0.05", + "MooseX::SemiAffordanceAccessor" : "<= 0.05", + "MooseX::SetOnce" : "<= 0.100473", + "MooseX::Singleton" : "<= 0.25", + "MooseX::SlurpyConstructor" : "<= 1.1", + "MooseX::Storage" : "<= 0.42", + "MooseX::StrictConstructor" : "<= 0.12", + "MooseX::Traits" : "<= 0.11", + "MooseX::Types" : "<= 0.19", + "MooseX::Types::Parameterizable" : "<= 0.05", + "MooseX::Types::Set::Object" : "<= 0.03", + "MooseX::Types::Signal" : "<= 1.101930", + "MooseX::UndefTolerant" : "<= 0.11", + "PRANG" : "<= 0.14", + "Pod::Elemental" : "<= 0.093280", + "Pod::Weaver" : "<= 3.101638", + "Reaction" : "<= 0.002003", + "Test::Able" : "<= 0.10", + "Test::CleanNamespaces" : "<= 0.03", + "Test::Moose::More" : "<= 0.022", + "Test::TempDir" : "<= 0.05", + "Throwable" : "<= 0.102080", + "namespace::autoclean" : "<= 0.08" + }, + "x_contributors" : [ + "Aankhen ", + "Adam J. Foxson ", + "Adam Kennedy ", + "Ævar Arnfjörð Bjarmason ", + "Anders Nor Berle ", + "Ansgar Burchardt ", + "Aran Clary Deltac ", + "Ash Berlin ", + "A. Sinan Unur ", + "Brad Bowman ", + "Brendan Byrd ", + "Brian Manning ", + "Chad Granum ", + "Chankey Pathak ", + "Chia-liang Kao ", + "Chip ", + "Christian Hansen ", + "Christopher J. Madsen ", + "Chris Weyl ", + "chromatic ", + "Cory Watson ", + "Curtis Jewell ", + "Dagfinn Ilmari Mannsåker ", + "Daisuke Maki (lestrrat) ", + "Dan Dascalescu ", + "Dann ", + "Dave Romano ", + "David Leadbeater ", + "David Steinbrunner ", + "Dylan William Hardison ", + "Eric Wilhelm ", + "Evan Carroll ", + "franck cuny ", + "Frew Schmidt ", + "Gerda Shank ", + "gfx ", + "Graham Knop ", + "gregor herrmann ", + "Guillermo Roditi ", + "hakim ", + "Henry Van Styn ", + "James Marca ", + "Jason May ", + "Jay Allen ", + "Jay Hannah ", + "Jay Kuri ", + "Jeff Bisbee ", + "Jesse Vincent ", + "Jess Robinson ", + "joel ", + "John Douglas Porter ", + "John Goulah ", + "John Napiorkowski ", + "Jonathan Rockway ", + "Justin DeVuyst ", + "Justin Hunter ", + "Kent Fredric ", + "Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 ", + "Leon Brocard ", + "Marcel Grünauer ", + "Marc Mims ", + "Marcus Ramberg ", + "Mark Allen ", + "Mark A. Stratman ", + "Mark Fowler ", + "Mateu X Hunter ", + "Matthew Horsfall ", + "matthof ", + "Matt Kraai ", + "Michael LaGrasta ", + "Michael Rykov ", + "Michael Schout ", + "Mike Whitaker ", + "Moritz Onken ", + "Nathan Gray ", + "Nelo Onyiah ", + "Nick Perez ", + "Olaf Alders ", + "Olivier Mengué ", + "Olof Johansson ", + "Patrick Donelan ", + "Paul Driver ", + "Paul Jamieson Fenwick ", + "Paweł Murias ", + "Pedro Melo ", + "Perlover ", + "Peter Shangov ", + "Philippe Bruhat (BooK) ", + "Phillip Smith ", + "Piotr Roszatycki ", + "pktm ", + "Rafael Kitover ", + "Ricardo Signes ", + "Robert Boone ", + "Robert Buels ", + "Robert 'phaylon' Sedlacek ", + "Robin V ", + "rodrigolive ", + "Sam Vilain ", + "Scott McWhirter ", + "shelling ", + "Shlomi Fish ", + "Stefan O'Rear ", + "Thomas Sibley ", + "Todd Hepler ", + "Tokuhiro Matsuno ", + "Tomas Doran ", + "Tuomas Jormola ", + "Upasana Shukla ", + "Wallace Reis ", + "wickline ", + "Zachary Lome ", + "Zoffix Znet " + ] +} + diff --git a/META.yml b/META.yml new file mode 100644 index 0000000..d3e72a7 --- /dev/null +++ b/META.yml @@ -0,0 +1,1879 @@ +--- +abstract: 'A postmodern object system for Perl 5' +author: + - 'Stevan Little ' + - 'Dave Rolsky ' + - 'Jesse Luehrs ' + - 'Shawn M Moore ' + - "יובל קוג'מן (Yuval Kogman) " + - 'Karen Etheridge ' + - 'Florian Ragwitz ' + - 'Hans Dieter Pearcey ' + - 'Chris Prather ' + - 'Matt S Trout ' +build_requires: + CPAN::Meta::Check: '0.007' + CPAN::Meta::Requirements: '0' + ExtUtils::MakeMaker: '0' + File::Spec: '0' + Test::CleanNamespaces: '0.13' + Test::Fatal: '0.001' + Test::More: '0.88' + Test::Requires: '0.05' + Test::Warnings: '0.016' +configure_requires: + Dist::CheckConflicts: '0.02' + ExtUtils::CBuilder: '0.27' + ExtUtils::MakeMaker: '0' + File::Spec: '0' +dynamic_config: 0 +generated_by: 'Dist::Zilla version 5.037, CPAN::Meta::Converter version 2.150001' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: Moose +no_index: + directory: + - author + - benchmarks + - doc + - inc + namespace: + - Class::MOP::Mixin + - Moose::Meta::Method::Accessor::Native + - Moose::Meta::Mixin + package: + - Class::MOP::Class::Immutable::Trait + - Class::MOP::Deprecated + - Class::MOP::MiniTrait + - Class::MOP::Mixin + - Moose::Deprecated + - Moose::Meta::Attribute::Native::Trait + - Moose::Meta::Class::Immutable::Trait + - Moose::Meta::Method::Accessor::Native + - Moose::Meta::Object::Trait + - Moose::Util::TypeConstraints::Builtins +provides: + Class::MOP: + file: lib/Class/MOP.pm + version: '2.1405' + Class::MOP::Attribute: + file: lib/Class/MOP/Attribute.pm + version: '2.1405' + Class::MOP::Class: + file: lib/Class/MOP/Class.pm + version: '2.1405' + Class::MOP::Instance: + file: lib/Class/MOP/Instance.pm + version: '2.1405' + Class::MOP::Method: + file: lib/Class/MOP/Method.pm + version: '2.1405' + Class::MOP::Method::Accessor: + file: lib/Class/MOP/Method/Accessor.pm + version: '2.1405' + Class::MOP::Method::Constructor: + file: lib/Class/MOP/Method/Constructor.pm + version: '2.1405' + Class::MOP::Method::Generated: + file: lib/Class/MOP/Method/Generated.pm + version: '2.1405' + Class::MOP::Method::Inlined: + file: lib/Class/MOP/Method/Inlined.pm + version: '2.1405' + Class::MOP::Method::Meta: + file: lib/Class/MOP/Method/Meta.pm + version: '2.1405' + Class::MOP::Method::Wrapped: + file: lib/Class/MOP/Method/Wrapped.pm + version: '2.1405' + Class::MOP::Module: + file: lib/Class/MOP/Module.pm + version: '2.1405' + Class::MOP::Object: + file: lib/Class/MOP/Object.pm + version: '2.1405' + Class::MOP::Overload: + file: lib/Class/MOP/Overload.pm + version: '2.1405' + Class::MOP::Package: + file: lib/Class/MOP/Package.pm + version: '2.1405' + Moose: + file: lib/Moose.pm + version: '2.1405' + Moose::Cookbook: + file: lib/Moose/Cookbook.pod + version: '2.1405' + Moose::Cookbook::Basics::BankAccount_MethodModifiersAndSubclassing: + file: lib/Moose/Cookbook/Basics/BankAccount_MethodModifiersAndSubclassing.pod + version: '2.1405' + Moose::Cookbook::Basics::BinaryTree_AttributeFeatures: + file: lib/Moose/Cookbook/Basics/BinaryTree_AttributeFeatures.pod + version: '2.1405' + Moose::Cookbook::Basics::BinaryTree_BuilderAndLazyBuild: + file: lib/Moose/Cookbook/Basics/BinaryTree_BuilderAndLazyBuild.pod + version: '2.1405' + Moose::Cookbook::Basics::Company_Subtypes: + file: lib/Moose/Cookbook/Basics/Company_Subtypes.pod + version: '2.1405' + Moose::Cookbook::Basics::DateTime_ExtendingNonMooseParent: + file: lib/Moose/Cookbook/Basics/DateTime_ExtendingNonMooseParent.pod + version: '2.1405' + Moose::Cookbook::Basics::Document_AugmentAndInner: + file: lib/Moose/Cookbook/Basics/Document_AugmentAndInner.pod + version: '2.1405' + Moose::Cookbook::Basics::Genome_OverloadingSubtypesAndCoercion: + file: lib/Moose/Cookbook/Basics/Genome_OverloadingSubtypesAndCoercion.pod + version: '2.1405' + Moose::Cookbook::Basics::HTTP_SubtypesAndCoercion: + file: lib/Moose/Cookbook/Basics/HTTP_SubtypesAndCoercion.pod + version: '2.1405' + Moose::Cookbook::Basics::Immutable: + file: lib/Moose/Cookbook/Basics/Immutable.pod + version: '2.1405' + Moose::Cookbook::Basics::Person_BUILDARGSAndBUILD: + file: lib/Moose/Cookbook/Basics/Person_BUILDARGSAndBUILD.pod + version: '2.1405' + Moose::Cookbook::Basics::Point_AttributesAndSubclassing: + file: lib/Moose/Cookbook/Basics/Point_AttributesAndSubclassing.pod + version: '2.1405' + Moose::Cookbook::Extending::Debugging_BaseClassRole: + file: lib/Moose/Cookbook/Extending/Debugging_BaseClassRole.pod + version: '2.1405' + Moose::Cookbook::Extending::ExtensionOverview: + file: lib/Moose/Cookbook/Extending/ExtensionOverview.pod + version: '2.1405' + Moose::Cookbook::Extending::Mooseish_MooseSugar: + file: lib/Moose/Cookbook/Extending/Mooseish_MooseSugar.pod + version: '2.1405' + Moose::Cookbook::Legacy::Debugging_BaseClassReplacement: + file: lib/Moose/Cookbook/Legacy/Debugging_BaseClassReplacement.pod + version: '2.1405' + Moose::Cookbook::Legacy::Labeled_AttributeMetaclass: + file: lib/Moose/Cookbook/Legacy/Labeled_AttributeMetaclass.pod + version: '2.1405' + Moose::Cookbook::Legacy::Table_ClassMetaclass: + file: lib/Moose/Cookbook/Legacy/Table_ClassMetaclass.pod + version: '2.1405' + Moose::Cookbook::Meta::GlobRef_InstanceMetaclass: + file: lib/Moose/Cookbook/Meta/GlobRef_InstanceMetaclass.pod + version: '2.1405' + Moose::Cookbook::Meta::Labeled_AttributeTrait: + file: lib/Moose/Cookbook/Meta/Labeled_AttributeTrait.pod + version: '2.1405' + Moose::Cookbook::Meta::PrivateOrPublic_MethodMetaclass: + file: lib/Moose/Cookbook/Meta/PrivateOrPublic_MethodMetaclass.pod + version: '2.1405' + Moose::Cookbook::Meta::Table_MetaclassTrait: + file: lib/Moose/Cookbook/Meta/Table_MetaclassTrait.pod + version: '2.1405' + Moose::Cookbook::Meta::WhyMeta: + file: lib/Moose/Cookbook/Meta/WhyMeta.pod + version: '2.1405' + Moose::Cookbook::Roles::ApplicationToInstance: + file: lib/Moose/Cookbook/Roles/ApplicationToInstance.pod + version: '2.1405' + Moose::Cookbook::Roles::Comparable_CodeReuse: + file: lib/Moose/Cookbook/Roles/Comparable_CodeReuse.pod + version: '2.1405' + Moose::Cookbook::Roles::Restartable_AdvancedComposition: + file: lib/Moose/Cookbook/Roles/Restartable_AdvancedComposition.pod + version: '2.1405' + Moose::Cookbook::Snack::Keywords: + file: lib/Moose/Cookbook/Snack/Keywords.pod + version: '2.1405' + Moose::Cookbook::Snack::Types: + file: lib/Moose/Cookbook/Snack/Types.pod + version: '2.1405' + Moose::Cookbook::Style: + file: lib/Moose/Cookbook/Style.pod + version: '2.1405' + Moose::Exception: + file: lib/Moose/Exception.pm + version: '2.1405' + Moose::Exception::AccessorMustReadWrite: + file: lib/Moose/Exception/AccessorMustReadWrite.pm + version: '2.1405' + Moose::Exception::AddParameterizableTypeTakesParameterizableType: + file: lib/Moose/Exception/AddParameterizableTypeTakesParameterizableType.pm + version: '2.1405' + Moose::Exception::AddRoleTakesAMooseMetaRoleInstance: + file: lib/Moose/Exception/AddRoleTakesAMooseMetaRoleInstance.pm + version: '2.1405' + Moose::Exception::AddRoleToARoleTakesAMooseMetaRole: + file: lib/Moose/Exception/AddRoleToARoleTakesAMooseMetaRole.pm + version: '2.1405' + Moose::Exception::ApplyTakesABlessedInstance: + file: lib/Moose/Exception/ApplyTakesABlessedInstance.pm + version: '2.1405' + Moose::Exception::AttachToClassNeedsAClassMOPClassInstanceOrASubclass: + file: lib/Moose/Exception/AttachToClassNeedsAClassMOPClassInstanceOrASubclass.pm + version: '2.1405' + Moose::Exception::AttributeConflictInRoles: + file: lib/Moose/Exception/AttributeConflictInRoles.pm + version: '2.1405' + Moose::Exception::AttributeConflictInSummation: + file: lib/Moose/Exception/AttributeConflictInSummation.pm + version: '2.1405' + Moose::Exception::AttributeExtensionIsNotSupportedInRoles: + file: lib/Moose/Exception/AttributeExtensionIsNotSupportedInRoles.pm + version: '2.1405' + Moose::Exception::AttributeIsRequired: + file: lib/Moose/Exception/AttributeIsRequired.pm + version: '2.1405' + Moose::Exception::AttributeMustBeAnClassMOPMixinAttributeCoreOrSubclass: + file: lib/Moose/Exception/AttributeMustBeAnClassMOPMixinAttributeCoreOrSubclass.pm + version: '2.1405' + Moose::Exception::AttributeNamesDoNotMatch: + file: lib/Moose/Exception/AttributeNamesDoNotMatch.pm + version: '2.1405' + Moose::Exception::AttributeValueIsNotAnObject: + file: lib/Moose/Exception/AttributeValueIsNotAnObject.pm + version: '2.1405' + Moose::Exception::AttributeValueIsNotDefined: + file: lib/Moose/Exception/AttributeValueIsNotDefined.pm + version: '2.1405' + Moose::Exception::AutoDeRefNeedsArrayRefOrHashRef: + file: lib/Moose/Exception/AutoDeRefNeedsArrayRefOrHashRef.pm + version: '2.1405' + Moose::Exception::BadOptionFormat: + file: lib/Moose/Exception/BadOptionFormat.pm + version: '2.1405' + Moose::Exception::BothBuilderAndDefaultAreNotAllowed: + file: lib/Moose/Exception/BothBuilderAndDefaultAreNotAllowed.pm + version: '2.1405' + Moose::Exception::BuilderDoesNotExist: + file: lib/Moose/Exception/BuilderDoesNotExist.pm + version: '2.1405' + Moose::Exception::BuilderMethodNotSupportedForAttribute: + file: lib/Moose/Exception/BuilderMethodNotSupportedForAttribute.pm + version: '2.1405' + Moose::Exception::BuilderMethodNotSupportedForInlineAttribute: + file: lib/Moose/Exception/BuilderMethodNotSupportedForInlineAttribute.pm + version: '2.1405' + Moose::Exception::BuilderMustBeAMethodName: + file: lib/Moose/Exception/BuilderMustBeAMethodName.pm + version: '2.1405' + Moose::Exception::CallingMethodOnAnImmutableInstance: + file: lib/Moose/Exception/CallingMethodOnAnImmutableInstance.pm + version: '2.1405' + Moose::Exception::CallingReadOnlyMethodOnAnImmutableInstance: + file: lib/Moose/Exception/CallingReadOnlyMethodOnAnImmutableInstance.pm + version: '2.1405' + Moose::Exception::CanExtendOnlyClasses: + file: lib/Moose/Exception/CanExtendOnlyClasses.pm + version: '2.1405' + Moose::Exception::CanOnlyConsumeRole: + file: lib/Moose/Exception/CanOnlyConsumeRole.pm + version: '2.1405' + Moose::Exception::CanOnlyWrapBlessedCode: + file: lib/Moose/Exception/CanOnlyWrapBlessedCode.pm + version: '2.1405' + Moose::Exception::CanReblessOnlyIntoASubclass: + file: lib/Moose/Exception/CanReblessOnlyIntoASubclass.pm + version: '2.1405' + Moose::Exception::CanReblessOnlyIntoASuperclass: + file: lib/Moose/Exception/CanReblessOnlyIntoASuperclass.pm + version: '2.1405' + Moose::Exception::CannotAddAdditionalTypeCoercionsToUnion: + file: lib/Moose/Exception/CannotAddAdditionalTypeCoercionsToUnion.pm + version: '2.1405' + Moose::Exception::CannotAddAsAnAttributeToARole: + file: lib/Moose/Exception/CannotAddAsAnAttributeToARole.pm + version: '2.1405' + Moose::Exception::CannotApplyBaseClassRolesToRole: + file: lib/Moose/Exception/CannotApplyBaseClassRolesToRole.pm + version: '2.1405' + Moose::Exception::CannotAssignValueToReadOnlyAccessor: + file: lib/Moose/Exception/CannotAssignValueToReadOnlyAccessor.pm + version: '2.1405' + Moose::Exception::CannotAugmentIfLocalMethodPresent: + file: lib/Moose/Exception/CannotAugmentIfLocalMethodPresent.pm + version: '2.1405' + Moose::Exception::CannotAugmentNoSuperMethod: + file: lib/Moose/Exception/CannotAugmentNoSuperMethod.pm + version: '2.1405' + Moose::Exception::CannotAutoDerefWithoutIsa: + file: lib/Moose/Exception/CannotAutoDerefWithoutIsa.pm + version: '2.1405' + Moose::Exception::CannotAutoDereferenceTypeConstraint: + file: lib/Moose/Exception/CannotAutoDereferenceTypeConstraint.pm + version: '2.1405' + Moose::Exception::CannotCalculateNativeType: + file: lib/Moose/Exception/CannotCalculateNativeType.pm + version: '2.1405' + Moose::Exception::CannotCallAnAbstractBaseMethod: + file: lib/Moose/Exception/CannotCallAnAbstractBaseMethod.pm + version: '2.1405' + Moose::Exception::CannotCallAnAbstractMethod: + file: lib/Moose/Exception/CannotCallAnAbstractMethod.pm + version: '2.1405' + Moose::Exception::CannotCoerceAWeakRef: + file: lib/Moose/Exception/CannotCoerceAWeakRef.pm + version: '2.1405' + Moose::Exception::CannotCoerceAttributeWhichHasNoCoercion: + file: lib/Moose/Exception/CannotCoerceAttributeWhichHasNoCoercion.pm + version: '2.1405' + Moose::Exception::CannotCreateHigherOrderTypeWithoutATypeParameter: + file: lib/Moose/Exception/CannotCreateHigherOrderTypeWithoutATypeParameter.pm + version: '2.1405' + Moose::Exception::CannotCreateMethodAliasLocalMethodIsPresent: + file: lib/Moose/Exception/CannotCreateMethodAliasLocalMethodIsPresent.pm + version: '2.1405' + Moose::Exception::CannotCreateMethodAliasLocalMethodIsPresentInClass: + file: lib/Moose/Exception/CannotCreateMethodAliasLocalMethodIsPresentInClass.pm + version: '2.1405' + Moose::Exception::CannotDelegateLocalMethodIsPresent: + file: lib/Moose/Exception/CannotDelegateLocalMethodIsPresent.pm + version: '2.1405' + Moose::Exception::CannotDelegateWithoutIsa: + file: lib/Moose/Exception/CannotDelegateWithoutIsa.pm + version: '2.1405' + Moose::Exception::CannotFindDelegateMetaclass: + file: lib/Moose/Exception/CannotFindDelegateMetaclass.pm + version: '2.1405' + Moose::Exception::CannotFindType: + file: lib/Moose/Exception/CannotFindType.pm + version: '2.1405' + Moose::Exception::CannotFindTypeGivenToMatchOnType: + file: lib/Moose/Exception/CannotFindTypeGivenToMatchOnType.pm + version: '2.1405' + Moose::Exception::CannotFixMetaclassCompatibility: + file: lib/Moose/Exception/CannotFixMetaclassCompatibility.pm + version: '2.1405' + Moose::Exception::CannotGenerateInlineConstraint: + file: lib/Moose/Exception/CannotGenerateInlineConstraint.pm + version: '2.1405' + Moose::Exception::CannotInitializeMooseMetaRoleComposite: + file: lib/Moose/Exception/CannotInitializeMooseMetaRoleComposite.pm + version: '2.1405' + Moose::Exception::CannotInlineTypeConstraintCheck: + file: lib/Moose/Exception/CannotInlineTypeConstraintCheck.pm + version: '2.1405' + Moose::Exception::CannotLocatePackageInINC: + file: lib/Moose/Exception/CannotLocatePackageInINC.pm + version: '2.1405' + Moose::Exception::CannotMakeMetaclassCompatible: + file: lib/Moose/Exception/CannotMakeMetaclassCompatible.pm + version: '2.1405' + Moose::Exception::CannotOverrideALocalMethod: + file: lib/Moose/Exception/CannotOverrideALocalMethod.pm + version: '2.1405' + Moose::Exception::CannotOverrideBodyOfMetaMethods: + file: lib/Moose/Exception/CannotOverrideBodyOfMetaMethods.pm + version: '2.1405' + Moose::Exception::CannotOverrideLocalMethodIsPresent: + file: lib/Moose/Exception/CannotOverrideLocalMethodIsPresent.pm + version: '2.1405' + Moose::Exception::CannotOverrideNoSuperMethod: + file: lib/Moose/Exception/CannotOverrideNoSuperMethod.pm + version: '2.1405' + Moose::Exception::CannotRegisterUnnamedTypeConstraint: + file: lib/Moose/Exception/CannotRegisterUnnamedTypeConstraint.pm + version: '2.1405' + Moose::Exception::CannotUseLazyBuildAndDefaultSimultaneously: + file: lib/Moose/Exception/CannotUseLazyBuildAndDefaultSimultaneously.pm + version: '2.1405' + Moose::Exception::CircularReferenceInAlso: + file: lib/Moose/Exception/CircularReferenceInAlso.pm + version: '2.1405' + Moose::Exception::ClassDoesNotHaveInitMeta: + file: lib/Moose/Exception/ClassDoesNotHaveInitMeta.pm + version: '2.1405' + Moose::Exception::ClassDoesTheExcludedRole: + file: lib/Moose/Exception/ClassDoesTheExcludedRole.pm + version: '2.1405' + Moose::Exception::ClassNamesDoNotMatch: + file: lib/Moose/Exception/ClassNamesDoNotMatch.pm + version: '2.1405' + Moose::Exception::CloneObjectExpectsAnInstanceOfMetaclass: + file: lib/Moose/Exception/CloneObjectExpectsAnInstanceOfMetaclass.pm + version: '2.1405' + Moose::Exception::CodeBlockMustBeACodeRef: + file: lib/Moose/Exception/CodeBlockMustBeACodeRef.pm + version: '2.1405' + Moose::Exception::CoercingWithoutCoercions: + file: lib/Moose/Exception/CoercingWithoutCoercions.pm + version: '2.1405' + Moose::Exception::CoercionAlreadyExists: + file: lib/Moose/Exception/CoercionAlreadyExists.pm + version: '2.1405' + Moose::Exception::CoercionNeedsTypeConstraint: + file: lib/Moose/Exception/CoercionNeedsTypeConstraint.pm + version: '2.1405' + Moose::Exception::ConflictDetectedInCheckRoleExclusions: + file: lib/Moose/Exception/ConflictDetectedInCheckRoleExclusions.pm + version: '2.1405' + Moose::Exception::ConflictDetectedInCheckRoleExclusionsInToClass: + file: lib/Moose/Exception/ConflictDetectedInCheckRoleExclusionsInToClass.pm + version: '2.1405' + Moose::Exception::ConstructClassInstanceTakesPackageName: + file: lib/Moose/Exception/ConstructClassInstanceTakesPackageName.pm + version: '2.1405' + Moose::Exception::CouldNotCreateMethod: + file: lib/Moose/Exception/CouldNotCreateMethod.pm + version: '2.1405' + Moose::Exception::CouldNotCreateWriter: + file: lib/Moose/Exception/CouldNotCreateWriter.pm + version: '2.1405' + Moose::Exception::CouldNotEvalConstructor: + file: lib/Moose/Exception/CouldNotEvalConstructor.pm + version: '2.1405' + Moose::Exception::CouldNotEvalDestructor: + file: lib/Moose/Exception/CouldNotEvalDestructor.pm + version: '2.1405' + Moose::Exception::CouldNotFindTypeConstraintToCoerceFrom: + file: lib/Moose/Exception/CouldNotFindTypeConstraintToCoerceFrom.pm + version: '2.1405' + Moose::Exception::CouldNotGenerateInlineAttributeMethod: + file: lib/Moose/Exception/CouldNotGenerateInlineAttributeMethod.pm + version: '2.1405' + Moose::Exception::CouldNotLocateTypeConstraintForUnion: + file: lib/Moose/Exception/CouldNotLocateTypeConstraintForUnion.pm + version: '2.1405' + Moose::Exception::CouldNotParseType: + file: lib/Moose/Exception/CouldNotParseType.pm + version: '2.1405' + Moose::Exception::CreateMOPClassTakesArrayRefOfAttributes: + file: lib/Moose/Exception/CreateMOPClassTakesArrayRefOfAttributes.pm + version: '2.1405' + Moose::Exception::CreateMOPClassTakesArrayRefOfSuperclasses: + file: lib/Moose/Exception/CreateMOPClassTakesArrayRefOfSuperclasses.pm + version: '2.1405' + Moose::Exception::CreateMOPClassTakesHashRefOfMethods: + file: lib/Moose/Exception/CreateMOPClassTakesHashRefOfMethods.pm + version: '2.1405' + Moose::Exception::CreateTakesArrayRefOfRoles: + file: lib/Moose/Exception/CreateTakesArrayRefOfRoles.pm + version: '2.1405' + Moose::Exception::CreateTakesHashRefOfAttributes: + file: lib/Moose/Exception/CreateTakesHashRefOfAttributes.pm + version: '2.1405' + Moose::Exception::CreateTakesHashRefOfMethods: + file: lib/Moose/Exception/CreateTakesHashRefOfMethods.pm + version: '2.1405' + Moose::Exception::DefaultToMatchOnTypeMustBeCodeRef: + file: lib/Moose/Exception/DefaultToMatchOnTypeMustBeCodeRef.pm + version: '2.1405' + Moose::Exception::DelegationToAClassWhichIsNotLoaded: + file: lib/Moose/Exception/DelegationToAClassWhichIsNotLoaded.pm + version: '2.1405' + Moose::Exception::DelegationToARoleWhichIsNotLoaded: + file: lib/Moose/Exception/DelegationToARoleWhichIsNotLoaded.pm + version: '2.1405' + Moose::Exception::DelegationToATypeWhichIsNotAClass: + file: lib/Moose/Exception/DelegationToATypeWhichIsNotAClass.pm + version: '2.1405' + Moose::Exception::DoesRequiresRoleName: + file: lib/Moose/Exception/DoesRequiresRoleName.pm + version: '2.1405' + Moose::Exception::EnumCalledWithAnArrayRefAndAdditionalArgs: + file: lib/Moose/Exception/EnumCalledWithAnArrayRefAndAdditionalArgs.pm + version: '2.1405' + Moose::Exception::EnumValuesMustBeString: + file: lib/Moose/Exception/EnumValuesMustBeString.pm + version: '2.1405' + Moose::Exception::ExtendsMissingArgs: + file: lib/Moose/Exception/ExtendsMissingArgs.pm + version: '2.1405' + Moose::Exception::HandlesMustBeAHashRef: + file: lib/Moose/Exception/HandlesMustBeAHashRef.pm + version: '2.1405' + Moose::Exception::IllegalInheritedOptions: + file: lib/Moose/Exception/IllegalInheritedOptions.pm + version: '2.1405' + Moose::Exception::IllegalMethodTypeToAddMethodModifier: + file: lib/Moose/Exception/IllegalMethodTypeToAddMethodModifier.pm + version: '2.1405' + Moose::Exception::IncompatibleMetaclassOfSuperclass: + file: lib/Moose/Exception/IncompatibleMetaclassOfSuperclass.pm + version: '2.1405' + Moose::Exception::InitMetaRequiresClass: + file: lib/Moose/Exception/InitMetaRequiresClass.pm + version: '2.1405' + Moose::Exception::InitializeTakesUnBlessedPackageName: + file: lib/Moose/Exception/InitializeTakesUnBlessedPackageName.pm + version: '2.1405' + Moose::Exception::InstanceBlessedIntoWrongClass: + file: lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm + version: '2.1405' + Moose::Exception::InstanceMustBeABlessedReference: + file: lib/Moose/Exception/InstanceMustBeABlessedReference.pm + version: '2.1405' + Moose::Exception::InvalidArgPassedToMooseUtilMetaRole: + file: lib/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm + version: '2.1405' + Moose::Exception::InvalidArgumentToMethod: + file: lib/Moose/Exception/InvalidArgumentToMethod.pm + version: '2.1405' + Moose::Exception::InvalidArgumentsToTraitAliases: + file: lib/Moose/Exception/InvalidArgumentsToTraitAliases.pm + version: '2.1405' + Moose::Exception::InvalidBaseTypeGivenToCreateParameterizedTypeConstraint: + file: lib/Moose/Exception/InvalidBaseTypeGivenToCreateParameterizedTypeConstraint.pm + version: '2.1405' + Moose::Exception::InvalidHandleValue: + file: lib/Moose/Exception/InvalidHandleValue.pm + version: '2.1405' + Moose::Exception::InvalidHasProvidedInARole: + file: lib/Moose/Exception/InvalidHasProvidedInARole.pm + version: '2.1405' + Moose::Exception::InvalidNameForType: + file: lib/Moose/Exception/InvalidNameForType.pm + version: '2.1405' + Moose::Exception::InvalidOverloadOperator: + file: lib/Moose/Exception/InvalidOverloadOperator.pm + version: '2.1405' + Moose::Exception::InvalidRoleApplication: + file: lib/Moose/Exception/InvalidRoleApplication.pm + version: '2.1405' + Moose::Exception::InvalidTypeConstraint: + file: lib/Moose/Exception/InvalidTypeConstraint.pm + version: '2.1405' + Moose::Exception::InvalidTypeGivenToCreateParameterizedTypeConstraint: + file: lib/Moose/Exception/InvalidTypeGivenToCreateParameterizedTypeConstraint.pm + version: '2.1405' + Moose::Exception::InvalidValueForIs: + file: lib/Moose/Exception/InvalidValueForIs.pm + version: '2.1405' + Moose::Exception::IsaDoesNotDoTheRole: + file: lib/Moose/Exception/IsaDoesNotDoTheRole.pm + version: '2.1405' + Moose::Exception::IsaLacksDoesMethod: + file: lib/Moose/Exception/IsaLacksDoesMethod.pm + version: '2.1405' + Moose::Exception::LazyAttributeNeedsADefault: + file: lib/Moose/Exception/LazyAttributeNeedsADefault.pm + version: '2.1405' + Moose::Exception::Legacy: + file: lib/Moose/Exception/Legacy.pm + version: '2.1405' + Moose::Exception::MOPAttributeNewNeedsAttributeName: + file: lib/Moose/Exception/MOPAttributeNewNeedsAttributeName.pm + version: '2.1405' + Moose::Exception::MatchActionMustBeACodeRef: + file: lib/Moose/Exception/MatchActionMustBeACodeRef.pm + version: '2.1405' + Moose::Exception::MessageParameterMustBeCodeRef: + file: lib/Moose/Exception/MessageParameterMustBeCodeRef.pm + version: '2.1405' + Moose::Exception::MetaclassIsAClassNotASubclassOfGivenMetaclass: + file: lib/Moose/Exception/MetaclassIsAClassNotASubclassOfGivenMetaclass.pm + version: '2.1405' + Moose::Exception::MetaclassIsARoleNotASubclassOfGivenMetaclass: + file: lib/Moose/Exception/MetaclassIsARoleNotASubclassOfGivenMetaclass.pm + version: '2.1405' + Moose::Exception::MetaclassIsNotASubclassOfGivenMetaclass: + file: lib/Moose/Exception/MetaclassIsNotASubclassOfGivenMetaclass.pm + version: '2.1405' + Moose::Exception::MetaclassMustBeASubclassOfMooseMetaClass: + file: lib/Moose/Exception/MetaclassMustBeASubclassOfMooseMetaClass.pm + version: '2.1405' + Moose::Exception::MetaclassMustBeASubclassOfMooseMetaRole: + file: lib/Moose/Exception/MetaclassMustBeASubclassOfMooseMetaRole.pm + version: '2.1405' + Moose::Exception::MetaclassMustBeDerivedFromClassMOPClass: + file: lib/Moose/Exception/MetaclassMustBeDerivedFromClassMOPClass.pm + version: '2.1405' + Moose::Exception::MetaclassNotLoaded: + file: lib/Moose/Exception/MetaclassNotLoaded.pm + version: '2.1405' + Moose::Exception::MetaclassTypeIncompatible: + file: lib/Moose/Exception/MetaclassTypeIncompatible.pm + version: '2.1405' + Moose::Exception::MethodExpectedAMetaclassObject: + file: lib/Moose/Exception/MethodExpectedAMetaclassObject.pm + version: '2.1405' + Moose::Exception::MethodExpectsFewerArgs: + file: lib/Moose/Exception/MethodExpectsFewerArgs.pm + version: '2.1405' + Moose::Exception::MethodExpectsMoreArgs: + file: lib/Moose/Exception/MethodExpectsMoreArgs.pm + version: '2.1405' + Moose::Exception::MethodModifierNeedsMethodName: + file: lib/Moose/Exception/MethodModifierNeedsMethodName.pm + version: '2.1405' + Moose::Exception::MethodNameConflictInRoles: + file: lib/Moose/Exception/MethodNameConflictInRoles.pm + version: '2.1405' + Moose::Exception::MethodNameNotFoundInInheritanceHierarchy: + file: lib/Moose/Exception/MethodNameNotFoundInInheritanceHierarchy.pm + version: '2.1405' + Moose::Exception::MethodNameNotGiven: + file: lib/Moose/Exception/MethodNameNotGiven.pm + version: '2.1405' + Moose::Exception::MustDefineAMethodName: + file: lib/Moose/Exception/MustDefineAMethodName.pm + version: '2.1405' + Moose::Exception::MustDefineAnAttributeName: + file: lib/Moose/Exception/MustDefineAnAttributeName.pm + version: '2.1405' + Moose::Exception::MustDefineAnOverloadOperator: + file: lib/Moose/Exception/MustDefineAnOverloadOperator.pm + version: '2.1405' + Moose::Exception::MustHaveAtLeastOneValueToEnumerate: + file: lib/Moose/Exception/MustHaveAtLeastOneValueToEnumerate.pm + version: '2.1405' + Moose::Exception::MustPassAHashOfOptions: + file: lib/Moose/Exception/MustPassAHashOfOptions.pm + version: '2.1405' + Moose::Exception::MustPassAMooseMetaRoleInstanceOrSubclass: + file: lib/Moose/Exception/MustPassAMooseMetaRoleInstanceOrSubclass.pm + version: '2.1405' + Moose::Exception::MustPassAPackageNameOrAnExistingClassMOPPackageInstance: + file: lib/Moose/Exception/MustPassAPackageNameOrAnExistingClassMOPPackageInstance.pm + version: '2.1405' + Moose::Exception::MustPassEvenNumberOfArguments: + file: lib/Moose/Exception/MustPassEvenNumberOfArguments.pm + version: '2.1405' + Moose::Exception::MustPassEvenNumberOfAttributeOptions: + file: lib/Moose/Exception/MustPassEvenNumberOfAttributeOptions.pm + version: '2.1405' + Moose::Exception::MustProvideANameForTheAttribute: + file: lib/Moose/Exception/MustProvideANameForTheAttribute.pm + version: '2.1405' + Moose::Exception::MustSpecifyAtleastOneMethod: + file: lib/Moose/Exception/MustSpecifyAtleastOneMethod.pm + version: '2.1405' + Moose::Exception::MustSpecifyAtleastOneRole: + file: lib/Moose/Exception/MustSpecifyAtleastOneRole.pm + version: '2.1405' + Moose::Exception::MustSpecifyAtleastOneRoleToApplicant: + file: lib/Moose/Exception/MustSpecifyAtleastOneRoleToApplicant.pm + version: '2.1405' + Moose::Exception::MustSupplyAClassMOPAttributeInstance: + file: lib/Moose/Exception/MustSupplyAClassMOPAttributeInstance.pm + version: '2.1405' + Moose::Exception::MustSupplyADelegateToMethod: + file: lib/Moose/Exception/MustSupplyADelegateToMethod.pm + version: '2.1405' + Moose::Exception::MustSupplyAMetaclass: + file: lib/Moose/Exception/MustSupplyAMetaclass.pm + version: '2.1405' + Moose::Exception::MustSupplyAMooseMetaAttributeInstance: + file: lib/Moose/Exception/MustSupplyAMooseMetaAttributeInstance.pm + version: '2.1405' + Moose::Exception::MustSupplyAnAccessorTypeToConstructWith: + file: lib/Moose/Exception/MustSupplyAnAccessorTypeToConstructWith.pm + version: '2.1405' + Moose::Exception::MustSupplyAnAttributeToConstructWith: + file: lib/Moose/Exception/MustSupplyAnAttributeToConstructWith.pm + version: '2.1405' + Moose::Exception::MustSupplyArrayRefAsCurriedArguments: + file: lib/Moose/Exception/MustSupplyArrayRefAsCurriedArguments.pm + version: '2.1405' + Moose::Exception::MustSupplyPackageNameAndName: + file: lib/Moose/Exception/MustSupplyPackageNameAndName.pm + version: '2.1405' + Moose::Exception::NeedsTypeConstraintUnionForTypeCoercionUnion: + file: lib/Moose/Exception/NeedsTypeConstraintUnionForTypeCoercionUnion.pm + version: '2.1405' + Moose::Exception::NeitherAttributeNorAttributeNameIsGiven: + file: lib/Moose/Exception/NeitherAttributeNorAttributeNameIsGiven.pm + version: '2.1405' + Moose::Exception::NeitherClassNorClassNameIsGiven: + file: lib/Moose/Exception/NeitherClassNorClassNameIsGiven.pm + version: '2.1405' + Moose::Exception::NeitherRoleNorRoleNameIsGiven: + file: lib/Moose/Exception/NeitherRoleNorRoleNameIsGiven.pm + version: '2.1405' + Moose::Exception::NeitherTypeNorTypeNameIsGiven: + file: lib/Moose/Exception/NeitherTypeNorTypeNameIsGiven.pm + version: '2.1405' + Moose::Exception::NoAttributeFoundInSuperClass: + file: lib/Moose/Exception/NoAttributeFoundInSuperClass.pm + version: '2.1405' + Moose::Exception::NoBodyToInitializeInAnAbstractBaseClass: + file: lib/Moose/Exception/NoBodyToInitializeInAnAbstractBaseClass.pm + version: '2.1405' + Moose::Exception::NoCasesMatched: + file: lib/Moose/Exception/NoCasesMatched.pm + version: '2.1405' + Moose::Exception::NoConstraintCheckForTypeConstraint: + file: lib/Moose/Exception/NoConstraintCheckForTypeConstraint.pm + version: '2.1405' + Moose::Exception::NoDestructorClassSpecified: + file: lib/Moose/Exception/NoDestructorClassSpecified.pm + version: '2.1405' + Moose::Exception::NoImmutableTraitSpecifiedForClass: + file: lib/Moose/Exception/NoImmutableTraitSpecifiedForClass.pm + version: '2.1405' + Moose::Exception::NoParentGivenToSubtype: + file: lib/Moose/Exception/NoParentGivenToSubtype.pm + version: '2.1405' + Moose::Exception::OnlyInstancesCanBeCloned: + file: lib/Moose/Exception/OnlyInstancesCanBeCloned.pm + version: '2.1405' + Moose::Exception::OperatorIsRequired: + file: lib/Moose/Exception/OperatorIsRequired.pm + version: '2.1405' + Moose::Exception::OverloadConflictInSummation: + file: lib/Moose/Exception/OverloadConflictInSummation.pm + version: '2.1405' + Moose::Exception::OverloadRequiresAMetaClass: + file: lib/Moose/Exception/OverloadRequiresAMetaClass.pm + version: '2.1405' + Moose::Exception::OverloadRequiresAMetaMethod: + file: lib/Moose/Exception/OverloadRequiresAMetaMethod.pm + version: '2.1405' + Moose::Exception::OverloadRequiresAMetaOverload: + file: lib/Moose/Exception/OverloadRequiresAMetaOverload.pm + version: '2.1405' + Moose::Exception::OverloadRequiresAMethodNameOrCoderef: + file: lib/Moose/Exception/OverloadRequiresAMethodNameOrCoderef.pm + version: '2.1405' + Moose::Exception::OverloadRequiresAnOperator: + file: lib/Moose/Exception/OverloadRequiresAnOperator.pm + version: '2.1405' + Moose::Exception::OverloadRequiresNamesForCoderef: + file: lib/Moose/Exception/OverloadRequiresNamesForCoderef.pm + version: '2.1405' + Moose::Exception::OverrideConflictInComposition: + file: lib/Moose/Exception/OverrideConflictInComposition.pm + version: '2.1405' + Moose::Exception::OverrideConflictInSummation: + file: lib/Moose/Exception/OverrideConflictInSummation.pm + version: '2.1405' + Moose::Exception::PackageDoesNotUseMooseExporter: + file: lib/Moose/Exception/PackageDoesNotUseMooseExporter.pm + version: '2.1405' + Moose::Exception::PackageNameAndNameParamsNotGivenToWrap: + file: lib/Moose/Exception/PackageNameAndNameParamsNotGivenToWrap.pm + version: '2.1405' + Moose::Exception::PackagesAndModulesAreNotCachable: + file: lib/Moose/Exception/PackagesAndModulesAreNotCachable.pm + version: '2.1405' + Moose::Exception::ParameterIsNotSubtypeOfParent: + file: lib/Moose/Exception/ParameterIsNotSubtypeOfParent.pm + version: '2.1405' + Moose::Exception::ReferencesAreNotAllowedAsDefault: + file: lib/Moose/Exception/ReferencesAreNotAllowedAsDefault.pm + version: '2.1405' + Moose::Exception::RequiredAttributeLacksInitialization: + file: lib/Moose/Exception/RequiredAttributeLacksInitialization.pm + version: '2.1405' + Moose::Exception::RequiredAttributeNeedsADefault: + file: lib/Moose/Exception/RequiredAttributeNeedsADefault.pm + version: '2.1405' + Moose::Exception::RequiredMethodsImportedByClass: + file: lib/Moose/Exception/RequiredMethodsImportedByClass.pm + version: '2.1405' + Moose::Exception::RequiredMethodsNotImplementedByClass: + file: lib/Moose/Exception/RequiredMethodsNotImplementedByClass.pm + version: '2.1405' + Moose::Exception::Role::Attribute: + file: lib/Moose/Exception/Role/Attribute.pm + version: '2.1405' + Moose::Exception::Role::AttributeName: + file: lib/Moose/Exception/Role/AttributeName.pm + version: '2.1405' + Moose::Exception::Role::Class: + file: lib/Moose/Exception/Role/Class.pm + version: '2.1405' + Moose::Exception::Role::EitherAttributeOrAttributeName: + file: lib/Moose/Exception/Role/EitherAttributeOrAttributeName.pm + version: '2.1405' + Moose::Exception::Role::Instance: + file: lib/Moose/Exception/Role/Instance.pm + version: '2.1405' + Moose::Exception::Role::InstanceClass: + file: lib/Moose/Exception/Role/InstanceClass.pm + version: '2.1405' + Moose::Exception::Role::InvalidAttributeOptions: + file: lib/Moose/Exception/Role/InvalidAttributeOptions.pm + version: '2.1405' + Moose::Exception::Role::Method: + file: lib/Moose/Exception/Role/Method.pm + version: '2.1405' + Moose::Exception::Role::ParamsHash: + file: lib/Moose/Exception/Role/ParamsHash.pm + version: '2.1405' + Moose::Exception::Role::Role: + file: lib/Moose/Exception/Role/Role.pm + version: '2.1405' + Moose::Exception::Role::RoleForCreate: + file: lib/Moose/Exception/Role/RoleForCreate.pm + version: '2.1405' + Moose::Exception::Role::RoleForCreateMOPClass: + file: lib/Moose/Exception/Role/RoleForCreateMOPClass.pm + version: '2.1405' + Moose::Exception::Role::TypeConstraint: + file: lib/Moose/Exception/Role/TypeConstraint.pm + version: '2.1405' + Moose::Exception::RoleDoesTheExcludedRole: + file: lib/Moose/Exception/RoleDoesTheExcludedRole.pm + version: '2.1405' + Moose::Exception::RoleExclusionConflict: + file: lib/Moose/Exception/RoleExclusionConflict.pm + version: '2.1405' + Moose::Exception::RoleNameRequired: + file: lib/Moose/Exception/RoleNameRequired.pm + version: '2.1405' + Moose::Exception::RoleNameRequiredForMooseMetaRole: + file: lib/Moose/Exception/RoleNameRequiredForMooseMetaRole.pm + version: '2.1405' + Moose::Exception::RolesDoNotSupportAugment: + file: lib/Moose/Exception/RolesDoNotSupportAugment.pm + version: '2.1405' + Moose::Exception::RolesDoNotSupportExtends: + file: lib/Moose/Exception/RolesDoNotSupportExtends.pm + version: '2.1405' + Moose::Exception::RolesDoNotSupportInner: + file: lib/Moose/Exception/RolesDoNotSupportInner.pm + version: '2.1405' + Moose::Exception::RolesDoNotSupportRegexReferencesForMethodModifiers: + file: lib/Moose/Exception/RolesDoNotSupportRegexReferencesForMethodModifiers.pm + version: '2.1405' + Moose::Exception::RolesInCreateTakesAnArrayRef: + file: lib/Moose/Exception/RolesInCreateTakesAnArrayRef.pm + version: '2.1405' + Moose::Exception::RolesListMustBeInstancesOfMooseMetaRole: + file: lib/Moose/Exception/RolesListMustBeInstancesOfMooseMetaRole.pm + version: '2.1405' + Moose::Exception::SingleParamsToNewMustBeHashRef: + file: lib/Moose/Exception/SingleParamsToNewMustBeHashRef.pm + version: '2.1405' + Moose::Exception::TriggerMustBeACodeRef: + file: lib/Moose/Exception/TriggerMustBeACodeRef.pm + version: '2.1405' + Moose::Exception::TypeConstraintCannotBeUsedForAParameterizableType: + file: lib/Moose/Exception/TypeConstraintCannotBeUsedForAParameterizableType.pm + version: '2.1405' + Moose::Exception::TypeConstraintIsAlreadyCreated: + file: lib/Moose/Exception/TypeConstraintIsAlreadyCreated.pm + version: '2.1405' + Moose::Exception::TypeParameterMustBeMooseMetaType: + file: lib/Moose/Exception/TypeParameterMustBeMooseMetaType.pm + version: '2.1405' + Moose::Exception::UnableToCanonicalizeHandles: + file: lib/Moose/Exception/UnableToCanonicalizeHandles.pm + version: '2.1405' + Moose::Exception::UnableToCanonicalizeNonRolePackage: + file: lib/Moose/Exception/UnableToCanonicalizeNonRolePackage.pm + version: '2.1405' + Moose::Exception::UnableToRecognizeDelegateMetaclass: + file: lib/Moose/Exception/UnableToRecognizeDelegateMetaclass.pm + version: '2.1405' + Moose::Exception::UndefinedHashKeysPassedToMethod: + file: lib/Moose/Exception/UndefinedHashKeysPassedToMethod.pm + version: '2.1405' + Moose::Exception::UnionCalledWithAnArrayRefAndAdditionalArgs: + file: lib/Moose/Exception/UnionCalledWithAnArrayRefAndAdditionalArgs.pm + version: '2.1405' + Moose::Exception::UnionTakesAtleastTwoTypeNames: + file: lib/Moose/Exception/UnionTakesAtleastTwoTypeNames.pm + version: '2.1405' + Moose::Exception::ValidationFailedForInlineTypeConstraint: + file: lib/Moose/Exception/ValidationFailedForInlineTypeConstraint.pm + version: '2.1405' + Moose::Exception::ValidationFailedForTypeConstraint: + file: lib/Moose/Exception/ValidationFailedForTypeConstraint.pm + version: '2.1405' + Moose::Exception::WrapTakesACodeRefToBless: + file: lib/Moose/Exception/WrapTakesACodeRefToBless.pm + version: '2.1405' + Moose::Exception::WrongTypeConstraintGiven: + file: lib/Moose/Exception/WrongTypeConstraintGiven.pm + version: '2.1405' + Moose::Exporter: + file: lib/Moose/Exporter.pm + version: '2.1405' + Moose::Intro: + file: lib/Moose/Intro.pod + version: '2.1405' + Moose::Manual: + file: lib/Moose/Manual.pod + version: '2.1405' + Moose::Manual::Attributes: + file: lib/Moose/Manual/Attributes.pod + version: '2.1405' + Moose::Manual::BestPractices: + file: lib/Moose/Manual/BestPractices.pod + version: '2.1405' + Moose::Manual::Classes: + file: lib/Moose/Manual/Classes.pod + version: '2.1405' + Moose::Manual::Concepts: + file: lib/Moose/Manual/Concepts.pod + version: '2.1405' + Moose::Manual::Construction: + file: lib/Moose/Manual/Construction.pod + version: '2.1405' + Moose::Manual::Contributing: + file: lib/Moose/Manual/Contributing.pod + version: '2.1405' + Moose::Manual::Delegation: + file: lib/Moose/Manual/Delegation.pod + version: '2.1405' + Moose::Manual::Delta: + file: lib/Moose/Manual/Delta.pod + version: '2.1405' + Moose::Manual::Exceptions: + file: lib/Moose/Manual/Exceptions.pod + version: '2.1405' + Moose::Manual::Exceptions::Manifest: + file: lib/Moose/Manual/Exceptions/Manifest.pod + version: '2.1405' + Moose::Manual::FAQ: + file: lib/Moose/Manual/FAQ.pod + version: '2.1405' + Moose::Manual::MOP: + file: lib/Moose/Manual/MOP.pod + version: '2.1405' + Moose::Manual::MethodModifiers: + file: lib/Moose/Manual/MethodModifiers.pod + version: '2.1405' + Moose::Manual::MooseX: + file: lib/Moose/Manual/MooseX.pod + version: '2.1405' + Moose::Manual::Resources: + file: lib/Moose/Manual/Resources.pod + version: '2.1405' + Moose::Manual::Roles: + file: lib/Moose/Manual/Roles.pod + version: '2.1405' + Moose::Manual::Support: + file: lib/Moose/Manual/Support.pod + version: '2.1405' + Moose::Manual::Types: + file: lib/Moose/Manual/Types.pod + version: '2.1405' + Moose::Manual::Unsweetened: + file: lib/Moose/Manual/Unsweetened.pod + version: '2.1405' + Moose::Meta::Attribute: + file: lib/Moose/Meta/Attribute.pm + version: '2.1405' + Moose::Meta::Attribute::Custom::Moose: + file: lib/Moose/Meta/Attribute.pm + version: '2.1405' + Moose::Meta::Attribute::Native: + file: lib/Moose/Meta/Attribute/Native.pm + version: '2.1405' + Moose::Meta::Attribute::Native::Trait::Array: + file: lib/Moose/Meta/Attribute/Native/Trait/Array.pm + version: '2.1405' + Moose::Meta::Attribute::Native::Trait::Bool: + file: lib/Moose/Meta/Attribute/Native/Trait/Bool.pm + version: '2.1405' + Moose::Meta::Attribute::Native::Trait::Code: + file: lib/Moose/Meta/Attribute/Native/Trait/Code.pm + version: '2.1405' + Moose::Meta::Attribute::Native::Trait::Counter: + file: lib/Moose/Meta/Attribute/Native/Trait/Counter.pm + version: '2.1405' + Moose::Meta::Attribute::Native::Trait::Hash: + file: lib/Moose/Meta/Attribute/Native/Trait/Hash.pm + version: '2.1405' + Moose::Meta::Attribute::Native::Trait::Number: + file: lib/Moose/Meta/Attribute/Native/Trait/Number.pm + version: '2.1405' + Moose::Meta::Attribute::Native::Trait::String: + file: lib/Moose/Meta/Attribute/Native/Trait/String.pm + version: '2.1405' + Moose::Meta::Class: + file: lib/Moose/Meta/Class.pm + version: '2.1405' + Moose::Meta::Instance: + file: lib/Moose/Meta/Instance.pm + version: '2.1405' + Moose::Meta::Method: + file: lib/Moose/Meta/Method.pm + version: '2.1405' + Moose::Meta::Method::Accessor: + file: lib/Moose/Meta/Method/Accessor.pm + version: '2.1405' + Moose::Meta::Method::Augmented: + file: lib/Moose/Meta/Method/Augmented.pm + version: '2.1405' + Moose::Meta::Method::Constructor: + file: lib/Moose/Meta/Method/Constructor.pm + version: '2.1405' + Moose::Meta::Method::Delegation: + file: lib/Moose/Meta/Method/Delegation.pm + version: '2.1405' + Moose::Meta::Method::Destructor: + file: lib/Moose/Meta/Method/Destructor.pm + version: '2.1405' + Moose::Meta::Method::Meta: + file: lib/Moose/Meta/Method/Meta.pm + version: '2.1405' + Moose::Meta::Method::Overridden: + file: lib/Moose/Meta/Method/Overridden.pm + version: '2.1405' + Moose::Meta::Role: + file: lib/Moose/Meta/Role.pm + version: '2.1405' + Moose::Meta::Role::Application: + file: lib/Moose/Meta/Role/Application.pm + version: '2.1405' + Moose::Meta::Role::Application::RoleSummation: + file: lib/Moose/Meta/Role/Application/RoleSummation.pm + version: '2.1405' + Moose::Meta::Role::Application::ToClass: + file: lib/Moose/Meta/Role/Application/ToClass.pm + version: '2.1405' + Moose::Meta::Role::Application::ToInstance: + file: lib/Moose/Meta/Role/Application/ToInstance.pm + version: '2.1405' + Moose::Meta::Role::Application::ToRole: + file: lib/Moose/Meta/Role/Application/ToRole.pm + version: '2.1405' + Moose::Meta::Role::Attribute: + file: lib/Moose/Meta/Role/Attribute.pm + version: '2.1405' + Moose::Meta::Role::Composite: + file: lib/Moose/Meta/Role/Composite.pm + version: '2.1405' + Moose::Meta::Role::Method: + file: lib/Moose/Meta/Role/Method.pm + version: '2.1405' + Moose::Meta::Role::Method::Conflicting: + file: lib/Moose/Meta/Role/Method/Conflicting.pm + version: '2.1405' + Moose::Meta::Role::Method::Required: + file: lib/Moose/Meta/Role/Method/Required.pm + version: '2.1405' + Moose::Meta::TypeCoercion: + file: lib/Moose/Meta/TypeCoercion.pm + version: '2.1405' + Moose::Meta::TypeCoercion::Union: + file: lib/Moose/Meta/TypeCoercion/Union.pm + version: '2.1405' + Moose::Meta::TypeConstraint: + file: lib/Moose/Meta/TypeConstraint.pm + version: '2.1405' + Moose::Meta::TypeConstraint::Class: + file: lib/Moose/Meta/TypeConstraint/Class.pm + version: '2.1405' + Moose::Meta::TypeConstraint::DuckType: + file: lib/Moose/Meta/TypeConstraint/DuckType.pm + version: '2.1405' + Moose::Meta::TypeConstraint::Enum: + file: lib/Moose/Meta/TypeConstraint/Enum.pm + version: '2.1405' + Moose::Meta::TypeConstraint::Parameterizable: + file: lib/Moose/Meta/TypeConstraint/Parameterizable.pm + version: '2.1405' + Moose::Meta::TypeConstraint::Parameterized: + file: lib/Moose/Meta/TypeConstraint/Parameterized.pm + version: '2.1405' + Moose::Meta::TypeConstraint::Registry: + file: lib/Moose/Meta/TypeConstraint/Registry.pm + version: '2.1405' + Moose::Meta::TypeConstraint::Role: + file: lib/Moose/Meta/TypeConstraint/Role.pm + version: '2.1405' + Moose::Meta::TypeConstraint::Union: + file: lib/Moose/Meta/TypeConstraint/Union.pm + version: '2.1405' + Moose::Object: + file: lib/Moose/Object.pm + version: '2.1405' + Moose::Role: + file: lib/Moose/Role.pm + version: '2.1405' + Moose::Spec::Role: + file: lib/Moose/Spec/Role.pod + version: '2.1405' + Moose::Unsweetened: + file: lib/Moose/Unsweetened.pod + version: '2.1405' + Moose::Util: + file: lib/Moose/Util.pm + version: '2.1405' + Moose::Util::MetaRole: + file: lib/Moose/Util/MetaRole.pm + version: '2.1405' + Moose::Util::TypeConstraints: + file: lib/Moose/Util/TypeConstraints.pm + version: '2.1405' + Test::Moose: + file: lib/Test/Moose.pm + version: '2.1405' + metaclass: + file: lib/metaclass.pm + version: '2.1405' + oose: + file: lib/oose.pm + version: '2.1405' +requires: + Carp: '1.22' + Class::Load: '0.09' + Class::Load::XS: '0.01' + Data::OptList: '0.107' + Devel::GlobalDestruction: '0' + Devel::OverloadInfo: '0.002' + Devel::StackTrace: '1.33' + Dist::CheckConflicts: '0.02' + Eval::Closure: '0.04' + List::MoreUtils: '0.28' + List::Util: '1.35' + MRO::Compat: '0.05' + Module::Runtime: '0.014' + Module::Runtime::Conflicts: '0.002' + Package::DeprecationManager: '0.11' + Package::Stash: '0.32' + Package::Stash::XS: '0.24' + Params::Util: '1.00' + Scalar::Util: '1.19' + Sub::Exporter: '0.980' + Sub::Identify: '0' + Sub::Name: '0.05' + Task::Weaken: '0' + Try::Tiny: '0.17' + parent: '0.223' + perl: v5.8.3 + strict: '1.03' + warnings: '1.03' +resources: + IRC: irc://irc.perl.org/#moose + MailingList: http://lists.perl.org/list/moose.html + bugtracker: https://rt.cpan.org/Dist/Display.html?Name=Moose + homepage: http://moose.perl.org/ + repository: git://github.com/moose/Moose.git +version: '2.1405' +x_Dist_Zilla: + perl: + version: '5.020002' + plugins: + - + class: Dist::Zilla::Plugin::EnsurePrereqsInstalled + name: EnsurePrereqsInstalled + version: '0.008' + - + class: Dist::Zilla::Plugin::Git::GatherDir + config: + Dist::Zilla::Plugin::GatherDir: + exclude_filename: + - Makefile.PL + - LICENSE + exclude_match: + - ^t/recipes/(?!basics_genome_overloadingsubtypesandcoercion) + follow_symlinks: '0' + include_dotfiles: '0' + prefix: '' + prune_directory: [] + root: . + Dist::Zilla::Plugin::Git::GatherDir: + include_untracked: '0' + name: Git::GatherDir + version: '2.034' + - + class: Dist::Zilla::Plugin::MetaYAML + name: MetaYAML + version: '5.037' + - + class: Dist::Zilla::Plugin::MetaJSON + name: MetaJSON + version: '5.037' + - + class: Dist::Zilla::Plugin::License + name: License + version: '5.037' + - + class: Dist::Zilla::Plugin::ExecDir + name: ExecDir + version: '5.037' + - + class: Dist::Zilla::Plugin::ShareDir + name: ShareDir + version: '5.037' + - + class: inc::MakeMaker + config: + Dist::Zilla::Role::TestRunner: + default_jobs: '9' + name: =inc::MakeMaker + version: ~ + - + class: Dist::Zilla::Plugin::Manifest + name: Manifest + version: '5.037' + - + class: Dist::Zilla::Plugin::MetaConfig + name: MetaConfig + version: '5.037' + - + class: inc::SimpleAuthority + name: =inc::SimpleAuthority + version: ~ + - + class: Dist::Zilla::Plugin::MetaResources + name: MetaResources + version: '5.037' + - + class: Dist::Zilla::Plugin::FileFinder::ByName + name: PodModules + version: '5.037' + - + class: Dist::Zilla::Plugin::FileFinder::Filter + name: ModulesSansPod + version: '5.037' + - + class: Dist::Zilla::Plugin::FileFinder::Filter + name: VersionedModules + version: '5.037' + - + class: inc::SimpleProvides + name: =inc::SimpleProvides + version: ~ + - + class: Dist::Zilla::Plugin::MetaProvides::Package + config: + Dist::Zilla::Plugin::MetaProvides::Package: + finder: + - ModulesSansPod + finder_objects: + - + class: Dist::Zilla::Plugin::FileFinder::Filter + name: ModulesSansPod + version: '5.037' + Dist::Zilla::Role::MetaProvider::Provider: + inherit_missing: '1' + inherit_version: '1' + meta_noindex: '1' + name: MetaProvides::Package + version: '2.003001' + - + class: Dist::Zilla::Plugin::MetaNoIndex + name: MetaNoIndex + version: '5.037' + - + class: Dist::Zilla::Plugin::Git::Contributors + config: + Dist::Zilla::Plugin::Git::Contributors: + include_authors: '0' + include_releaser: '1' + order_by: name + paths: [] + name: Git::Contributors + version: '0.011' + - + class: Dist::Zilla::Plugin::SurgicalPodWeaver + config: + Dist::Zilla::Plugin::PodWeaver: + finder: + - ':InstallModules' + - ':ExecFiles' + plugins: + - + class: Pod::Weaver::Plugin::EnsurePod5 + name: '@CorePrep/EnsurePod5' + version: '4.011' + - + class: Pod::Weaver::Plugin::H1Nester + name: '@CorePrep/H1Nester' + version: '4.011' + - + class: Pod::Weaver::Plugin::SingleEncoding + name: '@Default/SingleEncoding' + version: '4.011' + - + class: Pod::Weaver::Section::Name + name: '@Default/Name' + version: '4.011' + - + class: Pod::Weaver::Section::Version + name: '@Default/Version' + version: '4.011' + - + class: Pod::Weaver::Section::Region + name: '@Default/prelude' + version: '4.011' + - + class: Pod::Weaver::Section::Generic + name: SYNOPSIS + version: '4.011' + - + class: Pod::Weaver::Section::Generic + name: DESCRIPTION + version: '4.011' + - + class: Pod::Weaver::Section::Generic + name: OVERVIEW + version: '4.011' + - + class: Pod::Weaver::Section::Collect + name: ATTRIBUTES + version: '4.011' + - + class: Pod::Weaver::Section::Collect + name: METHODS + version: '4.011' + - + class: Pod::Weaver::Section::Collect + name: FUNCTIONS + version: '4.011' + - + class: Pod::Weaver::Section::Leftovers + name: '@Default/Leftovers' + version: '4.011' + - + class: Pod::Weaver::Section::Region + name: '@Default/postlude' + version: '4.011' + - + class: Pod::Weaver::Section::Authors + name: '@Default/Authors' + version: '4.011' + - + class: Pod::Weaver::Section::Legal + name: '@Default/Legal' + version: '4.011' + name: SurgicalPodWeaver + version: '0.0023' + - + class: Dist::Zilla::Plugin::RewriteVersion + name: RewriteVersion + version: '0.009' + - + class: Dist::Zilla::Plugin::Git::Describe + name: Git::Describe + version: '0.005' + - + class: inc::ExtractInlineTests + name: =inc::ExtractInlineTests + version: ~ + - + class: Dist::Zilla::Plugin::PromptIfStale + config: + Dist::Zilla::Plugin::PromptIfStale: + check_all_plugins: '1' + check_all_prereqs: '1' + modules: [] + phase: release + skip: [] + name: PromptIfStale + version: '0.044' + - + class: Dist::Zilla::Plugin::Test::EOL + config: + Dist::Zilla::Plugin::Test::EOL: + filename: xt/author/eol.t + finder: + - ':InstallModules' + - ':ExecFiles' + - ':TestFiles' + trailing_whitespace: '1' + name: Test::EOL + version: '0.18' + - + class: Dist::Zilla::Plugin::PodSyntaxTests + name: PodSyntaxTests + version: '5.037' + - + class: Dist::Zilla::Plugin::Test::NoTabs + config: + Dist::Zilla::Plugin::Test::NoTabs: + filename: xt/author/no-tabs.t + finder: + - ':InstallModules' + - ':ExecFiles' + - ':TestFiles' + name: Test::NoTabs + version: '0.15' + - + class: Dist::Zilla::Plugin::MetaTests + name: MetaTests + version: '5.037' + - + class: Dist::Zilla::Plugin::Test::Kwalitee + config: + Dist::Zilla::Plugin::Test::Kwalitee: + filename: xt/release/kwalitee.t + skiptest: + - use_strict + name: Test::Kwalitee + version: '2.11' + - + class: Dist::Zilla::Plugin::MojibakeTests + name: MojibakeTests + version: '0.7' + - + class: Dist::Zilla::Plugin::RunExtraTests + config: + Dist::Zilla::Role::TestRunner: + default_jobs: '9' + name: RunExtraTests + version: '0.027' + - + class: Dist::Zilla::Plugin::Test::ReportPrereqs + name: Test::ReportPrereqs + version: '0.021' + - + class: Dist::Zilla::Plugin::Test::CPAN::Changes + name: Test::CPAN::Changes + version: '0.009' + - + class: Dist::Zilla::Plugin::Test::Compile + config: + Dist::Zilla::Plugin::Test::Compile: + bail_out_on_fail: '1' + fail_on_warning: author + fake_home: '0' + filename: xt/release/00-compile.t + module_finder: + - ':InstallModules' + needs_display: '0' + phase: develop + script_finder: + - ':ExecFiles' + skips: + - ^Class::MOP::Attribute$ + - ^Class::MOP::Class$ + - ^Class::MOP::Method::Accessor$ + - ^Class::MOP::Method::Constructor$ + - ^Class::MOP::Method::Inlined$ + - ^Class::MOP::Method::Wrapped$ + - ^Class::MOP::Mixin::HasAttributes$ + - ^Class::MOP::Module$ + - ^Class::MOP::Package$ + - ^Moose::Meta::Attribute$ + - ^Moose::Meta::Attribute::Native$ + - ^Moose::Meta::Mixin::AttributeCore$ + - ^Moose::Meta::Role::Attribute$ + - ^Moose::Meta::TypeConstraint::Class$ + - ^Moose::Meta::TypeConstraint::DuckType$ + - ^Moose::Meta::TypeConstraint::Enum$ + - ^Moose::Meta::TypeConstraint::Parameterizable$ + - ^Moose::Meta::TypeConstraint::Parameterized$ + - ^Moose::Meta::TypeConstraint::Role$ + - ^Moose::Meta::TypeConstraint::Union$ + name: Test::Compile + version: '2.053' + - + class: inc::CheckReleaseType + name: =inc::CheckReleaseType + version: ~ + - + class: Dist::Zilla::Plugin::CheckVersionIncrement + name: CheckVersionIncrement + version: '0.121750' + - + class: Dist::Zilla::Plugin::CheckChangesHasContent + name: CheckChangesHasContent + version: '0.008' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: runtime + type: requires + name: Prereqs + version: '5.037' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: test + type: requires + name: TestRequires + version: '5.037' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: configure + type: requires + name: ConfigureRequires + version: '5.037' + - + class: Dist::Zilla::Plugin::Prereqs::AuthorDeps + name: Prereqs::AuthorDeps + version: '0.004' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: develop + type: requires + name: DevelopRequires + version: '5.037' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: runtime + type: suggests + name: RuntimeSuggests + version: '5.037' + - + class: Dist::Zilla::Plugin::Conflicts + name: Conflicts + version: '0.17' + - + class: Dist::Zilla::Plugin::Test::CheckBreaks + config: + Dist::Zilla::Plugin::Test::CheckBreaks: + conflicts_module: Moose::Conflicts + Dist::Zilla::Role::ModuleMetadata: + Module::Metadata: '1.000026' + version: '0.002' + name: Test::CheckBreaks + version: '0.012' + - + class: inc::CheckAuthorDeps + name: =inc::CheckAuthorDeps + version: ~ + - + class: inc::CheckDelta + name: =inc::CheckDelta + version: ~ + - + class: inc::GitUpToDate + name: =inc::GitUpToDate + version: ~ + - + class: Dist::Zilla::Plugin::Git::Remote::Check + name: Git::Remote::Check + version: 0.1.2 + - + class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch + config: + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: Git::CheckFor::CorrectBranch + version: '0.013' + - + class: Dist::Zilla::Plugin::Git::Check + config: + Dist::Zilla::Plugin::Git::Check: + untracked_files: die + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: [] + allow_dirty_match: [] + changelog: Changes + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: Git::Check + version: '2.034' + - + class: Dist::Zilla::Plugin::TestRelease + name: TestRelease + version: '5.037' + - + class: Dist::Zilla::Plugin::UploadToCPAN + name: UploadToCPAN + version: '5.037' + - + class: Dist::Zilla::Plugin::CopyFilesFromRelease + config: + Dist::Zilla::Plugin::CopyFilesFromRelease: + filename: + - Changes + - LICENSE + match: [] + name: CopyFilesFromRelease + version: '0.005' + - + class: Dist::Zilla::Plugin::Git::Commit + config: + Dist::Zilla::Plugin::Git::Commit: + add_files_in: [] + commit_msg: '%N-%v%t%n%n%c' + time_zone: local + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: + - Changes + - LICENSE + allow_dirty_match: [] + changelog: Changes + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: 'release snapshot' + version: '2.034' + - + class: Dist::Zilla::Plugin::Git::Tag + config: + Dist::Zilla::Plugin::Git::Tag: + branch: ~ + signed: 0 + tag: '2.1405' + tag_format: '%v' + tag_message: '%v%t' + time_zone: local + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: Git::Tag + version: '2.034' + - + class: Dist::Zilla::Plugin::BumpVersionAfterRelease + name: BumpVersionAfterRelease + version: '0.009' + - + class: Dist::Zilla::Plugin::NextRelease + name: NextRelease + version: '5.037' + - + class: Dist::Zilla::Plugin::Git::Commit + config: + Dist::Zilla::Plugin::Git::Commit: + add_files_in: [] + commit_msg: 'increment version after release' + time_zone: local + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: + - Changes + allow_dirty_match: + - (?^u:^lib/.*\.pm$) + changelog: Changes + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: 'increment version' + version: '2.034' + - + class: Dist::Zilla::Plugin::Git::Push + config: + Dist::Zilla::Plugin::Git::Push: + push_to: + - origin + remotes_must_exist: 1 + Dist::Zilla::Role::Git::Repo: + repo_root: . + name: Git::Push + version: '2.034' + - + class: Dist::Zilla::Plugin::Run::AfterRelease + config: + Dist::Zilla::Plugin::Run::Role::Runner: + fatal_errors: 1 + quiet: 0 + run: + - 'git checkout master' + - 'git merge --ff-only stable/2.14' + - 'git push' + name: Run::AfterRelease + version: '0.038' + - + class: inc::GenerateDocs + name: =inc::GenerateDocs + version: ~ + - + class: inc::Clean + name: =inc::Clean + version: ~ + - + class: Dist::Zilla::Plugin::ConfirmRelease + name: ConfirmRelease + version: '5.037' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':InstallModules' + version: '5.037' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':IncModules' + version: '5.037' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':TestFiles' + version: '5.037' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':ExecFiles' + version: '5.037' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':ShareFiles' + version: '5.037' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':MainModule' + version: '5.037' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':AllFiles' + version: '5.037' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':NoFiles' + version: '5.037' + zilla: + class: Dist::Zilla::Dist::Builder + config: + is_trial: '0' + version: '5.037' +x_authority: cpan:STEVAN +x_breaks: + Catalyst: '<= 5.90049999' + Config::MVP: '<= 2.200004' + Devel::REPL: '<= 1.003020' + Dist::Zilla::Plugin::Git: '<= 2.016' + Fey: '<= 0.36' + Fey::ORM: '<= 0.42' + File::ChangeNotify: '<= 0.15' + HTTP::Throwable: '<= 0.017' + KiokuDB: '<= 0.51' + Markdent: '<= 0.16' + Mason: '<= 2.18' + MooseX::ABC: '<= 0.05' + MooseX::Aliases: '<= 0.08' + MooseX::AlwaysCoerce: '<= 0.13' + MooseX::App: '<= 1.22' + MooseX::Attribute::Deflator: '<= 2.1.7' + MooseX::Attribute::Dependent: '<= 1.1.0' + MooseX::Attribute::Prototype: '<= 0.10' + MooseX::AttributeHelpers: '<= 0.22' + MooseX::AttributeIndexes: '<= 1.0.0' + MooseX::AttributeInflate: '<= 0.02' + MooseX::CascadeClearing: '<= 0.03' + MooseX::ClassAttribute: '<= 0.26' + MooseX::Constructor::AllErrors: '<= 0.021' + MooseX::Declare: '<= 0.35' + MooseX::FollowPBP: '<= 0.02' + MooseX::Getopt: '<= 0.56' + MooseX::InstanceTracking: '<= 0.04' + MooseX::LazyRequire: '<= 0.06' + MooseX::Meta::Attribute::Index: '<= 0.04' + MooseX::Meta::Attribute::Lvalue: '<= 0.05' + MooseX::Method::Signatures: '<= 0.44' + MooseX::MethodAttributes: '<= 0.22' + MooseX::NonMoose: '<= 0.24' + MooseX::Object::Pluggable: '<= 0.0011' + MooseX::POE: '<= 0.214' + MooseX::Params::Validate: '<= 0.05' + MooseX::PrivateSetters: '<= 0.03' + MooseX::Role::Cmd: '<= 0.06' + MooseX::Role::Parameterized: '<= 1.00' + MooseX::Role::WithOverloading: '<= 0.14' + MooseX::Runnable: '<= 0.03' + MooseX::Scaffold: '<= 0.05' + MooseX::SemiAffordanceAccessor: '<= 0.05' + MooseX::SetOnce: '<= 0.100473' + MooseX::Singleton: '<= 0.25' + MooseX::SlurpyConstructor: '<= 1.1' + MooseX::Storage: '<= 0.42' + MooseX::StrictConstructor: '<= 0.12' + MooseX::Traits: '<= 0.11' + MooseX::Types: '<= 0.19' + MooseX::Types::Parameterizable: '<= 0.05' + MooseX::Types::Set::Object: '<= 0.03' + MooseX::Types::Signal: '<= 1.101930' + MooseX::UndefTolerant: '<= 0.11' + PRANG: '<= 0.14' + Pod::Elemental: '<= 0.093280' + Pod::Weaver: '<= 3.101638' + Reaction: '<= 0.002003' + Test::Able: '<= 0.10' + Test::CleanNamespaces: '<= 0.03' + Test::Moose::More: '<= 0.022' + Test::TempDir: '<= 0.05' + Throwable: '<= 0.102080' + namespace::autoclean: '<= 0.08' +x_contributors: + - 'Aankhen ' + - 'Adam J. Foxson ' + - 'Adam Kennedy ' + - 'Ævar Arnfjörð Bjarmason ' + - 'Anders Nor Berle ' + - 'Ansgar Burchardt ' + - 'Aran Clary Deltac ' + - 'Ash Berlin ' + - 'A. Sinan Unur ' + - 'Brad Bowman ' + - 'Brendan Byrd ' + - 'Brian Manning ' + - 'Chad Granum ' + - 'Chankey Pathak ' + - 'Chia-liang Kao ' + - 'Chip ' + - 'Christian Hansen ' + - 'Christopher J. Madsen ' + - 'Chris Weyl ' + - 'chromatic ' + - 'Cory Watson ' + - 'Curtis Jewell ' + - 'Dagfinn Ilmari Mannsåker ' + - 'Daisuke Maki (lestrrat) ' + - 'Dan Dascalescu ' + - 'Dann ' + - 'Dave Romano ' + - 'David Leadbeater ' + - 'David Steinbrunner ' + - 'Dylan William Hardison ' + - 'Eric Wilhelm ' + - 'Evan Carroll ' + - 'franck cuny ' + - 'Frew Schmidt ' + - 'Gerda Shank ' + - 'gfx ' + - 'Graham Knop ' + - 'gregor herrmann ' + - 'Guillermo Roditi ' + - 'hakim ' + - 'Henry Van Styn ' + - 'James Marca ' + - 'Jason May ' + - 'Jay Allen ' + - 'Jay Hannah ' + - 'Jay Kuri ' + - 'Jeff Bisbee ' + - 'Jesse Vincent ' + - 'Jess Robinson ' + - 'joel ' + - 'John Douglas Porter ' + - 'John Goulah ' + - 'John Napiorkowski ' + - 'Jonathan Rockway ' + - 'Justin DeVuyst ' + - 'Justin Hunter ' + - 'Kent Fredric ' + - 'Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 ' + - 'Leon Brocard ' + - 'Marcel Grünauer ' + - 'Marc Mims ' + - 'Marcus Ramberg ' + - 'Mark Allen ' + - 'Mark A. Stratman ' + - 'Mark Fowler ' + - 'Mateu X Hunter ' + - 'Matthew Horsfall ' + - 'matthof ' + - 'Matt Kraai ' + - 'Michael LaGrasta ' + - 'Michael Rykov ' + - 'Michael Schout ' + - 'Mike Whitaker ' + - 'Moritz Onken ' + - 'Nathan Gray ' + - 'Nelo Onyiah ' + - 'Nick Perez ' + - 'Olaf Alders ' + - 'Olivier Mengué ' + - 'Olof Johansson ' + - 'Patrick Donelan ' + - 'Paul Driver ' + - 'Paul Jamieson Fenwick ' + - 'Paweł Murias ' + - 'Pedro Melo ' + - 'Perlover ' + - 'Peter Shangov ' + - 'Philippe Bruhat (BooK) ' + - 'Phillip Smith ' + - 'Piotr Roszatycki ' + - 'pktm ' + - 'Rafael Kitover ' + - 'Ricardo Signes ' + - 'Robert Boone ' + - 'Robert Buels ' + - "Robert 'phaylon' Sedlacek " + - 'Robin V ' + - 'rodrigolive ' + - 'Sam Vilain ' + - 'Scott McWhirter ' + - 'shelling ' + - 'Shlomi Fish ' + - "Stefan O'Rear " + - 'Thomas Sibley ' + - 'Todd Hepler ' + - 'Tokuhiro Matsuno ' + - 'Tomas Doran ' + - 'Tuomas Jormola ' + - 'Upasana Shukla ' + - 'Wallace Reis ' + - 'wickline ' + - 'Zachary Lome ' + - 'Zoffix Znet ' diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..df1e1e9 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,246 @@ +# This Makefile.PL for Moose was generated by +# inc::MakeMaker +# and Dist::Zilla::Plugin::MakeMaker::Awesome 0.34. +# Don't edit it but the dist.ini and plugins used to construct it. + +use strict; +use warnings; + +# Secondary compile testing via ExtUtils::CBuilder +sub can_xs { + # Do we have the configure_requires checker? + unless (eval 'require ExtUtils::CBuilder; ExtUtils::CBuilder->VERSION(0.27); 1') { + # They don't obey configure_requires, so it is + # someone old and delicate. Try to avoid hurting + # them by falling back to an older simpler test. + return can_cc(); + } + + return ExtUtils::CBuilder->new( quiet => 1 )->have_compiler; +} + +# can we locate a (the) C compiler +sub can_cc { + my @chunks = split(/ /, $Config::Config{cc}) or return; + + # $Config{cc} may contain args; try to find out the program part + while (@chunks) { + return can_run("@chunks") || (pop(@chunks), next); + } + + return; +} + +# check if we can run some command +sub can_run { + my ($cmd) = @_; + + return $cmd if -x $cmd; + if (my $found_cmd = MM->maybe_command($cmd)) { + return $found_cmd; + } + + for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { + next if $dir eq ''; + my $abs = File::Spec->catfile($dir, $cmd); + return $abs if (-x $abs or $abs = MM->maybe_command($abs)); + } + + return; +} + +die 'This distribution requires a working compiler' unless can_xs(); + +use ExtUtils::MakeMaker; +check_conflicts(); + +my %WriteMakefileArgs = ( + "ABSTRACT" => "A postmodern object system for Perl 5", + "AUTHOR" => "Stevan Little , Dave Rolsky , Jesse Luehrs , Shawn M Moore , \x{5d9}\x{5d5}\x{5d1}\x{5dc} \x{5e7}\x{5d5}\x{5d2}'\x{5de}\x{5df} (Yuval Kogman) , Karen Etheridge , Florian Ragwitz , Hans Dieter Pearcey , Chris Prather , Matt S Trout ", + "CONFIGURE_REQUIRES" => { + "Dist::CheckConflicts" => "0.02", + "ExtUtils::CBuilder" => "0.27", + "ExtUtils::MakeMaker" => 0, + "File::Spec" => 0 + }, + "DISTNAME" => "Moose", + "EXE_FILES" => [ + "bin/moose-outdated" + ], + "LICENSE" => "perl", + "NAME" => "Moose", + "OBJECT" => "xs/Attribute\$(OBJ_EXT) xs/AttributeCore\$(OBJ_EXT) xs/Class\$(OBJ_EXT) xs/Generated\$(OBJ_EXT) xs/HasAttributes\$(OBJ_EXT) xs/HasMethods\$(OBJ_EXT) xs/Inlined\$(OBJ_EXT) xs/Instance\$(OBJ_EXT) xs/Method\$(OBJ_EXT) xs/Moose\$(OBJ_EXT) xs/MOP\$(OBJ_EXT) xs/Package\$(OBJ_EXT) xs/ToInstance\$(OBJ_EXT) mop\$(OBJ_EXT)", + "PREREQ_PM" => { + "Carp" => "1.22", + "Class::Load" => "0.09", + "Class::Load::XS" => "0.01", + "Data::OptList" => "0.107", + "Devel::GlobalDestruction" => 0, + "Devel::OverloadInfo" => "0.002", + "Devel::StackTrace" => "1.33", + "Dist::CheckConflicts" => "0.02", + "Eval::Closure" => "0.04", + "List::MoreUtils" => "0.28", + "List::Util" => "1.35", + "MRO::Compat" => "0.05", + "Module::Runtime" => "0.014", + "Module::Runtime::Conflicts" => "0.002", + "Package::DeprecationManager" => "0.11", + "Package::Stash" => "0.32", + "Package::Stash::XS" => "0.24", + "Params::Util" => "1.00", + "Scalar::Util" => "1.19", + "Sub::Exporter" => "0.980", + "Sub::Identify" => 0, + "Sub::Name" => "0.05", + "Task::Weaken" => 0, + "Try::Tiny" => "0.17", + "parent" => "0.223", + "strict" => "1.03", + "warnings" => "1.03" + }, + "TEST_REQUIRES" => { + "CPAN::Meta::Check" => "0.007", + "CPAN::Meta::Requirements" => 0, + "ExtUtils::MakeMaker" => 0, + "File::Spec" => 0, + "Test::CleanNamespaces" => "0.13", + "Test::Fatal" => "0.001", + "Test::More" => "0.88", + "Test::Requires" => "0.05", + "Test::Warnings" => "0.016" + }, + "VERSION" => "2.1405", + "XS" => { + "xs/Attribute.xs" => "xs/Attribute.c", + "xs/AttributeCore.xs" => "xs/AttributeCore.c", + "xs/Class.xs" => "xs/Class.c", + "xs/Generated.xs" => "xs/Generated.c", + "xs/HasAttributes.xs" => "xs/HasAttributes.c", + "xs/HasMethods.xs" => "xs/HasMethods.c", + "xs/Inlined.xs" => "xs/Inlined.c", + "xs/Instance.xs" => "xs/Instance.c", + "xs/MOP.xs" => "xs/MOP.c", + "xs/Method.xs" => "xs/Method.c", + "xs/Moose.xs" => "xs/Moose.c", + "xs/Package.xs" => "xs/Package.c", + "xs/ToInstance.xs" => "xs/ToInstance.c" + }, + "clean" => { + "FILES" => "xs/Attribute\$(OBJ_EXT) xs/AttributeCore\$(OBJ_EXT) xs/Class\$(OBJ_EXT) xs/Generated\$(OBJ_EXT) xs/HasAttributes\$(OBJ_EXT) xs/HasMethods\$(OBJ_EXT) xs/Inlined\$(OBJ_EXT) xs/Instance\$(OBJ_EXT) xs/Method\$(OBJ_EXT) xs/Moose\$(OBJ_EXT) xs/MOP\$(OBJ_EXT) xs/Package\$(OBJ_EXT) xs/ToInstance\$(OBJ_EXT) mop\$(OBJ_EXT)" + }, + "test" => { + "TESTS" => "t/*.t t/attributes/*.t t/basics/*.t t/bugs/*.t t/cmop/*.t t/compat/*.t t/examples/*.t t/exceptions/*.t t/immutable/*.t t/metaclasses/*.t t/moose_util/*.t t/native_traits/*.t t/recipes/*.t t/roles/*.t t/test_moose/*.t t/todo_tests/*.t t/type_constraints/*.t" + } +); + +my %FallbackPrereqs = ( + "CPAN::Meta::Check" => "0.007", + "CPAN::Meta::Requirements" => 0, + "Carp" => "1.22", + "Class::Load" => "0.09", + "Class::Load::XS" => "0.01", + "Data::OptList" => "0.107", + "Devel::GlobalDestruction" => 0, + "Devel::OverloadInfo" => "0.002", + "Devel::StackTrace" => "1.33", + "Dist::CheckConflicts" => "0.02", + "Eval::Closure" => "0.04", + "ExtUtils::CBuilder" => "0.27", + "ExtUtils::MakeMaker" => 0, + "File::Spec" => 0, + "List::MoreUtils" => "0.28", + "List::Util" => "1.35", + "MRO::Compat" => "0.05", + "Module::Runtime" => "0.014", + "Module::Runtime::Conflicts" => "0.002", + "Package::DeprecationManager" => "0.11", + "Package::Stash" => "0.32", + "Package::Stash::XS" => "0.24", + "Params::Util" => "1.00", + "Scalar::Util" => "1.19", + "Sub::Exporter" => "0.980", + "Sub::Identify" => 0, + "Sub::Name" => "0.05", + "Task::Weaken" => 0, + "Test::CleanNamespaces" => "0.13", + "Test::Fatal" => "0.001", + "Test::More" => "0.88", + "Test::Requires" => "0.05", + "Test::Warnings" => "0.016", + "Try::Tiny" => "0.17", + "parent" => "0.223", + "strict" => "1.03", + "warnings" => "1.03" +); + +unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { + delete $WriteMakefileArgs{TEST_REQUIRES}; + delete $WriteMakefileArgs{BUILD_REQUIRES}; + $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; +} + +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} + unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; + +$WriteMakefileArgs{CCFLAGS} = ( $Config::Config{ccflags} || '' ) . ' -I.'; + +WriteMakefile(%WriteMakefileArgs); + +{ +package MY; + +use Config; + +sub const_cccmd { + my $ret = shift->SUPER::const_cccmd(@_); + return q{} unless $ret; + + if ($Config{cc} =~ /^cl\b/i) { + warn 'you are using MSVC... we may not have gotten some options quite right.'; + $ret .= ' /Fo$@'; + } + else { + $ret .= ' -o $@'; + } + + return $ret; +} + +sub postamble { + return <<'EOF'; +$(OBJECT) : mop.h +EOF +} +} + +sub check_conflicts { + if ( eval { require 'lib/Moose/Conflicts.pm'; 1; } ) { + if ( eval { Moose::Conflicts->check_conflicts; 1 } ) { + return; + } + else { + my $err = $@; + $err =~ s/^/ /mg; + warn "***\n$err***\n"; + } + } + else { + print <<'EOF'; +*** + Your toolchain doesn't support configure_requires, so Dist::CheckConflicts + hasn't been installed yet. You should check for conflicting modules + manually using the 'moose-outdated' script that is installed with + this distribution once the installation finishes. +*** +EOF + } + + return if $ENV{AUTOMATED_TESTING} || $ENV{NONINTERACTIVE_TESTING}; + + # More or less copied from Module::Build + return if $ENV{PERL_MM_USE_DEFAULT}; + return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) ); + + sleep 4; +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..a15eecf --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +[![CPAN version](https://badge.fury.io/pl/Moose.svg)](http://badge.fury.io/pl/Moose) +[![Build Status](https://travis-ci.org/moose/Moose.png?branch=master,stable/2.12)](https://travis-ci.org/moose/Moose) +[![Coverage Status](https://coveralls.io/repos/moose/Moose/badge.png?branch=master)](https://coveralls.io/r/moose/Moose?branch=master) + +Moose +===== + +Moose is a postmodern object system for Perl 5. + +Moose on CPAN: [https://metacpan.org/release/Moose] diff --git a/TODO b/TODO new file mode 100644 index 0000000..d00dca6 --- /dev/null +++ b/TODO @@ -0,0 +1,488 @@ +# vim: set ft=markdown : + +## Uncontroversial Items + +These items are reasonably well thought out, and can go in any major release. + +### RT Tickets + +RT#59478/RT#63000 - 0+ overload causes NV conversion on == on perls before +5.14 - this causes comparisons to fail when the number can't fit in an NV +without precision loss. I'd like to fix this in a more general way (forcing +anyone else who might be using == on tc objects to do weird things isn't very +good), although it's hard to test to see what actually works. + +### Revise MetaRole API to reunify class/role metaroles: + + apply_metaroles( + for => $meta, + roles => { + attribute => [...], + class => [...], + role_attribute => [ ... ], + } + ); + +If the $meta is a class, we apply the roles to the class. If it's a role, we +hold onto them and apply them as part of applying the role to a class. + +To make this all work nicely, we'll probably want to track the original role +where a method was defined, just like we do with attributes currently. We'll +also need to store method modifiers with their original role, which may mean +adding some sort of Moose::Meta::Role::MethodModifier class. + +For each role-specific thing (methods, attributes, etc.) we should allow a +`role_attribute`, `role_method`, etc. key. The common case will be that the +metaroles are intended for the consuming class, but we should allow for +metaroles on the role's metaobjects as well. + +### Deprecate old-style Moose extensions + +Moose extensions that work by calling `Moose->init_meta(metaclass => +'Some::Custom::Metaclass', ...)` during their own `init_meta` should be +deprecated, so they can be removed later (this should fix the issues with +`init_meta` generation in Moose::Exporter, see RT51561) + +This needs to wait until the previous fix gets in, since it will hopefully +eliminate the need to write custom `init_meta` methods entirely. + +### Attributes in roles need to be able to participate in role composition + +Right now, this fails with no decent workaround: + + package R1; + use Moose::Role; + has foo => (is => 'ro'); + + package R2; + use Moose::Role; + with 'R1'; + requires 'foo'; + + package C; + use Moose; + with 'R2'; + +Role attributes really need to be able to participate in role-role combination. +This should also fix "with 'Role1', 'Role2'" being broken when Role1 implements +a method as an accessor and Role2 requires that method, but at least in that +case you can split it into two 'with' statements with minimal loss of +functionality. + +### Method modifiers in roles should silently add 'requires' for them + +This shouldn't be a functionality change, just a better error message (and +better introspectability). This shouldn't happen if the role already contains a +method by that name, so it'll depend on the previous fix going in (so "has foo +=> (is => 'ro'); around foo => sub { }" doesn't produce a 'requires' entry). + +### has +foo in roles + +There's no actual reason for this not to work, and it gets asked often enough +that we really should just do it at some point. + +### use Sub::Identify instead of doing our own thing with `get_code_info` + +No idea why we stopped using Sub::Identify in the past, but there's no reason +not to do this. We have a bug fix in our version (the `isGV_with_GP` thing), so +this should be submitted to Sub::Identify first. + +## Needs Thought + +These are things we think are good ideas, but they need more fleshing out. + +### Actual API for metaclass extensions + +Right now, the only way to bundle multiple metaclass traits is via +Moose::Exporter. This is unhelpful if you want to apply the extension to a +metaclass object rather than a class you're actually writing. We should come up +with an API for doing this. + +### MooseX::NonMoose in core + +I think all of the actual issues are solved at this point. The only issue is +the (necessary) implementation weirdness - it sets up multiple inheritance +between the non-Moose class and Moose::Object, and it installs a custom +constructor method at 'extends' time (although perhaps this could be solved by +moving some of the logic back into Moose::Object::new?). Other than that, it +handles everything transparently as far as I can tell. + +### Fix attribute and method metaclass compatibility + +So i got this wrong when rewriting it last year - right now, metaclass compat +checks the default attribute and method metaclasses, which is wrong. This means +that if a parent class does "use MooseX::FollowPBP", then attributes declared +in a subclass will get PBP-style accessors, which is quite surprising. + +On the other hand, sometimes metaclasses might need to be able to say "I'm +going to assume that all of my attributes at least inherit from this custom +class", so we might need to split it into "default specified by the user" and +"default specified by the metaclass" and only do compat checking on the second? +I'm not actually sure this is a valid use case though. + +Something that probably should be taken into account though is attributes and +methods that extend existing attributes or methods from a superclass should +inherit the metaclass of the existing one. Also not sure if this is correct, +but something to think about. + +### Rename a bunch of the public API methods + +Right now the public API is kind of a mess - we have things like `get_method` +vs `find_method_by_name` (you almost always want to use the latter), there +being no `has_method` equivalent that checks superclasses, `get_method_list` +being public but only returning method names, while `_get_local_methods` is +private (returning method objects), and yet neither of those looks at +superclasses, and basically none of this naming follows any kind of consistent +pattern. + +What we really need is a consistent and easy to remember API where the method +that people would think to use first is the method that they actually mean. +Something like renaming `find_method_by_name` to `find_method`, and `get_method` to +`find_local_method` or something along those lines. + +### Clean up metaclass constructors + +There's a _lot_ of different conventions in here. Some things to consider: + +* `new` vs `_new` +* allowing new( 'name', %args ) vs ( name => 'name', %args ) +* `Method->wrap` vs `Method->new` + +### Move method modifiers out to an external module + +Class::Method::Modifiers uses a different method for doing method modifiers, +which I'm not sure why we aren't using in Moose right now. Optionally using +Class::Method::Modifiers::Fast would be even better - it uses Data::Util to +implement XS method modifiers, which could help things a lot. + +### Move type constraints out to an external module + +There's nothing about our type constraint system that requires being tied to +Moose - it's conceptually an entirely separate system that Moose just happens +to use. Splitting it out into its own thing (that Moose could extend to add +things like role types) would make things conceptually a lot cleaner, and would +let people interested in just the type system have that. + +### Merge Class::MOP and Moose + +This is a long term goal, but would allow for a lot of things to be cleaned up. +There's a bunch of stuff that's duplicated, and other stuff that's not +implemented as well as it could be (Class::MOP::Method::Wrapped should be a +role, for instance). + +### Moose::Util::TypeConstraints vs Moose::Meta::Type{Coercion,Constraint} + +The Util module has _way_ too much functionality. It needs to be +refactored so it's a thin sugar layer on top of the meta API. As it +stands now, it does things like parse type names (and determine if +they're valid), manage the registry, and much more. + +### Anything with a \_(meta)?class method + +Every method that returns a class name needs to become a rw attribute +that can be set via the constructor. + +## Things to contemplate + +These are ideas we're not sure about. Prototypes are welcome, but we may never +merge the feature. + +### Does applying metaroles really need to reinitialize the metaclass? + +Seems like the logic that's actually necessary is already contained in +`rebless_instance`, and not reinitializing means that existing attributes and +methods won't be blown away when metaroles are applied. + +### Do we want to core namespace::autoclean behavior somehow? + +This would add Variable::Magic as a required XS dep (not a huge deal at the +moment, since Sub::Name is also a required XS dep, but it'd be nice for Moose +to be able to be pure perl again at some point in the future, and I'm not sure +what the relative chances of Sub::Name vs Variable::Magic making it into core +are). If we enabled it by default, this would also break things for people who +have introduced Moose into legacy-ish systems where roles are faked using +exporters (since those imported methods would be cleaned). + +If we decide we want this, we may want to core it as an option first ("use +Moose -clean" or so), and move to making it the default later. + +### Should using -excludes with a role add 'requires' for excluded methods? + +It seems to make sense, since otherwise you're violating the role's API +contract. + +### Moose "strict" mode + +use Moose 'strict'; This would allow us to have all sort of expensive tests +which can be turned off in prod. + +### Moose::Philosophy.pod + +To explain Moose from a very high level + +### moosedoc + +We certainly have enough meta-information to make pretty complete POD docs. + +## TODO test summary + +Note that some of these are fairly old, and may not be things we actually want +to do anymore. + +### `t/basics/basic_class_setup.t` + +Imports aren't automatically cleaned. Need to think about bringing +namespace::autoclean functionality into core. + +### `t/bugs/create_anon_recursion.t` + +Loading Moose::Meta::Class (or probably a lot of other metaclasses) before +loading Moose or Class::MOP causes issues (the bootstrapping gets confused). + +### `t/bugs/handles_foreign_class_bug.t` + +There should be a warning when delegated methods override 'new' (and possibly +others?). + +### `t/bugs/role_caller.t` + +Role methods should be cloned into classes on composition so that using +caller(0) in a role method uses the class's package, not the role's. + +### `t/cmop/metaclass_incompatibility.t` + +If a child class is created before a parent class, metaclass compatibility +checks won't run on the child when the parent is created, and so the child +could end up with an incompatible metaclass. + +### `t/cmop/modify_parent_method.t` + +Modifying parent class methods after a child class has already wrapped them +with a method modifier will cause the child class method to retain the original +method that it wrapped, not the new one it was replaced with. + +### `t/immutable/inline_close_over.t` + +Initializers and custom error classes still close over metaobjects. +Initializers do it because the initializer has to be passed in the attribute +metaobject as a parameter, and custom error classes can't be automatically +inlined. + +### `t/metaclasses/moose_exporter_trait_aliases.t` + +Renamed imports aren't cleaned on unimport. For instance: + + package Foo; + use Moose has => { -as => 'my_has' }; + no Moose; + # Foo still contains my_has + +### `t/metaclasses/reinitialize.t` + +Special method types can't have method metaroles applied. Applying a method +metarole to a class doesn't apply that role to things like constructors, +accessors, etc. + +### `t/roles/method_modifiers.t` + +Method modifiers in roles don't support the regex form of method selection. + +### `t/roles/role_compose_requires.t` + +Accessors for attributes defined in roles don't satisfy role method +requirements (this is detailed above - Attributes in roles need to be able to +participate in role composition). + +### `t/todo_tests/exception_reflects_failed_constraint.t` + +Type constraint failures should indicate which ancestor constraint failed - +subtype 'Foo', as 'Str', where { length < 5 } should mention Str when passed an +arrayref, but not when passed the string "ArrayRef". + +### `t/todo_tests/moose_and_threads.t` + +On 5.8, the type constraint name parser isn't thread safe. + +### `t/todo_tests/replacing_super_methods.t` + +Modifying parent class methods after a child class has already wrapped them +with a override will cause 'super' in the child class to call the original +parent class method, not the one it was overridden with. + +### `t/todo_tests/required_role_accessors.t` + +Role attribute accessors don't satisfy requires from roles they consume. + +### `t/todo_tests/role_insertion_order.t` + +Roles don't preserve attribute `insertion_order`. + +### `t/todo_tests/various_role_features.t` + +* Role attribute accessors don't satisfy requires from roles they consume. +* Role combination should produce a conflict when one role has an actual method + and the other role has an accessor. +* Role attribute accessors should not override methods in the class the role is + applied to. +* Role attribute accessors should be delegated when a class does + handles => 'Role'. +* Delegating to a role doesn't make $class->does('Role') true. +* Method modifier in a role doesn't create a method requirement. +* `Role->meta->has_method('attr_accessor')` is false. + +### `t/type_constraints/type_names.t` + +Type constraint object constructors don't validate the type name provided. + +### MooseX::Aliases in core + +Is there any reason why this would be bad? It would certainly make the +implementation a little faster (it can be inlined better). + +### MooseX::MethodAttributes in core + +discuss + +---- + +## Old todo + +Old todo stuff which may be totally out of date. + +### DDuncan's Str types + + subtype 'Str' + => as 'Value' + => where { Encode::is_utf8( $_[0] ) or $_[0] !~ m/[^0x00-0x7F]/x } + => optimize_as { defined($_[0]) && !ref($_[0]) }; + + subtype 'Blob' + => as 'Value' + => where { !Encode::is_utf8( $_[0] ) } + => optimize_as { defined($_[0]) && !ref($_[0]) }; + +### type unions + +Add support for doing it with Classes which do not have a type constraint yet +created + +### type intersections + +Mostly just for Roles +KENTNL is working on this + +### inherited slot specs + +'does' can be added to,.. but not changed (need type unions for this) + +### proxy attributes + +a proxied attribute is an attribute which looks like an attribute, talks like +an attribute, smells like an attribute,.. but if you look behind the +curtain,.. its over there.. in that other object + +(... probably be a custom metaclass) + +### local coerce + + [13:16] mst stevan: slight problem with coerce + [13:16] mst I only get to declare it once + [13:17] mst so if I'm trying to declare it cast-style per-source-class rather than per-target-class + [13:17] mst I am extremely screwed + [13:17] stevan yes + [13:17] stevan they are not class specific + [13:18] stevan they are attached to the type constraint itself + [13:18] * stevan ponders anon-coercion-metaobjects + [13:18] mst yes, that's fine + [13:19] mst but when I declare a class + [13:19] mst I want to be able to say "this class coerces to X type via " + [13:19] stevan yeah something like that + [13:19] stevan oh,.. hmm + [13:20] stevan sort of like inflate/deflate? + [13:20] stevan around the accessors? + [13:25] * bluefeet has quit (Remote host closed the connection) + [13:27] mst no + [13:27] mst nothing like that + [13:27] mst like a cast + [13:31] mst stevan: $obj->foo($bar); where 'foo' expects a 'Foo' object + [13:31] mst stevan: is effectively $bar, right? + [13:32] mst stevan: I want to be able to say in package Bar + [13:32] mst stevan: coerce_to 'Foo' via { ... }; + [13:32] mst etc. + [13:53] stevan hmm + +### add support for locally scoped TC + +This would borrow from MooseX::TypeLibrary to prefix the TC with the name +of the package. It would then be accesible from the outside as the fully +scoped name, but the local attributes would use it first. (this would need support +in the registry for this). + +### look into sugar extensions + +Use roles as sugar layer function providers (ala MooseX::AttributeHelpers). This +would allow custom metaclasses to provide roles to extend the sugar syntax with. + +(NOTE: Talk to phaylon a bit more on this) + +### allow a switch of some kind to optionally turn TC checking off at runtime + +The type checks can get expensive and some people have suggested that allowing +the checks to be turned off would be helpful for deploying into performance +intensive systems. Perhaps this can actually be done as an option to `make_immutable`? + +### misc. minor bits + +* make the errors for TCs use `->message` +* look into localizing the messages too +* make ANON TCs be lazy, so they can possibly be subsituted for the real thing later +* make ANON TCs more introspectable +* add this ... + + subtype 'Username', + from 'Str', + where { (/[a-z][a-z0-9]+/i or fail('Invalid character(s)')) + and (length($_) >= 5 or fail('Too short (less than 5 chars)')) + } + on_fail { MyException->throw(value => $_[0], message => $_[1]) }; + +fail() will just return false unless the call is made via `$tc->check_or_fail($value);` + +* and then something like this: + + subtype Foo => as Bar => where { ... } => scoped => -global; + subtype Foo => as Bar => where { ... } => scoped => -local; + + # or + + subtype Foo => as Bar => where { ... } => in __PACKAGE__ ; + + # or (not sure if it would be possible) + + my $Foo = subtype Bar => where { ... }; + +### Deep coercion? + + [17:10] stevan: it should do it if I pass coerce => 1 as part of the attribute definition + [17:12] autarch: what I am not 100% sure of is how to tell it to deep coerce and when to not + [17:13] cause a basic coerce is from A to B + [17:13] hmm + [17:13] which is valid for collection types too + [17:13] deep coercion is what you are asking for + [17:13] yeah + [17:13] so perhaps we add deep_coerce => 1 + [17:13] which will do it + [17:13] that's fine for me + [17:13] k + +`coerce_deeply => 1 # reads better` + +### Moose::Meta::TypeConstraint::Parameter{izable,ized} + +The relationship between these two classes is very odd. In particular, +this line in Parameterized is insane: + + foreach my $type (Moose::Util::TypeConstraints::get_all_parameterizable_types()) { + +Why does it need to loop through all parameterizable types? Shouldn't +it know which parameterizable type it "came from"? diff --git a/author/docGenerator.pl b/author/docGenerator.pl new file mode 100644 index 0000000..6e3eef0 --- /dev/null +++ b/author/docGenerator.pl @@ -0,0 +1,279 @@ +use blib; +use Moose; +use Class::Load 0.07 qw(load_class); + +my $text = generate_docs(); +print $text; + +sub generate_docs { + my $dir; + my $path = 'lib/Moose/Exception/'; + my $pod_file; + + opendir( $dir, $path) or die $!; + + my $version = $ARGV[0]; + + my $number = 0; + my $text = ''; + + my $exceptions_to_msg_hashref = get_exceptions_to_messages(); + + while( my $file = readdir($dir) ) + { + my %exceptions = %$exceptions_to_msg_hashref; + + my ($exception, $description, $attributes_text, $superclasses, $consumed_roles, $exception_messages); + my (@attributes, @roles, @super_classes, @roles_names, @super_class_names); + if( !(-d 'lib/Moose/Exception/'.$file) ) + { + $file =~ s/\.pm//i; + + $exception = "Moose::Exception::".$file; + + load_class( $exception ); + my $metaclass = Class::MOP::class_of( $exception ) + or die "No metaclass for $exception"; + + my @super_classes = sort { $a->name cmp $b->name } $metaclass->superclasses; + my @roles = sort { $a->name cmp $b->name } $metaclass->calculate_all_roles; + my @attributes = sort { $a->name cmp $b->name } $metaclass->get_all_attributes; + + my $file_handle; + + @roles_names = map { + my $name = $_->name; + if( $name =~ /\|/ ) { + undef; + } else { + $name; + } + } @roles; + + $superclasses = place_commas_and_and( @super_classes ); + $consumed_roles = place_commas_and_and( @roles_names ); + + foreach my $attribute ( @attributes ) + { + my $name = $attribute->name; + my $traits; + + if( $attribute->has_applied_traits ) { + my @traits_array = @{$attribute->applied_traits}; + + $traits = "has traits of "; + my $traits_str = place_commas_and_and( @traits_array ); + $traits .= $traits_str; + } + + my ( $tc, $type_constraint ) = ( $attribute->type_constraint->name, "isa " ); + if( $tc =~ /::/ && !(defined $traits) ) { + $type_constraint .= "L<".$tc.">"; + } else { + $type_constraint .= $tc; + } + my $read_or_write = ( $attribute->has_writer ? 'is read-write' : 'is read-only' ); + my $required = ( $attribute->is_required ? 'is required' : 'is optional' ); + my $predicate = ( $attribute->has_predicate ? 'has a predicate C<'.$attribute->predicate.'>': undef ); + + my $default; + if( $attribute->has_default ) { + if( $tc eq "Str" ) { + $default = 'has a default value "'.$attribute->default.'"'; + } + else { + $default = 'has a default value '.$attribute->default; + } + } + + my $handles_text; + if( $attribute->has_handles ) { + my %handles = %{$attribute->handles}; + my @keys = sort keys( %handles ); + my $first_element_inserted = 1; + foreach my $key ( @keys ) { + next + if( $key =~ /^_/ ); + my $str_text = sprintf("\n %-25s=> %s", $key, $handles{$key}); + if( $first_element_inserted == 1 ) { + $handles_text = "This attribute has handles as follows:"; + $first_element_inserted = 0; + } + $handles_text .= $str_text; + } + } + + $exception_messages = "=back\n\n=head4 Sample Error Message"; + + my $msg_or_msg_ref = $exceptions{$file}; + if( ref $msg_or_msg_ref eq "ARRAY" ) { + $exception_messages .= "s:\n\n"; + my @array = @$msg_or_msg_ref; + foreach( @array ) { + $exception_messages .= " $_"; + } + } else { + $exception_messages .= ":\n\n"; + if( $exceptions{$file} ) { + $exception_messages .= " ".$exceptions{$file}; + } + } + + $exception_messages .= "\n"; + + $attributes_text .= "=item B<< \$exception->$name >>\n\n"; + if( $attribute->has_documentation ) { + $attributes_text .= $attribute->documentation."\n\n"; + } else { + $attributes_text .= "This attribute $read_or_write, $type_constraint". + ( defined $predicate ? ", $predicate" : '' ). + ( defined $default ? ", $default" : ''). + " and $required.". + ( defined $handles_text && ( $handles_text ne "This attribute has handles as follows:\n" ) ? "\n\n$handles_text" : '' )."\n\n"; + } + } + my $role_verb = "consume".( $#roles == 0 ? 's role' : ' roles' ); + + $text .= "=head1 Moose::Exception::$file\n\nThis class is a subclass of $superclasses". +( defined $consumed_roles ? " and $role_verb $consumed_roles.": '.' ). +"\n\n=over 4\n\n=back\n\n=head2 ATTRIBUTES\n\n=over 4\n\n". +( defined $attributes_text ? "$attributes_text\n\n" : '' ); + + $text = fix_line_length( $text ); + $text .= $exception_messages; + $number++; + $text =~ s/\s+$//; + $text .= "\n\n"; + } + } + + return $text; +} + +sub fix_line_length { + my $doc = shift; + + my @tokens = split /\n/, $doc; + + my $str; + foreach( @tokens ) { + my $string = shorten_to_eighty($_); + $str .= ($string."\n"); + } + return $str."\n"; +} + +sub shorten_to_eighty { + my ($str) = @_; + if( length $str > 80 && length $str != 81 ) { + my $s1 = substr($str, 0, 80); + my $s2 = substr($str, 80); + my $substr1 = substr($s1, length($s1) - 1 ); + my $substr2 = substr($s2, 0, 1); + $s1 =~ s/[\s]+$//g; + $s2 =~ s/[\s]+$//g; + if( ( $substr1 =~ /[\(\)\[\w:,'"<>\]\$]/ ) && ( $substr2 =~ /[\$'"\(\)\[<>\w:,\]]/ ) ) { + if( $s1 =~ s/\s([\(\)\[<:\w+>,"'\]\$]+)$// ) { + $s1 =~ s/[\s]+$//g; + $s2 = $1.$s2; + $s2 =~ s/[\s]+$//g; + my $s3 = shorten_to_eighty( $s2 ); + $s3 =~ s/[\s]+$//g; + $s2 =~ s/[\s]+$//g; + if( $s2 ne $s3 ) { + return "$s1\n$s3"; + } else { + return "$s1\n$s2"; + } + } + } + return "$s1\n$s2"; + } + else + { + return $str; + } +} + +sub place_commas_and_and { + my @array = @_; + my ($str, $last_undef); + + for( my $i = 0; $i <= $#array; $i++ ) { + my $element = $array[$i]; + if( !(defined $element ) ) { + $last_undef = 1; + next; + } + if ( $i == 0 || ( $last_undef && $i == 1 ) ) { + $str .= "L<$element>"; + } elsif( $i == $#array ) { + $str .= " and L<$element>"; + } else { + $str .= ", L<$element>"; + } + $last_undef = 0; + } + return $str; +} + +sub get_exceptions_to_messages { + my $test_dir; + my $test_path = 't/exceptions/'; + + my %hash; + + opendir( $test_dir, $test_path ) or die $!; + + my $file; + while( $file = readdir( $test_dir ) ) { + my $file_handle; + + open( $file_handle, "t/exceptions/$file" ) or die $!; + my ($message, $exception); + while( <$file_handle> ) { + if( /like\($/ ) { + my $exception_var = <$file_handle>; + if( $exception_var =~ /\$exception,$/ ) { + $message = <$file_handle>; + if( $message =~ q/\$\w+/ || ( $message =~ /\\\(\w+\\\)/) ) { + my $garbage = <$file_handle>; + $message = <$file_handle>; + $message =~ s/^\s+#//; + } + $message =~ s!^\s*qr(/|\!)(\^)?(\\Q)?!!; + $message =~ s!(/|\!),$!!; + } + } elsif( /isa_ok\($/ ) { + my $exception_var = <$file_handle>; + if( $exception_var =~ /\$exception(->error)?,$/ ) { + $exception = <$file_handle>; + if( $exception =~ /Moose::Exception::(\w+)/ ) { + $exception = $1; + } + } + } + + if( ( defined $exception ) && ( defined $message ) ) { + if( exists $hash{$exception} && + ( ref $hash{$exception} eq "ARRAY" ) ) { + my @array = @{$hash{$exception}}; + push @array, $message; + $hash{$exception} = \@array; + } elsif( exists $hash{$exception} && + ( $hash{$exception} ne $message ) ) { + my $msg = $hash{$exception}; + my $array_ref = [ $msg, $message ]; + $hash{$exception} = $array_ref; + } else { + $hash{$exception} = $message; + } + $exception = undef; + $message = undef; + } + } + close $file_handle; + } + + return \%hash; +} diff --git a/author/extract-inline-tests b/author/extract-inline-tests new file mode 100755 index 0000000..aa90787 --- /dev/null +++ b/author/extract-inline-tests @@ -0,0 +1,47 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use File::Find::Rule; +use Getopt::Long; +use Test::Inline; + +use lib 'inc'; +use MyInline; + +my $quiet; +GetOptions( 'quiet' => \$quiet ); + +my $inline = Test::Inline->new( + verbose => !$quiet, + ExtractHandler => 'My::Extract', + ContentHandler => 'My::Content', + OutputHandler => 'My::Output', +); + +for my $pod ( + File::Find::Rule->file->name(qr/\.pod$/)->in('lib/Moose/Cookbook') ) { + $inline->add($pod); +} + +$inline->save; + +{ + + package My::Output; + + use Path::Tiny; + + sub write { + my $class = shift; + my $name = shift; + my $content = shift; + + $name =~ s/^moose_cookbook_//; + + path( "t/recipes/$name" )->spew( $content ); + + return 1; + } +} diff --git a/author/find-dupe-test-numbers b/author/find-dupe-test-numbers new file mode 100755 index 0000000..ce975a0 --- /dev/null +++ b/author/find-dupe-test-numbers @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use File::Basename qw( basename ); + +for my $subdir ( glob 't/*' ) { + my %files; + + for my $file ( map { basename($_) } glob "$subdir/*.t" ) { + my ($number) = $file =~ /^(\d+)/; + next unless defined $number; + + push @{ $files{$number} }, $file; + } + + for my $number ( grep { @{ $files{$_} } > 1 } keys %files ) { + print $subdir, "\n"; + print ' - ', $_, "\n" for @{ $files{$number} }; + print "\n"; + } +} diff --git a/benchmarks/caf_vs_moose.pl b/benchmarks/caf_vs_moose.pl new file mode 100644 index 0000000..ef6ef28 --- /dev/null +++ b/benchmarks/caf_vs_moose.pl @@ -0,0 +1,85 @@ +#!perl + +### MODULES + +{ + package PlainMoose; + use Moose; + has foo => (is => 'rw'); +} +{ + package MooseImmutable; + use Moose; + has foo => (is => 'rw'); + __PACKAGE__->meta->make_immutable(); +} +{ + package MooseImmutable::NoConstructor; + use Moose; + has foo => (is => 'rw'); + __PACKAGE__->meta->make_immutable(inline_constructor => 0); +} +{ + package ClassAccessorFast; + use warnings; + use strict; + use base 'Class::Accessor::Fast'; + __PACKAGE__->mk_accessors(qw(foo)); +} + +use Benchmark qw(cmpthese); +use Benchmark ':hireswallclock'; + +my $moose = PlainMoose->new; +my $moose_immut = MooseImmutable->new; +my $moose_immut_no_const = MooseImmutable::NoConstructor->new; +my $caf = ClassAccessorFast->new; + +my $acc_rounds = 100_000; +my $ins_rounds = 100_000; + +print "\nSETTING\n"; +cmpthese($acc_rounds, { + Moose => sub { $moose->foo(23) }, + MooseImmutable => sub { $moose_immut->foo(23) }, + MooseImmutableNoConstructor => sub { $moose_immut_no_const->foo(23) }, + ClassAccessorFast => sub { $caf->foo(23) }, +}, 'noc'); + +print "\nGETTING\n"; +cmpthese($acc_rounds, { + Moose => sub { $moose->foo }, + MooseImmutable => sub { $moose_immut->foo }, + MooseImmutableNoConstructor => sub { $moose_immut_no_const->foo }, + ClassAccessorFast => sub { $caf->foo }, +}, 'noc'); + +my (@moose, @moose_immut, @moose_immut_no_const, @caf_stall); +print "\nCREATION\n"; +cmpthese($ins_rounds, { + Moose => sub { push @moose, PlainMoose->new(foo => 23) }, + MooseImmutable => sub { push @moose_immut, MooseImmutable->new(foo => 23) }, + MooseImmutableNoConstructor => sub { push @moose_immut_no_const, MooseImmutable::NoConstructor->new(foo => 23) }, + ClassAccessorFast => sub { push @caf_stall, ClassAccessorFast->new({foo => 23}) }, +}, 'noc'); + +my ( $moose_idx, $moose_immut_idx, $moose_immut_no_const_idx, $caf_idx ) = ( 0, 0, 0, 0 ); +print "\nDESTRUCTION\n"; +cmpthese($ins_rounds, { + Moose => sub { + $moose[$moose_idx] = undef; + $moose_idx++; + }, + MooseImmutable => sub { + $moose_immut[$moose_immut_idx] = undef; + $moose_immut_idx++; + }, + MooseImmutableNoConstructor => sub { + $moose_immut_no_const[$moose_immut_no_const_idx] = undef; + $moose_immut_no_const_idx++; + }, + ClassAccessorFast => sub { + $caf_stall[$caf_idx] = undef; + $caf_idx++; + }, +}, 'noc'); diff --git a/benchmarks/cmop/all.yml b/benchmarks/cmop/all.yml new file mode 100644 index 0000000..f0d5758 --- /dev/null +++ b/benchmarks/cmop/all.yml @@ -0,0 +1,29 @@ +--- +- name: Point classes + classes: + - 'MOP::Point' + - 'MOP::Point3D' + - 'MOP::Immutable::Point' + - 'MOP::Immutable::Point3D' + - 'MOP::Installed::Point' + - 'MOP::Installed::Point3D' + - 'Plain::Point' + - 'Plain::Point3D' + benchmarks: + - class: 'Bench::Construct' + name: object construction + args: + y: 137 + - class: 'Bench::Accessor' + name: accessor get + construct: + x: 4 + y: 6 + accessor: x + - class: 'Bench::Accessor' + name: accessor set + construct: + x: 4 + y: 6 + accessor: x + accessor_args: [ 5 ] diff --git a/benchmarks/cmop/foo.pl b/benchmarks/cmop/foo.pl new file mode 100755 index 0000000..e99365b --- /dev/null +++ b/benchmarks/cmop/foo.pl @@ -0,0 +1,5 @@ +#!perl -wd:NYTProf +# a moose using script for profiling +# Usage: perl bench/profile.pl + +require KiokuDB; diff --git a/benchmarks/cmop/lib/Bench/Accessor.pm b/benchmarks/cmop/lib/Bench/Accessor.pm new file mode 100644 index 0000000..3f30239 --- /dev/null +++ b/benchmarks/cmop/lib/Bench/Accessor.pm @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +package Bench::Accessor; +use Moose; +use Moose::Util::TypeConstraints; + +eval { +coerce ArrayRef + => from HashRef + => via { [ %$_ ] }; +}; + +has class => ( + isa => "Str", + is => "ro", +); + +has construct => ( + isa => "ArrayRef", + is => "ro", + auto_deref => 1, + coerce => 1, +); + +has accessor => ( + isa => "Str", + is => "ro", +); + +has accessor_args => ( + isa => "ArrayRef", + is => "ro", + auto_deref => 1, + coerce => 1, +); + +sub code { + my $self = shift; + + my $obj = $self->class->new( $self->construct ); + my @accessor_args = $self->accessor_args; + my $accessor = $self->accessor; + + sub { $obj->$accessor( @accessor_args ) }; +} + +__PACKAGE__; + +__END__ diff --git a/benchmarks/cmop/lib/Bench/Construct.pm b/benchmarks/cmop/lib/Bench/Construct.pm new file mode 100644 index 0000000..c290304 --- /dev/null +++ b/benchmarks/cmop/lib/Bench/Construct.pm @@ -0,0 +1,36 @@ +#!/usr/bin/perl + +package Bench::Construct; +use Moose; +use Moose::Util::TypeConstraints; + +has class => ( + isa => "Str", + is => "ro", +); + +eval { +coerce ArrayRef + => from HashRef + => via { [ %$_ ] }; +}; + +has args => ( + isa => "ArrayRef", + is => "ro", + auto_deref => 1, + coerce => 1, +); + +sub code { + my $self = shift; + + my $class = $self->class; + my @args = $self->args; + + sub { my $obj = $class->new( @args ) } +} + +__PACKAGE__; + +__END__ diff --git a/benchmarks/cmop/lib/Bench/Run.pm b/benchmarks/cmop/lib/Bench/Run.pm new file mode 100644 index 0000000..09ac1b6 --- /dev/null +++ b/benchmarks/cmop/lib/Bench/Run.pm @@ -0,0 +1,55 @@ +#!/usr/bin/perl + +package Bench::Run; +use Moose; + +use Benchmark qw/:hireswallclock :all/; + +has classes => ( + isa => "ArrayRef", + is => "rw", + auto_deref => 1, +); + +has benchmarks => ( + isa => "ArrayRef", + is => "rw", + auto_deref => 1, +); + +has min_time => ( + isa => "Num", + is => "rw", + default => 5, +); + +sub run { + my $self = shift; + + foreach my $bench ( $self->benchmarks ) { + my $bench_class = delete $bench->{class}; + my $name = delete $bench->{name} || $bench_class; + my @bench_args = %$bench; + + eval "require $bench_class"; + die $@ if $@; + + my %res; + + foreach my $class ( $self->classes ) { + eval "require $class"; + die $@ if $@; + + my $b = $bench_class->new( @bench_args, class => $class ); + $res{$class} = countit( $self->min_time, $b->code ); + } + + print "- $name:\n"; + cmpthese( \%res ); + print "\n"; + } +} + +__PACKAGE__; + +__END__ diff --git a/benchmarks/cmop/lib/MOP/Immutable/Point.pm b/benchmarks/cmop/lib/MOP/Immutable/Point.pm new file mode 100644 index 0000000..a0d7c90 --- /dev/null +++ b/benchmarks/cmop/lib/MOP/Immutable/Point.pm @@ -0,0 +1,21 @@ + +package MOP::Immutable::Point; + +use strict; +use warnings; +use metaclass; + +__PACKAGE__->meta->add_attribute('x' => (accessor => 'x', default => 10)); +__PACKAGE__->meta->add_attribute('y' => (accessor => 'y')); + +sub clear { + my $self = shift; + $self->x(0); + $self->y(0); +} + +__PACKAGE__->meta->make_immutable; + +1; + +__END__ diff --git a/benchmarks/cmop/lib/MOP/Immutable/Point3D.pm b/benchmarks/cmop/lib/MOP/Immutable/Point3D.pm new file mode 100644 index 0000000..bf33cf0 --- /dev/null +++ b/benchmarks/cmop/lib/MOP/Immutable/Point3D.pm @@ -0,0 +1,22 @@ + +package MOP::Immutable::Point3D; + +use strict; +use warnings; +use metaclass; + +use base 'MOP::Point'; + +__PACKAGE__->meta->add_attribute('z' => (accessor => 'z')); + +sub clear { + my $self = shift; + $self->SUPER::clear(); + $self->z(0); +} + +__PACKAGE__->meta->make_immutable; + +1; + +__END__ diff --git a/benchmarks/cmop/lib/MOP/Installed/Point.pm b/benchmarks/cmop/lib/MOP/Installed/Point.pm new file mode 100644 index 0000000..9b6e6cf --- /dev/null +++ b/benchmarks/cmop/lib/MOP/Installed/Point.pm @@ -0,0 +1,26 @@ + +use lib reverse @INC; + +package MOP::Installed::Point; + +use strict; +use warnings; +use metaclass; + +__PACKAGE__->meta->add_attribute('x' => (accessor => 'x', default => 10)); +__PACKAGE__->meta->add_attribute('y' => (accessor => 'y')); + +sub new { + my $class = shift; + $class->meta->new_object(@_); +} + +sub clear { + my $self = shift; + $self->x(0); + $self->y(0); +} + +1; + +__END__ diff --git a/benchmarks/cmop/lib/MOP/Installed/Point3D.pm b/benchmarks/cmop/lib/MOP/Installed/Point3D.pm new file mode 100644 index 0000000..e1b66f3 --- /dev/null +++ b/benchmarks/cmop/lib/MOP/Installed/Point3D.pm @@ -0,0 +1,22 @@ + +use lib reverse @INC; + +package MOP::Installed::Point3D; + +use strict; +use warnings; +use metaclass; + +use base 'MOP::Point'; + +__PACKAGE__->meta->add_attribute('z' => (accessor => 'z')); + +sub clear { + my $self = shift; + $self->SUPER::clear(); + $self->z(0); +} + +1; + +__END__ diff --git a/benchmarks/cmop/lib/MOP/Point.pm b/benchmarks/cmop/lib/MOP/Point.pm new file mode 100644 index 0000000..12160f7 --- /dev/null +++ b/benchmarks/cmop/lib/MOP/Point.pm @@ -0,0 +1,24 @@ + +package MOP::Point; + +use strict; +use warnings; +use metaclass; + +__PACKAGE__->meta->add_attribute('x' => (accessor => 'x', default => 10)); +__PACKAGE__->meta->add_attribute('y' => (accessor => 'y')); + +sub new { + my $class = shift; + $class->meta->new_object(@_); +} + +sub clear { + my $self = shift; + $self->x(0); + $self->y(0); +} + +1; + +__END__ diff --git a/benchmarks/cmop/lib/MOP/Point3D.pm b/benchmarks/cmop/lib/MOP/Point3D.pm new file mode 100644 index 0000000..0287499 --- /dev/null +++ b/benchmarks/cmop/lib/MOP/Point3D.pm @@ -0,0 +1,20 @@ + +package MOP::Point3D; + +use strict; +use warnings; +use metaclass; + +use base 'MOP::Point'; + +__PACKAGE__->meta->add_attribute('z' => (accessor => 'z')); + +sub clear { + my $self = shift; + $self->SUPER::clear(); + $self->z(0); +} + +1; + +__END__ diff --git a/benchmarks/cmop/lib/Plain/Point.pm b/benchmarks/cmop/lib/Plain/Point.pm new file mode 100644 index 0000000..3a69f56 --- /dev/null +++ b/benchmarks/cmop/lib/Plain/Point.pm @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +package Plain::Point; + +use strict; +use warnings; + +sub new { + my ( $class, %params ) = @_; + + return bless { + x => $params{x} || 10, + y => $params{y}, + }, $class; +} + +sub x { + my ( $self, @args ) = @_; + + if ( @args ) { + $self->{x} = $args[0]; + } + + return $self->{x}; +} + +sub y { + my ( $self, @args ) = @_; + + if ( @args ) { + $self->{y} = $args[0]; + } + + return $self->{y}; +} + +sub clear { + my $self = shift; + @{$self}{qw/x y/} = (0, 0); +} + +__PACKAGE__; + +__END__ diff --git a/benchmarks/cmop/lib/Plain/Point3D.pm b/benchmarks/cmop/lib/Plain/Point3D.pm new file mode 100644 index 0000000..87a460e --- /dev/null +++ b/benchmarks/cmop/lib/Plain/Point3D.pm @@ -0,0 +1,35 @@ +#!/usr/bin/perl + +package Plain::Point3D; + +use strict; +use warnings; + +use base 'Plain::Point'; + +sub new { + my ( $class, %params ) = @_; + my $self = $class->SUPER::new( %params ); + $self->{z} = $params{z}; + return $self; +} + +sub z { + my ( $self, @args ) = @_; + + if ( @args ) { + $self->{z} = $args[0]; + } + + return $self->{z}; +} + +sub clear { + my $self = shift; + $self->SUPER::clear(); + $self->{z} = 0; +} + +__PACKAGE__; + +__END__ diff --git a/benchmarks/cmop/loading-benchmark.pl b/benchmarks/cmop/loading-benchmark.pl new file mode 100755 index 0000000..612ae63 --- /dev/null +++ b/benchmarks/cmop/loading-benchmark.pl @@ -0,0 +1,27 @@ +#!perl -w +use strict; +use Benchmark qw(:all); + +my ( $count, $module ) = @ARGV; +$count ||= 10; +$module ||= 'Moose'; + +my @blib + = qw(-Iblib/lib -Iblib/arch -I../Moose/blib/lib -I../Moose/blib/arch -I../Moose/lib); + +$| = 1; # autoflush + +print 'Installed: '; +system $^X, '-le', 'require Moose; print $INC{q{Moose.pm}}'; + +print 'Blead: '; +system $^X, @blib, '-le', 'require Moose; print $INC{q{Moose.pm}}'; + +cmpthese timethese $count => { + released => sub { + system( $^X, '-e', "require $module" ) == 0 or die; + }, + blead => sub { + system( $^X, @blib, '-e', "require $module" ) == 0 or die; + }, +}; diff --git a/benchmarks/cmop/profile.pl b/benchmarks/cmop/profile.pl new file mode 100755 index 0000000..4ea5b01 --- /dev/null +++ b/benchmarks/cmop/profile.pl @@ -0,0 +1,25 @@ +#!perl -w +# Usage: perl bench/profile.pl (no other options including -Mblib are reqired) + +use strict; + +my $script = 'bench/foo.pl'; + +my $branch = do { + open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!"; + my $s = scalar <$in>; + chomp $s; + $s =~ s{^ref: \s+ refs/heads/}{}xms; + $s =~ s{/}{_}xmsg; + $s; +}; + +print "Profiling $branch ...\n"; + +my @cmd = ( $^X, '-Iblib/lib', '-Iblib/arch', $script ); +print "> @cmd\n"; +system(@cmd) == 0 or die "Cannot profile"; + +@cmd = ( $^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch" ); +print "> @cmd\n"; +system(@cmd) == 0 or die "Cannot profile"; diff --git a/benchmarks/cmop/run_yml.pl b/benchmarks/cmop/run_yml.pl new file mode 100644 index 0000000..341b640 --- /dev/null +++ b/benchmarks/cmop/run_yml.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/lib"; + +use YAML::Syck; +use Bench::Run; + +my $data = LoadFile( shift || "$FindBin::Bin/all.yml" ); + +foreach my $bench ( @$data ) { + print "== ", delete $bench->{name}, " ==\n\n"; + Bench::Run->new( %$bench )->run; + print "\n\n"; +} diff --git a/benchmarks/immutable.pl b/benchmarks/immutable.pl new file mode 100644 index 0000000..0263404 --- /dev/null +++ b/benchmarks/immutable.pl @@ -0,0 +1,99 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Benchmark qw[cmpthese]; + +use Moose::Util::TypeConstraints; + +{ + package Foo; + use Moose; + Foo->meta->make_immutable(debug => 0); +} + +coerce 'Foo' + => from 'ArrayRef' + => via { Foo->new(@{$_}) }; + +{ + package Foo::Normal; + use Moose; + + has 'default' => (is => 'rw', default => 10); + has 'default_sub' => (is => 'rw', default => sub { [] }); + has 'lazy' => (is => 'rw', default => 10, lazy => 1); + has 'required' => (is => 'rw', required => 1); + has 'weak_ref' => (is => 'rw', weak_ref => 1); + has 'type_constraint' => (is => 'rw', isa => 'Foo'); + has 'coercion' => (is => 'rw', isa => 'Foo', coerce => 1); + + package Bar::Normal; + use Moose; + + extends 'Foo::Normal'; + + has 'default_w_type_constraint' => ( + is => 'rw', + isa => 'Int', + default => 10, + ); +} + +{ + package Foo::Immutable; + use Moose; + + has 'default' => (is => 'rw', default => 10); + has 'default_sub' => (is => 'rw', default => sub { [] }); + has 'lazy' => (is => 'rw', default => 10, lazy => 1); + has 'required' => (is => 'rw', required => 1); + has 'weak_ref' => (is => 'rw', weak_ref => 1); + has 'type_constraint' => (is => 'rw', isa => 'Foo'); + has 'coercion' => (is => 'rw', isa => 'Foo', coerce => 1); + + #sub BUILD { + # # ... + #} + + Foo::Immutable->meta->make_immutable(debug => 0); + + package Bar::Immutable; + use Moose; + + extends 'Foo::Immutable'; + + has 'default_w_type_constraint' => ( + is => 'rw', + isa => 'Int', + default => 10, + ); + + Bar::Immutable->meta->make_immutable(debug => 0); +} + +#__END__ + +my $foo = Foo->new; + +cmpthese(10_000, + { + 'normal' => sub { + Foo::Normal->new( + required => 'BAR', + type_constraint => $foo, + coercion => [], + weak_ref => {}, + ); + }, + 'immutable' => sub { + Foo::Immutable->new( + required => 'BAR', + type_constraint => $foo, + coercion => [], + weak_ref => {}, + ); + }, + } +); \ No newline at end of file diff --git a/benchmarks/lotsa-classes.pl b/benchmarks/lotsa-classes.pl new file mode 100644 index 0000000..c21decd --- /dev/null +++ b/benchmarks/lotsa-classes.pl @@ -0,0 +1,78 @@ +#!/usr/bin/env perl + +use warnings FATAL => 'all'; +use strict; +use File::Temp; +use Path::Class; + +my $number_of_classes = shift || 1500; +my $number_of_attributes = shift || 20; +my $t = shift || File::Temp->newdir; +my $tmp = dir($t); +$tmp->rmtree; +$tmp->mkpath; +(-d $tmp) or die "not a dir: $tmp"; +#print "$tmp\n"; + +my %class_writer = ( + 'Moose' => sub { + my $name = shift; + my $attrs = join '', map { "has '$_' => ( is => 'ro', isa => 'Str' );\n" } @_; + return qq{package $name;\nuse Moose;\n$attrs\n1;\n__END__\n}; + }, + 'MooseImmutable' => sub { + my $name = shift; + my $attrs = join '', map { "has '$_' => ( is => 'ro', isa => 'Str' );\n" } @_; + return qq{package $name;\nuse Moose;\n$attrs\n__PACKAGE__->meta->make_immutable;\n1;\n__END__\n}; + }, + 'Moo' => sub { + my $name = shift; + my $attrs = join'', map { "has '$_' => ( is => 'ro', isa => 'Str' );\n" } @_; + return qq{package $name;\nuse Moo;\n$attrs\n1;\n__END__\n}; + }, + 'Mo' => sub { + my $name = shift; + my $attrs = join'', map { "has '$_' => ( is => 'ro', isa => 'Str' );\n" } @_; + return qq{package $name;\nuse Mo;\n$attrs\n1;\n__END__\n}; + }, + 'Mouse' => sub { + my $name = shift; + my $attrs = join'', map { "has '$_' => ( is => 'ro', isa => 'Str' );\n" } @_; + return qq{package $name;\nuse Mouse;\n$attrs\n1;\n__END__\n}; + }, + 'plain-package' => sub { + my $name = shift; + my $attrs = join'', map { "sub $_ {}\n" } @_; + return qq{package $name;\n$attrs\n1;\n__END__\n}; + }, +); + +my $class_prefix = 'TmpClassThingy'; +my %lib_map; +my @attribute_names = map { 'a' . $_ } 1 .. $number_of_attributes; +for my $module (sort keys %class_writer) { + my $lib = $tmp->subdir($module . '-lib'); + $lib->mkpath; + my $all_fh = $lib->file('All.pm')->openw; + for my $n (1 .. $number_of_classes) { + my $class_name = $class_prefix . $n; + my $fh = $lib->file($class_name . '.pm')->openw; + $fh->say($class_writer{$module}->($class_name, @attribute_names)) or die; + $fh->close or die; + $all_fh->say("use $class_name;") or die; + } + $all_fh->say('1;') or die; + $all_fh->close or die; + $lib_map{$module} = $lib; +} + +#$DB::single = 1; +for my $module (sort keys %lib_map) { + my $lib = $lib_map{$module}; + print "$module\n"; + my $cmd = "time -p $^X -I$lib -MAll -e '1'"; + `$cmd > /dev/null 2>&1`; # to cache +# print "$cmd\n"; + system($cmd); + print "\n"; +} diff --git a/benchmarks/method_modifiers.pl b/benchmarks/method_modifiers.pl new file mode 100755 index 0000000..ac860a9 --- /dev/null +++ b/benchmarks/method_modifiers.pl @@ -0,0 +1,116 @@ +#!perl + +### MODULES + +{ + package PlainParent; + sub new { bless {} => shift } + sub method { "P" } +} +{ + package MooseParent; + use Moose; + sub method { "P" } +} + +{ + package CMMChild::Before; + use Class::Method::Modifiers; + use base 'PlainParent'; + + before method => sub { "B" }; +} +{ + package MooseBefore; + use Moose; + extends 'MooseParent'; + + before method => sub { "B" }; +} + +{ + package CMMChild::Around; + use Class::Method::Modifiers; + use base 'PlainParent'; + + around method => sub { shift->() . "A" }; +} +{ + package MooseAround; + use Moose; + extends 'MooseParent'; + + around method => sub { shift->() . "A" }; +} + +{ + package CMMChild::AllThree; + use Class::Method::Modifiers; + use base 'PlainParent'; + + before method => sub { "B" }; + around method => sub { shift->() . "A" }; + after method => sub { "Z" }; +} +{ + package MooseAllThree; + use Moose; + extends 'MooseParent'; + + before method => sub { "B" }; + around method => sub { shift->() . "A" }; + after method => sub { "Z" }; +} +{ + package CMM::Install; + use Class::Method::Modifiers; + use base 'PlainParent'; +} +{ + package Moose::Install; + use Moose; + extends 'MooseParent'; +} + +use Benchmark qw(cmpthese); +use Benchmark ':hireswallclock'; + +my $rounds = -5; + +my $cmm_before = CMMChild::Before->new(); +my $cmm_around = CMMChild::Around->new(); +my $cmm_allthree = CMMChild::AllThree->new(); + +my $moose_before = MooseBefore->new(); +my $moose_around = MooseAround->new(); +my $moose_allthree = MooseAllThree->new(); + +print "\nBEFORE\n"; +cmpthese($rounds, { + Moose => sub { $moose_before->method() }, + ClassMethodModifiers => sub { $cmm_before->method() }, +}, 'noc'); + +print "\nAROUND\n"; +cmpthese($rounds, { + Moose => sub { $moose_around->method() }, + ClassMethodModifiers => sub { $cmm_around->method() }, +}, 'noc'); + +print "\nALL THREE\n"; +cmpthese($rounds, { + Moose => sub { $moose_allthree->method() }, + ClassMethodModifiers => sub { $cmm_allthree->method() }, +}, 'noc'); + +print "\nINSTALL AROUND\n"; +cmpthese($rounds, { + Moose => sub { + package Moose::Install; + Moose::Install::around(method => sub {}); + }, + ClassMethodModifiers => sub { + package CMM::Install; + CMM::Install::around(method => sub {}); + }, +}, 'noc'); diff --git a/benchmarks/moose_bench.pl b/benchmarks/moose_bench.pl new file mode 100755 index 0000000..b8dc426 --- /dev/null +++ b/benchmarks/moose_bench.pl @@ -0,0 +1,152 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Time::HiRes 'time'; +use List::Util 'sum'; +use IPC::System::Simple 'system'; +use autodie; +use Parse::BACKPAN::Packages; +use LWP::Simple; +use Archive::Tar; +use Path::Tiny; + +my $backpan = Parse::BACKPAN::Packages->new; +my @cmops = $backpan->distributions('Class-MOP'); +my @mooses = $backpan->distributions('Moose'); + +my $cmop_version = 0; +my $cmop_dir; + +my $base = "http://backpan.cpan.org/"; + +my %time; +my %mem; + +open my $output, ">", "moose_bench.txt"; + +for my $moose (@mooses) { + my $moose_dir = build($moose); + + # Find the CMOP dependency + my $makefile = path("$moose_dir/Makefile.PL")->slurp_utf8; + my ($cmop_dep) = $makefile =~ /Class::MOP.*?([0-9._]+)/ + or die "Unable to find Class::MOP version dependency in $moose_dir/Makefile.PL"; + + # typo? + $cmop_dep = '0.64_07' if $cmop_dep eq '0.6407'; + + # nonexistent dev releases? + $cmop_dep = '0.79' if $cmop_dep eq '0.78_02'; + $cmop_dep = '0.83' if $cmop_dep eq '0.82_01'; + + bump_cmop($cmop_dep, $moose); + + warn "Building $moose_dir"; + eval { + system("(cd '$moose_dir' && '$^X' '-I$cmop_dir/lib' Makefile.PL && make && sudo make install) >/dev/null"); + + my @times; + for (1 .. 5) { + my $start = time; + system( + $^X, + "-I$moose_dir/lib", + "-I$cmop_dir/lib", + '-e', 'package Class; use Moose;', + ); + push @times, time - $start; + } + + $time{$moose->version} = sum(@times) / @times; + $mem{$moose->version} = qx[$^X -I$moose_dir/lib -I$cmop_dir/lib -MGTop -e 'my (\$gtop, \$before); BEGIN { \$gtop = GTop->new; \$before = \$gtop->proc_mem(\$\$)->size; } package Class; use Moose; print \$gtop->proc_mem(\$\$)->size - \$before']; + my $line = sprintf "%7s: %0.4f (%s), %d bytes\n", + $moose->version, + $time{$moose->version}, + join(', ', map { sprintf "%0.4f", $_ } @times), + $mem{$moose->version}; + print $output $line; + }; + warn $@ if $@; +} + +require Chart::Clicker; +require Chart::Clicker::Data::Series; +require Chart::Clicker::Data::DataSet; +my @versions = sort keys %time; +my @startups = map { $time{$_} } @versions; +my @memories = map { int($mem{$_} / 1024) } @versions; +my @keys = (0..$#versions); +my $cc = Chart::Clicker->new(width => 900, height => 400); +my $sutime = Chart::Clicker::Data::Series->new( + values => \@startups, + keys => \@keys, + name => 'Startup Time', +); +my $def = $cc->get_context('default'); +$def->domain_axis->tick_values(\@keys); +$def->domain_axis->tick_labels(\@versions); +$def->domain_axis->tick_label_angle(1.57); +$def->domain_axis->tick_font->size(8); +$def->range_axis->fudge_amount('0.05'); + +my $context = Chart::Clicker::Context->new(name => 'memory'); +$context->range_axis->tick_values([qw(1024 2048 3072 4096 5120)]); +$context->range_axis->format('%d'); +$context->domain_axis->hidden(1); +$context->range_axis->fudge_amount('0.05'); +$cc->add_to_contexts($context); + +my $musage = Chart::Clicker::Data::Series->new( + values => \@memories, + keys => \@keys, + name => 'Memory Usage (kb)' +); + +my $ds1 = Chart::Clicker::Data::DataSet->new(series => [ $sutime ]); +my $ds2 = Chart::Clicker::Data::DataSet->new(series => [ $musage ]); +$ds2->context('memory'); + +$cc->add_to_datasets($ds1); +$cc->add_to_datasets($ds2); +$cc->write_output('moose_bench.png'); + +sub bump_cmop { + my $expected = shift; + my $moose = shift; + + return $cmop_dir if $cmop_version eq $expected; + + my @orig_cmops = @cmops; + shift @cmops until !@cmops || $cmops[0]->version eq $expected; + + die "Ran out of cmops, wanted $expected for " + . $moose->distvname + . " (had " . join(', ', map { $_->version } @orig_cmops) . ")" + if !@cmops; + + $cmop_version = $cmops[0]->version; + $cmop_dir = build($cmops[0]); + + warn "Building $cmop_dir"; + system("(cd '$cmop_dir' && '$^X' Makefile.PL && make && sudo make install) >/dev/null"); + + return $cmop_dir; +} + +sub build { + my $dist = shift; + my $distvname = $dist->distvname; + return $distvname if -d $distvname; + + warn "Downloading $distvname"; + my $tarball = get($base . $dist->prefix); + open my $handle, '<', \$tarball; + + my $tar = Archive::Tar->new; + $tar->read($handle); + $tar->extract; + + my ($arbitrary_file) = $tar->list_files; + (my $directory = $arbitrary_file) =~ s{/.*}{}; + return $directory; +} diff --git a/benchmarks/simple_class.pl b/benchmarks/simple_class.pl new file mode 100644 index 0000000..f0061f1 --- /dev/null +++ b/benchmarks/simple_class.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Benchmark::Forking qw[cmpthese]; + +=pod + +This compares the burden of a basic Moose +class to a basic Class::MOP class. + +It is worth noting that the basic Moose +class will also create a type constraint +as well as export many subs, so this comparison +is really not fair :) + +=cut + +cmpthese(5_000, + { + 'w/out_moose' => sub { + eval 'package Bar; use metaclass;'; + }, + 'w_moose' => sub { + eval 'package Baz; use Moose;'; + }, + } +); + +1; \ No newline at end of file diff --git a/benchmarks/simple_compile.pl b/benchmarks/simple_compile.pl new file mode 100644 index 0000000..4b5b4a8 --- /dev/null +++ b/benchmarks/simple_compile.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Benchmark::Forking qw[cmpthese]; + +=pod + +This compare the overhead of Class::MOP +to the overhead of Moose. + +The goal here is to see how much more +startup cost Moose adds to Class::MOP. + +NOTE: +This benchmark may not be all that +relevant really, but it's helpful to +see maybe. + +=cut + +cmpthese(5_000, + { + 'w/out_moose' => sub { + eval 'use Class::MOP;'; + }, + 'w_moose' => sub { + eval 'use Moose;'; + }, + } +); + +1; \ No newline at end of file diff --git a/benchmarks/simple_constructor.pl b/benchmarks/simple_constructor.pl new file mode 100644 index 0000000..def63ed --- /dev/null +++ b/benchmarks/simple_constructor.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my $num_iterations = shift || 100; + +{ + package Foo; + use Moose; + + has 'default' => (is => 'rw', default => 10); + has 'default_sub' => (is => 'rw', default => sub { [] }); + has 'lazy' => (is => 'rw', default => 10, lazy => 1); + has 'required' => (is => 'rw', required => 1); + has 'weak_ref' => (is => 'rw', weak_ref => 1); + has 'type_constraint' => (is => 'rw', isa => 'ArrayRef'); +} + +foreach (0 .. $num_iterations) { + my $foo = Foo->new( + required => 'BAR', + type_constraint => [], + weak_ref => {}, + ); +} \ No newline at end of file diff --git a/benchmarks/type_constraints.pl b/benchmarks/type_constraints.pl new file mode 100644 index 0000000..e9b29f8 --- /dev/null +++ b/benchmarks/type_constraints.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Benchmark qw[cmpthese]; + +=pod + +This benchmark compares the overhead of a +auto-created type constraint vs. none at +all vs. a custom-created type. + +=cut + +{ + package Foo; + use Moose; + use Moose::Util::TypeConstraints; + + has 'baz' => (is => 'rw'); + has 'bar' => (is => 'rw', isa => 'Foo'); +} + +{ + package Bar; + + sub new { bless {} => __PACKAGE__ } + sub bar { + my $self = shift; + $self->{bar} = shift if @_; + $self->{bar}; + } +} + +my $foo = Foo->new; +my $bar = Bar->new; + +cmpthese(200_000, + { + 'hand coded' => sub { + $bar->bar($bar); + }, + 'w/out_constraint' => sub { + $foo->baz($foo); + }, + 'w_constraint' => sub { + $foo->bar($foo); + }, + } +); + +1; \ No newline at end of file diff --git a/benchmarks/type_constraints2.pl b/benchmarks/type_constraints2.pl new file mode 100644 index 0000000..7c97b99 --- /dev/null +++ b/benchmarks/type_constraints2.pl @@ -0,0 +1,153 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Benchmark qw[timethese]; + +=pod + +This benchmark is designed to measure how long things with type constraints +take (constructors, accessors). It was created to measure the impact of +inlining type constraints. + +=cut + +{ + package Thing; + + use Moose; + + has int => ( + is => 'rw', + isa => 'Int', + ); + + has str => ( + is => 'rw', + isa => 'Str', + ); + + has fh => ( + is => 'rw', + isa => 'FileHandle', + ); + + has object => ( + is => 'rw', + isa => 'Object', + ); + + has a_int => ( + is => 'rw', + isa => 'ArrayRef[Int]', + ); + + has a_str => ( + is => 'rw', + isa => 'ArrayRef[Str]', + ); + + has a_fh => ( + is => 'rw', + isa => 'ArrayRef[FileHandle]', + ); + + has a_object => ( + is => 'rw', + isa => 'ArrayRef[Object]', + ); + + has h_int => ( + is => 'rw', + isa => 'HashRef[Int]', + ); + + has h_str => ( + is => 'rw', + isa => 'HashRef[Str]', + ); + + has h_fh => ( + is => 'rw', + isa => 'HashRef[FileHandle]', + ); + + has h_object => ( + is => 'rw', + isa => 'HashRef[Object]', + ); + + __PACKAGE__->meta->make_immutable; +} + +{ + package Simple; + use Moose; + + has str => ( + is => 'rw', + isa => 'Str', + ); + + __PACKAGE__->meta->make_immutable; +} + +my @ints = 1 .. 10; +my @strs = 'a' .. 'j'; +my @fhs = map { my $fh; open $fh, '<', $0 or die; $fh; } 1 .. 10; +my @objects = map { Thing->new } 1 .. 10; + +my %ints = map { $_ => $_ } @ints; +my %strs = map { $_ => $_ } @ints; +my %fhs = map { $_ => $_ } @fhs; +my %objects = map { $_ => $_ } @objects; + +my $thing = Thing->new; +my $simple = Simple->new; + +timethese( + 1_000_000, { + constructor_simple => sub { + Simple->new( str => $strs[0] ); + }, + accessors_simple => sub { + $simple->str( $strs[0] ); + }, + } +); + +timethese( + 20_000, { + constructor_all => sub { + Thing->new( + int => $ints[0], + str => $strs[0], + fh => $fhs[0], + object => $objects[0], + a_int => \@ints, + a_str => \@strs, + a_fh => \@fhs, + a_object => \@objects, + h_int => \%ints, + h_str => \%strs, + h_fh => \%fhs, + h_object => \%objects, + ); + }, + accessors_all => sub { + $thing->int( $ints[0] ); + $thing->str( $strs[0] ); + $thing->fh( $fhs[0] ); + $thing->object( $objects[0] ); + $thing->a_int( \@ints ); + $thing->a_str( \@strs ); + $thing->a_fh( \@fhs ); + $thing->a_object( \@objects ); + $thing->h_int( \%ints ); + $thing->h_str( \%strs ); + $thing->h_fh( \%fhs ); + $thing->h_object( \%objects ); + }, + } +); diff --git a/bin/moose-outdated b/bin/moose-outdated new file mode 100644 index 0000000..341daf1 --- /dev/null +++ b/bin/moose-outdated @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use strict; +use warnings; +# PODNAME: moose-outdated + +# this script was generated with Dist::Zilla::Plugin::Conflicts 0.17 + +use Getopt::Long; +use Moose::Conflicts; + +my $verbose; +GetOptions( 'verbose|v' => \$verbose ); + +if ($verbose) { + Moose::Conflicts->check_conflicts; +} +else { + my @conflicts = Moose::Conflicts->calculate_conflicts; + print "$_\n" for map { $_->{package} } @conflicts; + exit @conflicts; +} diff --git a/dist.ini b/dist.ini new file mode 100644 index 0000000..37924c1 --- /dev/null +++ b/dist.ini @@ -0,0 +1,464 @@ +name = Moose +author = Stevan Little +author = Dave Rolsky +author = Jesse Luehrs +author = Shawn M Moore +author = יובל קוג'מן (Yuval Kogman) +author = Karen Etheridge +author = Florian Ragwitz +author = Hans Dieter Pearcey +author = Chris Prather +author = Matt S Trout +license = Perl_5 +copyright_holder = Infinity Interactive, Inc. +copyright_year = 2006 + +; $VERSION will be extracted from lib/Moose.pm, +; or override it with $ENV{V} + +[EnsurePrereqsInstalled] +:version = 0.003 +build_phase = release ; be nice to travis +type = requires +type = recommends + +[Git::GatherDir] +exclude_match = ^t/recipes/(?!basics_genome_overloadingsubtypesandcoercion) +exclude_filename = Makefile.PL +exclude_filename = LICENSE + +[MetaYAML] +[MetaJSON] +[License] +[ExecDir] +[ShareDir] + +; authordep Dist::Zilla::Plugin::MakeMaker::Awesome +[=inc::MakeMaker] +default_jobs = 9 + +[Manifest] + +[MetaConfig] + +[=inc::SimpleAuthority] + +[MetaResources] +bugtracker.web = https://rt.cpan.org/Dist/Display.html?Name=Moose +bugtracker.mailto = bug-moose@rt.cpan.org +homepage = http://moose.perl.org/ +repository.url = git://github.com/moose/Moose.git +repository.web = https://github.com/moose/Moose +repository.type = git +x_IRC = irc://irc.perl.org/#moose +x_MailingList = http://lists.perl.org/list/moose.html + +[FileFinder::ByName / PodModules] +dir = lib +file = *.pod + +[FileFinder::Filter / ModulesSansPod] +finder = :InstallModules +skip = \.pod$ + +[FileFinder::Filter / VersionedModules] +finder = :InstallModules +skip = \.pod$ +skip = ^lib/Moose/Conflicts.pm$ + +[=inc::SimpleProvides] +finder = PodModules + +[MetaProvides::Package] +meta_noindex = 1 +:version = 1.15000002 +finder = ModulesSansPod ; to avoid "No namespaces detected in file..." spewage + +[MetaNoIndex] +package = Class::MOP::Class::Immutable::Trait +package = Class::MOP::Deprecated +package = Class::MOP::MiniTrait +package = Class::MOP::Mixin +namespace = Class::MOP::Mixin +package = Moose::Deprecated +package = Moose::Meta::Attribute::Native::Trait +package = Moose::Meta::Class::Immutable::Trait +package = Moose::Meta::Method::Accessor::Native +namespace = Moose::Meta::Method::Accessor::Native +namespace = Moose::Meta::Mixin +package = Moose::Meta::Object::Trait +package = Moose::Util::TypeConstraints::Builtins +directory = author +directory = benchmarks +directory = doc +directory = inc + +[Git::Contributors] + +[SurgicalPodWeaver] +:version = 0.0023 +replacer = replace_with_comment +post_code_replacer = replace_with_nothing + +[RewriteVersion] +finder = VersionedModules + +[Git::Describe] +:version = 0.004 +on_package_line = 1 + +; authordep Test::Inline +; authordep File::Find::Rule +; authordep Test::Inline::Extract +[=inc::ExtractInlineTests] + +[PromptIfStale] +phase = release +check_all_prereqs = 1 +check_all_plugins = 1 + +[Test::EOL] +:version = 0.14 +[PodSyntaxTests] +[Test::NoTabs] +[MetaTests] +[Test::Kwalitee] +skiptest = use_strict ; temporary, until RT#94468 is fixed + +[MojibakeTests] +[RunExtraTests] +default_jobs = 9 + +[Test::ReportPrereqs] +include = Algorithm::C3 +include = DBM::Deep +include = DateTime +include = DateTime::Calendar::Mayan +include = DateTime::Format::MySQL +include = Declare::Constraints::Simple +include = Dist::CheckConflicts +include = HTTP::Headers +include = IO::File +include = IO::String +include = Locale::US +include = Module::Refresh +include = MooseX::NonMoose +include = Params::Coerce +include = Regexp::Common +include = SUPER +include = Test::Deep +include = Test::DependentModules +include = Test::LeakTrace +include = Test::Output +include = URI + +[Test::CPAN::Changes] + +[Test::Compile] +:version = 2.037 +phase = develop +filename = xt/release/00-compile.t +bail_out_on_fail = 1 +; this serves as a TODO list for getting all modules to load independently -- +; see RT#89536 +skip = ^Class::MOP::Attribute$ +skip = ^Class::MOP::Class$ +skip = ^Class::MOP::Method::Accessor$ +skip = ^Class::MOP::Method::Constructor$ +skip = ^Class::MOP::Method::Inlined$ +skip = ^Class::MOP::Method::Wrapped$ +skip = ^Class::MOP::Mixin::HasAttributes$ +skip = ^Class::MOP::Module$ +skip = ^Class::MOP::Package$ +skip = ^Moose::Meta::Attribute$ +skip = ^Moose::Meta::Attribute::Native$ +skip = ^Moose::Meta::Mixin::AttributeCore$ +skip = ^Moose::Meta::Role::Attribute$ +skip = ^Moose::Meta::TypeConstraint::Class$ +skip = ^Moose::Meta::TypeConstraint::DuckType$ +skip = ^Moose::Meta::TypeConstraint::Enum$ +skip = ^Moose::Meta::TypeConstraint::Parameterizable$ +skip = ^Moose::Meta::TypeConstraint::Parameterized$ +skip = ^Moose::Meta::TypeConstraint::Role$ +skip = ^Moose::Meta::TypeConstraint::Union$ + +[=inc::CheckReleaseType] +[CheckVersionIncrement] + +; we would like to have this, but currently there are false negatives: +; https://rt.cpan.org/Ticket/Display.html?id=87883 +; https://rt.cpan.org/Ticket/Display.html?id=87884 +;[Test::MinimumVersion] +;:version = 2.000003 +;max_target_perl = 5.008003 + +[CheckChangesHasContent] +;[CheckPrereqsIndexed] + +; all runtime deps must be author deps +[Prereqs] + Carp = 1.22 +;authordep Carp = 1.22 + Class::Load = 0.09 +;authordep Class::Load = 0.09 + Class::Load::XS = 0.01 +;authordep Class::Load::XS = 0.01 + Data::OptList = 0.107 +;authordep Data::OptList = 0.107 + Devel::GlobalDestruction = 0 +;authordep Devel::GlobalDestruction = 0 + Devel::OverloadInfo = 0.002 +;authordep Devel::OverloadInfo = 0.002 + Devel::StackTrace = 1.33 +;authordep Devel::StackTrace = 1.33 + Eval::Closure = 0.04 +;authordep Eval::Closure = 0.04 + List::MoreUtils = 0.28 +;authordep List::MoreUtils = 0.28 + List::Util = 1.35 +;authordep List::Util = 1.35 + MRO::Compat = 0.05 +;authordep MRO::Compat = 0.05 + Module::Runtime = 0.014 +;authordep Module::Runtime = 0.014 + Module::Runtime::Conflicts = 0.002 +;authordep Module::Runtime::Conflicts = 0.002 + Package::DeprecationManager = 0.11 +;authordep Package::DeprecationManager = 0.11 + Package::Stash = 0.32 +;authordep Package::Stash = 0.32 + Package::Stash::XS = 0.24 +;authordep Package::Stash::XS = 0.24 + Params::Util = 1.00 +;authordep Params::Util = 1.00 + Scalar::Util = 1.19 +;authordep Scalar::Util = 1.19 + Sub::Exporter = 0.980 +;authordep Sub::Exporter = 0.980 + Sub::Identify = 0 +;authordep Sub::Identify = 0 + Sub::Name = 0.05 +;authordep Sub::Name = 0.05 + Task::Weaken = 0 +;authordep Task::Weaken = 0 + Try::Tiny = 0.17 +;authordep Try::Tiny = 0.17 + parent = 0.223 +;authordep parent = 0.223 + perl = 5.8.3 +;authordep perl = 5.8.3 + strict = 1.03 +;authordep strict = 1.03 + warnings = 1.03 +;authordep warnings = 1.03 + +[Prereqs / TestRequires] +Test::CleanNamespaces = 0.13 +Test::Fatal = 0.001 +Test::More = 0.88 +Test::Requires = 0.05 +Test::Warnings = 0.016 + +; all configure deps must be author deps +[Prereqs / ConfigureRequires] + ExtUtils::CBuilder = 0.27 +;authordep ExtUtils::CBuilder = 0.27 + File::Spec = 0 +;authordep File::Spec = 0 +;Config = 0 ; not actually in 02packages.details.txt!!! + +[Prereqs::AuthorDeps] +relation = suggests +exclude = inc::CheckAuthorDeps +exclude = inc::CheckDelta +exclude = inc::CheckReleaseType +exclude = inc::Clean +exclude = inc::ExtractInlineTests +exclude = inc::GenerateDocs +exclude = inc::GitUpToDate +exclude = inc::MMHelper +exclude = inc::MakeMaker +exclude = inc::MyInline +exclude = inc::SimpleAuthority +exclude = inc::SimpleProvides +exclude = inc::TestRelease + +; mostly, these are things needed by xt tests +[Prereqs / DevelopRequires] +Algorithm::C3 = 0 +Class::Load = 0.07 +DBM::Deep = 1.003 +Data::Visitor = 0 +DateTime = 0 +DateTime::Calendar::Mayan = 0 +DateTime::Format::MySQL = 0 +Declare::Constraints::Simple = 0 +ExtUtils::MakeMaker::Dist::Zilla::Develop = 0 +File::Find::Rule = 0 +HTTP::Headers = 0 +IO::File = 0 +IO::String = 0 +Locale::US = 0 +Module::CPANTS::Analyse = 0.92 +Module::Refresh = 0 +MooseX::MarkAsMethods = 0 +MooseX::NonMoose = 0 +PadWalker = 0 +Params::Coerce = 0 +Regexp::Common = 0 +SUPER = 1.10 +Specio = 0.10 +Test::Deep = 0 +;Test::DependentModules = 0.13 ; bad dep chain, used by a disabled test. +Test::Inline = 0 +Test::Kwalitee = 1.15 +Test::LeakTrace = 0 +Test::Memory::Cycle = 0 +Test::Output = 0 +Test::Pod::Coverage = 1.04 +Test::Spelling = 0 +URI = 0 +blib = 0 + +[Prereqs / RuntimeSuggests] +; this needs to be installed *after*, since it deps on Moose +; remove this if this is an issue +Devel::PartialDump = 0.14 + +[Conflicts] +:version = 0.16 +-script = bin/moose-outdated +Catalyst = 5.90049999 +Config::MVP = 2.200004 +Devel::REPL = 1.003020 +Dist::Zilla::Plugin::Git = 2.016 +Fey = 0.36 +Fey::ORM = 0.42 +File::ChangeNotify = 0.15 +HTTP::Throwable = 0.017 +KiokuDB = 0.51 +Markdent = 0.16 +Mason = 2.18 +MooseX::ABC = 0.05 +MooseX::Aliases = 0.08 +MooseX::AlwaysCoerce = 0.13 +MooseX::App = 1.22 +MooseX::Attribute::Deflator = 2.1.7 +MooseX::Attribute::Dependent = 1.1.0 +MooseX::Attribute::Prototype = 0.10 +MooseX::AttributeHelpers = 0.22 +MooseX::AttributeIndexes = 1.0.0 +MooseX::AttributeInflate = 0.02 +MooseX::CascadeClearing = 0.03 +MooseX::ClassAttribute = 0.26 +MooseX::Constructor::AllErrors = 0.021 +MooseX::Declare = 0.35 +MooseX::FollowPBP = 0.02 +MooseX::Getopt = 0.56 +MooseX::InstanceTracking = 0.04 +MooseX::LazyRequire = 0.06 +MooseX::Meta::Attribute::Index = 0.04 +MooseX::Meta::Attribute::Lvalue = 0.05 +MooseX::Method::Signatures = 0.44 +MooseX::MethodAttributes = 0.22 +MooseX::NonMoose = 0.24 +MooseX::Object::Pluggable = 0.0011 +MooseX::POE = 0.214 +MooseX::Params::Validate = 0.05 +MooseX::PrivateSetters = 0.03 +MooseX::Role::Cmd = 0.06 +MooseX::Role::Parameterized = 1.00 +MooseX::Role::WithOverloading = 0.14 +MooseX::Runnable = 0.03 +MooseX::Scaffold = 0.05 +MooseX::SemiAffordanceAccessor = 0.05 +MooseX::SetOnce = 0.100473 +MooseX::Singleton = 0.25 +MooseX::SlurpyConstructor = 1.1 +MooseX::Storage = 0.42 +MooseX::StrictConstructor = 0.12 +MooseX::Traits = 0.11 +MooseX::Types = 0.19 +MooseX::Types::Parameterizable = 0.05 +MooseX::Types::Set::Object = 0.03 +MooseX::Types::Signal = 1.101930 +MooseX::UndefTolerant = 0.11 +PRANG = 0.14 +Pod::Elemental = 0.093280 +Pod::Weaver = 3.101638 +Reaction = 0.002003 +Test::Able = 0.10 +Test::CleanNamespaces = 0.03 +Test::Moose::More = 0.022 +Test::TempDir = 0.05 +Throwable = 0.102080 +namespace::autoclean = 0.08 + +[Test::CheckBreaks] +conflicts_module = Moose::Conflicts + +; authordep Dist::Zilla::Util::AuthorDeps = 5.021 +; authordep CPAN::Meta::Requirements +; authordep Test::Deep +[=inc::CheckAuthorDeps] + +[=inc::CheckDelta] +[=inc::GitUpToDate] + +[Git::Remote::Check] +branch = stable/2.14 +remote_branch = stable/2.14 + +[Git::CheckFor::CorrectBranch] +release_branch = stable/2.14 + +[Git::Check] +allow_dirty = + +[TestRelease] +[UploadToCPAN] + +[CopyFilesFromRelease] +filename = Changes +filename = LICENSE + +[Git::Commit / release snapshot] +allow_dirty = Changes +allow_dirty = LICENSE +commit_msg = %N-%v%t%n%n%c + +[Git::Tag] +tag_format = %v +tag_message = %v%t + +[BumpVersionAfterRelease] +finder = VersionedModules + +[NextRelease] +:version = 5.033 +format = %-7v %{yyyy-MM-dd}d%{ (TRIAL RELEASE)}T + +[Git::Commit / increment version] +allow_dirty = Changes +allow_dirty_match = ^lib/.*\.pm$ +commit_msg = increment version after release + +[Git::Push] + +; note: this is going to die if releasing from an older release branch (the +; merge won't go in cleanly) +[Run::AfterRelease] +run = git checkout master +run = git merge --ff-only stable/2.14 +run = git push + +; authordep Class::Load +; authordep IPC::System::Simple +; authordep File::pushd +; authordep Path::Tiny +[=inc::GenerateDocs] + +[=inc::Clean] + +; last, so all before-release checks can occur first before prompting +[ConfirmRelease] diff --git a/doc/moosex-compile b/doc/moosex-compile new file mode 100644 index 0000000..7d0a049 --- /dev/null +++ b/doc/moosex-compile @@ -0,0 +1,176 @@ +MooseX-Compile, wherein Yuval explains how MooseX::Compile is supposed to work and what needs doing. + +TODO: PLEASE EDIT ME + +19:11 hiya +19:12 hola +19:13 so, my empty mail was an attempted abort +19:13 but was going to be "MX::Compile doesn't depend on MX::Compile::CLI. should it?" +19:13 ah, ok =) +19:13 but i'm without my laptop, so i couldn't actually check my assumption +19:14 no, because MX::Compile::CLI is "just a a frontend" and at the time the dependencies were a little sketchy +19:14 they've since matured, so maybe it should dep +19:21 * obra nods +19:21 I was on a plane and was trying to see if MX::Compile was at the point where I could try trivial tests +19:22 ah +19:22 so the answer is definitely maybe ;-) +19:22 i haven't been able to make time for it in the past week +19:23 if you guys hand me small, targetted test cases (just commit to it) of code that passes under plain Moose and should pass with MX::Compile i can probably do that stuff pretty quickly +19:23 but the biggest barrier MXC has right now is testing, in order for it to progress towards something production worthy it basically needs to pass the Moose test suite +19:23 except without the Moose test suite's assumptions +19:23 about state and module loading, and all that +19:24 and doing that is a much more daunting prospect than hacking on MXC itself +19:24 understood. the problem is that I still don't have a good sense of how to get it going, even manually +19:24 ah +19:24 none of the test files seem to show off what I need +19:24 i can walk you through thjat +19:25 the assumptions of the system are: +19:25 the class you are compiling is in its own .pm using standard moose sugar +19:25 there is one package in that file +19:26 the compiler object takes the metaclass and the .pm file as args +19:26 it serializes the metaclass to a .mopc file, and the generated code into a .pmc +19:26 the .pmc contains the original .pm verbatim +19:26 except that all the moose sugar does nothing +19:27 meta is overriden to lazy load .mopc +19:27 and the class is supposed to be usable without loading Moose at all +19:27 what is the point of containing the original pm verbatim? +19:27 the user code +19:28 could open and slurp and eval +19:28 but this is a little more flexible +19:28 basically any subroutines the user has written, global/lexical variable initialization, loading of assorted modules etc all must work +19:28 are you using the flexibility? +19:28 (open, slurp, eval sounds suspiciously like "do") +19:29 can't use do/require/etc because it will go to the .pmc +19:29 instead of the .pm +19:29 the flexibility is helpful because you get a lexical set if the code is compiled +19:29 for when you need to do trickery +19:29 see Moose/Object.pm +19:29 I didn't think 'do' had that logic. but ok :) +19:30 anyway +19:30 do go on +19:30 now that we have Devel::Declare that might prove even simpler +19:30 simply replacing has() etc to export the subs inline +19:30 and write the resulting buffers to a .pmc +19:30 but that's for Later™ +19:30 The fact that the TM shows up in my terminal scare me +19:30 but only a bit less than that you typed it ;) +19:30 utf8++ +19:31 ubuntu++ +19:31 most linuxes seem to get that refreshingly right +19:31 so, erm +19:31 yeah. it's pleasant. +19:31 mxcompile +19:31 anyway +19:31 that is a nice frontend to the compiler object +19:31 I guess "what do I need to do to try MX::Compile for prophet+sd?" +19:31 it can recurse through a directory of modules, or take a list of classes +19:31 for starters, role support +19:31 i know how to do it +19:31 but haven't yet +19:32 type constraint support is very primitive +19:32 is that essentially the same code sartak needs to write to give Mouse roles? +19:32 i don't know what that is but doesn't sound likely +19:32 in MXC moose has already done the role composition +19:32 i just need to figure where the data came from, load that file and realias the subs +19:33 (at bootstrap time) +19:33 no role composition per se +19:33 it's nice to make clear that MXC has two "levels" of awesome +19:33 so you can figure out what you can hope to achieve +19:34 100% compiled everything means you don't load Moose or Class::MOP +19:34 until you need runtime reflection +19:34 no codegen at compile time +19:34 it should load as fast as hand written code +19:34 i've had it beating Object::Tiny in some benchmarks =) +19:35 oo +19:35 Moose::XS should aid in making MooseX::Compile's supported feature set easier +19:35 the less awesome level of awesome is just some classes +19:35 you don't pay for those classes' compilation (Role composition, etc) +19:35 (especially since for me perl -MMoose -e1 takes up 50% of "sd help"'s runtime +19:36 (.4s here) +19:36 5.8.8/ +19:36 ? +19:36 yeah +19:36 "that's what's in the wild" +19:36 i'm just curious if it makes a dfif +19:36 * obra nods +19:36 I don't have my macbook right now or I'd test +19:36 trunk moose loads slower +19:36 how much slower? +19:36 but 5.10 loads faster +19:36 negligiably +19:36 i think like 10% +19:36 this was trunk moose as of friday +19:36 but we can fix that +19:36 ah +19:36 my tests aren't scientific. +19:36 trunk moose as of you sending me nytprofs +19:37 actually that's CPAN moose now +19:37 0.35 - 0.45 +19:37 ouch +19:37 well, part of the problem is that it loads *EVERYTHING* +19:37 every type of meta method class, meta type constraint, the role system, etc +19:37 for a big app these probably will get loaded +19:38 but for a small app, especially if you load the various sub modules only as needed, you shouldn't pay for these +19:38 that's a trivial fix that perigrin started working on +19:38 yeah. I played with his branch and saw no change as of last night +19:39 so yeah, we're using roles. if roles aren't ready yet, I won't get far at all. +19:39 (Also, I do really appreciate all the work you're doing. That I'm not paying for, even ;) +19:39 Thank you. +19:39 i will try shaving Moose's own load time with a profile based approach +19:39 It's SO MUCH better than it was +19:39 well, everybody wins =) +19:39 a. you're a friend +19:40 b. part of my job is making Moose work well +19:40 c. your using Moose helps moose directly and indirectly +19:40 d. I LIKE TACOS +19:40 erm, i mean sushi +19:40 so no worries on that +19:41 so, long term goals: +19:41 App::SD etc has all the meta calculations already cached in .mopc and .pmc +19:41 moose is not loaded +19:41 all generated code is cached +19:41 at worst Moose::XS is loaded to install subs with newXS +19:41 that would be really cool +19:41 depending on which actually fairs better +19:42 that goal is realistic, but involves a lot of work +19:42 more realistic short term goals: +19:42 I started playing with try to dump the symbol table, etc +19:42 MooseX::Compile partly speeding up SD +19:42 we can incrementally improve on that +19:42 and found that DD::Streamer is a lot closer than anything has ever been, but it craps out around not being able to dump lvalue subs +19:43 Moose::XS replacing some code gen +19:43 yes, the initial approach was to to try and marshall Moose classes into DDS +19:43 but it wasn't stable enough +19:43 and also there's the problem of imports +19:43 you must serialize the whole table at once +19:43 or manage an intricate web of inter dependencies +19:43 * obra nods +19:44 i sort of work around that by making all the require()/use() statements stay verbatim +19:44 also it doesn't handle xsubs +19:44 how hard would it be to get moose's codegen to write out source code instead of blowing subs into memory? +19:44 so there's guesswork for where ::bootstrap was called +19:44 i was just getting to that = +19:44 =) +19:44 pretty trivial +19:44 heh +19:44 just grunt work +19:44 is that a more viable approach? +19:44 it's one of the limiting parts of MooseX::Compile +19:45 if we clean up that code it will be easier to add support for more features +19:45 but it's not a huge hurdle since it's a very contained problem +19:45 it doesn't directly affect the design of MXC +19:45 is this stuff written down anywhere other than this buffer? +19:45 i don't think so +19:46 where should it get pasted? +19:46 good question =) +19:46 i think #moose-dev is pretty aware +19:46 is there a moose wiki? +19:46 but documenting is good for people to help out +19:46 no, there should be +19:46 yeah. but the goal is to turn it into written docs. +19:46 ok. for now, it should end up in MooseX-Compile/doc/design +19:46 sounds good +19:46 . o O { Thank god I don't have a moose commit bit } +19:47 though most of this affects moose itself though +19:47 * obra nods +19:47 Moose/doc/moosex-compile, then diff --git a/inc/CheckAuthorDeps.pm b/inc/CheckAuthorDeps.pm new file mode 100644 index 0000000..69f2dde --- /dev/null +++ b/inc/CheckAuthorDeps.pm @@ -0,0 +1,52 @@ +use strict; +use warnings; +package inc::CheckAuthorDeps; + +# our goal is to verify that the declared authordeps already reflect +# everything in configure + runtime prerequisites -- otherwise, we won't be +# able to bootstrap our built Moose for the purposes of running +# author/docGenerator.pl + +use Moose; +with 'Dist::Zilla::Role::AfterBuild'; + +sub after_build +{ + my $self = shift; + + # get our authordeps + require Dist::Zilla::Util::AuthorDeps; + Dist::Zilla::Util::AuthorDeps->VERSION(5.021); + + require CPAN::Meta::Requirements; + my $authordeps = CPAN::Meta::Requirements->new; + $authordeps->add_string_requirement(%$_) + foreach @{ Dist::Zilla::Util::AuthorDeps::extract_author_deps('.') }; + + # get our prereqs + my $prereqs = $self->zilla->prereqs; + + # merge prereqs into authordeps + my $merged_prereqs = CPAN::Meta::Requirements->new; + $merged_prereqs->add_requirements($authordeps); + $merged_prereqs->add_requirements($prereqs->requirements_for('configure', 'requires')); + $merged_prereqs->add_requirements($prereqs->requirements_for('runtime', 'requires')); + + # remove some false positives we know we already have fulfilled + $merged_prereqs->clear_requirement('ExtUtils::MakeMaker'); + $merged_prereqs->clear_requirement('Dist::CheckConflicts'); + + # the merged set should not be different than the original authordeps. + require Test::Deep; + my ($ok, $stack) = Test::Deep::cmp_details( + $authordeps->as_string_hash, + Test::Deep::superhashof($merged_prereqs->as_string_hash), + ); + + return if $ok; + + $self->log_fatal('authordeps does not have all prereqs found in configure, runtime prereqs: ' + . Test::Deep::deep_diag($stack)); +} + +1; diff --git a/inc/CheckDelta.pm b/inc/CheckDelta.pm new file mode 100644 index 0000000..d4ef142 --- /dev/null +++ b/inc/CheckDelta.pm @@ -0,0 +1,18 @@ +package inc::CheckDelta; +use Moose; + +with 'Dist::Zilla::Role::AfterBuild'; + +sub after_build { + my $self = shift; + + return unless $ENV{DZIL_RELEASING}; + + my ($delta) = grep { $_->name eq 'lib/Moose/Manual/Delta.pod' } + @{ $self->zilla->files }; + + die "Moose::Manual::Delta still contains \$NEXT" + if $delta->content =~ /\$NEXT/; +} + +1; diff --git a/inc/CheckReleaseType.pm b/inc/CheckReleaseType.pm new file mode 100644 index 0000000..6e79958 --- /dev/null +++ b/inc/CheckReleaseType.pm @@ -0,0 +1,37 @@ +package inc::CheckReleaseType; +use Moose; +with 'Dist::Zilla::Role::BeforeRelease'; + +# this is so I don't accidentally release 2.xxx without the --trial +# option, which has very nearly happened a few times. + +sub before_release +{ + my $self = shift; + my $version = $self->zilla->version; + + $version =~ m/^\d\.\d{4}$/ + or $self->log_fatal("version $version doesn't seem to conform to the normal specification!"); + + my $digit = substr($version, 3, 1); + if ($self->zilla->is_trial) + { + $digit % 2 == 1 + or $self->log_fatal('-TRIAL releases must be numbered 2.x{ODD}xx!'); + } + else + { + $digit % 2 == 0 + or $self->log_fatal('stable releases must be numbered 2.x{EVEN}xx!'); + + # Moose::Manual::Support says: + # 2.x{EVEN}00 must be January, April, July, October only. + if (substr($version, -2, 2) eq '00') + { + # month is 0..11 + my $month = (gmtime(time))[4]; + $month % 3 == 0 + or $self->log_fatal('2.x{EVEN}00 releases can only occur in January, April, July or October!'); + } + } +} diff --git a/inc/Clean.pm b/inc/Clean.pm new file mode 100644 index 0000000..a2a5563 --- /dev/null +++ b/inc/Clean.pm @@ -0,0 +1,50 @@ +package inc::Clean; +use Moose; + +with 'Dist::Zilla::Role::BeforeBuild', + 'Dist::Zilla::Role::AfterBuild'; +use Path::Tiny; +use File::pushd 'pushd'; +use Config; + +sub before_build { shift->_clean('.') } + +sub after_build { + my ($self, $opts) = @_; + + $self->_clean($opts->{build_root}); + + my $iter = path($opts->{build_root})->iterator({ recurse => 1 }); + my %found_files; + while (my $found_file = $iter->()) { + next if -d $found_file; + ++$found_files{ $found_file->relative($opts->{build_root}) }; + } + delete $found_files{$_->name} foreach @{ $self->zilla->files }; + + $self->log(join("\n", + "WARNING: Files were left behind in $opts->{build_root} that were not explicitly added:", + sort keys %found_files, + )) if keys %found_files; +} + +sub _clean { + my ($self, $build_dir) = @_; + + my $cwd = pushd $build_dir; + if (-e 'Makefile') { + + my $make = $Config{make} || 'make'; + + $self->log("Running $make distclean in $build_dir to clear out build cruft"); + my $pid = fork; + unless ($pid) { + close(STDIN); + close(STDOUT); + close(STDERR); + { exec("$^X Makefile.PL && $make distclean") } + die "couldn't exec: $!"; + } + waitpid($pid, 0) if $pid; + } +} diff --git a/inc/ExtractInlineTests.pm b/inc/ExtractInlineTests.pm new file mode 100644 index 0000000..e2cda0a --- /dev/null +++ b/inc/ExtractInlineTests.pm @@ -0,0 +1,58 @@ +package inc::ExtractInlineTests; + +use Moose; + +with 'Dist::Zilla::Role::FileGatherer'; + +use File::Find::Rule; +use inc::MyInline; +use Test::Inline; + +sub gather_files { + my $self = shift; + my $arg = shift; + + my $inline = Test::Inline->new( + verbose => 0, + ExtractHandler => 'My::Extract', + ContentHandler => 'My::Content', + OutputHandler => My::Output->new($self), + ); + + for my $pod ( + File::Find::Rule->file->name(qr/\.pod$/)->in('lib/Moose/Cookbook') ) { + $inline->add($pod); + } + + $inline->save; +} + +{ + package My::Output; + + sub new { + my $class = shift; + my $dzil = shift; + + return bless { dzil => $dzil }, $class; + } + + sub write { + my $self = shift; + my $name = shift; + my $content = shift; + + $name =~ s/^moose_cookbook_//; + + $self->{dzil}->add_file( + Dist::Zilla::File::InMemory->new( + name => "t/recipes/$name", + content => $content, + ) + ); + + return 1; + } +} + +1; diff --git a/inc/GenerateDocs.pm b/inc/GenerateDocs.pm new file mode 100644 index 0000000..27d4cf4 --- /dev/null +++ b/inc/GenerateDocs.pm @@ -0,0 +1,57 @@ +package inc::GenerateDocs; + +use Moose; +with 'Dist::Zilla::Role::FileGatherer', + 'Dist::Zilla::Role::AfterBuild', + 'Dist::Zilla::Role::FileInjector'; +use IPC::System::Simple qw(capturex); +use File::pushd; +use Path::Tiny; +use List::Util 'first'; + +my $filename = path(qw(lib Moose Manual Exceptions Manifest.pod)); + +sub gather_files { + my ($self, $arg) = @_; + + $self->add_file(Dist::Zilla::File::InMemory->new( + name => $filename->stringify, + # more to fill in later + content => <<'END_POD', +# PODNAME: Moose::Manual::Exceptions::Manifest +# ABSTRACT: Moose's Exception Types + +__END__ + +=for comment insert generated content here +END_POD + )); +} + +sub after_build { + my ($self, $opts) = @_; + my $build_dir = $opts->{build_root}; + + my $wd = File::pushd::pushd($build_dir); + unless ( -d 'blib' ) { + my @builders = @{ $self->zilla->plugins_with( -BuildRunner ) }; + die "no BuildRunner plugins specified" unless @builders; + $_->build for @builders; + die "no blib; failed to build properly?" unless -d 'blib'; + } + + # this must be run as a separate process because we need to use the new + # Moose we just generated, in order to introspect all the exception classes + $self->log('running author/docGenerator.pl...'); + my $text = capturex($^X, "author/docGenerator.pl"); + + my $file_obj = first { $_->name eq $filename } @{$self->zilla->files}; + + my $content = $file_obj->content; + my $pos = index($content, "\n\n=for comment insert generated content here"); + $file_obj->content(substr($content, 0, $pos) . "\n\n" . $text . substr($content, $pos, -1)); + + $filename->spew_raw($file_obj->encoded_content); +} + +1; diff --git a/inc/GitUpToDate.pm b/inc/GitUpToDate.pm new file mode 100644 index 0000000..b688d8a --- /dev/null +++ b/inc/GitUpToDate.pm @@ -0,0 +1,52 @@ +package inc::GitUpToDate; +use Moose; + +with 'Dist::Zilla::Role::BeforeBuild'; + +sub git { + if (wantarray) { + chomp(my @ret = qx{git $_[0]}); + return @ret; + } + else { + chomp(my $ret = qx{git $_[0]}); + return $ret; + } +} + +sub before_build { + my $self = shift; + + return unless $ENV{DZIL_RELEASING}; + + my $branch = git "symbolic-ref HEAD"; + die "Could not get the current branch" + unless $branch; + + $branch =~ s{refs/heads/}{}; + + $self->log("Ensuring branch $branch is up to date"); + + git "fetch origin"; + my $origin = git "rev-parse origin/$branch"; + my $head = git "rev-parse HEAD"; + + die "Branch $branch is not up to date (origin: $origin, HEAD: $head)" + if $origin ne $head; + + + # now also check that HEAD is current with the release branch + # that is, that the release branch is an ancestor commit of HEAD. + my $release_branch = ($self->zilla->plugin_named('Git::CheckFor::CorrectBranch')->release_branch)[0]; + foreach my $remote ('origin/', '') + { + my $release_commit = git "rev-parse ${remote}$release_branch"; + my $common_ancestor = git "merge-base $head $release_commit"; + + die "Branch $branch does not contain all commits from the current release branch ", + "(common ancestor for ${remote}$release_branch: $common_ancestor)" + if $common_ancestor ne $release_commit; + } +} + +1; diff --git a/inc/MMHelper.pm b/inc/MMHelper.pm new file mode 100644 index 0000000..7e340b9 --- /dev/null +++ b/inc/MMHelper.pm @@ -0,0 +1,79 @@ +package MMHelper; + +use strict; +use warnings; + +use Config; + +sub ccflags_dyn { + my $is_dev = shift; + + my $ccflags = q<( $Config::Config{ccflags} || '' ) . ' -I.'>; + if ($is_dev and ($Config{cc} !~ /^cl\b/i)) { + $ccflags .= q< . ' -Wall -Wdeclaration-after-statement'>; + } + + return $ccflags; +} + +sub ccflags_static { + my $is_dev = shift; + + return eval(ccflags_dyn($is_dev)); +} + +sub mm_args { + my ( @object, %xs ); + + for my $xs ( glob "xs/*.xs" ) { + ( my $c = $xs ) =~ s/\.xs$/.c/i; + ( my $o = $xs ) =~ s/\.xs$/\$(OBJ_EXT)/i; + + $xs{$xs} = $c; + push @object, $o; + } + + for my $c ( glob "*.c" ) { + ( my $o = $c ) =~ s/\.c$/\$(OBJ_EXT)/i; + push @object, $o; + } + + return ( + clean => { FILES => join( q{ }, @object ) }, + OBJECT => join( q{ }, @object ), + XS => \%xs, + ); +} + +sub my_package_subs { + return <<'EOP'; +{ +package MY; + +use Config; + +sub const_cccmd { + my $ret = shift->SUPER::const_cccmd(@_); + return q{} unless $ret; + + if ($Config{cc} =~ /^cl\b/i) { + warn 'you are using MSVC... we may not have gotten some options quite right.'; + $ret .= ' /Fo$@'; + } + else { + $ret .= ' -o $@'; + } + + return $ret; +} + +sub postamble { + return <<'EOF'; +$(OBJECT) : mop.h +EOF +} +} +EOP +} + +1; diff --git a/inc/MakeMaker.pm b/inc/MakeMaker.pm new file mode 100644 index 0000000..cd034ff --- /dev/null +++ b/inc/MakeMaker.pm @@ -0,0 +1,96 @@ +package inc::MakeMaker; + +use Moose; + +use lib 'inc'; + +use MMHelper; + +extends 'Dist::Zilla::Plugin::MakeMaker::Awesome'; + +override _build_MakeFile_PL_template => sub { + my $self = shift; + + my $tmpl = super(); + my $assert_compiler = <<'ASSERT_COMPILER'; +# Secondary compile testing via ExtUtils::CBuilder +sub can_xs { + # Do we have the configure_requires checker? + unless (eval 'require ExtUtils::CBuilder; ExtUtils::CBuilder->VERSION(0.27); 1') { + # They don't obey configure_requires, so it is + # someone old and delicate. Try to avoid hurting + # them by falling back to an older simpler test. + return can_cc(); + } + + return ExtUtils::CBuilder->new( quiet => 1 )->have_compiler; +} + +# can we locate a (the) C compiler +sub can_cc { + my @chunks = split(/ /, $Config::Config{cc}) or return; + + # $Config{cc} may contain args; try to find out the program part + while (@chunks) { + return can_run("@chunks") || (pop(@chunks), next); + } + + return; +} + +# check if we can run some command +sub can_run { + my ($cmd) = @_; + + return $cmd if -x $cmd; + if (my $found_cmd = MM->maybe_command($cmd)) { + return $found_cmd; + } + + for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { + next if $dir eq ''; + my $abs = File::Spec->catfile($dir, $cmd); + return $abs if (-x $abs or $abs = MM->maybe_command($abs)); + } + + return; +} + +die 'This distribution requires a working compiler' unless can_xs(); + +ASSERT_COMPILER + + # splice in our stuff after the preamble bits + # TODO - MMA ought to make this easier. + $tmpl =~ m/use warnings;\n\n/g; + $tmpl = substr($tmpl, 0, pos($tmpl)) . $assert_compiler . substr($tmpl, pos($tmpl)); + + + # TODO: splice this in using 'around _build_WriteMakefile_args' + my $ccflags = MMHelper::ccflags_dyn(); + $tmpl =~ s/^(WriteMakefile\()/\$WriteMakefileArgs{CCFLAGS} = $ccflags;\n\n$1/m; + + return $tmpl . "\n\n" . MMHelper::my_package_subs(); +}; + +override _build_WriteMakefile_args => sub { + my $self = shift; + + my $args = super(); + + return { + %{$args}, + MMHelper::mm_args(), + }; +}; + +override test => sub { + my $self = shift; + + local $ENV{PERL5LIB} = join ':', + grep {defined} @ENV{ 'PERL5LIB', 'DZIL_TEST_INC' }; + + super(); +}; + +1; diff --git a/inc/MyInline.pm b/inc/MyInline.pm new file mode 100644 index 0000000..e0697a6 --- /dev/null +++ b/inc/MyInline.pm @@ -0,0 +1,98 @@ +package MyInline; + +use strict; +use warnings; + +{ + package My::Extract; + + use parent 'Test::Inline::Extract'; + + use List::Util qw( first ); + + # This extracts the SYNOPSIS in addition to code specifically + # marked for testing + my $search = qr/ + (?:^|\n) # After the beginning of the string, or a newline + ( # ... start capturing + # EITHER + package\s+ # A package + [^\W\d]\w*(?:(?:\'|::)[^\W\d]\w*)* # ... with a name + \s*; # And a statement terminator + | # OR + \#\s*PODNAME:\s+ # A PODNAME comment + [^\W\d]\w*(?:(?:\'|::)[^\W\d]\w*)* # ... with a name + (?:\s+|$) # And a name terminator + | + =head1[ \t]+SYNOPSIS\n + .*? + (?=\n=) + | # OR + =for[ \t]+example[ \t]+begin\n # ... when we find a =for example begin + .*? # ... and keep capturing + \n=for[ \t]+example[ \t]+end\s*? # ... until the =for example end + (?:\n|$) # ... at the end of file or a newline + | # OR + =begin[ \t]+(?:test|testing)(?:-SETUP)? # ... when we find a =begin test or testing + .*? # ... and keep capturing + \n=end[ \t]+(?:test|testing)(?:-SETUP)? # ... until an =end tag + .*? + (?:\n|$) # ... at the end of file or a newline + ) # ... and stop capturing + /isx; + + sub _elements { + my $self = shift; + my @elements = (); + while ( $self->{source} =~ m/$search/go ) { + my $elt = $1; + + # A hack to turn the SYNOPSIS into something Test::Inline + # doesn't barf on + if ( $elt =~ s/=head1[ \t]+SYNOPSIS/=begin testing-SETUP\n\n{/ ) { + $elt .= "}\n\n=end testing-SETUP"; + } + + # It seems like search.cpan doesn't like a name with + # spaces after =begin. bleah, what a mess. + $elt =~ s/testing-SETUP/testing SETUP/g; + + push @elements, $elt; + } + + # If we have just one element it's a SYNOPSIS, so there's no + # tests. + return unless @elements > 2; + + if ( @elements && $self->{source} =~ /# PODNAME: (Moose::Cookbook\S+)(?:\s|$)/ ) { + foreach my $element (@elements) + { + $element = "package $1;" if $element =~ /# PODNAME: (Moose::Cookbook\S+)(?:\s+|$)/; + } + } + + if ( @elements && $self->{source} =~ /=head1 NAME\n\n(Moose::Cookbook\S+)/ ) { + unshift @elements, 'package ' . $1 . ';'; + } + + ( first {/^=/} @elements ) ? \@elements : ''; + } +} + +{ + package My::Content; + + use parent 'Test::Inline::Content::Default'; + + sub process { + my $self = shift; + + my $base = $self->SUPER::process(@_); + + $base =~ s/(\$\| = 1;)/use Test::Fatal;\n$1/; + + return $base; + } +} + +1; diff --git a/inc/SimpleAuthority.pm b/inc/SimpleAuthority.pm new file mode 100644 index 0000000..839571a --- /dev/null +++ b/inc/SimpleAuthority.pm @@ -0,0 +1,13 @@ +use strict; +use warnings; +package inc::SimpleAuthority; + +use Moose; +with 'Dist::Zilla::Role::MetaProvider'; + +sub metadata +{ + return +{ x_authority => 'cpan:STEVAN' }; +} + +1; diff --git a/inc/SimpleProvides.pm b/inc/SimpleProvides.pm new file mode 100644 index 0000000..3d768b1 --- /dev/null +++ b/inc/SimpleProvides.pm @@ -0,0 +1,34 @@ +use strict; +use warnings; +package inc::SimpleProvides; + +use Moose; +with 'Dist::Zilla::Role::MetaProvider', + 'Dist::Zilla::Role::FileFinderUser' => { + default_finders => [ ':InstallModules' ], # this is overridden in dist.ini! + }, +; + +sub metadata +{ + my $self = shift; + + my $version = $self->zilla->version; + + return +{ + provides => { + map { + # this is an awful hack and assumes ascii package names: + # please do not cargo-cult this code elsewhere. The proper + # thing to do is to crack open the file and read the pod name. + my $filename = $_->name; + (my $package = $filename) =~ s{[/\\]}{::}g; + $package =~ s/^lib:://; + $package =~ s/\.pod$//; + $package => { file => $filename, version => $version } + } @{$self->found_files}, + } + }; +} + +__PACKAGE__->meta->make_immutable; diff --git a/inc/TestRelease.pm b/inc/TestRelease.pm new file mode 100644 index 0000000..9d30a76 --- /dev/null +++ b/inc/TestRelease.pm @@ -0,0 +1,17 @@ +package inc::TestRelease; + +use Moose; + +extends 'Dist::Zilla::Plugin::TestRelease'; + +around before_release => sub { + my $orig = shift; + my $self = shift; + + local $ENV{MOOSE_TEST_MD} = 1 if not $self->zilla->is_trial; + local $ENV{AUTHOR_TESTING} = 1 if not $self->zilla->is_trial; + + $self->$orig(@_); +}; + +1; diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm new file mode 100644 index 0000000..e55527d --- /dev/null +++ b/lib/Class/MOP.pm @@ -0,0 +1,1232 @@ +package Class::MOP; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use 5.008003; + +use MRO::Compat; +use Class::Load 0.07 (); +use Scalar::Util 'weaken', 'isweak', 'blessed'; +use Data::OptList; + +use Class::MOP::Mixin::AttributeCore; +use Class::MOP::Mixin::HasAttributes; +use Class::MOP::Mixin::HasMethods; +use Class::MOP::Mixin::HasOverloads; +use Class::MOP::Class; +use Class::MOP::Attribute; +use Class::MOP::Method; + +BEGIN { + *IS_RUNNING_ON_5_10 = ($] < 5.009_005) + ? sub () { 0 } + : sub () { 1 }; + + # this is either part of core or set up appropriately by MRO::Compat + *check_package_cache_flag = \&mro::get_pkg_gen; +} + +XSLoader::load( + 'Moose', + $VERSION, +); + +{ + # Metaclasses are singletons, so we cache them here. + # there is no need to worry about destruction though + # because they should die only when the program dies. + # After all, do package definitions even get reaped? + # Anonymous classes manage their own destruction. + my %METAS; + + sub get_all_metaclasses { %METAS } + sub get_all_metaclass_instances { values %METAS } + sub get_all_metaclass_names { keys %METAS } + sub get_metaclass_by_name { $METAS{$_[0]} } + sub store_metaclass_by_name { $METAS{$_[0]} = $_[1] } + sub weaken_metaclass { weaken($METAS{$_[0]}) } + sub metaclass_is_weak { isweak($METAS{$_[0]}) } + sub does_metaclass_exist { exists $METAS{$_[0]} && defined $METAS{$_[0]} } + sub remove_metaclass_by_name { delete $METAS{$_[0]}; return } + + # This handles instances as well as class names + sub class_of { + return unless defined $_[0]; + my $class = blessed($_[0]) || $_[0]; + return $METAS{$class}; + } + + # NOTE: + # We only cache metaclasses, meaning instances of + # Class::MOP::Class. We do not cache instance of + # Class::MOP::Package or Class::MOP::Module. Mostly + # because I don't yet see a good reason to do so. +} + +sub load_class { + Class::MOP::Deprecated::deprecated( + message => 'Class::MOP::load_class is deprecated', + feature => 'Class::Load wrapper functions', + ); + require Class::Load; + goto &Class::Load::load_class; +} + +sub load_first_existing_class { + Class::MOP::Deprecated::deprecated( + message => 'Class::MOP::load_first_existing_class is deprecated', + feature => 'Class::Load wrapper functions', + ); + require Class::Load; + goto &Class::Load::load_first_existing_class; +} + +sub is_class_loaded { + Class::MOP::Deprecated::deprecated( + message => 'Class::MOP::is_class_loaded is deprecated', + feature => 'Class::Load wrapper functions', + ); + require Class::Load; + goto &Class::Load::is_class_loaded; +} + +sub _definition_context { + my %context; + @context{qw(package file line)} = caller(1); + + return ( + definition_context => \%context, + ); +} + +## ---------------------------------------------------------------------------- +## Setting up our environment ... +## ---------------------------------------------------------------------------- +## Class::MOP needs to have a few things in the global perl environment so +## that it can operate effectively. Those things are done here. +## ---------------------------------------------------------------------------- + +# ... nothing yet actually ;) + +## ---------------------------------------------------------------------------- +## Bootstrapping +## ---------------------------------------------------------------------------- +## The code below here is to bootstrap our MOP with itself. This is also +## sometimes called "tying the knot". By doing this, we make it much easier +## to extend the MOP through subclassing and such since now you can use the +## MOP itself to extend itself. +## +## Yes, I know, that's weird and insane, but it's a good thing, trust me :) +## ---------------------------------------------------------------------------- + +# We need to add in the meta-attributes here so that +# any subclass of Class::MOP::* will be able to +# inherit them using _construct_instance + +## -------------------------------------------------------- +## Class::MOP::Mixin::HasMethods + +Class::MOP::Mixin::HasMethods->meta->add_attribute( + Class::MOP::Attribute->new('_methods' => ( + reader => { + # NOTE: + # we just alias the original method + # rather than re-produce it here + '_method_map' => \&Class::MOP::Mixin::HasMethods::_method_map + }, + default => sub { {} }, + _definition_context(), + )) +); + +Class::MOP::Mixin::HasMethods->meta->add_attribute( + Class::MOP::Attribute->new('method_metaclass' => ( + reader => { + # NOTE: + # we just alias the original method + # rather than re-produce it here + 'method_metaclass' => \&Class::MOP::Mixin::HasMethods::method_metaclass + }, + default => 'Class::MOP::Method', + _definition_context(), + )) +); + +Class::MOP::Mixin::HasMethods->meta->add_attribute( + Class::MOP::Attribute->new('wrapped_method_metaclass' => ( + reader => { + # NOTE: + # we just alias the original method + # rather than re-produce it here + 'wrapped_method_metaclass' => \&Class::MOP::Mixin::HasMethods::wrapped_method_metaclass + }, + default => 'Class::MOP::Method::Wrapped', + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Mixin::HasAttributes + +Class::MOP::Mixin::HasAttributes->meta->add_attribute( + Class::MOP::Attribute->new('attributes' => ( + reader => { + # NOTE: we need to do this in order + # for the instance meta-object to + # not fall into meta-circular death + # + # we just alias the original method + # rather than re-produce it here + '_attribute_map' => \&Class::MOP::Mixin::HasAttributes::_attribute_map + }, + default => sub { {} }, + _definition_context(), + )) +); + +Class::MOP::Mixin::HasAttributes->meta->add_attribute( + Class::MOP::Attribute->new('attribute_metaclass' => ( + reader => { + # NOTE: + # we just alias the original method + # rather than re-produce it here + 'attribute_metaclass' => \&Class::MOP::Mixin::HasAttributes::attribute_metaclass + }, + default => 'Class::MOP::Attribute', + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Mixin::HasOverloads + +Class::MOP::Mixin::HasOverloads->meta->add_attribute( + Class::MOP::Attribute->new('_overload_map' => ( + reader => { + '_overload_map' => \&Class::MOP::Mixin::HasOverloads::_overload_map + }, + clearer => '_clear_overload_map', + default => sub { {} }, + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Package + +Class::MOP::Package->meta->add_attribute( + Class::MOP::Attribute->new('package' => ( + reader => { + # NOTE: we need to do this in order + # for the instance meta-object to + # not fall into meta-circular death + # + # we just alias the original method + # rather than re-produce it here + 'name' => \&Class::MOP::Package::name + }, + _definition_context(), + )) +); + +Class::MOP::Package->meta->add_attribute( + Class::MOP::Attribute->new('namespace' => ( + reader => { + # NOTE: + # we just alias the original method + # rather than re-produce it here + 'namespace' => \&Class::MOP::Package::namespace + }, + init_arg => undef, + default => sub { \undef }, + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Module + +# NOTE: +# yeah this is kind of stretching things a bit, +# but truthfully the version should be an attribute +# of the Module, the weirdness comes from having to +# stick to Perl 5 convention and store it in the +# $VERSION package variable. Basically if you just +# squint at it, it will look how you want it to look. +# Either as a package variable, or as a attribute of +# the metaclass, isn't abstraction great :) + +Class::MOP::Module->meta->add_attribute( + Class::MOP::Attribute->new('version' => ( + reader => { + # NOTE: + # we just alias the original method + # rather than re-produce it here + 'version' => \&Class::MOP::Module::version + }, + init_arg => undef, + default => sub { \undef }, + _definition_context(), + )) +); + +# NOTE: +# By following the same conventions as version here, +# we are opening up the possibility that people can +# use the $AUTHORITY in non-Class::MOP modules as +# well. + +Class::MOP::Module->meta->add_attribute( + Class::MOP::Attribute->new('authority' => ( + reader => { + # NOTE: + # we just alias the original method + # rather than re-produce it here + 'authority' => \&Class::MOP::Module::authority + }, + init_arg => undef, + default => sub { \undef }, + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Class + +Class::MOP::Class->meta->add_attribute( + Class::MOP::Attribute->new('superclasses' => ( + accessor => { + # NOTE: + # we just alias the original method + # rather than re-produce it here + 'superclasses' => \&Class::MOP::Class::superclasses + }, + init_arg => undef, + default => sub { \undef }, + _definition_context(), + )) +); + +Class::MOP::Class->meta->add_attribute( + Class::MOP::Attribute->new('instance_metaclass' => ( + reader => { + # NOTE: we need to do this in order + # for the instance meta-object to + # not fall into meta-circular death + # + # we just alias the original method + # rather than re-produce it here + 'instance_metaclass' => \&Class::MOP::Class::instance_metaclass + }, + default => 'Class::MOP::Instance', + _definition_context(), + )) +); + +Class::MOP::Class->meta->add_attribute( + Class::MOP::Attribute->new('immutable_trait' => ( + reader => { + 'immutable_trait' => \&Class::MOP::Class::immutable_trait + }, + default => "Class::MOP::Class::Immutable::Trait", + _definition_context(), + )) +); + +Class::MOP::Class->meta->add_attribute( + Class::MOP::Attribute->new('constructor_name' => ( + reader => { + 'constructor_name' => \&Class::MOP::Class::constructor_name, + }, + default => "new", + _definition_context(), + )) +); + +Class::MOP::Class->meta->add_attribute( + Class::MOP::Attribute->new('constructor_class' => ( + reader => { + 'constructor_class' => \&Class::MOP::Class::constructor_class, + }, + default => "Class::MOP::Method::Constructor", + _definition_context(), + )) +); + + +Class::MOP::Class->meta->add_attribute( + Class::MOP::Attribute->new('destructor_class' => ( + reader => { + 'destructor_class' => \&Class::MOP::Class::destructor_class, + }, + _definition_context(), + )) +); + +# NOTE: +# we don't actually need to tie the knot with +# Class::MOP::Class here, it is actually handled +# within Class::MOP::Class itself in the +# _construct_class_instance method. + +## -------------------------------------------------------- +## Class::MOP::Mixin::AttributeCore +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('name' => ( + reader => { + # NOTE: we need to do this in order + # for the instance meta-object to + # not fall into meta-circular death + # + # we just alias the original method + # rather than re-produce it here + 'name' => \&Class::MOP::Mixin::AttributeCore::name + }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('accessor' => ( + reader => { 'accessor' => \&Class::MOP::Mixin::AttributeCore::accessor }, + predicate => { 'has_accessor' => \&Class::MOP::Mixin::AttributeCore::has_accessor }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('reader' => ( + reader => { 'reader' => \&Class::MOP::Mixin::AttributeCore::reader }, + predicate => { 'has_reader' => \&Class::MOP::Mixin::AttributeCore::has_reader }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('initializer' => ( + reader => { 'initializer' => \&Class::MOP::Mixin::AttributeCore::initializer }, + predicate => { 'has_initializer' => \&Class::MOP::Mixin::AttributeCore::has_initializer }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('definition_context' => ( + reader => { 'definition_context' => \&Class::MOP::Mixin::AttributeCore::definition_context }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('writer' => ( + reader => { 'writer' => \&Class::MOP::Mixin::AttributeCore::writer }, + predicate => { 'has_writer' => \&Class::MOP::Mixin::AttributeCore::has_writer }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('predicate' => ( + reader => { 'predicate' => \&Class::MOP::Mixin::AttributeCore::predicate }, + predicate => { 'has_predicate' => \&Class::MOP::Mixin::AttributeCore::has_predicate }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('clearer' => ( + reader => { 'clearer' => \&Class::MOP::Mixin::AttributeCore::clearer }, + predicate => { 'has_clearer' => \&Class::MOP::Mixin::AttributeCore::has_clearer }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('builder' => ( + reader => { 'builder' => \&Class::MOP::Mixin::AttributeCore::builder }, + predicate => { 'has_builder' => \&Class::MOP::Mixin::AttributeCore::has_builder }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('init_arg' => ( + reader => { 'init_arg' => \&Class::MOP::Mixin::AttributeCore::init_arg }, + predicate => { 'has_init_arg' => \&Class::MOP::Mixin::AttributeCore::has_init_arg }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('default' => ( + # default has a custom 'reader' method ... + predicate => { 'has_default' => \&Class::MOP::Mixin::AttributeCore::has_default }, + _definition_context(), + )) +); + +Class::MOP::Mixin::AttributeCore->meta->add_attribute( + Class::MOP::Attribute->new('insertion_order' => ( + reader => { 'insertion_order' => \&Class::MOP::Mixin::AttributeCore::insertion_order }, + writer => { '_set_insertion_order' => \&Class::MOP::Mixin::AttributeCore::_set_insertion_order }, + predicate => { 'has_insertion_order' => \&Class::MOP::Mixin::AttributeCore::has_insertion_order }, + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Attribute +Class::MOP::Attribute->meta->add_attribute( + Class::MOP::Attribute->new('associated_class' => ( + reader => { + # NOTE: we need to do this in order + # for the instance meta-object to + # not fall into meta-circular death + # + # we just alias the original method + # rather than re-produce it here + 'associated_class' => \&Class::MOP::Attribute::associated_class + }, + _definition_context(), + )) +); + +Class::MOP::Attribute->meta->add_attribute( + Class::MOP::Attribute->new('associated_methods' => ( + reader => { 'associated_methods' => \&Class::MOP::Attribute::associated_methods }, + default => sub { [] }, + _definition_context(), + )) +); + +Class::MOP::Attribute->meta->add_method('clone' => sub { + my $self = shift; + $self->meta->clone_object($self, @_); +}); + +## -------------------------------------------------------- +## Class::MOP::Method +Class::MOP::Method->meta->add_attribute( + Class::MOP::Attribute->new('body' => ( + reader => { 'body' => \&Class::MOP::Method::body }, + _definition_context(), + )) +); + +Class::MOP::Method->meta->add_attribute( + Class::MOP::Attribute->new('associated_metaclass' => ( + reader => { 'associated_metaclass' => \&Class::MOP::Method::associated_metaclass }, + _definition_context(), + )) +); + +Class::MOP::Method->meta->add_attribute( + Class::MOP::Attribute->new('package_name' => ( + reader => { 'package_name' => \&Class::MOP::Method::package_name }, + _definition_context(), + )) +); + +Class::MOP::Method->meta->add_attribute( + Class::MOP::Attribute->new('name' => ( + reader => { 'name' => \&Class::MOP::Method::name }, + _definition_context(), + )) +); + +Class::MOP::Method->meta->add_attribute( + Class::MOP::Attribute->new('original_method' => ( + reader => { 'original_method' => \&Class::MOP::Method::original_method }, + writer => { '_set_original_method' => \&Class::MOP::Method::_set_original_method }, + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Method::Wrapped + +# NOTE: +# the way this item is initialized, this +# really does not follow the standard +# practices of attributes, but we put +# it here for completeness +Class::MOP::Method::Wrapped->meta->add_attribute( + Class::MOP::Attribute->new('modifier_table' => ( + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Method::Generated + +Class::MOP::Method::Generated->meta->add_attribute( + Class::MOP::Attribute->new('is_inline' => ( + reader => { 'is_inline' => \&Class::MOP::Method::Generated::is_inline }, + default => 0, + _definition_context(), + )) +); + +Class::MOP::Method::Generated->meta->add_attribute( + Class::MOP::Attribute->new('definition_context' => ( + reader => { 'definition_context' => \&Class::MOP::Method::Generated::definition_context }, + _definition_context(), + )) +); + + +## -------------------------------------------------------- +## Class::MOP::Method::Inlined + +Class::MOP::Method::Inlined->meta->add_attribute( + Class::MOP::Attribute->new('_expected_method_class' => ( + reader => { '_expected_method_class' => \&Class::MOP::Method::Inlined::_expected_method_class }, + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Method::Accessor + +Class::MOP::Method::Accessor->meta->add_attribute( + Class::MOP::Attribute->new('attribute' => ( + reader => { + 'associated_attribute' => \&Class::MOP::Method::Accessor::associated_attribute + }, + _definition_context(), + )) +); + +Class::MOP::Method::Accessor->meta->add_attribute( + Class::MOP::Attribute->new('accessor_type' => ( + reader => { 'accessor_type' => \&Class::MOP::Method::Accessor::accessor_type }, + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Method::Constructor + +Class::MOP::Method::Constructor->meta->add_attribute( + Class::MOP::Attribute->new('options' => ( + reader => { + 'options' => \&Class::MOP::Method::Constructor::options + }, + default => sub { +{} }, + _definition_context(), + )) +); + +Class::MOP::Method::Constructor->meta->add_attribute( + Class::MOP::Attribute->new('associated_metaclass' => ( + init_arg => "metaclass", # FIXME alias and rename + reader => { + 'associated_metaclass' => \&Class::MOP::Method::Constructor::associated_metaclass + }, + _definition_context(), + )) +); + +## -------------------------------------------------------- +## Class::MOP::Overload + +Class::MOP::Overload->meta->add_attribute( + Class::MOP::Attribute->new( + 'operator' => ( + reader => { 'operator' => \&Class::MOP::Overload::operator }, + required => 1, + _definition_context(), + ) + ) +); + +for my $attr (qw( method_name coderef coderef_package coderef_name method )) { + Class::MOP::Overload->meta->add_attribute( + Class::MOP::Attribute->new( + $attr => ( + reader => { $attr => Class::MOP::Overload->can($attr) }, + predicate => { + 'has_' + . $attr => Class::MOP::Overload->can( 'has_' . $attr ) + }, + _definition_context(), + ) + ) + ); +} + +Class::MOP::Overload->meta->add_attribute( + Class::MOP::Attribute->new( + 'associated_metaclass' => ( + reader => { + 'associated_metaclass' => + \&Class::MOP::Overload::associated_metaclass + }, + _definition_context(), + ) + ) +); + +## -------------------------------------------------------- +## Class::MOP::Instance + +# NOTE: +# these don't yet do much of anything, but are just +# included for completeness + +Class::MOP::Instance->meta->add_attribute( + Class::MOP::Attribute->new('associated_metaclass', + reader => { associated_metaclass => \&Class::MOP::Instance::associated_metaclass }, + _definition_context(), + ), +); + +Class::MOP::Instance->meta->add_attribute( + Class::MOP::Attribute->new('_class_name', + init_arg => undef, + reader => { _class_name => \&Class::MOP::Instance::_class_name }, + #lazy => 1, # not yet supported by Class::MOP but out our version does it anyway + #default => sub { $_[0]->associated_metaclass->name }, + _definition_context(), + ), +); + +Class::MOP::Instance->meta->add_attribute( + Class::MOP::Attribute->new('attributes', + reader => { attributes => \&Class::MOP::Instance::get_all_attributes }, + _definition_context(), + ), +); + +Class::MOP::Instance->meta->add_attribute( + Class::MOP::Attribute->new('slots', + reader => { slots => \&Class::MOP::Instance::slots }, + _definition_context(), + ), +); + +Class::MOP::Instance->meta->add_attribute( + Class::MOP::Attribute->new('slot_hash', + reader => { slot_hash => \&Class::MOP::Instance::slot_hash }, + _definition_context(), + ), +); + +## -------------------------------------------------------- +## Class::MOP::Object + +# need to replace the meta method there with a real meta method object +Class::MOP::Object->meta->_add_meta_method('meta'); + +## -------------------------------------------------------- +## Class::MOP::Mixin + +# need to replace the meta method there with a real meta method object +Class::MOP::Mixin->meta->_add_meta_method('meta'); + +require Class::MOP::Deprecated unless our $no_deprecated; + +# we need the meta instance of the meta instance to be created now, in order +# for the constructor to be able to use it +Class::MOP::Instance->meta->get_meta_instance; + +# pretend the add_method never happened. it hasn't yet affected anything +undef Class::MOP::Instance->meta->{_package_cache_flag}; + +## -------------------------------------------------------- +## Now close all the Class::MOP::* classes + +# NOTE: we don't need to inline the accessors this only lengthens the compile +# time of the MOP, and gives us no actual benefits. + +$_->meta->make_immutable( + inline_constructor => 0, + constructor_name => "_new", + inline_accessors => 0, +) for qw/ + Class::MOP::Package + Class::MOP::Module + Class::MOP::Class + + Class::MOP::Attribute + Class::MOP::Method + Class::MOP::Instance + + Class::MOP::Object + + Class::MOP::Method::Generated + Class::MOP::Method::Inlined + + Class::MOP::Method::Accessor + Class::MOP::Method::Constructor + Class::MOP::Method::Wrapped + + Class::MOP::Method::Meta + + Class::MOP::Overload +/; + +$_->meta->make_immutable( + inline_constructor => 0, + constructor_name => undef, + inline_accessors => 0, +) for qw/ + Class::MOP::Mixin + Class::MOP::Mixin::AttributeCore + Class::MOP::Mixin::HasAttributes + Class::MOP::Mixin::HasMethods + Class::MOP::Mixin::HasOverloads +/; + +1; + +# ABSTRACT: A Meta Object Protocol for Perl 5 + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP - A Meta Object Protocol for Perl 5 + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This module is a fully functioning meta object protocol for the +Perl 5 object system. It makes no attempt to change the behavior or +characteristics of the Perl 5 object system, only to create a +protocol for its manipulation and introspection. + +That said, it does attempt to create the tools for building a rich set +of extensions to the Perl 5 object system. Every attempt has been made +to abide by the spirit of the Perl 5 object system that we all know +and love. + +This documentation is sparse on conceptual details. We suggest looking +at the items listed in the L section for more +information. In particular the book "The Art of the Meta Object +Protocol" was very influential in the development of this system. + +=head2 What is a Meta Object Protocol? + +A meta object protocol is an API to an object system. + +To be more specific, it abstracts the components of an object system +(classes, object, methods, object attributes, etc.). These +abstractions can then be used to inspect and manipulate the object +system which they describe. + +It can be said that there are two MOPs for any object system; the +implicit MOP and the explicit MOP. The implicit MOP handles things +like method dispatch or inheritance, which happen automatically as +part of how the object system works. The explicit MOP typically +handles the introspection/reflection features of the object system. + +All object systems have implicit MOPs. Without one, they would not +work. Explicit MOPs are much less common, and depending on the +language can vary from restrictive (Reflection in Java or C#) to wide +open (CLOS is a perfect example). + +=head2 Yet Another Class Builder! Why? + +This is B a class builder so much as a I>. The intent is that an end user will not use this module +directly, but instead this module is used by module authors to build +extensions and features onto the Perl 5 object system. + +This system is used by L, which supplies a powerful class +builder system built entirely on top of C. + +=head2 Who is this module for? + +This module is for anyone who has ever created or wanted to create a +module for the Class:: namespace. The tools which this module provides +make doing complex Perl 5 wizardry simpler, by removing such barriers +as the need to hack symbol tables, or understand the fine details of +method dispatch. + +=head2 What changes do I have to make to use this module? + +This module was designed to be as unobtrusive as possible. Many of its +features are accessible without B change to your existing +code. It is meant to be a complement to your existing code and not an +intrusion on your code base. Unlike many other B modules, +this module B require you subclass it, or even that you +C it in within your module's package. + +The only features which require additions to your code are the +attribute handling and instance construction features, and these are +both completely optional features. The only reason for this is because +Perl 5's object system does not actually have these features built +in. More information about this feature can be found below. + +=head2 About Performance + +It is a common misconception that explicit MOPs are a performance hit. +This is not a universal truth, it is a side-effect of some specific +implementations. For instance, using Java reflection is slow because +the JVM cannot take advantage of any compiler optimizations, and the +JVM has to deal with much more runtime type information as well. + +Reflection in C# is marginally better as it was designed into the +language and runtime (the CLR). In contrast, CLOS (the Common Lisp +Object System) was built to support an explicit MOP, and so +performance is tuned for it. + +This library in particular does its absolute best to avoid putting +B drain at all upon your code's performance. In fact, by itself +it does nothing to affect your existing code. So you only pay for what +you actually use. + +=head2 About Metaclass compatibility + +This module makes sure that all metaclasses created are both upwards +and downwards compatible. The topic of metaclass compatibility is +highly esoteric and is something only encountered when doing deep and +involved metaclass hacking. There are two basic kinds of metaclass +incompatibility; upwards and downwards. + +Upwards metaclass compatibility means that the metaclass of a +given class is either the same as (or a subclass of) all of the +metaclasses of the class's ancestors. + +Downward metaclass compatibility means that the metaclasses of a +given class's ancestors are all the same as (or a subclass of) that +class's metaclass. + +Here is a diagram showing a set of two classes (C and C) and +two metaclasses (C and C) which have correct +metaclass compatibility both upwards and downwards. + + +---------+ +---------+ + | Meta::A |<----| Meta::B | <....... (instance of ) + +---------+ +---------+ <------- (inherits from) + ^ ^ + : : + +---------+ +---------+ + | A |<----| B | + +---------+ +---------+ + +In actuality, I of a class's metaclasses must be compatible, +not just the class metaclass. That includes the instance, attribute, +and method metaclasses, as well as the constructor and destructor +classes. + +C will attempt to fix some simple types of +incompatibilities. If all the metaclasses for the parent class are +I of the child's metaclasses then we can simply replace +the child's metaclasses with the parent's. In addition, if the child +is missing a metaclass that the parent has, we can also just make the +child use the parent's metaclass. + +As I said this is a highly esoteric topic and one you will only run +into if you do a lot of subclassing of L. If you +are interested in why this is an issue see the paper I linked to in the L section of +this document. + +=head2 Using custom metaclasses + +Always use the L pragma when using a custom metaclass, this +will ensure the proper initialization order and not accidentally +create an incorrect type of metaclass for you. This is a very rare +problem, and one which can only occur if you are doing deep metaclass +programming. So in other words, don't worry about it. + +Note that if you're using L we encourage you to I use the +L pragma, and instead use L to apply +roles to a class's metaclasses. This topic is covered at length in +various L recipes. + +=head1 PROTOCOLS + +The meta-object protocol is divided into 4 main sub-protocols: + +=head2 The Class protocol + +This provides a means of manipulating and introspecting a Perl 5 +class. It handles symbol table hacking for you, and provides a rich +set of methods that go beyond simple package introspection. + +See L for more details. + +=head2 The Attribute protocol + +This provides a consistent representation for an attribute of a Perl 5 +class. Since there are so many ways to create and handle attributes in +Perl 5 OO, the Attribute protocol provide as much of a unified +approach as possible. Of course, you are always free to extend this +protocol by subclassing the appropriate classes. + +See L for more details. + +=head2 The Method protocol + +This provides a means of manipulating and introspecting methods in the +Perl 5 object system. As with attributes, there are many ways to +approach this topic, so we try to keep it pretty basic, while still +making it possible to extend the system in many ways. + +See L for more details. + +=head2 The Instance protocol + +This provides a layer of abstraction for creating object instances. +Since the other layers use this protocol, it is relatively easy to +change the type of your instances from the default hash reference to +some other type of reference. Several examples are provided in the +F directory included in this distribution. + +See L for more details. + +=head1 FUNCTIONS + +Note that this module does not export any constants or functions. + +=head2 Utility functions + +Note that these are all called as B. + +=over 4 + +=item B + +This function returns two values, the name of the package the C<$code> +is from and the name of the C<$code> itself. This is used by several +elements of the MOP to determine where a given C<$code> reference is +from. + +=item B + +This will return the metaclass of the given instance or class name. If the +class lacks a metaclass, no metaclass will be initialized, and C will be +returned. + +You should almost certainly be using +L|Moose::Util/find_meta> instead. + +=back + +=head2 Metaclass cache functions + +C holds a cache of metaclasses. The following are functions +(B) which can be used to access that cache. It is not +recommended that you mess with these. Bad things could happen, but if +you are brave and willing to risk it: go for it! + +=over 4 + +=item B + +This will return a hash of all the metaclass instances that have +been cached by L, keyed by the package name. + +=item B + +This will return a list of all the metaclass instances that have +been cached by L. + +=item B + +This will return a list of all the metaclass names that have +been cached by L. + +=item B + +This will return a cached L instance, or nothing +if no metaclass exists with that C<$name>. + +=item B + +This will store a metaclass in the cache at the supplied C<$key>. + +=item B + +In rare cases (e.g. anonymous metaclasses) it is desirable to +store a weakened reference in the metaclass cache. This +function will weaken the reference to the metaclass stored +in C<$name>. + +=item B + +Returns true if the metaclass for C<$name> has been weakened +(via C). + +=item B + +This will return true of there exists a metaclass stored in the +C<$name> key, and return false otherwise. + +=item B + +This will remove the metaclass stored in the C<$name> key. + +=back + +Some utility functions (such as C) that were +previously defined in C regarding loading of classes have been +extracted to L. Please see L for documentation. + +=head1 SEE ALSO + +=head2 Books + +There are very few books out on Meta Object Protocols and Metaclasses +because it is such an esoteric topic. The following books are really +the only ones I have found. If you know of any more, B> +email me and let me know, I would love to hear about them. + +=over 4 + +=item I + +=item I + +=item I + +=item I + +=back + +=head2 Papers + +=over 4 + +=item "Uniform and safe metaclass composition" + +An excellent paper by the people who brought us the original Traits paper. +This paper is on how Traits can be used to do safe metaclass composition, +and offers an excellent introduction section which delves into the topic of +metaclass compatibility. + +L + +=item "Safe Metaclass Programming" + +This paper seems to precede the above paper, and propose a mix-in based +approach as opposed to the Traits based approach. Both papers have similar +information on the metaclass compatibility problem space. + +L + +=back + +=head2 Prior Art + +=over 4 + +=item The Perl 6 MetaModel work in the Pugs project + +=over 4 + +=item L + +=item L + +=back + +=back + +=head2 Articles + +=over 4 + +=item CPAN Module Review of Class::MOP + +L + +=back + +=head1 SIMILAR MODULES + +As I have said above, this module is a class-builder-builder, so it is +not the same thing as modules like L and +L. That being said there are very few modules on CPAN +with similar goals to this module. The one I have found which is most +like this module is L, although its philosophy and the MOP it +creates are very different from this modules. + +=head1 BUGS + +All complex software has bugs lurking in it, and this module is no +exception. + +Please report any bugs to C, or through the +web interface at L. + +You can also discuss feature requests or possible bugs on the Moose +mailing list (moose@perl.org) or on IRC at +L. + +=head1 ACKNOWLEDGEMENTS + +=over 4 + +=item Rob Kinyon + +Thanks to Rob for actually getting the development of this module kick-started. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Attribute.pm b/lib/Class/MOP/Attribute.pm new file mode 100644 index 0000000..c5c4995 --- /dev/null +++ b/lib/Class/MOP/Attribute.pm @@ -0,0 +1,1100 @@ +package Class::MOP::Attribute; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Class::MOP::Method::Accessor; + +use Carp 'confess'; +use Scalar::Util 'blessed', 'weaken'; +use Try::Tiny; + +use parent 'Class::MOP::Object', 'Class::MOP::Mixin::AttributeCore'; + +# NOTE: (meta-circularity) +# This method will be replaced in the +# boostrap section of Class::MOP, by +# a new version which uses the +# &Class::MOP::Class::construct_instance +# method to build an attribute meta-object +# which itself is described with attribute +# meta-objects. +# - Ain't meta-circularity grand? :) +sub new { + my ( $class, @args ) = @_; + + unshift @args, "name" if @args % 2 == 1; + my %options = @args; + + my $name = $options{name}; + + (defined $name) + || $class->_throw_exception( MOPAttributeNewNeedsAttributeName => class => $class, + params => \%options + ); + + $options{init_arg} = $name + if not exists $options{init_arg}; + if(exists $options{builder}){ + $class->_throw_exception( BuilderMustBeAMethodName => class => $class, + params => \%options + ) + if ref $options{builder} || !(defined $options{builder}); + $class->_throw_exception( BothBuilderAndDefaultAreNotAllowed => class => $class, + params => \%options + ) + if exists $options{default}; + } else { + ($class->is_default_a_coderef(\%options)) + || $class->_throw_exception( ReferencesAreNotAllowedAsDefault => class => $class, + params => \%options, + attribute_name => $options{name} + ) + if exists $options{default} && ref $options{default}; + } + + if( $options{required} and not( defined($options{builder}) || defined($options{init_arg}) || exists $options{default} ) ) { + $class->_throw_exception( RequiredAttributeLacksInitialization => class => $class, + params => \%options + ); + } + + $class->_new(\%options); +} + +sub _new { + my $class = shift; + + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $options = @_ == 1 ? $_[0] : {@_}; + + bless { + 'name' => $options->{name}, + 'accessor' => $options->{accessor}, + 'reader' => $options->{reader}, + 'writer' => $options->{writer}, + 'predicate' => $options->{predicate}, + 'clearer' => $options->{clearer}, + 'builder' => $options->{builder}, + 'init_arg' => $options->{init_arg}, + exists $options->{default} + ? ('default' => $options->{default}) + : (), + 'initializer' => $options->{initializer}, + 'definition_context' => $options->{definition_context}, + # keep a weakened link to the + # class we are associated with + 'associated_class' => undef, + # and a list of the methods + # associated with this attr + 'associated_methods' => [], + # this let's us keep track of + # our order inside the associated + # class + 'insertion_order' => undef, + }, $class; +} + +# NOTE: +# this is a primitive (and kludgy) clone operation +# for now, it will be replaced in the Class::MOP +# bootstrap with a proper one, however we know +# that this one will work fine for now. +sub clone { + my $self = shift; + my %options = @_; + (blessed($self)) + || confess "Can only clone an instance"; + # this implementation is overwritten by the bootstrap process, + # so this exception will never trigger. If it ever does occur, + # it indicates a gigantic problem with the most internal parts + # of Moose, so we wouldn't want a Moose-based exception object anyway + + return bless { %{$self}, %options } => ref($self); +} + +sub initialize_instance_slot { + my ($self, $meta_instance, $instance, $params) = @_; + my $init_arg = $self->{'init_arg'}; + + # try to fetch the init arg from the %params ... + + # if nothing was in the %params, we can use the + # attribute's default value (if it has one) + if(defined $init_arg and exists $params->{$init_arg}){ + $self->_set_initial_slot_value( + $meta_instance, + $instance, + $params->{$init_arg}, + ); + } + elsif (exists $self->{'default'}) { + $self->_set_initial_slot_value( + $meta_instance, + $instance, + $self->default($instance), + ); + } + elsif (defined( my $builder = $self->{'builder'})) { + if ($builder = $instance->can($builder)) { + $self->_set_initial_slot_value( + $meta_instance, + $instance, + $instance->$builder, + ); + } + else { + $self->_throw_exception( BuilderMethodNotSupportedForAttribute => attribute => $self, + instance => $instance + ); + } + } +} + +sub _set_initial_slot_value { + my ($self, $meta_instance, $instance, $value) = @_; + + my $slot_name = $self->name; + + return $meta_instance->set_slot_value($instance, $slot_name, $value) + unless $self->has_initializer; + + my $callback = $self->_make_initializer_writer_callback( + $meta_instance, $instance, $slot_name + ); + + my $initializer = $self->initializer; + + # most things will just want to set a value, so make it first arg + $instance->$initializer($value, $callback, $self); +} + +sub _make_initializer_writer_callback { + my $self = shift; + my ($meta_instance, $instance, $slot_name) = @_; + + return sub { + $meta_instance->set_slot_value($instance, $slot_name, $_[0]); + }; +} + +sub get_read_method { + my $self = shift; + my $reader = $self->reader || $self->accessor; + # normal case ... + return $reader unless ref $reader; + # the HASH ref case + my ($name) = %$reader; + return $name; +} + +sub get_write_method { + my $self = shift; + my $writer = $self->writer || $self->accessor; + # normal case ... + return $writer unless ref $writer; + # the HASH ref case + my ($name) = %$writer; + return $name; +} + +sub get_read_method_ref { + my $self = shift; + if ((my $reader = $self->get_read_method) && $self->associated_class) { + return $self->associated_class->get_method($reader); + } + else { + my $code = sub { $self->get_value(@_) }; + if (my $class = $self->associated_class) { + return $class->method_metaclass->wrap( + $code, + package_name => $class->name, + name => '__ANON__' + ); + } + else { + return $code; + } + } +} + +sub get_write_method_ref { + my $self = shift; + if ((my $writer = $self->get_write_method) && $self->associated_class) { + return $self->associated_class->get_method($writer); + } + else { + my $code = sub { $self->set_value(@_) }; + if (my $class = $self->associated_class) { + return $class->method_metaclass->wrap( + $code, + package_name => $class->name, + name => '__ANON__' + ); + } + else { + return $code; + } + } +} + +# slots + +sub slots { (shift)->name } + +# class association + +sub attach_to_class { + my ($self, $class) = @_; + (blessed($class) && $class->isa('Class::MOP::Class')) + || $self->_throw_exception( AttachToClassNeedsAClassMOPClassInstanceOrASubclass => attribute => $self, + class => $class + ); + weaken($self->{'associated_class'} = $class); +} + +sub detach_from_class { + my $self = shift; + $self->{'associated_class'} = undef; +} + +# method association + +sub associate_method { + my ($self, $method) = @_; + push @{$self->{'associated_methods'}} => $method; +} + +## Slot management + +sub set_initial_value { + my ($self, $instance, $value) = @_; + $self->_set_initial_slot_value( + Class::MOP::Class->initialize(ref($instance))->get_meta_instance, + $instance, + $value + ); +} + +sub set_value { shift->set_raw_value(@_) } + +sub set_raw_value { + my $self = shift; + my ($instance, $value) = @_; + + my $mi = Class::MOP::Class->initialize(ref($instance))->get_meta_instance; + return $mi->set_slot_value($instance, $self->name, $value); +} + +sub _inline_set_value { + my $self = shift; + return $self->_inline_instance_set(@_) . ';'; +} + +sub _inline_instance_set { + my $self = shift; + my ($instance, $value) = @_; + + my $mi = $self->associated_class->get_meta_instance; + return $mi->inline_set_slot_value($instance, $self->name, $value); +} + +sub get_value { shift->get_raw_value(@_) } + +sub get_raw_value { + my $self = shift; + my ($instance) = @_; + + my $mi = Class::MOP::Class->initialize(ref($instance))->get_meta_instance; + return $mi->get_slot_value($instance, $self->name); +} + +sub _inline_get_value { + my $self = shift; + return $self->_inline_instance_get(@_) . ';'; +} + +sub _inline_instance_get { + my $self = shift; + my ($instance) = @_; + + my $mi = $self->associated_class->get_meta_instance; + return $mi->inline_get_slot_value($instance, $self->name); +} + +sub has_value { + my $self = shift; + my ($instance) = @_; + + my $mi = Class::MOP::Class->initialize(ref($instance))->get_meta_instance; + return $mi->is_slot_initialized($instance, $self->name); +} + +sub _inline_has_value { + my $self = shift; + return $self->_inline_instance_has(@_) . ';'; +} + +sub _inline_instance_has { + my $self = shift; + my ($instance) = @_; + + my $mi = $self->associated_class->get_meta_instance; + return $mi->inline_is_slot_initialized($instance, $self->name); +} + +sub clear_value { + my $self = shift; + my ($instance) = @_; + + my $mi = Class::MOP::Class->initialize(ref($instance))->get_meta_instance; + return $mi->deinitialize_slot($instance, $self->name); +} + +sub _inline_clear_value { + my $self = shift; + return $self->_inline_instance_clear(@_) . ';'; +} + +sub _inline_instance_clear { + my $self = shift; + my ($instance) = @_; + + my $mi = $self->associated_class->get_meta_instance; + return $mi->inline_deinitialize_slot($instance, $self->name); +} + +## load em up ... + +sub accessor_metaclass { 'Class::MOP::Method::Accessor' } + +sub _process_accessors { + my ($self, $type, $accessor, $generate_as_inline_methods) = @_; + + my $method_ctx = { %{ $self->definition_context || {} } }; + + if (ref($accessor)) { + (ref($accessor) eq 'HASH') + || $self->_throw_exception( BadOptionFormat => attribute => $self, + option_value => $accessor, + option_name => $type + ); + + my ($name, $method) = %{$accessor}; + + $method_ctx->{description} = $self->_accessor_description($name, $type); + + $method = $self->accessor_metaclass->wrap( + $method, + attribute => $self, + package_name => $self->associated_class->name, + name => $name, + associated_metaclass => $self->associated_class, + definition_context => $method_ctx, + ); + $self->associate_method($method); + return ($name, $method); + } + else { + my $inline_me = ($generate_as_inline_methods && $self->associated_class->instance_metaclass->is_inlinable); + my $method; + try { + $method_ctx->{description} = $self->_accessor_description($accessor, $type); + + $method = $self->accessor_metaclass->new( + attribute => $self, + is_inline => $inline_me, + accessor_type => $type, + package_name => $self->associated_class->name, + name => $accessor, + associated_metaclass => $self->associated_class, + definition_context => $method_ctx, + ); + } + catch { + $self->_throw_exception( CouldNotCreateMethod => attribute => $self, + option_value => $accessor, + option_name => $type, + error => $_ + ); + }; + $self->associate_method($method); + return ($accessor, $method); + } +} + +sub _accessor_description { + my $self = shift; + my ($name, $type) = @_; + + my $desc = "$type " . $self->associated_class->name . "::$name"; + if ( $name ne $self->name ) { + $desc .= " of attribute " . $self->name; + } + + return $desc; +} + +sub install_accessors { + my $self = shift; + my $inline = shift; + my $class = $self->associated_class; + + $class->add_method( + $self->_process_accessors('accessor' => $self->accessor(), $inline) + ) if $self->has_accessor(); + + $class->add_method( + $self->_process_accessors('reader' => $self->reader(), $inline) + ) if $self->has_reader(); + + $class->add_method( + $self->_process_accessors('writer' => $self->writer(), $inline) + ) if $self->has_writer(); + + $class->add_method( + $self->_process_accessors('predicate' => $self->predicate(), $inline) + ) if $self->has_predicate(); + + $class->add_method( + $self->_process_accessors('clearer' => $self->clearer(), $inline) + ) if $self->has_clearer(); + + return; +} + +{ + my $_remove_accessor = sub { + my ($accessor, $class) = @_; + if (ref($accessor) && ref($accessor) eq 'HASH') { + ($accessor) = keys %{$accessor}; + } + my $method = $class->get_method($accessor); + $class->remove_method($accessor) + if (ref($method) && $method->isa('Class::MOP::Method::Accessor')); + }; + + sub remove_accessors { + my $self = shift; + # TODO: + # we really need to make sure to remove from the + # associates methods here as well. But this is + # such a slimly used method, I am not worried + # about it right now. + $_remove_accessor->($self->accessor(), $self->associated_class()) if $self->has_accessor(); + $_remove_accessor->($self->reader(), $self->associated_class()) if $self->has_reader(); + $_remove_accessor->($self->writer(), $self->associated_class()) if $self->has_writer(); + $_remove_accessor->($self->predicate(), $self->associated_class()) if $self->has_predicate(); + $_remove_accessor->($self->clearer(), $self->associated_class()) if $self->has_clearer(); + return; + } + +} + +1; + +# ABSTRACT: Attribute Meta Object + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Attribute - Attribute Meta Object + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + Class::MOP::Attribute->new( + foo => ( + accessor => 'foo', # dual purpose get/set accessor + predicate => 'has_foo', # predicate check for defined-ness + init_arg => '-foo', # class->new will look for a -foo key + default => 'BAR IS BAZ!' # if no -foo key is provided, use this + ) + ); + + Class::MOP::Attribute->new( + bar => ( + reader => 'bar', # getter + writer => 'set_bar', # setter + predicate => 'has_bar', # predicate check for defined-ness + init_arg => ':bar', # class->new will look for a :bar key + # no default value means it is undef + ) + ); + +=head1 DESCRIPTION + +The Attribute Protocol is almost entirely an invention of +C. Perl 5 does not have a consistent notion of +attributes. There are so many ways in which this is done, and very few +(if any) are easily discoverable by this module. + +With that said, this module attempts to inject some order into this +chaos, by introducing a consistent API which can be used to create +object attributes. + +=head1 METHODS + +=head2 Creation + +=over 4 + +=item B<< Class::MOP::Attribute->new($name, ?%options) >> + +An attribute must (at the very least), have a C<$name>. All other +C<%options> are added as key-value pairs. + +=over 8 + +=item * init_arg + +This is a string value representing the expected key in an +initialization hash. For instance, if we have an C value of +C<-foo>, then the following code will Just Work. + + MyClass->meta->new_object( -foo => 'Hello There' ); + +If an init_arg is not assigned, it will automatically use the +attribute's name. If C is explicitly set to C, the +attribute cannot be specified during initialization. + +=item * builder + +This provides the name of a method that will be called to initialize +the attribute. This method will be called on the object after it is +constructed. It is expected to return a valid value for the attribute. + +=item * default + +This can be used to provide an explicit default for initializing the +attribute. If the default you provide is a subroutine reference, then +this reference will be called I on the object. + +If the value is a simple scalar (string or number), then it can be +just passed as is. However, if you wish to initialize it with a HASH +or ARRAY ref, then you need to wrap that inside a subroutine +reference: + + Class::MOP::Attribute->new( + 'foo' => ( + default => sub { [] }, + ) + ); + + # or ... + + Class::MOP::Attribute->new( + 'foo' => ( + default => sub { {} }, + ) + ); + +If you wish to initialize an attribute with a subroutine reference +itself, then you need to wrap that in a subroutine as well: + + Class::MOP::Attribute->new( + 'foo' => ( + default => sub { + sub { print "Hello World" } + }, + ) + ); + +And lastly, if the value of your attribute is dependent upon some +other aspect of the instance structure, then you can take advantage of +the fact that when the C value is called as a method: + + Class::MOP::Attribute->new( + 'object_identity' => ( + default => sub { Scalar::Util::refaddr( $_[0] ) }, + ) + ); + +Note that there is no guarantee that attributes are initialized in any +particular order, so you cannot rely on the value of some other +attribute when generating the default. + +=item * initializer + +This option can be either a method name or a subroutine +reference. This method will be called when setting the attribute's +value in the constructor. Unlike C and C, the +initializer is only called when a value is provided to the +constructor. The initializer allows you to munge this value during +object construction. + +The initializer is called as a method with three arguments. The first +is the value that was passed to the constructor. The second is a +subroutine reference that can be called to actually set the +attribute's value, and the last is the associated +C object. + +This contrived example shows an initializer that sets the attribute to +twice the given value. + + Class::MOP::Attribute->new( + 'doubled' => ( + initializer => sub { + my ( $self, $value, $set, $attr ) = @_; + $set->( $value * 2 ); + }, + ) + ); + +Since an initializer can be a method name, you can easily make +attribute initialization use the writer: + + Class::MOP::Attribute->new( + 'some_attr' => ( + writer => 'some_attr', + initializer => 'some_attr', + ) + ); + +Your writer (actually, a wrapper around the writer, using +L) will need to examine +C<@_> and determine under which +context it is being called: + + around 'some_attr' => sub { + my $orig = shift; + my $self = shift; + # $value is not defined if being called as a reader + # $setter and $attr are only defined if being called as an initializer + my ($value, $setter, $attr) = @_; + + # the reader behaves normally + return $self->$orig if not @_; + + # mutate $value as desired + # $value = ($row) if $setter; + + # otherwise, call the real writer with the new value + $self->$orig($row); + }; + +=back + +The C, C, C, C and C +options all accept the same parameters. You can provide the name of +the method, in which case an appropriate default method will be +generated for you. Or instead you can also provide hash reference +containing exactly one key (the method name) and one value. The value +should be a subroutine reference, which will be installed as the +method itself. + +=over 8 + +=item * accessor + +An C is a standard Perl-style read/write accessor. It will +return the value of the attribute, and if a value is passed as an +argument, it will assign that value to the attribute. + +Note that C is a legitimate value, so this will work: + + $object->set_something(undef); + +=item * reader + +This is a basic read-only accessor. It returns the value of the +attribute. + +=item * writer + +This is a basic write accessor, it accepts a single argument, and +assigns that value to the attribute. + +Note that C is a legitimate value, so this will work: + + $object->set_something(undef); + +=item * predicate + +The predicate method returns a boolean indicating whether or not the +attribute has been explicitly set. + +Note that the predicate returns true even if the attribute was set to +a false value (C<0> or C). + +=item * clearer + +This method will uninitialize the attribute. After an attribute is +cleared, its C will return false. + +=item * definition_context + +Mostly, this exists as a hook for the benefit of Moose. + +This option should be a hash reference containing several keys which +will be used when inlining the attribute's accessors. The keys should +include C, the line number where the attribute was created, and +either C or C. + +This information will ultimately be used when eval'ing inlined +accessor code so that error messages report a useful line and file +name. + +=back + +=item B<< $attr->clone(%options) >> + +This clones the attribute. Any options you provide will override the +settings of the original attribute. You can change the name of the new +attribute by passing a C key in C<%options>. + +=back + +=head2 Informational + +These are all basic read-only accessors for the values passed into +the constructor. + +=over 4 + +=item B<< $attr->name >> + +Returns the attribute's name. + +=item B<< $attr->accessor >> + +=item B<< $attr->reader >> + +=item B<< $attr->writer >> + +=item B<< $attr->predicate >> + +=item B<< $attr->clearer >> + +The C, C, C, C, and C +methods all return exactly what was passed to the constructor, so it +can be either a string containing a method name, or a hash reference. + +=item B<< $attr->initializer >> + +Returns the initializer as passed to the constructor, so this may be +either a method name or a subroutine reference. + +=item B<< $attr->init_arg >> + +=item B<< $attr->is_default_a_coderef >> + +=item B<< $attr->builder >> + +=item B<< $attr->default($instance) >> + +The C<$instance> argument is optional. If you don't pass it, the +return value for this method is exactly what was passed to the +constructor, either a simple scalar or a subroutine reference. + +If you I pass an C<$instance> and the default is a subroutine +reference, then the reference is called as a method on the +C<$instance> and the generated value is returned. + +=item B<< $attr->slots >> + +Return a list of slots required by the attribute. This is usually just +one, the name of the attribute. + +A slot is the name of the hash key used to store the attribute in an +object instance. + +=item B<< $attr->get_read_method >> + +=item B<< $attr->get_write_method >> + +Returns the name of a method suitable for reading or writing the value +of the attribute in the associated class. + +If an attribute is read- or write-only, then these methods can return +C as appropriate. + +=item B<< $attr->has_read_method >> + +=item B<< $attr->has_write_method >> + +This returns a boolean indicating whether the attribute has a I +read or write method. + +=item B<< $attr->get_read_method_ref >> + +=item B<< $attr->get_write_method_ref >> + +Returns the subroutine reference of a method suitable for reading or +writing the attribute's value in the associated class. These methods +always return a subroutine reference, regardless of whether or not the +attribute is read- or write-only. + +=item B<< $attr->insertion_order >> + +If this attribute has been inserted into a class, this returns a zero +based index regarding the order of insertion. + +=back + +=head2 Informational predicates + +These are all basic predicate methods for the values passed into C. + +=over 4 + +=item B<< $attr->has_accessor >> + +=item B<< $attr->has_reader >> + +=item B<< $attr->has_writer >> + +=item B<< $attr->has_predicate >> + +=item B<< $attr->has_clearer >> + +=item B<< $attr->has_initializer >> + +=item B<< $attr->has_init_arg >> + +This will be I if the C was set to C. + +=item B<< $attr->has_default >> + +This will be I if the C was set to C, since +C is the default C anyway. + +=item B<< $attr->has_builder >> + +=item B<< $attr->has_insertion_order >> + +This will be I if this attribute has not be inserted into a class + +=back + +=head2 Value management + +These methods are basically "back doors" to the instance, and can be +used to bypass the regular accessors, but still stay within the MOP. + +These methods are not for general use, and should only be used if you +really know what you are doing. + +=over 4 + +=item B<< $attr->initialize_instance_slot($meta_instance, $instance, $params) >> + +This method is used internally to initialize the attribute's slot in +the object C<$instance>. + +The C<$params> is a hash reference of the values passed to the object +constructor. + +It's unlikely that you'll need to call this method yourself. + +=item B<< $attr->set_value($instance, $value) >> + +Sets the value without going through the accessor. Note that this +works even with read-only attributes. + +=item B<< $attr->set_raw_value($instance, $value) >> + +Sets the value with no side effects such as a trigger. + +This doesn't actually apply to Class::MOP attributes, only to subclasses. + +=item B<< $attr->set_initial_value($instance, $value) >> + +Sets the value without going through the accessor. This method is only +called when the instance is first being initialized. + +=item B<< $attr->get_value($instance) >> + +Returns the value without going through the accessor. Note that this +works even with write-only accessors. + +=item B<< $attr->get_raw_value($instance) >> + +Returns the value without any side effects such as lazy attributes. + +Doesn't actually apply to Class::MOP attributes, only to subclasses. + +=item B<< $attr->has_value($instance) >> + +Return a boolean indicating whether the attribute has been set in +C<$instance>. This how the default C method works. + +=item B<< $attr->clear_value($instance) >> + +This will clear the attribute's value in C<$instance>. This is what +the default C calls. + +Note that this works even if the attribute does not have any +associated read, write or clear methods. + +=back + +=head2 Class association + +These methods allow you to manage the attributes association with +the class that contains it. These methods should not be used +lightly, nor are they very magical, they are mostly used internally +and by metaclass instances. + +=over 4 + +=item B<< $attr->associated_class >> + +This returns the L with which this attribute is +associated, if any. + +=item B<< $attr->attach_to_class($metaclass) >> + +This method stores a weakened reference to the C<$metaclass> object +internally. + +This method does not remove the attribute from its old class, +nor does it create any accessors in the new class. + +It is probably best to use the L C +method instead. + +=item B<< $attr->detach_from_class >> + +This method removes the associate metaclass object from the attribute +it has one. + +This method does not remove the attribute itself from the class, or +remove its accessors. + +It is probably best to use the L +C method instead. + +=back + +=head2 Attribute Accessor generation + +=over 4 + +=item B<< $attr->accessor_metaclass >> + +Accessor methods are generated using an accessor metaclass. By +default, this is L. This method returns +the name of the accessor metaclass that this attribute uses. + +=item B<< $attr->associate_method($method) >> + +This associates a L object with the +attribute. Typically, this is called internally when an attribute +generates its accessors. + +=item B<< $attr->associated_methods >> + +This returns the list of methods which have been associated with the +attribute. + +=item B<< $attr->install_accessors >> + +This method generates and installs code the attributes various +accessors. It is typically called from the L +C method. + +=item B<< $attr->remove_accessors >> + +This method removes all of the accessors associated with the +attribute. + +This does not currently remove methods from the list returned by +C. + +=item B<< $attr->inline_get >> + +=item B<< $attr->inline_set >> + +=item B<< $attr->inline_has >> + +=item B<< $attr->inline_clear >> + +These methods return a code snippet suitable for inlining the relevant +operation. They expect strings containing variable names to be used in the +inlining, like C<'$self'> or C<'$_[1]'>. + +=back + +=head2 Introspection + +=over 4 + +=item B<< Class::MOP::Attribute->meta >> + +This will return a L instance for this class. + +It should also be noted that L will actually bootstrap +this module by installing a number of attribute meta-objects into its +metaclass. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm new file mode 100644 index 0000000..c5e1bae --- /dev/null +++ b/lib/Class/MOP/Class.pm @@ -0,0 +1,2312 @@ +package Class::MOP::Class; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Class::MOP::Instance; +use Class::MOP::Method::Wrapped; +use Class::MOP::Method::Accessor; +use Class::MOP::Method::Constructor; +use Class::MOP::MiniTrait; + +use Carp 'confess'; +use Module::Runtime 'use_package_optimistically'; +use Scalar::Util 'blessed'; +use Sub::Name 'subname'; +use Try::Tiny; +use List::Util 1.33 'all'; + +use parent 'Class::MOP::Module', + 'Class::MOP::Mixin::HasAttributes', + 'Class::MOP::Mixin::HasMethods', + 'Class::MOP::Mixin::HasOverloads'; + +# Creation + +sub initialize { + my $class = shift; + + my $package_name; + + if ( @_ % 2 ) { + $package_name = shift; + } else { + my %options = @_; + $package_name = $options{package}; + } + + ($package_name && !ref($package_name)) + || ($class||__PACKAGE__)->_throw_exception( InitializeTakesUnBlessedPackageName => package_name => $package_name ); + return Class::MOP::get_metaclass_by_name($package_name) + || $class->_construct_class_instance(package => $package_name, @_); +} + +sub reinitialize { + my ( $class, @args ) = @_; + unshift @args, "package" if @args % 2; + my %options = @args; + my $old_metaclass = blessed($options{package}) + ? $options{package} + : Class::MOP::get_metaclass_by_name($options{package}); + $options{weaken} = Class::MOP::metaclass_is_weak($old_metaclass->name) + if !exists $options{weaken} + && blessed($old_metaclass) + && $old_metaclass->isa('Class::MOP::Class'); + $old_metaclass->_remove_generated_metaobjects + if $old_metaclass && $old_metaclass->isa('Class::MOP::Class'); + my $new_metaclass = $class->SUPER::reinitialize(%options); + $new_metaclass->_restore_metaobjects_from($old_metaclass) + if $old_metaclass && $old_metaclass->isa('Class::MOP::Class'); + return $new_metaclass; +} + +# NOTE: (meta-circularity) +# this is a special form of _construct_instance +# (see below), which is used to construct class +# meta-object instances for any Class::MOP::* +# class. All other classes will use the more +# normal &construct_instance. +sub _construct_class_instance { + my $class = shift; + my $options = @_ == 1 ? $_[0] : {@_}; + my $package_name = $options->{package}; + (defined $package_name && $package_name) + || $class->_throw_exception("ConstructClassInstanceTakesPackageName"); + # NOTE: + # return the metaclass if we have it cached, + # and it is still defined (it has not been + # reaped by DESTROY yet, which can happen + # annoyingly enough during global destruction) + + if (defined(my $meta = Class::MOP::get_metaclass_by_name($package_name))) { + return $meta; + } + + $class + = ref $class + ? $class->_real_ref_name + : $class; + + # now create the metaclass + my $meta; + if ($class eq 'Class::MOP::Class') { + $meta = $class->_new($options); + } + else { + # NOTE: + # it is safe to use meta here because + # class will always be a subclass of + # Class::MOP::Class, which defines meta + $meta = $class->meta->_construct_instance($options) + } + + # and check the metaclass compatibility + $meta->_check_metaclass_compatibility(); + + Class::MOP::store_metaclass_by_name($package_name, $meta); + + # NOTE: + # we need to weaken any anon classes + # so that they can call DESTROY properly + Class::MOP::weaken_metaclass($package_name) if $options->{weaken}; + + $meta; +} + +sub _real_ref_name { + my $self = shift; + + # NOTE: we need to deal with the possibility of class immutability here, + # and then get the name of the class appropriately + return $self->is_immutable + ? $self->_get_mutable_metaclass_name() + : ref $self; +} + +sub _new { + my $class = shift; + + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $options = @_ == 1 ? $_[0] : {@_}; + + return bless { + # inherited from Class::MOP::Package + 'package' => $options->{package}, + + # NOTE: + # since the following attributes will + # actually be loaded from the symbol + # table, and actually bypass the instance + # entirely, we can just leave these things + # listed here for reference, because they + # should not actually have a value associated + # with the slot. + 'namespace' => \undef, + 'methods' => {}, + + # inherited from Class::MOP::Module + 'version' => \undef, + 'authority' => \undef, + + # defined in Class::MOP::Class + 'superclasses' => \undef, + + 'attributes' => {}, + 'attribute_metaclass' => + ( $options->{'attribute_metaclass'} || 'Class::MOP::Attribute' ), + 'method_metaclass' => + ( $options->{'method_metaclass'} || 'Class::MOP::Method' ), + 'wrapped_method_metaclass' => ( + $options->{'wrapped_method_metaclass'} + || 'Class::MOP::Method::Wrapped' + ), + 'instance_metaclass' => + ( $options->{'instance_metaclass'} || 'Class::MOP::Instance' ), + 'immutable_trait' => ( + $options->{'immutable_trait'} + || 'Class::MOP::Class::Immutable::Trait' + ), + 'constructor_name' => ( $options->{constructor_name} || 'new' ), + 'constructor_class' => ( + $options->{constructor_class} || 'Class::MOP::Method::Constructor' + ), + 'destructor_class' => $options->{destructor_class}, + }, $class; +} + +## Metaclass compatibility +{ + my %base_metaclass = ( + attribute_metaclass => 'Class::MOP::Attribute', + method_metaclass => 'Class::MOP::Method', + wrapped_method_metaclass => 'Class::MOP::Method::Wrapped', + instance_metaclass => 'Class::MOP::Instance', + constructor_class => 'Class::MOP::Method::Constructor', + destructor_class => 'Class::MOP::Method::Destructor', + ); + + sub _base_metaclasses { %base_metaclass } +} + +sub _check_metaclass_compatibility { + my $self = shift; + + my @superclasses = $self->superclasses + or return; + + $self->_fix_metaclass_incompatibility(@superclasses); + + my %base_metaclass = $self->_base_metaclasses; + + # this is always okay ... + return + if ref($self) eq 'Class::MOP::Class' + && all { + my $meta = $self->$_; + !defined($meta) || $meta eq $base_metaclass{$_}; + } + keys %base_metaclass; + + for my $superclass (@superclasses) { + $self->_check_class_metaclass_compatibility($superclass); + } + + for my $metaclass_type ( keys %base_metaclass ) { + next unless defined $self->$metaclass_type; + for my $superclass (@superclasses) { + $self->_check_single_metaclass_compatibility( $metaclass_type, + $superclass ); + } + } +} + +sub _check_class_metaclass_compatibility { + my $self = shift; + my ( $superclass_name ) = @_; + + if (!$self->_class_metaclass_is_compatible($superclass_name)) { + my $super_meta = Class::MOP::get_metaclass_by_name($superclass_name); + + my $super_meta_type = $super_meta->_real_ref_name; + + $self->_throw_exception( IncompatibleMetaclassOfSuperclass => class_name => $self->name, + class_meta_type => ref( $self ), + superclass_name => $superclass_name, + superclass_meta_type => $super_meta_type + ); + } +} + +sub _class_metaclass_is_compatible { + my $self = shift; + my ( $superclass_name ) = @_; + + my $super_meta = Class::MOP::get_metaclass_by_name($superclass_name) + || return 1; + + my $super_meta_name = $super_meta->_real_ref_name; + + return $self->_is_compatible_with($super_meta_name); +} + +sub _check_single_metaclass_compatibility { + my $self = shift; + my ( $metaclass_type, $superclass_name ) = @_; + + if (!$self->_single_metaclass_is_compatible($metaclass_type, $superclass_name)) { + my $super_meta = Class::MOP::get_metaclass_by_name($superclass_name); + + $self->_throw_exception( MetaclassTypeIncompatible => class_name => $self->name, + superclass_name => $superclass_name, + metaclass_type => $metaclass_type + ); + } +} + +sub _single_metaclass_is_compatible { + my $self = shift; + my ( $metaclass_type, $superclass_name ) = @_; + + my $super_meta = Class::MOP::get_metaclass_by_name($superclass_name) + || return 1; + + # for instance, Moose::Meta::Class has a error_class attribute, but + # Class::MOP::Class doesn't - this shouldn't be an error + return 1 unless $super_meta->can($metaclass_type); + # for instance, Moose::Meta::Class has a destructor_class, but + # Class::MOP::Class doesn't - this shouldn't be an error + return 1 unless defined $super_meta->$metaclass_type; + # if metaclass is defined in superclass but not here, it's not compatible + # this is a really odd case + return 0 unless defined $self->$metaclass_type; + + return $self->$metaclass_type->_is_compatible_with($super_meta->$metaclass_type); +} + +sub _fix_metaclass_incompatibility { + my $self = shift; + my @supers = map { Class::MOP::Class->initialize($_) } @_; + + my $necessary = 0; + for my $super (@supers) { + $necessary = 1 + if $self->_can_fix_metaclass_incompatibility($super); + } + return unless $necessary; + + for my $super (@supers) { + if (!$self->_class_metaclass_is_compatible($super->name)) { + $self->_fix_class_metaclass_incompatibility($super); + } + } + + my %base_metaclass = $self->_base_metaclasses; + for my $metaclass_type (keys %base_metaclass) { + for my $super (@supers) { + if (!$self->_single_metaclass_is_compatible($metaclass_type, $super->name)) { + $self->_fix_single_metaclass_incompatibility( + $metaclass_type, $super + ); + } + } + } +} + +sub _can_fix_metaclass_incompatibility { + my $self = shift; + my ($super_meta) = @_; + + return 1 if $self->_class_metaclass_can_be_made_compatible($super_meta); + + my %base_metaclass = $self->_base_metaclasses; + for my $metaclass_type (keys %base_metaclass) { + return 1 if $self->_single_metaclass_can_be_made_compatible($super_meta, $metaclass_type); + } + + return; +} + +sub _class_metaclass_can_be_made_compatible { + my $self = shift; + my ($super_meta) = @_; + + return $self->_can_be_made_compatible_with($super_meta->_real_ref_name); +} + +sub _single_metaclass_can_be_made_compatible { + my $self = shift; + my ($super_meta, $metaclass_type) = @_; + + my $specific_meta = $self->$metaclass_type; + + return unless $super_meta->can($metaclass_type); + my $super_specific_meta = $super_meta->$metaclass_type; + + # for instance, Moose::Meta::Class has a destructor_class, but + # Class::MOP::Class doesn't - this shouldn't be an error + return unless defined $super_specific_meta; + + # if metaclass is defined in superclass but not here, it's fixable + # this is a really odd case + return 1 unless defined $specific_meta; + + return 1 if $specific_meta->_can_be_made_compatible_with($super_specific_meta); +} + +sub _fix_class_metaclass_incompatibility { + my $self = shift; + my ( $super_meta ) = @_; + + if ($self->_class_metaclass_can_be_made_compatible($super_meta)) { + ($self->is_pristine) + || $self->_throw_exception( CannotFixMetaclassCompatibility => class_name => $self->name, + superclass => $super_meta + ); + + my $super_meta_name = $super_meta->_real_ref_name; + + $self->_make_compatible_with($super_meta_name); + } +} + +sub _fix_single_metaclass_incompatibility { + my $self = shift; + my ( $metaclass_type, $super_meta ) = @_; + + if ($self->_single_metaclass_can_be_made_compatible($super_meta, $metaclass_type)) { + ($self->is_pristine) + || $self->_throw_exception( CannotFixMetaclassCompatibility => class_name => $self->name, + superclass => $super_meta, + metaclass_type => $metaclass_type + ); + + my $new_metaclass = $self->$metaclass_type + ? $self->$metaclass_type->_get_compatible_metaclass($super_meta->$metaclass_type) + : $super_meta->$metaclass_type; + $self->{$metaclass_type} = $new_metaclass; + } +} + +sub _restore_metaobjects_from { + my $self = shift; + my ($old_meta) = @_; + + $self->_restore_metamethods_from($old_meta); + $self->_restore_metaattributes_from($old_meta); +} + +sub _remove_generated_metaobjects { + my $self = shift; + + for my $attr (map { $self->get_attribute($_) } $self->get_attribute_list) { + $attr->remove_accessors; + } +} + +# creating classes with MOP ... + +sub create { + my $class = shift; + my @args = @_; + + unshift @args, 'package' if @args % 2 == 1; + my %options = @args; + + (ref $options{superclasses} eq 'ARRAY') + || __PACKAGE__->_throw_exception( CreateMOPClassTakesArrayRefOfSuperclasses => class => $class, + params => \%options + ) + if exists $options{superclasses}; + + (ref $options{attributes} eq 'ARRAY') + || __PACKAGE__->_throw_exception( CreateMOPClassTakesArrayRefOfAttributes => class => $class, + params => \%options + ) + if exists $options{attributes}; + + (ref $options{methods} eq 'HASH') + || __PACKAGE__->_throw_exception( CreateMOPClassTakesHashRefOfMethods => class => $class, + params => \%options + ) + if exists $options{methods}; + + my $package = delete $options{package}; + my $superclasses = delete $options{superclasses}; + my $attributes = delete $options{attributes}; + my $methods = delete $options{methods}; + my $meta_name = exists $options{meta_name} + ? delete $options{meta_name} + : 'meta'; + + my $meta = $class->SUPER::create($package => %options); + + $meta->_add_meta_method($meta_name) + if defined $meta_name; + + $meta->superclasses(@{$superclasses}) + if defined $superclasses; + # NOTE: + # process attributes first, so that they can + # install accessors, but locally defined methods + # can then overwrite them. It is maybe a little odd, but + # I think this should be the order of things. + if (defined $attributes) { + foreach my $attr (@{$attributes}) { + $meta->add_attribute($attr); + } + } + if (defined $methods) { + foreach my $method_name (keys %{$methods}) { + $meta->add_method($method_name, $methods->{$method_name}); + } + } + return $meta; +} + +# XXX: something more intelligent here? +sub _anon_package_prefix { 'Class::MOP::Class::__ANON__::SERIAL::' } + +sub create_anon_class { shift->create_anon(@_) } +sub is_anon_class { shift->is_anon(@_) } + +sub _anon_cache_key { + my $class = shift; + my %options = @_; + # Makes something like Super::Class|Super::Class::2 + return join '=' => ( + join( '|', sort @{ $options{superclasses} || [] } ), + ); +} + +# Instance Construction & Cloning + +sub new_object { + my $class = shift; + + # NOTE: + # we need to protect the integrity of the + # Class::MOP::Class singletons here, so we + # delegate this to &construct_class_instance + # which will deal with the singletons + return $class->_construct_class_instance(@_) + if $class->name->isa('Class::MOP::Class'); + return $class->_construct_instance(@_); +} + +sub _construct_instance { + my $class = shift; + my $params = @_ == 1 ? $_[0] : {@_}; + my $meta_instance = $class->get_meta_instance(); + # FIXME: + # the code below is almost certainly incorrect + # but this is foreign inheritance, so we might + # have to kludge it in the end. + my $instance; + if (my $instance_class = blessed($params->{__INSTANCE__})) { + ($instance_class eq $class->name) + || $class->_throw_exception( InstanceBlessedIntoWrongClass => class_name => $class->name, + params => $params, + instance => $params->{__INSTANCE__} + ); + $instance = $params->{__INSTANCE__}; + } + elsif (exists $params->{__INSTANCE__}) { + $class->_throw_exception( InstanceMustBeABlessedReference => class_name => $class->name, + params => $params, + instance => $params->{__INSTANCE__} + ); + } + else { + $instance = $meta_instance->create_instance(); + } + foreach my $attr ($class->get_all_attributes()) { + $attr->initialize_instance_slot($meta_instance, $instance, $params); + } + if (Class::MOP::metaclass_is_weak($class->name)) { + $meta_instance->_set_mop_slot($instance, $class); + } + return $instance; +} + +sub _inline_new_object { + my $self = shift; + + return ( + 'my $class = shift;', + '$class = Scalar::Util::blessed($class) || $class;', + $self->_inline_fallback_constructor('$class'), + $self->_inline_params('$params', '$class'), + $self->_inline_generate_instance('$instance', '$class'), + $self->_inline_slot_initializers, + $self->_inline_preserve_weak_metaclasses, + $self->_inline_extra_init, + 'return $instance', + ); +} + +sub _inline_fallback_constructor { + my $self = shift; + my ($class) = @_; + return ( + 'return ' . $self->_generate_fallback_constructor($class), + 'if ' . $class . ' ne \'' . $self->name . '\';', + ); +} + +sub _generate_fallback_constructor { + my $self = shift; + my ($class) = @_; + return 'Class::MOP::Class->initialize(' . $class . ')->new_object(@_)', +} + +sub _inline_params { + my $self = shift; + my ($params, $class) = @_; + return ( + 'my ' . $params . ' = @_ == 1 ? $_[0] : {@_};', + ); +} + +sub _inline_generate_instance { + my $self = shift; + my ($inst, $class) = @_; + return ( + 'my ' . $inst . ' = ' . $self->_inline_create_instance($class) . ';', + ); +} + +sub _inline_create_instance { + my $self = shift; + + return $self->get_meta_instance->inline_create_instance(@_); +} + +sub _inline_slot_initializers { + my $self = shift; + + my $idx = 0; + + return map { $self->_inline_slot_initializer($_, $idx++) } + sort { $a->name cmp $b->name } $self->get_all_attributes; +} + +sub _inline_slot_initializer { + my $self = shift; + my ($attr, $idx) = @_; + + if (defined(my $init_arg = $attr->init_arg)) { + my @source = ( + 'if (exists $params->{\'' . $init_arg . '\'}) {', + $self->_inline_init_attr_from_constructor($attr, $idx), + '}', + ); + if (my @default = $self->_inline_init_attr_from_default($attr, $idx)) { + push @source, ( + 'else {', + @default, + '}', + ); + } + return @source; + } + elsif (my @default = $self->_inline_init_attr_from_default($attr, $idx)) { + return ( + '{', + @default, + '}', + ); + } + else { + return (); + } +} + +sub _inline_init_attr_from_constructor { + my $self = shift; + my ($attr, $idx) = @_; + + my @initial_value = $attr->_inline_set_value( + '$instance', '$params->{\'' . $attr->init_arg . '\'}', + ); + + push @initial_value, ( + '$attrs->[' . $idx . ']->set_initial_value(', + '$instance,', + $attr->_inline_instance_get('$instance'), + ');', + ) if $attr->has_initializer; + + return @initial_value; +} + +sub _inline_init_attr_from_default { + my $self = shift; + my ($attr, $idx) = @_; + + my $default = $self->_inline_default_value($attr, $idx); + return unless $default; + + my @initial_value = $attr->_inline_set_value('$instance', $default); + + push @initial_value, ( + '$attrs->[' . $idx . ']->set_initial_value(', + '$instance,', + $attr->_inline_instance_get('$instance'), + ');', + ) if $attr->has_initializer; + + return @initial_value; +} + +sub _inline_default_value { + my $self = shift; + my ($attr, $index) = @_; + + if ($attr->has_default) { + # NOTE: + # default values can either be CODE refs + # in which case we need to call them. Or + # they can be scalars (strings/numbers) + # in which case we can just deal with them + # in the code we eval. + if ($attr->is_default_a_coderef) { + return '$defaults->[' . $index . ']->($instance)'; + } + else { + return '$defaults->[' . $index . ']'; + } + } + elsif ($attr->has_builder) { + return '$instance->' . $attr->builder; + } + else { + return; + } +} + +sub _inline_preserve_weak_metaclasses { + my $self = shift; + if (Class::MOP::metaclass_is_weak($self->name)) { + return ( + $self->_inline_set_mop_slot( + '$instance', 'Class::MOP::class_of($class)' + ) . ';' + ); + } + else { + return (); + } +} + +sub _inline_extra_init { } + +sub _eval_environment { + my $self = shift; + + my @attrs = sort { $a->name cmp $b->name } $self->get_all_attributes; + + my $defaults = [map { $_->default } @attrs]; + + return { + '$defaults' => \$defaults, + }; +} + + +sub get_meta_instance { + my $self = shift; + $self->{'_meta_instance'} ||= $self->_create_meta_instance(); +} + +sub _create_meta_instance { + my $self = shift; + + my $instance = $self->instance_metaclass->new( + associated_metaclass => $self, + attributes => [ $self->get_all_attributes() ], + ); + + $self->add_meta_instance_dependencies() + if $instance->is_dependent_on_superclasses(); + + return $instance; +} + +# TODO: this is actually not being used! +sub _inline_rebless_instance { + my $self = shift; + + return $self->get_meta_instance->inline_rebless_instance_structure(@_); +} + +sub _inline_get_mop_slot { + my $self = shift; + + return $self->get_meta_instance->_inline_get_mop_slot(@_); +} + +sub _inline_set_mop_slot { + my $self = shift; + + return $self->get_meta_instance->_inline_set_mop_slot(@_); +} + +sub _inline_clear_mop_slot { + my $self = shift; + + return $self->get_meta_instance->_inline_clear_mop_slot(@_); +} + +sub clone_object { + my $class = shift; + my $instance = shift; + (blessed($instance) && $instance->isa($class->name)) + || $class->_throw_exception( CloneObjectExpectsAnInstanceOfMetaclass => class_name => $class->name, + instance => $instance, + ); + # NOTE: + # we need to protect the integrity of the + # Class::MOP::Class singletons here, they + # should not be cloned. + return $instance if $instance->isa('Class::MOP::Class'); + $class->_clone_instance($instance, @_); +} + +sub _clone_instance { + my ($class, $instance, %params) = @_; + (blessed($instance)) + || $class->_throw_exception( OnlyInstancesCanBeCloned => class_name => $class->name, + instance => $instance, + params => \%params + ); + my $meta_instance = $class->get_meta_instance(); + my $clone = $meta_instance->clone_instance($instance); + foreach my $attr ($class->get_all_attributes()) { + if ( defined( my $init_arg = $attr->init_arg ) ) { + if (exists $params{$init_arg}) { + $attr->set_value($clone, $params{$init_arg}); + } + } + } + return $clone; +} + +sub _force_rebless_instance { + my ($self, $instance, %params) = @_; + my $old_metaclass = Class::MOP::class_of($instance); + + $old_metaclass->rebless_instance_away($instance, $self, %params) + if $old_metaclass; + + my $meta_instance = $self->get_meta_instance; + + if (Class::MOP::metaclass_is_weak($old_metaclass->name)) { + $meta_instance->_clear_mop_slot($instance); + } + + # rebless! + # we use $_[1] here because of t/cmop/rebless_overload.t regressions + # on 5.8.8 + $meta_instance->rebless_instance_structure($_[1], $self); + + $self->_fixup_attributes_after_rebless($instance, $old_metaclass, %params); + + if (Class::MOP::metaclass_is_weak($self->name)) { + $meta_instance->_set_mop_slot($instance, $self); + } +} + +sub rebless_instance { + my ($self, $instance, %params) = @_; + my $old_metaclass = Class::MOP::class_of($instance); + + my $old_class = $old_metaclass ? $old_metaclass->name : blessed($instance); + $self->name->isa($old_class) + || $self->_throw_exception( CanReblessOnlyIntoASubclass => class_name => $self->name, + instance => $instance, + instance_class => blessed( $instance ), + params => \%params, + ); + + $self->_force_rebless_instance($_[1], %params); + + return $instance; +} + +sub rebless_instance_back { + my ( $self, $instance ) = @_; + my $old_metaclass = Class::MOP::class_of($instance); + my $old_class + = $old_metaclass ? $old_metaclass->name : blessed($instance); + $old_class->isa( $self->name ) + || $self->_throw_exception( CanReblessOnlyIntoASuperclass => class_name => $self->name, + instance => $instance, + instance_class => blessed( $instance ), + ); + + $self->_force_rebless_instance($_[1]); + + return $instance; +} + +sub rebless_instance_away { + # this intentionally does nothing, it is just a hook +} + +sub _fixup_attributes_after_rebless { + my $self = shift; + my ($instance, $rebless_from, %params) = @_; + my $meta_instance = $self->get_meta_instance; + + for my $attr ( $rebless_from->get_all_attributes ) { + next if $self->find_attribute_by_name( $attr->name ); + $meta_instance->deinitialize_slot( $instance, $_ ) for $attr->slots; + } + + foreach my $attr ( $self->get_all_attributes ) { + if ( $attr->has_value($instance) ) { + if ( defined( my $init_arg = $attr->init_arg ) ) { + $params{$init_arg} = $attr->get_value($instance) + unless exists $params{$init_arg}; + } + else { + $attr->set_value($instance, $attr->get_value($instance)); + } + } + } + + foreach my $attr ($self->get_all_attributes) { + $attr->initialize_instance_slot($meta_instance, $instance, \%params); + } +} + +sub _attach_attribute { + my ($self, $attribute) = @_; + $attribute->attach_to_class($self); +} + +sub _post_add_attribute { + my ( $self, $attribute ) = @_; + + $self->invalidate_meta_instances; + + # invalidate package flag here + try { + local $SIG{__DIE__}; + $attribute->install_accessors; + } + catch { + $self->remove_attribute( $attribute->name ); + die $_; + }; +} + +sub remove_attribute { + my $self = shift; + + my $removed_attribute = $self->SUPER::remove_attribute(@_) + or return; + + $self->invalidate_meta_instances; + + $removed_attribute->remove_accessors; + $removed_attribute->detach_from_class; + + return$removed_attribute; +} + +sub find_attribute_by_name { + my ( $self, $attr_name ) = @_; + + foreach my $class ( $self->linearized_isa ) { + # fetch the meta-class ... + my $meta = Class::MOP::Class->initialize($class); + return $meta->get_attribute($attr_name) + if $meta->has_attribute($attr_name); + } + + return; +} + +sub get_all_attributes { + my $self = shift; + my %attrs = map { %{ Class::MOP::Class->initialize($_)->_attribute_map } } + reverse $self->linearized_isa; + return values %attrs; +} + +# Inheritance + +sub superclasses { + my $self = shift; + + my $isa = $self->get_or_add_package_symbol('@ISA'); + + if (@_) { + my @supers = @_; + @{$isa} = @supers; + + # NOTE: + # on 5.8 and below, we need to call + # a method to get Perl to detect + # a cycle in the class hierarchy + my $class = $self->name; + $class->isa($class); + + # NOTE: + # we need to check the metaclass + # compatibility here so that we can + # be sure that the superclass is + # not potentially creating an issues + # we don't know about + + $self->_check_metaclass_compatibility(); + $self->_superclasses_updated(); + } + + return @{$isa}; +} + +sub _superclasses_updated { + my $self = shift; + $self->update_meta_instance_dependencies(); + # keep strong references to all our parents, so they don't disappear if + # they are anon classes and don't have any direct instances + $self->_superclass_metas( + map { Class::MOP::class_of($_) } $self->superclasses + ); +} + +sub _superclass_metas { + my $self = shift; + $self->{_superclass_metas} = [@_]; +} + +sub subclasses { + my $self = shift; + my $super_class = $self->name; + + return @{ $super_class->mro::get_isarev() }; +} + +sub direct_subclasses { + my $self = shift; + my $super_class = $self->name; + + return grep { + grep { + $_ eq $super_class + } Class::MOP::Class->initialize($_)->superclasses + } $self->subclasses; +} + +sub linearized_isa { + return @{ mro::get_linear_isa( (shift)->name ) }; +} + +sub class_precedence_list { + my $self = shift; + my $name = $self->name; + + unless (Class::MOP::IS_RUNNING_ON_5_10()) { + # NOTE: + # We need to check for circular inheritance here + # if we are not on 5.10, cause 5.8 detects it late. + # This will do nothing if all is well, and blow up + # otherwise. Yes, it's an ugly hack, better + # suggestions are welcome. + # - SL + ($name || return)->isa('This is a test for circular inheritance') + } + + # if our mro is c3, we can + # just grab the linear_isa + if (mro::get_mro($name) eq 'c3') { + return @{ mro::get_linear_isa($name) } + } + else { + # NOTE: + # we can't grab the linear_isa for dfs + # since it has all the duplicates + # already removed. + return ( + $name, + map { + Class::MOP::Class->initialize($_)->class_precedence_list() + } $self->superclasses() + ); + } +} + +sub _method_lookup_order { + return (shift->linearized_isa, 'UNIVERSAL'); +} + +## Methods + +{ + my $fetch_and_prepare_method = sub { + my ($self, $method_name) = @_; + my $wrapped_metaclass = $self->wrapped_method_metaclass; + # fetch it locally + my $method = $self->get_method($method_name); + # if we don't have local ... + unless ($method) { + # try to find the next method + $method = $self->find_next_method_by_name($method_name); + # die if it does not exist + (defined $method) + || $self->_throw_exception( MethodNameNotFoundInInheritanceHierarchy => class_name => $self->name, + method_name => $method_name + ); + # and now make sure to wrap it + # even if it is already wrapped + # because we need a new sub ref + $method = $wrapped_metaclass->wrap($method, + package_name => $self->name, + name => $method_name, + ); + } + else { + # now make sure we wrap it properly + $method = $wrapped_metaclass->wrap($method, + package_name => $self->name, + name => $method_name, + ) unless $method->isa($wrapped_metaclass); + } + $self->add_method($method_name => $method); + return $method; + }; + + sub add_before_method_modifier { + my ($self, $method_name, $method_modifier) = @_; + (defined $method_name && length $method_name) + || $self->_throw_exception( MethodModifierNeedsMethodName => class_name => $self->name ); + my $method = $fetch_and_prepare_method->($self, $method_name); + $method->add_before_modifier( + subname(':before' => $method_modifier) + ); + } + + sub add_after_method_modifier { + my ($self, $method_name, $method_modifier) = @_; + (defined $method_name && length $method_name) + || $self->_throw_exception( MethodModifierNeedsMethodName => class_name => $self->name ); + my $method = $fetch_and_prepare_method->($self, $method_name); + $method->add_after_modifier( + subname(':after' => $method_modifier) + ); + } + + sub add_around_method_modifier { + my ($self, $method_name, $method_modifier) = @_; + (defined $method_name && length $method_name) + || $self->_throw_exception( MethodModifierNeedsMethodName => class_name => $self->name ); + my $method = $fetch_and_prepare_method->($self, $method_name); + $method->add_around_modifier( + subname(':around' => $method_modifier) + ); + } + + # NOTE: + # the methods above used to be named like this: + # ${pkg}::${method}:(before|after|around) + # but this proved problematic when using one modifier + # to wrap multiple methods (something which is likely + # to happen pretty regularly IMO). So instead of naming + # it like this, I have chosen to just name them purely + # with their modifier names, like so: + # :(before|after|around) + # The fact is that in a stack trace, it will be fairly + # evident from the context what method they are attached + # to, and so don't need the fully qualified name. +} + +sub find_method_by_name { + my ($self, $method_name) = @_; + (defined $method_name && length $method_name) + || $self->_throw_exception( MethodNameNotGiven => class_name => $self->name ); + foreach my $class ($self->_method_lookup_order) { + my $method = Class::MOP::Class->initialize($class)->get_method($method_name); + return $method if defined $method; + } + return; +} + +sub get_all_methods { + my $self = shift; + + my %methods; + for my $class ( reverse $self->_method_lookup_order ) { + my $meta = Class::MOP::Class->initialize($class); + + $methods{ $_->name } = $_ for $meta->_get_local_methods; + } + + return values %methods; +} + +sub get_all_method_names { + my $self = shift; + map { $_->name } $self->get_all_methods; +} + +sub find_all_methods_by_name { + my ($self, $method_name) = @_; + (defined $method_name && length $method_name) + || $self->_throw_exception( MethodNameNotGiven => class_name => $self->name ); + my @methods; + foreach my $class ($self->_method_lookup_order) { + # fetch the meta-class ... + my $meta = Class::MOP::Class->initialize($class); + push @methods => { + name => $method_name, + class => $class, + code => $meta->get_method($method_name) + } if $meta->has_method($method_name); + } + return @methods; +} + +sub find_next_method_by_name { + my ($self, $method_name) = @_; + (defined $method_name && length $method_name) + || $self->_throw_exception( MethodNameNotGiven => class_name => $self->name ); + my @cpl = ($self->_method_lookup_order); + shift @cpl; # discard ourselves + foreach my $class (@cpl) { + my $method = Class::MOP::Class->initialize($class)->get_method($method_name); + return $method if defined $method; + } + return; +} + +sub update_meta_instance_dependencies { + my $self = shift; + + if ( $self->{meta_instance_dependencies} ) { + return $self->add_meta_instance_dependencies; + } +} + +sub add_meta_instance_dependencies { + my $self = shift; + + $self->remove_meta_instance_dependencies; + + my @attrs = $self->get_all_attributes(); + + my %seen; + my @classes = grep { not $seen{ $_->name }++ } + map { $_->associated_class } @attrs; + + foreach my $class (@classes) { + $class->add_dependent_meta_instance($self); + } + + $self->{meta_instance_dependencies} = \@classes; +} + +sub remove_meta_instance_dependencies { + my $self = shift; + + if ( my $classes = delete $self->{meta_instance_dependencies} ) { + foreach my $class (@$classes) { + $class->remove_dependent_meta_instance($self); + } + + return $classes; + } + + return; + +} + +sub add_dependent_meta_instance { + my ( $self, $metaclass ) = @_; + push @{ $self->{dependent_meta_instances} }, $metaclass; +} + +sub remove_dependent_meta_instance { + my ( $self, $metaclass ) = @_; + my $name = $metaclass->name; + @$_ = grep { $_->name ne $name } @$_ + for $self->{dependent_meta_instances}; +} + +sub invalidate_meta_instances { + my $self = shift; + $_->invalidate_meta_instance() + for $self, @{ $self->{dependent_meta_instances} }; +} + +sub invalidate_meta_instance { + my $self = shift; + undef $self->{_meta_instance}; +} + +# check if we can reinitialize +sub is_pristine { + my $self = shift; + + # if any local attr is defined + return if $self->get_attribute_list; + + # or any non-declared methods + for my $method ( map { $self->get_method($_) } $self->get_method_list ) { + return if $method->isa("Class::MOP::Method::Generated"); + # FIXME do we need to enforce this too? return unless $method->isa( $self->method_metaclass ); + } + + return 1; +} + +## Class closing + +sub is_mutable { 1 } +sub is_immutable { 0 } + +sub immutable_options { %{ $_[0]{__immutable}{options} || {} } } + +sub _immutable_options { + my ( $self, @args ) = @_; + + return ( + inline_accessors => 1, + inline_constructor => 1, + inline_destructor => 0, + debug => 0, + immutable_trait => $self->immutable_trait, + constructor_name => $self->constructor_name, + constructor_class => $self->constructor_class, + destructor_class => $self->destructor_class, + @args, + ); +} + +sub make_immutable { + my ( $self, @args ) = @_; + + return $self unless $self->is_mutable; + + my ($file, $line) = (caller)[1..2]; + + $self->_initialize_immutable( + file => $file, + line => $line, + $self->_immutable_options(@args), + ); + $self->_rebless_as_immutable(@args); + + return $self; +} + +sub make_mutable { + my $self = shift; + + if ( $self->is_immutable ) { + my @args = $self->immutable_options; + $self->_rebless_as_mutable(); + $self->_remove_inlined_code(@args); + delete $self->{__immutable}; + return $self; + } + else { + return; + } +} + +sub _rebless_as_immutable { + my ( $self, @args ) = @_; + + $self->{__immutable}{original_class} = ref $self; + + bless $self => $self->_immutable_metaclass(@args); +} + +sub _immutable_metaclass { + my ( $self, %args ) = @_; + + if ( my $class = $args{immutable_metaclass} ) { + return $class; + } + + my $trait = $args{immutable_trait} = $self->immutable_trait + || $self->_throw_exception( NoImmutableTraitSpecifiedForClass => class_name => $self->name, + params => \%args + ); + + my $meta = $self->meta; + my $meta_attr = $meta->find_attribute_by_name("immutable_trait"); + + my $class_name; + + if ( $meta_attr and $trait eq $meta_attr->default ) { + # if the trait is the same as the default we try and pick a + # predictable name for the immutable metaclass + $class_name = 'Class::MOP::Class::Immutable::' . ref($self); + } + else { + $class_name = join '::', 'Class::MOP::Class::Immutable::CustomTrait', + $trait, 'ForMetaClass', ref($self); + } + + return $class_name + if Class::MOP::does_metaclass_exist($class_name); + + # If the metaclass is a subclass of CMOP::Class which has had + # metaclass roles applied (via Moose), then we want to make sure + # that we preserve that anonymous class (see Fey::ORM for an + # example of where this matters). + my $meta_name = $meta->_real_ref_name; + + my $immutable_meta = $meta_name->create( + $class_name, + superclasses => [ ref $self ], + ); + + Class::MOP::MiniTrait::apply( $immutable_meta, $trait ); + + $immutable_meta->make_immutable( + inline_constructor => 0, + inline_accessors => 0, + ); + + return $class_name; +} + +sub _remove_inlined_code { + my $self = shift; + + $self->remove_method( $_->name ) for $self->_inlined_methods; + + delete $self->{__immutable}{inlined_methods}; +} + +sub _inlined_methods { @{ $_[0]{__immutable}{inlined_methods} || [] } } + +sub _add_inlined_method { + my ( $self, $method ) = @_; + + push @{ $self->{__immutable}{inlined_methods} ||= [] }, $method; +} + +sub _initialize_immutable { + my ( $self, %args ) = @_; + + $self->{__immutable}{options} = \%args; + $self->_install_inlined_code(%args); +} + +sub _install_inlined_code { + my ( $self, %args ) = @_; + + # FIXME + $self->_inline_accessors(%args) if $args{inline_accessors}; + $self->_inline_constructor(%args) if $args{inline_constructor}; + $self->_inline_destructor(%args) if $args{inline_destructor}; +} + +sub _rebless_as_mutable { + my $self = shift; + + bless $self, $self->_get_mutable_metaclass_name; + + return $self; +} + +sub _inline_accessors { + my $self = shift; + + foreach my $attr_name ( $self->get_attribute_list ) { + $self->get_attribute($attr_name)->install_accessors(1); + } +} + +sub _inline_constructor { + my ( $self, %args ) = @_; + + my $name = $args{constructor_name}; + # A class may not even have a constructor, and that's okay. + return unless defined $name; + + if ( $self->has_method($name) && !$args{replace_constructor} ) { + my $class = $self->name; + warn "Not inlining a constructor for $class since it defines" + . " its own constructor.\n" + . "If you are certain you don't need to inline your" + . " constructor, specify inline_constructor => 0 in your" + . " call to $class->meta->make_immutable\n"; + return; + } + + my $constructor_class = $args{constructor_class}; + + { + local $@; + use_package_optimistically($constructor_class); + } + + my $constructor = $constructor_class->new( + options => \%args, + metaclass => $self, + is_inline => 1, + package_name => $self->name, + name => $name, + definition_context => { + description => "constructor " . $self->name . "::" . $name, + file => $args{file}, + line => $args{line}, + }, + ); + + if ( $args{replace_constructor} or $constructor->can_be_inlined ) { + $self->add_method( $name => $constructor ); + $self->_add_inlined_method($constructor); + } +} + +sub _inline_destructor { + my ( $self, %args ) = @_; + + ( exists $args{destructor_class} && defined $args{destructor_class} ) + || $self->_throw_exception( NoDestructorClassSpecified => class_name => $self->name, + params => \%args, + ); + + if ( $self->has_method('DESTROY') && ! $args{replace_destructor} ) { + my $class = $self->name; + warn "Not inlining a destructor for $class since it defines" + . " its own destructor.\n"; + return; + } + + my $destructor_class = $args{destructor_class}; + + { + local $@; + use_package_optimistically($destructor_class); + } + + return unless $destructor_class->is_needed($self); + + my $destructor = $destructor_class->new( + options => \%args, + metaclass => $self, + package_name => $self->name, + name => 'DESTROY', + definition_context => { + description => "destructor " . $self->name . "::DESTROY", + file => $args{file}, + line => $args{line}, + }, + ); + + if ( $args{replace_destructor} or $destructor->can_be_inlined ) { + $self->add_method( 'DESTROY' => $destructor ); + $self->_add_inlined_method($destructor); + } +} + +1; + +# ABSTRACT: Class Meta Object + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Class - Class Meta Object + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + # assuming that class Foo + # has been defined, you can + + # use this for introspection ... + + # add a method to Foo ... + Foo->meta->add_method( 'bar' => sub {...} ) + + # get a list of all the classes searched + # the method dispatcher in the correct order + Foo->meta->class_precedence_list() + + # remove a method from Foo + Foo->meta->remove_method('bar'); + + # or use this to actually create classes ... + + Class::MOP::Class->create( + 'Bar' => ( + version => '0.01', + superclasses => ['Foo'], + attributes => [ + Class::MOP::Attribute->new('$bar'), + Class::MOP::Attribute->new('$baz'), + ], + methods => { + calculate_bar => sub {...}, + construct_baz => sub {...} + } + ) + ); + +=head1 DESCRIPTION + +The Class Protocol is the largest and most complex part of the +Class::MOP meta-object protocol. It controls the introspection and +manipulation of Perl 5 classes, and it can create them as well. The +best way to understand what this module can do is to read the +documentation for each of its methods. + +=head1 INHERITANCE + +C is a subclass of L. + +=head1 METHODS + +=head2 Class construction + +These methods all create new C objects. These +objects can represent existing classes or they can be used to create +new classes from scratch. + +The metaclass object for a given class is a singleton. If you attempt +to create a metaclass for the same class twice, you will just get the +existing object. + +=over 4 + +=item B<< Class::MOP::Class->create($package_name, %options) >> + +This method creates a new C object with the given +package name. It accepts a number of options: + +=over 8 + +=item * version + +An optional version number for the newly created package. + +=item * authority + +An optional authority for the newly created package. +See L for more details. + +=item * superclasses + +An optional array reference of superclass names. + +=item * methods + +An optional hash reference of methods for the class. The keys of the +hash reference are method names and values are subroutine references. + +=item * attributes + +An optional array reference of L objects. + +=item * meta_name + +Specifies the name to install the C method for this class under. +If it is not passed, C is assumed, and if C is explicitly +given, no meta method will be installed. + +=item * weaken + +If true, the metaclass that is stored in the global cache will be a +weak reference. + +Classes created in this way are destroyed once the metaclass they are +attached to goes out of scope, and will be removed from Perl's internal +symbol table. + +All instances of a class with a weakened metaclass keep a special +reference to the metaclass object, which prevents the metaclass from +going out of scope while any instances exist. + +This only works if the instance is based on a hash reference, however. + +=back + +=item B<< Class::MOP::Class->create_anon_class(%options) >> + +This method works just like C<< Class::MOP::Class->create >> but it +creates an "anonymous" class. In fact, the class does have a name, but +that name is a unique name generated internally by this module. + +It accepts the same C, C, and C +parameters that C accepts. + +It also accepts a C option. If this is C, then the anonymous class +will be cached based on its superclasses and roles. If an existing anonymous +class in the cache has the same superclasses and roles, it will be reused. + +Anonymous classes default to C<< weaken => 1 >> if cache is C, although +this can be overridden. + +=item B<< Class::MOP::Class->initialize($package_name, %options) >> + +This method will initialize a C object for the +named package. Unlike C, this method I create a new +class. + +The purpose of this method is to retrieve a C +object for introspecting an existing class. + +If an existing C object exists for the named +package, it will be returned, and any options provided will be +ignored! + +If the object does not yet exist, it will be created. + +The valid options that can be passed to this method are +C, C, +C, and C. These are all +optional, and default to the appropriate class in the C +distribution. + +=back + +=head2 Object instance construction and cloning + +These methods are all related to creating and/or cloning object +instances. + +=over 4 + +=item B<< $metaclass->clone_object($instance, %params) >> + +This method clones an existing object instance. Any parameters you +provide are will override existing attribute values in the object. + +This is a convenience method for cloning an object instance, then +blessing it into the appropriate package. + +You could implement a clone method in your class, using this method: + + sub clone { + my ($self, %params) = @_; + $self->meta->clone_object($self, %params); + } + +=item B<< $metaclass->rebless_instance($instance, %params) >> + +This method changes the class of C<$instance> to the metaclass's class. + +You can only rebless an instance into a subclass of its current +class. If you pass any additional parameters, these will be treated +like constructor parameters and used to initialize the object's +attributes. Any existing attributes that are already set will be +overwritten. + +Before reblessing the instance, this method will call +C on the instance's current metaclass. This method +will be passed the instance, the new metaclass, and any parameters +specified to C. By default, C +does nothing; it is merely a hook. + +=item B<< $metaclass->rebless_instance_back($instance) >> + +Does the same thing as C, except that you can only +rebless an instance into one of its superclasses. Any attributes that +do not exist in the superclass will be deinitialized. + +This is a much more dangerous operation than C, +especially when multiple inheritance is involved, so use this carefully! + +=item B<< $metaclass->new_object(%params) >> + +This method is used to create a new object of the metaclass's +class. Any parameters you provide are used to initialize the +instance's attributes. A special C<__INSTANCE__> key can be passed to +provide an already generated instance, rather than having Class::MOP +generate it for you. This is mostly useful for using Class::MOP with +foreign classes which generate instances using their own constructors. + +=item B<< $metaclass->instance_metaclass >> + +Returns the class name of the instance metaclass. See +L for more information on the instance +metaclass. + +=item B<< $metaclass->get_meta_instance >> + +Returns an instance of the C to be used in the +construction of a new instance of the class. + +=back + +=head2 Informational predicates + +These are a few predicate methods for asking information about the +class itself. + +=over 4 + +=item B<< $metaclass->is_anon_class >> + +This returns true if the class was created by calling C<< +Class::MOP::Class->create_anon_class >>. + +=item B<< $metaclass->is_mutable >> + +This returns true if the class is still mutable. + +=item B<< $metaclass->is_immutable >> + +This returns true if the class has been made immutable. + +=item B<< $metaclass->is_pristine >> + +A class is I pristine if it has non-inherited attributes or if it +has any generated methods. + +=back + +=head2 Inheritance Relationships + +=over 4 + +=item B<< $metaclass->superclasses(@superclasses) >> + +This is a read-write accessor which represents the superclass +relationships of the metaclass's class. + +This is basically sugar around getting and setting C<@ISA>. + +=item B<< $metaclass->class_precedence_list >> + +This returns a list of all of the class's ancestor classes. The +classes are returned in method dispatch order. + +=item B<< $metaclass->linearized_isa >> + +This returns a list based on C but with all +duplicates removed. + +=item B<< $metaclass->subclasses >> + +This returns a list of all subclasses for this class, even indirect +subclasses. + +=item B<< $metaclass->direct_subclasses >> + +This returns a list of immediate subclasses for this class, which does not +include indirect subclasses. + +=back + +=head2 Method introspection and creation + +These methods allow you to introspect a class's methods, as well as +add, remove, or change methods. + +Determining what is truly a method in a Perl 5 class requires some +heuristics (aka guessing). + +Methods defined outside the package with a fully qualified name (C) will be included. Similarly, methods named +with a fully qualified name using L are also included. + +However, we attempt to ignore imported functions. + +Ultimately, we are using heuristics to determine what truly is a +method in a class, and these heuristics may get the wrong answer in +some edge cases. However, for most "normal" cases the heuristics work +correctly. + +=over 4 + +=item B<< $metaclass->get_method($method_name) >> + +This will return a L for the specified +C<$method_name>. If the class does not have the specified method, it +returns C + +=item B<< $metaclass->has_method($method_name) >> + +Returns a boolean indicating whether or not the class defines the +named method. It does not include methods inherited from parent +classes. + +=item B<< $metaclass->get_method_list >> + +This will return a list of method I for all methods defined in +this class. + +=item B<< $metaclass->add_method($method_name, $method) >> + +This method takes a method name and a subroutine reference, and adds +the method to the class. + +The subroutine reference can be a L, and you are +strongly encouraged to pass a meta method object instead of a code +reference. If you do so, that object gets stored as part of the +class's method map directly. If not, the meta information will have to +be recreated later, and may be incorrect. + +If you provide a method object, this method will clone that object if +the object's package name does not match the class name. This lets us +track the original source of any methods added from other classes +(notably Moose roles). + +=item B<< $metaclass->remove_method($method_name) >> + +Remove the named method from the class. This method returns the +L object for the method. + +=item B<< $metaclass->method_metaclass >> + +Returns the class name of the method metaclass, see +L for more information on the method metaclass. + +=item B<< $metaclass->wrapped_method_metaclass >> + +Returns the class name of the wrapped method metaclass, see +L for more information on the wrapped +method metaclass. + +=item B<< $metaclass->get_all_methods >> + +This will traverse the inheritance hierarchy and return a list of all +the L objects for this class and its parents. + +=item B<< $metaclass->find_method_by_name($method_name) >> + +This will return a L for the specified +C<$method_name>. If the class does not have the specified method, it +returns C + +Unlike C, this method I look for the named method in +superclasses. + +=item B<< $metaclass->get_all_method_names >> + +This will return a list of method I for all of this class's +methods, including inherited methods. + +=item B<< $metaclass->find_all_methods_by_name($method_name) >> + +This method looks for the named method in the class and all of its +parents. It returns every matching method it finds in the inheritance +tree, so it returns a list of methods. + +Each method is returned as a hash reference with three keys. The keys +are C, C, and C. The C key has a +L object as its value. + +The list of methods is distinct. + +=item B<< $metaclass->find_next_method_by_name($method_name) >> + +This method returns the first method in any superclass matching the +given name. It is effectively the method that C +would dispatch to. + +=back + +=head2 Attribute introspection and creation + +Because Perl 5 does not have a core concept of attributes in classes, +we can only return information about attributes which have been added +via this class's methods. We cannot discover information about +attributes which are defined in terms of "regular" Perl 5 methods. + +=over 4 + +=item B<< $metaclass->get_attribute($attribute_name) >> + +This will return a L for the specified +C<$attribute_name>. If the class does not have the specified +attribute, it returns C. + +NOTE that get_attribute does not search superclasses, for that you +need to use C. + +=item B<< $metaclass->has_attribute($attribute_name) >> + +Returns a boolean indicating whether or not the class defines the +named attribute. It does not include attributes inherited from parent +classes. + +=item B<< $metaclass->get_attribute_list >> + +This will return a list of attributes I for all attributes +defined in this class. Note that this operates on the current class +only, it does not traverse the inheritance hierarchy. + +=item B<< $metaclass->get_all_attributes >> + +This will traverse the inheritance hierarchy and return a list of all +the L objects for this class and its parents. + +=item B<< $metaclass->find_attribute_by_name($attribute_name) >> + +This will return a L for the specified +C<$attribute_name>. If the class does not have the specified +attribute, it returns C. + +Unlike C, this attribute I look for the named +attribute in superclasses. + +=item B<< $metaclass->add_attribute(...) >> + +This method accepts either an existing L +object or parameters suitable for passing to that class's C +method. + +The attribute provided will be added to the class. + +Any accessor methods defined by the attribute will be added to the +class when the attribute is added. + +If an attribute of the same name already exists, the old attribute +will be removed first. + +=item B<< $metaclass->remove_attribute($attribute_name) >> + +This will remove the named attribute from the class, and +L object. + +Removing an attribute also removes any accessor methods defined by the +attribute. + +However, note that removing an attribute will only affect I +object instances created for this class, not existing instances. + +=item B<< $metaclass->attribute_metaclass >> + +Returns the class name of the attribute metaclass for this class. By +default, this is L. + +=back + +=head2 Overload introspection and creation + +These methods provide an API to the core L functionality. + +=over 4 + +=item B<< $metaclass->is_overloaded >> + +Returns true if overloading is enabled for this class. Corresponds to +L. + +=item B<< $metaclass->get_overloaded_operator($op) >> + +Returns the L object corresponding to the operator named +C<$op>, if one exists for this class. + +=item B<< $metaclass->has_overloaded_operator($op) >> + +Returns whether or not the operator C<$op> is overloaded for this class. + +=item B<< $metaclass->get_overload_list >> + +Returns a list of operator names which have been overloaded (see +L for the list of valid operator names). + +=item B<< $metaclass->get_all_overloaded_operators >> + +Returns a list of L objects corresponding to the +operators that have been overloaded. + +=item B<< $metaclass->add_overloaded_operator($op, $impl) >> + +Overloads the operator C<$op> for this class. The C<$impl> can be a coderef, a +method name, or a L object. Corresponds to +C<< use overload $op => $impl; >> + +=item B<< $metaclass->remove_overloaded_operator($op) >> + +Remove overloading for operator C<$op>. Corresponds to C<< no overload $op; >> + +=item B<< $metaclass->get_overload_fallback_value >> + +Returns the overload C setting for the package. + +=item B<< $metaclass->set_overload_fallback_value($fallback) >> + +Sets the overload C setting for the package. + +=back + +=head2 Class Immutability + +Making a class immutable "freezes" the class definition. You can no +longer call methods which alter the class, such as adding or removing +methods or attributes. + +Making a class immutable lets us optimize the class by inlining some +methods, and also allows us to optimize some methods on the metaclass +object itself. + +After immutabilization, the metaclass object will cache most informational +methods that returns information about methods or attributes. Methods which +would alter the class, such as C and C, will +throw an error on an immutable metaclass object. + +The immutabilization system in L takes much greater advantage +of the inlining features than Class::MOP itself does. + +=over 4 + +=item B<< $metaclass->make_immutable(%options) >> + +This method will create an immutable transformer and use it to make +the class and its metaclass object immutable, and returns true +(you should not rely on the details of this value apart from its truth). + +This method accepts the following options: + +=over 8 + +=item * inline_accessors + +=item * inline_constructor + +=item * inline_destructor + +These are all booleans indicating whether the specified method(s) +should be inlined. + +By default, accessors and the constructor are inlined, but not the +destructor. + +=item * immutable_trait + +The name of a class which will be used as a parent class for the +metaclass object being made immutable. This "trait" implements the +post-immutability functionality of the metaclass (but not the +transformation itself). + +This defaults to L. + +=item * constructor_name + +This is the constructor method name. This defaults to "new". + +=item * constructor_class + +The name of the method metaclass for constructors. It will be used to +generate the inlined constructor. This defaults to +"Class::MOP::Method::Constructor". + +=item * replace_constructor + +This is a boolean indicating whether an existing constructor should be +replaced when inlining a constructor. This defaults to false. + +=item * destructor_class + +The name of the method metaclass for destructors. It will be used to +generate the inlined destructor. This defaults to +"Class::MOP::Method::Denstructor". + +=item * replace_destructor + +This is a boolean indicating whether an existing destructor should be +replaced when inlining a destructor. This defaults to false. + +=back + +=item B<< $metaclass->immutable_options >> + +Returns a hash of the options used when making the class immutable, including +both defaults and anything supplied by the user in the call to C<< +$metaclass->make_immutable >>. This is useful if you need to temporarily make +a class mutable and then restore immutability as it was before. + +=item B<< $metaclass->make_mutable >> + +Calling this method reverse the immutabilization transformation. + +=back + +=head2 Method Modifiers + +Method modifiers are hooks which allow a method to be wrapped with +I, I and I method modifiers. Every time a +method is called, its modifiers are also called. + +A class can modify its own methods, as well as methods defined in +parent classes. + +=head3 How method modifiers work? + +Method modifiers work by wrapping the original method and then +replacing it in the class's symbol table. The wrappers will handle +calling all the modifiers in the appropriate order and preserving the +calling context for the original method. + +The return values of C and C modifiers are +ignored. This is because their purpose is B to filter the input +and output of the primary method (this is done with an I +modifier). + +This may seem like an odd restriction to some, but doing this allows +for simple code to be added at the beginning or end of a method call +without altering the function of the wrapped method or placing any +extra responsibility on the code of the modifier. + +Of course if you have more complex needs, you can use the C +modifier which allows you to change both the parameters passed to the +wrapped method, as well as its return value. + +Before and around modifiers are called in last-defined-first-called +order, while after modifiers are called in first-defined-first-called +order. So the call tree might looks something like this: + + before 2 + before 1 + around 2 + around 1 + primary + around 1 + around 2 + after 1 + after 2 + +=head3 What is the performance impact? + +Of course there is a performance cost associated with method +modifiers, but we have made every effort to make that cost directly +proportional to the number of modifier features you use. + +The wrapping method does its best to B do as much work as it +absolutely needs to. In order to do this we have moved some of the +performance costs to set-up time, where they are easier to amortize. + +All this said, our benchmarks have indicated the following: + + simple wrapper with no modifiers 100% slower + simple wrapper with simple before modifier 400% slower + simple wrapper with simple after modifier 450% slower + simple wrapper with simple around modifier 500-550% slower + simple wrapper with all 3 modifiers 1100% slower + +These numbers may seem daunting, but you must remember, every feature +comes with some cost. To put things in perspective, just doing a +simple C which does nothing but extract the name of the +method called and return it costs about 400% over a normal method +call. + +=over 4 + +=item B<< $metaclass->add_before_method_modifier($method_name, $code) >> + +This wraps the specified method with the supplied subroutine +reference. The modifier will be called as a method itself, and will +receive the same arguments as are passed to the method. + +When the modifier exits, the wrapped method will be called. + +The return value of the modifier will be ignored. + +=item B<< $metaclass->add_after_method_modifier($method_name, $code) >> + +This wraps the specified method with the supplied subroutine +reference. The modifier will be called as a method itself, and will +receive the same arguments as are passed to the method. + +When the wrapped methods exits, the modifier will be called. + +The return value of the modifier will be ignored. + +=item B<< $metaclass->add_around_method_modifier($method_name, $code) >> + +This wraps the specified method with the supplied subroutine +reference. + +The first argument passed to the modifier will be a subroutine +reference to the wrapped method. The second argument is the object, +and after that come any arguments passed when the method is called. + +The around modifier can choose to call the original method, as well as +what arguments to pass if it does so. + +The return value of the modifier is what will be seen by the caller. + +=back + +=head2 Introspection + +=over 4 + +=item B<< Class::MOP::Class->meta >> + +This will return a L instance for this class. + +It should also be noted that L will actually bootstrap +this module by installing a number of attribute meta-objects into its +metaclass. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Class/Immutable/Trait.pm b/lib/Class/MOP/Class/Immutable/Trait.pm new file mode 100644 index 0000000..8bb6c93 --- /dev/null +++ b/lib/Class/MOP/Class/Immutable/Trait.pm @@ -0,0 +1,172 @@ +package Class::MOP::Class::Immutable::Trait; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use MRO::Compat; +use Module::Runtime 'use_module'; + +# the original class of the metaclass instance +sub _get_mutable_metaclass_name { $_[0]{__immutable}{original_class} } + +sub is_mutable { 0 } +sub is_immutable { 1 } + +sub _immutable_metaclass { ref $_[1] } + +sub _immutable_read_only { + my $name = shift; + __throw_exception( CallingReadOnlyMethodOnAnImmutableInstance => method_name => $name ); +} + +sub _immutable_cannot_call { + my $name = shift; + __throw_exception( CallingMethodOnAnImmutableInstance => method_name => $name ); +} + +for my $name (qw/superclasses/) { + no strict 'refs'; + *{__PACKAGE__."::$name"} = sub { + my $orig = shift; + my $self = shift; + _immutable_read_only($name) if @_; + $self->$orig; + }; +} + +for my $name (qw/add_method alias_method remove_method add_attribute remove_attribute remove_package_symbol add_package_symbol/) { + no strict 'refs'; + *{__PACKAGE__."::$name"} = sub { _immutable_cannot_call($name) }; +} + +sub class_precedence_list { + my $orig = shift; + my $self = shift; + @{ $self->{__immutable}{class_precedence_list} + ||= [ $self->$orig ] }; +} + +sub linearized_isa { + my $orig = shift; + my $self = shift; + @{ $self->{__immutable}{linearized_isa} ||= [ $self->$orig ] }; +} + +sub get_all_methods { + my $orig = shift; + my $self = shift; + @{ $self->{__immutable}{get_all_methods} ||= [ $self->$orig ] }; +} + +sub get_all_method_names { + my $orig = shift; + my $self = shift; + @{ $self->{__immutable}{get_all_method_names} ||= [ $self->$orig ] }; +} + +sub get_all_attributes { + my $orig = shift; + my $self = shift; + @{ $self->{__immutable}{get_all_attributes} ||= [ $self->$orig ] }; +} + +sub get_meta_instance { + my $orig = shift; + my $self = shift; + $self->{__immutable}{get_meta_instance} ||= $self->$orig; +} + +sub _method_map { + my $orig = shift; + my $self = shift; + $self->{__immutable}{_method_map} ||= $self->$orig; +} + +# private method, for this file only - +# if we declare a method here, it will behave differently depending on what +# class this trait is applied to, so we won't have a reliable parameter list. +sub __throw_exception { + my ($exception_type, @args_to_exception) = @_; + die use_module( "Moose::Exception::$exception_type" )->new( @args_to_exception ); +} + +1; + +# ABSTRACT: Implements immutability for metaclass objects + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Class::Immutable::Trait - Implements immutability for metaclass objects + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This class provides a pseudo-trait that is applied to immutable metaclass +objects. In reality, it is simply a parent class. + +It implements caching and read-only-ness for various metaclass methods. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Deprecated.pm b/lib/Class/MOP/Deprecated.pm new file mode 100644 index 0000000..cb9329a --- /dev/null +++ b/lib/Class/MOP/Deprecated.pm @@ -0,0 +1,95 @@ +package Class::MOP::Deprecated; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Package::DeprecationManager -deprecations => { + 'Class::Load wrapper functions' => '2.1100', +}; + +1; + +# ABSTRACT: Manages deprecation warnings for Class::MOP + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Deprecated - Manages deprecation warnings for Class::MOP + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + + use Class::MOP::Deprecated -api_version => $version; + +=head1 FUNCTIONS + +This module manages deprecation warnings for features that have been +deprecated in Class::MOP. + +If you specify C<< -api_version => $version >>, you can use deprecated features +without warnings. Note that this special treatment is limited to the package +that loads C. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm new file mode 100644 index 0000000..3cffb4e --- /dev/null +++ b/lib/Class/MOP/Instance.pm @@ -0,0 +1,533 @@ +package Class::MOP::Instance; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'isweak', 'weaken', 'blessed'; + +use parent 'Class::MOP::Object'; + +# make this not a valid method name, to avoid (most) attribute conflicts +my $RESERVED_MOP_SLOT = '<>'; + +sub BUILDARGS { + my ($class, @args) = @_; + + if ( @args == 1 ) { + unshift @args, "associated_metaclass"; + } elsif ( @args >= 2 && blessed($args[0]) && $args[0]->isa("Class::MOP::Class") ) { + # compat mode + my ( $meta, @attrs ) = @args; + @args = ( associated_metaclass => $meta, attributes => \@attrs ); + } + + my %options = @args; + # FIXME lazy_build + $options{slots} ||= [ map { $_->slots } @{ $options{attributes} || [] } ]; + $options{slot_hash} = { map { $_ => undef } @{ $options{slots} } }; # FIXME lazy_build + + return \%options; +} + +sub new { + my $class = shift; + my $options = $class->BUILDARGS(@_); + + # FIXME replace with a proper constructor + my $instance = $class->_new(%$options); + + # FIXME weak_ref => 1, + weaken($instance->{'associated_metaclass'}); + + return $instance; +} + +sub _new { + my $class = shift; + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $params = @_ == 1 ? $_[0] : {@_}; + return bless { + # NOTE: + # I am not sure that it makes + # sense to pass in the meta + # The ideal would be to just + # pass in the class name, but + # that is placing too much of + # an assumption on bless(), + # which is *probably* a safe + # assumption,.. but you can + # never tell <:) + 'associated_metaclass' => $params->{associated_metaclass}, + 'attributes' => $params->{attributes}, + 'slots' => $params->{slots}, + 'slot_hash' => $params->{slot_hash}, + } => $class; +} + +sub _class_name { $_[0]->{_class_name} ||= $_[0]->associated_metaclass->name } + +sub create_instance { + my $self = shift; + bless {}, $self->_class_name; +} + +sub clone_instance { + my ($self, $instance) = @_; + + my $clone = $self->create_instance; + for my $attr ($self->get_all_attributes) { + next unless $attr->has_value($instance); + for my $slot ($attr->slots) { + my $val = $self->get_slot_value($instance, $slot); + $self->set_slot_value($clone, $slot, $val); + $self->weaken_slot_value($clone, $slot) + if $self->slot_value_is_weak($instance, $slot); + } + } + + $self->_set_mop_slot($clone, $self->_get_mop_slot($instance)) + if $self->_has_mop_slot($instance); + + return $clone; +} + +# operations on meta instance + +sub get_all_slots { + my $self = shift; + return @{$self->{'slots'}}; +} + +sub get_all_attributes { + my $self = shift; + return @{$self->{attributes}}; +} + +sub is_valid_slot { + my ($self, $slot_name) = @_; + exists $self->{'slot_hash'}->{$slot_name}; +} + +# operations on created instances + +sub get_slot_value { + my ($self, $instance, $slot_name) = @_; + $instance->{$slot_name}; +} + +sub set_slot_value { + my ($self, $instance, $slot_name, $value) = @_; + $instance->{$slot_name} = $value; +} + +sub initialize_slot { + my ($self, $instance, $slot_name) = @_; + return; +} + +sub deinitialize_slot { + my ( $self, $instance, $slot_name ) = @_; + delete $instance->{$slot_name}; +} + +sub initialize_all_slots { + my ($self, $instance) = @_; + foreach my $slot_name ($self->get_all_slots) { + $self->initialize_slot($instance, $slot_name); + } +} + +sub deinitialize_all_slots { + my ($self, $instance) = @_; + foreach my $slot_name ($self->get_all_slots) { + $self->deinitialize_slot($instance, $slot_name); + } +} + +sub is_slot_initialized { + my ($self, $instance, $slot_name, $value) = @_; + exists $instance->{$slot_name}; +} + +sub weaken_slot_value { + my ($self, $instance, $slot_name) = @_; + weaken $instance->{$slot_name}; +} + +sub slot_value_is_weak { + my ($self, $instance, $slot_name) = @_; + isweak $instance->{$slot_name}; +} + +sub strengthen_slot_value { + my ($self, $instance, $slot_name) = @_; + $self->set_slot_value($instance, $slot_name, $self->get_slot_value($instance, $slot_name)); +} + +sub rebless_instance_structure { + my ($self, $instance, $metaclass) = @_; + + # we use $_[1] here because of t/cmop/rebless_overload.t regressions + # on 5.8.8 + bless $_[1], $metaclass->name; +} + +sub is_dependent_on_superclasses { + return; # for meta instances that require updates on inherited slot changes +} + +sub _get_mop_slot { + my ($self, $instance) = @_; + $self->get_slot_value($instance, $RESERVED_MOP_SLOT); +} + +sub _has_mop_slot { + my ($self, $instance) = @_; + $self->is_slot_initialized($instance, $RESERVED_MOP_SLOT); +} + +sub _set_mop_slot { + my ($self, $instance, $value) = @_; + $self->set_slot_value($instance, $RESERVED_MOP_SLOT, $value); +} + +sub _clear_mop_slot { + my ($self, $instance) = @_; + $self->deinitialize_slot($instance, $RESERVED_MOP_SLOT); +} + +# inlinable operation snippets + +sub is_inlinable { 1 } + +sub inline_create_instance { + my ($self, $class_variable) = @_; + 'bless {} => ' . $class_variable; +} + +sub inline_slot_access { + my ($self, $instance, $slot_name) = @_; + sprintf q[%s->{"%s"}], $instance, quotemeta($slot_name); +} + +sub inline_get_is_lvalue { 1 } + +sub inline_get_slot_value { + my ($self, $instance, $slot_name) = @_; + $self->inline_slot_access($instance, $slot_name); +} + +sub inline_set_slot_value { + my ($self, $instance, $slot_name, $value) = @_; + $self->inline_slot_access($instance, $slot_name) . " = $value", +} + +sub inline_initialize_slot { + my ($self, $instance, $slot_name) = @_; + return ''; +} + +sub inline_deinitialize_slot { + my ($self, $instance, $slot_name) = @_; + "delete " . $self->inline_slot_access($instance, $slot_name); +} +sub inline_is_slot_initialized { + my ($self, $instance, $slot_name) = @_; + "exists " . $self->inline_slot_access($instance, $slot_name); +} + +sub inline_weaken_slot_value { + my ($self, $instance, $slot_name) = @_; + sprintf "Scalar::Util::weaken( %s )", $self->inline_slot_access($instance, $slot_name); +} + +sub inline_strengthen_slot_value { + my ($self, $instance, $slot_name) = @_; + $self->inline_set_slot_value($instance, $slot_name, $self->inline_slot_access($instance, $slot_name)); +} + +sub inline_rebless_instance_structure { + my ($self, $instance, $class_variable) = @_; + "bless $instance => $class_variable"; +} + +sub _inline_get_mop_slot { + my ($self, $instance) = @_; + $self->inline_get_slot_value($instance, $RESERVED_MOP_SLOT); +} + +sub _inline_set_mop_slot { + my ($self, $instance, $value) = @_; + $self->inline_set_slot_value($instance, $RESERVED_MOP_SLOT, $value); +} + +sub _inline_clear_mop_slot { + my ($self, $instance) = @_; + $self->inline_deinitialize_slot($instance, $RESERVED_MOP_SLOT); +} + +1; + +# ABSTRACT: Instance Meta Object + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Instance - Instance Meta Object + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +The Instance Protocol controls the creation of object instances, and +the storage of attribute values in those instances. + +Using this API directly in your own code violates encapsulation, and +we recommend that you use the appropriate APIs in L +and L instead. Those APIs in turn call the +methods in this class as appropriate. + +This class also participates in generating inlined code by providing +snippets of code to access an object instance. + +=head1 METHODS + +=head2 Object construction + +=over 4 + +=item B<< Class::MOP::Instance->new(%options) >> + +This method creates a new meta-instance object. + +It accepts the following keys in C<%options>: + +=over 8 + +=item * associated_metaclass + +The L object for which instances will be created. + +=item * attributes + +An array reference of L objects. These are the +attributes which can be stored in each instance. + +=back + +=back + +=head2 Creating and altering instances + +=over 4 + +=item B<< $metainstance->create_instance >> + +This method returns a reference blessed into the associated +metaclass's class. + +The default is to use a hash reference. Subclasses can override this. + +=item B<< $metainstance->clone_instance($instance) >> + +Given an instance, this method creates a new object by making +I clone of the original. + +=back + +=head2 Introspection + +=over 4 + +=item B<< $metainstance->associated_metaclass >> + +This returns the L object associated with the +meta-instance object. + +=item B<< $metainstance->get_all_slots >> + +This returns a list of slot names stored in object instances. In +almost all cases, slot names correspond directly attribute names. + +=item B<< $metainstance->is_valid_slot($slot_name) >> + +This will return true if C<$slot_name> is a valid slot name. + +=item B<< $metainstance->get_all_attributes >> + +This returns a list of attributes corresponding to the attributes +passed to the constructor. + +=back + +=head2 Operations on Instance Structures + +It's important to understand that the meta-instance object is a +different entity from the actual instances it creates. For this +reason, any operations on the C<$instance_structure> always require +that the object instance be passed to the method. + +=over 4 + +=item B<< $metainstance->get_slot_value($instance_structure, $slot_name) >> + +=item B<< $metainstance->set_slot_value($instance_structure, $slot_name, $value) >> + +=item B<< $metainstance->initialize_slot($instance_structure, $slot_name) >> + +=item B<< $metainstance->deinitialize_slot($instance_structure, $slot_name) >> + +=item B<< $metainstance->initialize_all_slots($instance_structure) >> + +=item B<< $metainstance->deinitialize_all_slots($instance_structure) >> + +=item B<< $metainstance->is_slot_initialized($instance_structure, $slot_name) >> + +=item B<< $metainstance->weaken_slot_value($instance_structure, $slot_name) >> + +=item B<< $metainstance->slot_value_is_weak($instance_structure, $slot_name) >> + +=item B<< $metainstance->strengthen_slot_value($instance_structure, $slot_name) >> + +=item B<< $metainstance->rebless_instance_structure($instance_structure, $new_metaclass) >> + +The exact details of what each method does should be fairly obvious +from the method name. + +=back + +=head2 Inlinable Instance Operations + +=over 4 + +=item B<< $metainstance->is_inlinable >> + +This is a boolean that indicates whether or not slot access operations +can be inlined. By default it is true, but subclasses can override +this. + +=item B<< $metainstance->inline_create_instance($class_variable) >> + +This method expects a string that, I, will become a +class name. This would literally be something like C<'$class'>, not an +actual class name. + +It returns a snippet of code that creates a new object for the +class. This is something like C< bless {}, $class_name >. + +=item B<< $metainstance->inline_get_is_lvalue >> + +Returns whether or not C is a valid lvalue. This can be +used to do extra optimizations when generating inlined methods. + +=item B<< $metainstance->inline_slot_access($instance_variable, $slot_name) >> + +=item B<< $metainstance->inline_get_slot_value($instance_variable, $slot_name) >> + +=item B<< $metainstance->inline_set_slot_value($instance_variable, $slot_name, $value) >> + +=item B<< $metainstance->inline_initialize_slot($instance_variable, $slot_name) >> + +=item B<< $metainstance->inline_deinitialize_slot($instance_variable, $slot_name) >> + +=item B<< $metainstance->inline_is_slot_initialized($instance_variable, $slot_name) >> + +=item B<< $metainstance->inline_weaken_slot_value($instance_variable, $slot_name) >> + +=item B<< $metainstance->inline_strengthen_slot_value($instance_variable, $slot_name) >> + +These methods all expect two arguments. The first is the name of a +variable, than when inlined, will represent the object +instance. Typically this will be a literal string like C<'$_[0]'>. + +The second argument is a slot name. + +The method returns a snippet of code that, when inlined, performs some +operation on the instance. + +=item B<< $metainstance->inline_rebless_instance_structure($instance_variable, $class_variable) >> + +This takes the name of a variable that will, when inlined, represent the object +instance, and the name of a variable that will represent the class to rebless +into, and returns code to rebless an instance into a class. + +=back + +=head2 Introspection + +=over 4 + +=item B<< Class::MOP::Instance->meta >> + +This will return a L instance for this class. + +It should also be noted that L will actually bootstrap +this module by installing a number of attribute meta-objects into its +metaclass. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Method.pm b/lib/Class/MOP/Method.pm new file mode 100644 index 0000000..d945bcb --- /dev/null +++ b/lib/Class/MOP/Method.pm @@ -0,0 +1,343 @@ +package Class::MOP::Method; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'weaken', 'reftype', 'blessed'; + +use parent 'Class::MOP::Object'; + +# NOTE: +# if poked in the right way, +# they should act like CODE refs. +use overload '&{}' => sub { $_[0]->body }, fallback => 1; + +# construction + +sub wrap { + my ( $class, @args ) = @_; + + unshift @args, 'body' if @args % 2 == 1; + + my %params = @args; + my $code = $params{body}; + + if (blessed($code) && $code->isa(__PACKAGE__)) { + my $method = $code->clone; + delete $params{body}; + Class::MOP::class_of($class)->rebless_instance($method, %params); + return $method; + } + elsif (!ref $code || 'CODE' ne reftype($code)) { + $class->_throw_exception( WrapTakesACodeRefToBless => params => \%params, + class => $class, + code => $code + ); + } + + ($params{package_name} && $params{name}) + || $class->_throw_exception( PackageNameAndNameParamsNotGivenToWrap => params => \%params, + class => $class, + code => $code + ); + + my $self = $class->_new(\%params); + + weaken($self->{associated_metaclass}) if $self->{associated_metaclass}; + + return $self; +} + +sub _new { + my $class = shift; + + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $params = @_ == 1 ? $_[0] : {@_}; + + return bless { + 'body' => $params->{body}, + 'associated_metaclass' => $params->{associated_metaclass}, + 'package_name' => $params->{package_name}, + 'name' => $params->{name}, + 'original_method' => $params->{original_method}, + } => $class; +} + +## accessors + +sub associated_metaclass { shift->{'associated_metaclass'} } + +sub attach_to_class { + my ( $self, $class ) = @_; + $self->{associated_metaclass} = $class; + weaken($self->{associated_metaclass}); +} + +sub detach_from_class { + my $self = shift; + delete $self->{associated_metaclass}; +} + +sub fully_qualified_name { + my $self = shift; + $self->package_name . '::' . $self->name; +} + +sub original_method { (shift)->{'original_method'} } + +sub _set_original_method { $_[0]->{'original_method'} = $_[1] } + +# It's possible that this could cause a loop if there is a circular +# reference in here. That shouldn't ever happen in normal +# circumstances, since original method only gets set when clone is +# called. We _could_ check for such a loop, but it'd involve some sort +# of package-lexical variable, and wouldn't be terribly subclassable. +sub original_package_name { + my $self = shift; + + $self->original_method + ? $self->original_method->original_package_name + : $self->package_name; +} + +sub original_name { + my $self = shift; + + $self->original_method + ? $self->original_method->original_name + : $self->name; +} + +sub original_fully_qualified_name { + my $self = shift; + + $self->original_method + ? $self->original_method->original_fully_qualified_name + : $self->fully_qualified_name; +} + +sub execute { + my $self = shift; + $self->body->(@_); +} + +# We used to go through use Class::MOP::Class->clone_instance to do this, but +# this was awfully slow. This method may be called a number of times when +# classes are loaded (especially during Moose role application), so it is +# worth optimizing. - DR +sub clone { + my $self = shift; + + my $clone = bless { %{$self}, @_ }, blessed($self); + weaken($clone->{associated_metaclass}) if $clone->{associated_metaclass}; + + $clone->_set_original_method($self); + + return $clone; +} + +1; + +# ABSTRACT: Method Meta Object + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Method - Method Meta Object + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +The Method Protocol is very small, since methods in Perl 5 are just +subroutines in a specific package. We provide a very basic +introspection interface. + +=head1 METHODS + +=over 4 + +=item B<< Class::MOP::Method->wrap($code, %options) >> + +This is the constructor. It accepts a method body in the form of +either a code reference or a L instance, followed +by a hash of options. + +The options are: + +=over 8 + +=item * name + +The method name (without a package name). This is required if C<$code> +is a coderef. + +=item * package_name + +The package name for the method. This is required if C<$code> is a +coderef. + +=item * associated_metaclass + +An optional L object. This is the metaclass for the +method's class. + +=back + +=item B<< $metamethod->clone(%params) >> + +This makes a shallow clone of the method object. In particular, +subroutine reference itself is shared between all clones of a given +method. + +When a method is cloned, the original method object will be available +by calling C on the clone. + +=item B<< $metamethod->body >> + +This returns a reference to the method's subroutine. + +=item B<< $metamethod->name >> + +This returns the method's name. + +=item B<< $metamethod->package_name >> + +This returns the method's package name. + +=item B<< $metamethod->fully_qualified_name >> + +This returns the method's fully qualified name (package name and +method name). + +=item B<< $metamethod->associated_metaclass >> + +This returns the L object for the method, if one +exists. + +=item B<< $metamethod->original_method >> + +If this method object was created as a clone of some other method +object, this returns the object that was cloned. + +=item B<< $metamethod->original_name >> + +This returns the method's original name, wherever it was first +defined. + +If this method is a clone of a clone (of a clone, etc.), this method +returns the name from the I method in the chain of clones. + +=item B<< $metamethod->original_package_name >> + +This returns the method's original package name, wherever it was first +defined. + +If this method is a clone of a clone (of a clone, etc.), this method +returns the package name from the I method in the chain of +clones. + +=item B<< $metamethod->original_fully_qualified_name >> + +This returns the method's original fully qualified name, wherever it +was first defined. + +If this method is a clone of a clone (of a clone, etc.), this method +returns the fully qualified name from the I method in the chain +of clones. + +=item B<< $metamethod->is_stub >> + +Returns true if the method is just a stub: + + sub foo; + +=item B<< $metamethod->attach_to_class($metaclass) >> + +Given a L object, this method sets the associated +metaclass for the method. This will overwrite any existing associated +metaclass. + +=item B<< $metamethod->detach_from_class >> + +Removes any associated metaclass object for the method. + +=item B<< $metamethod->execute(...) >> + +This executes the method. Any arguments provided will be passed on to +the method itself. + +=item B<< Class::MOP::Method->meta >> + +This will return a L instance for this class. + +It should also be noted that L will actually bootstrap +this module by installing a number of attribute meta-objects into its +metaclass. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Method/Accessor.pm b/lib/Class/MOP/Method/Accessor.pm new file mode 100644 index 0000000..673bfde --- /dev/null +++ b/lib/Class/MOP/Method/Accessor.pm @@ -0,0 +1,409 @@ +package Class::MOP::Method::Accessor; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'blessed', 'weaken'; +use Try::Tiny; + +use parent 'Class::MOP::Method::Generated'; + +sub new { + my $class = shift; + my %options = @_; + + (exists $options{attribute}) + || $class->_throw_exception( MustSupplyAnAttributeToConstructWith => params => \%options, + class => $class, + ); + + (exists $options{accessor_type}) + || $class->_throw_exception( MustSupplyAnAccessorTypeToConstructWith => params => \%options, + class => $class, + ); + + (blessed($options{attribute}) && $options{attribute}->isa('Class::MOP::Attribute')) + || $class->_throw_exception( MustSupplyAClassMOPAttributeInstance => params => \%options, + class => $class + ); + + ($options{package_name} && $options{name}) + || $class->_throw_exception( MustSupplyPackageNameAndName => params => \%options, + class => $class + ); + + my $self = $class->_new(\%options); + + # we don't want this creating + # a cycle in the code, if not + # needed + weaken($self->{'attribute'}); + + $self->_initialize_body; + + return $self; +} + +sub _new { + my $class = shift; + + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $params = @_ == 1 ? $_[0] : {@_}; + + return bless { + # inherited from Class::MOP::Method + body => $params->{body}, + associated_metaclass => $params->{associated_metaclass}, + package_name => $params->{package_name}, + name => $params->{name}, + original_method => $params->{original_method}, + + # inherit from Class::MOP::Generated + is_inline => $params->{is_inline} || 0, + definition_context => $params->{definition_context}, + + # defined in this class + attribute => $params->{attribute}, + accessor_type => $params->{accessor_type}, + } => $class; +} + +## accessors + +sub associated_attribute { (shift)->{'attribute'} } +sub accessor_type { (shift)->{'accessor_type'} } + +## factory + +sub _initialize_body { + my $self = shift; + + my $method_name = join "_" => ( + '_generate', + $self->accessor_type, + 'method', + ($self->is_inline ? 'inline' : ()) + ); + + $self->{'body'} = $self->$method_name(); +} + +## generators + +sub _generate_accessor_method { + my $self = shift; + my $attr = $self->associated_attribute; + + return sub { + if (@_ >= 2) { + $attr->set_value($_[0], $_[1]); + } + $attr->get_value($_[0]); + }; +} + +sub _generate_accessor_method_inline { + my $self = shift; + my $attr = $self->associated_attribute; + + return try { + $self->_compile_code([ + 'sub {', + 'if (@_ > 1) {', + $attr->_inline_set_value('$_[0]', '$_[1]'), + '}', + $attr->_inline_get_value('$_[0]'), + '}', + ]); + } + catch { + $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self, + error => $_, + option => "accessor" + ); + }; +} + +sub _generate_reader_method { + my $self = shift; + my $attr = $self->associated_attribute; + my $class = $attr->associated_class; + + return sub { + $self->_throw_exception( CannotAssignValueToReadOnlyAccessor => class_name => $class->name, + value => $_[1], + attribute => $attr + ) + if @_ > 1; + $attr->get_value($_[0]); + }; +} + +sub _generate_reader_method_inline { + my $self = shift; + my $attr = $self->associated_attribute; + my $attr_name = $attr->name; + + return try { + $self->_compile_code([ + 'sub {', + 'if (@_ > 1) {', + $self->_inline_throw_exception( CannotAssignValueToReadOnlyAccessor => + 'class_name => ref $_[0],'. + 'value => $_[1],'. + "attribute_name => '".$attr_name."'", + ) . ';', + '}', + $attr->_inline_get_value('$_[0]'), + '}', + ]); + } + catch { + $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self, + error => $_, + option => "reader" + ); + }; +} + +sub _inline_throw_exception { + my ( $self, $exception_type, $throw_args ) = @_; + return 'die Module::Runtime::use_module("Moose::Exception::' . $exception_type . '")->new(' . ($throw_args || '') . ')'; +} + +sub _generate_writer_method { + my $self = shift; + my $attr = $self->associated_attribute; + + return sub { + $attr->set_value($_[0], $_[1]); + }; +} + +sub _generate_writer_method_inline { + my $self = shift; + my $attr = $self->associated_attribute; + + return try { + $self->_compile_code([ + 'sub {', + $attr->_inline_set_value('$_[0]', '$_[1]'), + '}', + ]); + } + catch { + $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self, + error => $_, + option => "writer" + ); + }; +} + +sub _generate_predicate_method { + my $self = shift; + my $attr = $self->associated_attribute; + + return sub { + $attr->has_value($_[0]) + }; +} + +sub _generate_predicate_method_inline { + my $self = shift; + my $attr = $self->associated_attribute; + + return try { + $self->_compile_code([ + 'sub {', + $attr->_inline_has_value('$_[0]'), + '}', + ]); + } + catch { + $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self, + error => $_, + option => "predicate" + ); + }; +} + +sub _generate_clearer_method { + my $self = shift; + my $attr = $self->associated_attribute; + + return sub { + $attr->clear_value($_[0]) + }; +} + +sub _generate_clearer_method_inline { + my $self = shift; + my $attr = $self->associated_attribute; + + return try { + $self->_compile_code([ + 'sub {', + $attr->_inline_clear_value('$_[0]'), + '}', + ]); + } + catch { + $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self, + error => $_, + option => "clearer" + ); + }; +} + +1; + +# ABSTRACT: Method Meta Object for accessors + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Method::Accessor - Method Meta Object for accessors + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + use Class::MOP::Method::Accessor; + + my $reader = Class::MOP::Method::Accessor->new( + attribute => $attribute, + is_inline => 1, + accessor_type => 'reader', + ); + + $reader->body->execute($instance); # call the reader method + +=head1 DESCRIPTION + +This is a subclass of C which is used by +C to generate accessor code. It handles +generation of readers, writers, predicates and clearers. For each type +of method, it can either create a subroutine reference, or actually +inline code by generating a string and C'ing it. + +=head1 METHODS + +=over 4 + +=item B<< Class::MOP::Method::Accessor->new(%options) >> + +This returns a new C based on the +C<%options> provided. + +=over 4 + +=item * attribute + +This is the C for which accessors are being +generated. This option is required. + +=item * accessor_type + +This is a string which should be one of "reader", "writer", +"accessor", "predicate", or "clearer". This is the type of method +being generated. This option is required. + +=item * is_inline + +This indicates whether or not the accessor should be inlined. This +defaults to false. + +=item * name + +The method name (without a package name). This is required. + +=item * package_name + +The package name for the method. This is required. + +=back + +=item B<< $metamethod->accessor_type >> + +Returns the accessor type which was passed to C. + +=item B<< $metamethod->is_inline >> + +Returns a boolean indicating whether or not the accessor is inlined. + +=item B<< $metamethod->associated_attribute >> + +This returns the L object which was passed to +C. + +=item B<< $metamethod->body >> + +The method itself is I when the accessor object is +constructed. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Method/Constructor.pm b/lib/Class/MOP/Method/Constructor.pm new file mode 100644 index 0000000..c8a30ac --- /dev/null +++ b/lib/Class/MOP/Method/Constructor.pm @@ -0,0 +1,251 @@ +package Class::MOP::Method::Constructor; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'blessed', 'weaken'; +use Try::Tiny; + +use parent 'Class::MOP::Method::Inlined'; + +sub new { + my $class = shift; + my %options = @_; + + (blessed $options{metaclass} && $options{metaclass}->isa('Class::MOP::Class')) + || $class->_throw_exception( MustSupplyAMetaclass => params => \%options, + class => $class + ) + if $options{is_inline}; + + ($options{package_name} && $options{name}) + || $class->_throw_exception( MustSupplyPackageNameAndName => params => \%options, + class => $class + ); + + my $self = $class->_new(\%options); + + # we don't want this creating + # a cycle in the code, if not + # needed + weaken($self->{'associated_metaclass'}); + + $self->_initialize_body; + + return $self; +} + +sub _new { + my $class = shift; + + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $params = @_ == 1 ? $_[0] : {@_}; + + return bless { + # inherited from Class::MOP::Method + body => $params->{body}, + # associated_metaclass => $params->{associated_metaclass}, # overridden + package_name => $params->{package_name}, + name => $params->{name}, + original_method => $params->{original_method}, + + # inherited from Class::MOP::Generated + is_inline => $params->{is_inline} || 0, + definition_context => $params->{definition_context}, + + # inherited from Class::MOP::Inlined + _expected_method_class => $params->{_expected_method_class}, + + # defined in this subclass + options => $params->{options} || {}, + associated_metaclass => $params->{metaclass}, + }, $class; +} + +## accessors + +sub options { (shift)->{'options'} } +sub associated_metaclass { (shift)->{'associated_metaclass'} } + +## method + +sub _initialize_body { + my $self = shift; + my $method_name = '_generate_constructor_method'; + + $method_name .= '_inline' if $self->is_inline; + + $self->{'body'} = $self->$method_name; +} + +sub _eval_environment { + my $self = shift; + return $self->associated_metaclass->_eval_environment; +} + +sub _generate_constructor_method { + return sub { Class::MOP::Class->initialize(shift)->new_object(@_) } +} + +sub _generate_constructor_method_inline { + my $self = shift; + + my $meta = $self->associated_metaclass; + + my @source = ( + 'sub {', + $meta->_inline_new_object, + '}', + ); + + warn join("\n", @source) if $self->options->{debug}; + + my $code = try { + $self->_compile_code(\@source); + } + catch { + my $source = join("\n", @source); + $self->_throw_exception( CouldNotEvalConstructor => constructor_method => $self, + source => $source, + error => $_ + ); + }; + + return $code; +} + +1; + +# ABSTRACT: Method Meta Object for constructors + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Method::Constructor - Method Meta Object for constructors + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + use Class::MOP::Method::Constructor; + + my $constructor = Class::MOP::Method::Constructor->new( + metaclass => $metaclass, + options => { + debug => 1, # this is all for now + }, + ); + + # calling the constructor ... + $constructor->body->execute($metaclass->name, %params); + +=head1 DESCRIPTION + +This is a subclass of L which generates +constructor methods. + +=head1 METHODS + +=over 4 + +=item B<< Class::MOP::Method::Constructor->new(%options) >> + +This creates a new constructor object. It accepts a hash reference of +options. + +=over 8 + +=item * metaclass + +This should be a L object. It is required. + +=item * name + +The method name (without a package name). This is required. + +=item * package_name + +The package name for the method. This is required. + +=item * is_inline + +This indicates whether or not the constructor should be inlined. This +defaults to false. + +=back + +=item B<< $metamethod->is_inline >> + +Returns a boolean indicating whether or not the constructor is +inlined. + +=item B<< $metamethod->associated_metaclass >> + +This returns the L object for the method. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Method/Generated.pm b/lib/Class/MOP/Method/Generated.pm new file mode 100644 index 0000000..740f5f5 --- /dev/null +++ b/lib/Class/MOP/Method/Generated.pm @@ -0,0 +1,142 @@ +package Class::MOP::Method::Generated; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Eval::Closure; + +use parent 'Class::MOP::Method'; + +## accessors + +sub new { + $_[0]->_throw_exception( CannotCallAnAbstractBaseMethod => package_name => __PACKAGE__ ); +} + +sub _initialize_body { + $_[0]->_throw_exception( NoBodyToInitializeInAnAbstractBaseClass => package_name => __PACKAGE__ ); +} + +sub _generate_description { + my ( $self, $context ) = @_; + $context ||= $self->definition_context; + + my $desc = "generated method"; + my $origin = "unknown origin"; + + if (defined $context) { + if (defined $context->{description}) { + $desc = $context->{description}; + } + + if (defined $context->{file} || defined $context->{line}) { + $origin = "defined at " + . (defined $context->{file} + ? $context->{file} : "") + . " line " + . (defined $context->{line} + ? $context->{line} : ""); + } + } + + return "$desc ($origin)"; +} + +sub _compile_code { + my ( $self, @args ) = @_; + unshift @args, 'source' if @args % 2; + my %args = @args; + + my $context = delete $args{context}; + my $environment = $self->can('_eval_environment') + ? $self->_eval_environment + : {}; + + return eval_closure( + environment => $environment, + description => $self->_generate_description($context), + %args, + ); +} + +1; + +# ABSTRACT: Abstract base class for generated methods + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Method::Generated - Abstract base class for generated methods + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This is a C subclass which is subclassed by +C and +C. + +It is not intended to be used directly. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Method/Inlined.pm b/lib/Class/MOP/Method/Inlined.pm new file mode 100644 index 0000000..a075200 --- /dev/null +++ b/lib/Class/MOP/Method/Inlined.pm @@ -0,0 +1,195 @@ +package Class::MOP::Method::Inlined; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'refaddr'; + +use parent 'Class::MOP::Method::Generated'; + +sub _uninlined_body { + my $self = shift; + + my $super_method + = $self->associated_metaclass->find_next_method_by_name( $self->name ) + or return; + + if ( $super_method->isa(__PACKAGE__) ) { + return $super_method->_uninlined_body; + } + else { + return $super_method->body; + } +} + +sub can_be_inlined { + my $self = shift; + my $metaclass = $self->associated_metaclass; + my $class = $metaclass->name; + + # If we don't find an inherited method, this is a rather weird + # case where we have no method in the inheritance chain even + # though we're expecting one to be there + my $inherited_method + = $metaclass->find_next_method_by_name( $self->name ); + + if ( $inherited_method + && $inherited_method->isa('Class::MOP::Method::Wrapped') ) { + warn "Not inlining '" + . $self->name + . "' for $class since it " + . "has method modifiers which would be lost if it were inlined\n"; + + return 0; + } + + my $expected_class = $self->_expected_method_class + or return 1; + + # if we are shadowing a method we first verify that it is + # compatible with the definition we are replacing it with + my $expected_method = $expected_class->can( $self->name ); + + if ( ! $expected_method ) { + warn "Not inlining '" + . $self->name + . "' for $class since ${expected_class}::" + . $self->name + . " is not defined\n"; + + return 0; + } + + my $actual_method = $class->can( $self->name ) + or return 1; + + # the method is what we wanted (probably Moose::Object::new) + return 1 + if refaddr($expected_method) == refaddr($actual_method); + + # otherwise we have to check that the actual method is an inlined + # version of what we're expecting + if ( $inherited_method->isa(__PACKAGE__) ) { + if ( $inherited_method->_uninlined_body + && refaddr( $inherited_method->_uninlined_body ) + == refaddr($expected_method) ) { + return 1; + } + } + elsif ( refaddr( $inherited_method->body ) + == refaddr($expected_method) ) { + return 1; + } + + my $warning + = "Not inlining '" + . $self->name + . "' for $class since it is not" + . " inheriting the default ${expected_class}::" + . $self->name . "\n"; + + if ( $self->isa("Class::MOP::Method::Constructor") ) { + + # FIXME kludge, refactor warning generation to a method + $warning + .= "If you are certain you don't need to inline your" + . " constructor, specify inline_constructor => 0 in your" + . " call to $class->meta->make_immutable\n"; + } + + warn $warning; + + return 0; +} + +1; + +# ABSTRACT: Method base class for methods which have been inlined + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Method::Inlined - Method base class for methods which have been inlined + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This is a L subclass for methods which +can be inlined. + +=head1 METHODS + +=over 4 + +=item B<< $metamethod->can_be_inlined >> + +This method returns true if the method in question can be inlined in +the associated metaclass. + +If it cannot be inlined, it spits out a warning and returns false. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Method/Meta.pm b/lib/Class/MOP/Method/Meta.pm new file mode 100644 index 0000000..23b3567 --- /dev/null +++ b/lib/Class/MOP/Method/Meta.pm @@ -0,0 +1,169 @@ +package Class::MOP::Method::Meta; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Carp 'confess'; +use Scalar::Util 'blessed', 'weaken'; + +use constant DEBUG_NO_META => $ENV{DEBUG_NO_META} ? 1 : 0; + +use parent 'Class::MOP::Method'; + +sub _is_caller_mop_internal { + my $self = shift; + my ($caller) = @_; + return $caller =~ /^(?:Class::MOP|metaclass)(?:::|$)/; +} + +sub _generate_meta_method { + my $method_self = shift; + my $metaclass = shift; + weaken($metaclass); + + sub { + # this will be compiled out if the env var wasn't set + if (DEBUG_NO_META) { + confess "'meta' method called by MOP internals" + # it's okay to call meta methods on metaclasses, since we + # explicitly ask for them + if !$_[0]->isa('Class::MOP::Object') + && !$_[0]->isa('Class::MOP::Mixin') + # it's okay if the test itself calls ->meta, we only care about + # if the mop internals call ->meta + && $method_self->_is_caller_mop_internal(scalar caller); + } + # we must re-initialize so that it + # works as expected in subclasses, + # since metaclass instances are + # singletons, this is not really a + # big deal anyway. + $metaclass->initialize(blessed($_[0]) || $_[0]) + }; +} + +sub wrap { + my ($class, @args) = @_; + + unshift @args, 'body' if @args % 2 == 1; + my %params = @args; + $class->_throw_exception( CannotOverrideBodyOfMetaMethods => params => \%params, + class => $class + ) + if $params{body}; + + my $metaclass_class = $params{associated_metaclass}->meta; + $params{body} = $class->_generate_meta_method($metaclass_class); + return $class->SUPER::wrap(%params); +} + +sub _make_compatible_with { + my $self = shift; + my ($other) = @_; + + # XXX: this is pretty gross. the issue here is that CMOP::Method::Meta + # objects are subclasses of CMOP::Method, but when we get to moose, they'll + # need to be compatible with Moose::Meta::Method, which isn't possible. the + # right solution here is to make ::Meta into a role that gets applied to + # whatever the method_metaclass happens to be and get rid of + # _meta_method_metaclass entirely, but that's not going to happen until + # we ditch cmop and get roles into the bootstrapping, so. i'm not + # maintaining the previous behavior of turning them into instances of the + # new method_metaclass because that's equally broken, and at least this way + # any issues will at least be detectable and potentially fixable. -doy + return $self unless $other->_is_compatible_with($self->_real_ref_name); + + return $self->SUPER::_make_compatible_with(@_); +} + +1; + +# ABSTRACT: Method Meta Object for C methods + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Method::Meta - Method Meta Object for C methods + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This is a L subclass which represents C +methods installed into classes by Class::MOP. + +=head1 METHODS + +=over 4 + +=item B<< Class::MOP::Method::Wrapped->wrap($metamethod, %options) >> + +This is the constructor. It accepts a L object and +a hash of options. The options accepted are identical to the ones +accepted by L, except that C cannot be passed +(it will be generated automatically). + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Method/Wrapped.pm b/lib/Class/MOP/Method/Wrapped.pm new file mode 100644 index 0000000..6b96c5f --- /dev/null +++ b/lib/Class/MOP/Method/Wrapped.pm @@ -0,0 +1,331 @@ +package Class::MOP::Method::Wrapped; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'blessed'; + +use parent 'Class::MOP::Method'; + +# NOTE: +# this ugly beast is the result of trying +# to micro optimize this as much as possible +# while not completely loosing maintainability. +# At this point it's "fast enough", after all +# you can't get something for nothing :) +my $_build_wrapped_method = sub { + my $modifier_table = shift; + my ($before, $after, $around) = ( + $modifier_table->{before}, + $modifier_table->{after}, + $modifier_table->{around}, + ); + if (@$before && @$after) { + $modifier_table->{cache} = sub { + for my $c (@$before) { $c->(@_) }; + my @rval; + ((defined wantarray) ? + ((wantarray) ? + (@rval = $around->{cache}->(@_)) + : + ($rval[0] = $around->{cache}->(@_))) + : + $around->{cache}->(@_)); + for my $c (@$after) { $c->(@_) }; + return unless defined wantarray; + return wantarray ? @rval : $rval[0]; + } + } + elsif (@$before && !@$after) { + $modifier_table->{cache} = sub { + for my $c (@$before) { $c->(@_) }; + return $around->{cache}->(@_); + } + } + elsif (@$after && !@$before) { + $modifier_table->{cache} = sub { + my @rval; + ((defined wantarray) ? + ((wantarray) ? + (@rval = $around->{cache}->(@_)) + : + ($rval[0] = $around->{cache}->(@_))) + : + $around->{cache}->(@_)); + for my $c (@$after) { $c->(@_) }; + return unless defined wantarray; + return wantarray ? @rval : $rval[0]; + } + } + else { + $modifier_table->{cache} = $around->{cache}; + } +}; + +sub wrap { + my ( $class, $code, %params ) = @_; + + (blessed($code) && $code->isa('Class::MOP::Method')) + || $class->_throw_exception( CanOnlyWrapBlessedCode => params => \%params, + class => $class, + code => $code + ); + + my $modifier_table = { + cache => undef, + orig => $code->body, + before => [], + after => [], + around => { + cache => $code->body, + methods => [], + }, + }; + $_build_wrapped_method->($modifier_table); + return $class->SUPER::wrap( + sub { $modifier_table->{cache}->(@_) }, + # get these from the original + # unless explicitly overridden + package_name => $params{package_name} || $code->package_name, + name => $params{name} || $code->name, + original_method => $code, + + modifier_table => $modifier_table, + ); +} + +sub _new { + my $class = shift; + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $params = @_ == 1 ? $_[0] : {@_}; + + return bless { + # inherited from Class::MOP::Method + 'body' => $params->{body}, + 'associated_metaclass' => $params->{associated_metaclass}, + 'package_name' => $params->{package_name}, + 'name' => $params->{name}, + 'original_method' => $params->{original_method}, + + # defined in this class + 'modifier_table' => $params->{modifier_table} + } => $class; +} + +sub get_original_method { + my $code = shift; + $code->original_method; +} + +sub add_before_modifier { + my $code = shift; + my $modifier = shift; + unshift @{$code->{'modifier_table'}->{before}} => $modifier; + $_build_wrapped_method->($code->{'modifier_table'}); +} + +sub before_modifiers { + my $code = shift; + return @{$code->{'modifier_table'}->{before}}; +} + +sub add_after_modifier { + my $code = shift; + my $modifier = shift; + push @{$code->{'modifier_table'}->{after}} => $modifier; + $_build_wrapped_method->($code->{'modifier_table'}); +} + +sub after_modifiers { + my $code = shift; + return @{$code->{'modifier_table'}->{after}}; +} + +{ + # NOTE: + # this is another possible candidate for + # optimization as well. There is an overhead + # associated with the currying that, if + # eliminated might make around modifiers + # more manageable. + my $compile_around_method = sub {{ + my $f1 = pop; + return $f1 unless @_; + my $f2 = pop; + push @_, sub { $f2->( $f1, @_ ) }; + redo; + }}; + + sub add_around_modifier { + my $code = shift; + my $modifier = shift; + unshift @{$code->{'modifier_table'}->{around}->{methods}} => $modifier; + $code->{'modifier_table'}->{around}->{cache} = $compile_around_method->( + @{$code->{'modifier_table'}->{around}->{methods}}, + $code->{'modifier_table'}->{orig} + ); + $_build_wrapped_method->($code->{'modifier_table'}); + } +} + +sub around_modifiers { + my $code = shift; + return @{$code->{'modifier_table'}->{around}->{methods}}; +} + +sub _make_compatible_with { + my $self = shift; + my ($other) = @_; + + # XXX: this is pretty gross. the issue here is that CMOP::Method::Wrapped + # objects are subclasses of CMOP::Method, but when we get to moose, they'll + # need to be compatible with Moose::Meta::Method, which isn't possible. the + # right solution here is to make ::Wrapped into a role that gets applied to + # whatever the method_metaclass happens to be and get rid of + # wrapped_method_metaclass entirely, but that's not going to happen until + # we ditch cmop and get roles into the bootstrapping, so. i'm not + # maintaining the previous behavior of turning them into instances of the + # new method_metaclass because that's equally broken, and at least this way + # any issues will at least be detectable and potentially fixable. -doy + return $self unless $other->_is_compatible_with($self->_real_ref_name); + + return $self->SUPER::_make_compatible_with(@_); +} + +1; + +# ABSTRACT: Method Meta Object for methods with before/after/around modifiers + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Method::Wrapped - Method Meta Object for methods with before/after/around modifiers + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This is a L subclass which implements before, +after, and around method modifiers. + +=head1 METHODS + +=head2 Construction + +=over 4 + +=item B<< Class::MOP::Method::Wrapped->wrap($metamethod, %options) >> + +This is the constructor. It accepts a L object and +a hash of options. + +The options are: + +=over 8 + +=item * name + +The method name (without a package name). This will be taken from the +provided L object if it is not provided. + +=item * package_name + +The package name for the method. This will be taken from the provided +L object if it is not provided. + +=item * associated_metaclass + +An optional L object. This is the metaclass for the +method's class. + +=back + +=item B<< $metamethod->get_original_method >> + +This returns the L object that was passed to the +constructor. + +=item B<< $metamethod->add_before_modifier($code) >> + +=item B<< $metamethod->add_after_modifier($code) >> + +=item B<< $metamethod->add_around_modifier($code) >> + +These methods all take a subroutine reference and apply it as a +modifier to the original method. + +=item B<< $metamethod->before_modifiers >> + +=item B<< $metamethod->after_modifiers >> + +=item B<< $metamethod->around_modifiers >> + +These methods all return a list of subroutine references which are +acting as the specified type of modifier. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/MiniTrait.pm b/lib/Class/MOP/MiniTrait.pm new file mode 100644 index 0000000..4272901 --- /dev/null +++ b/lib/Class/MOP/MiniTrait.pm @@ -0,0 +1,113 @@ +package Class::MOP::MiniTrait; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Module::Runtime 'use_package_optimistically'; + +sub apply { + my ( $to_class, $trait ) = @_; + + for ( grep { !ref } $to_class, $trait ) { + use_package_optimistically($_); + $_ = Class::MOP::Class->initialize($_); + } + + for my $meth ( grep { $_->package_name ne 'UNIVERSAL' } $trait->get_all_methods ) { + my $meth_name = $meth->name; + next if index($meth_name, '__') == 0; # skip private subs + + if ( $to_class->find_method_by_name($meth_name) ) { + $to_class->add_around_method_modifier( $meth_name, $meth->body ); + } + else { + $to_class->add_method( $meth_name, $meth->clone ); + } + } +} + +# We can't load this with use, since it may be loaded and used from Class::MOP +# (via CMOP::Class, etc). However, if for some reason this module is loaded +# _without_ first loading Class::MOP we need to require Class::MOP so we can +# use it and CMOP::Class. +require Class::MOP; + +1; + +# ABSTRACT: Extremely limited trait application + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::MiniTrait - Extremely limited trait application + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This package provides a single function, C, which does a half-assed job +of applying a trait to a class. It exists solely for use inside Class::MOP and +L core classes. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Mixin.pm b/lib/Class/MOP/Mixin.pm new file mode 100644 index 0000000..578448a --- /dev/null +++ b/lib/Class/MOP/Mixin.pm @@ -0,0 +1,111 @@ +package Class::MOP::Mixin; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'blessed'; +use Module::Runtime 'use_module'; + +sub meta { + require Class::MOP::Class; + Class::MOP::Class->initialize( blessed( $_[0] ) || $_[0] ); +} + +sub _throw_exception { + my ($class, $exception_type, @args_to_exception) = @_; + die use_module( "Moose::Exception::$exception_type" )->new( @args_to_exception ); +} + +1; + +# ABSTRACT: Base class for mixin classes + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Mixin - Base class for mixin classes + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This class provides a few methods which are useful in all metaclasses. + +=head1 METHODS + +=over 4 + +=item B<< Class::MOP::Mixin->meta >> + +This returns a L object for the mixin class. + +=item B<< Class::MOP::Mixin->_throw_exception >> + +Throws an exception in the L family. This should ONLY be +used internally -- any callers outside Class::MOP::* should be using the +version in L instead. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Mixin/AttributeCore.pm b/lib/Class/MOP/Mixin/AttributeCore.pm new file mode 100644 index 0000000..9c96c6c --- /dev/null +++ b/lib/Class/MOP/Mixin/AttributeCore.pm @@ -0,0 +1,125 @@ +package Class::MOP::Mixin::AttributeCore; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'blessed'; + +use parent 'Class::MOP::Mixin'; + +sub has_accessor { defined $_[0]->{'accessor'} } +sub has_reader { defined $_[0]->{'reader'} } +sub has_writer { defined $_[0]->{'writer'} } +sub has_predicate { defined $_[0]->{'predicate'} } +sub has_clearer { defined $_[0]->{'clearer'} } +sub has_builder { defined $_[0]->{'builder'} } +sub has_init_arg { defined $_[0]->{'init_arg'} } +sub has_default { exists $_[0]->{'default'} } +sub has_initializer { defined $_[0]->{'initializer'} } +sub has_insertion_order { defined $_[0]->{'insertion_order'} } + +sub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] } + +sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor } +sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor } + +sub is_default_a_coderef { + # Uber hack because it is called from CMOP::Attribute constructor as + # $class->is_default_a_coderef(\%options) + my ($value) = ref $_[0] ? $_[0]->{'default'} : $_[1]->{'default'}; + + return unless ref($value); + + return ref($value) eq 'CODE' + || ( blessed($value) && $value->isa('Class::MOP::Method') ); +} + +sub default { + my ( $self, $instance ) = @_; + if ( defined $instance && $self->is_default_a_coderef ) { + # if the default is a CODE ref, then we pass in the instance and + # default can return a value based on that instance. Somewhat crude, + # but works. + return $self->{'default'}->($instance); + } + $self->{'default'}; +} + +1; + +# ABSTRACT: Core attributes shared by attribute metaclasses + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Mixin::AttributeCore - Core attributes shared by attribute metaclasses + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This class implements the core attributes (aka properties) shared by all +attributes. See the L documentation for API details. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Mixin/HasAttributes.pm b/lib/Class/MOP/Mixin/HasAttributes.pm new file mode 100644 index 0000000..c76377d --- /dev/null +++ b/lib/Class/MOP/Mixin/HasAttributes.pm @@ -0,0 +1,171 @@ +package Class::MOP::Mixin::HasAttributes; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'blessed'; + +use parent 'Class::MOP::Mixin'; + +sub add_attribute { + my $self = shift; + + my $attribute + = blessed( $_[0] ) ? $_[0] : $self->attribute_metaclass->new(@_); + + ( $attribute->isa('Class::MOP::Mixin::AttributeCore') ) + || $self->_throw_exception( AttributeMustBeAnClassMOPMixinAttributeCoreOrSubclass => attribute => $attribute, + class_name => $self->name, + ); + + $self->_attach_attribute($attribute); + + my $attr_name = $attribute->name; + + $self->remove_attribute($attr_name) + if $self->has_attribute($attr_name); + + my $order = ( scalar keys %{ $self->_attribute_map } ); + $attribute->_set_insertion_order($order); + + $self->_attribute_map->{$attr_name} = $attribute; + + # This method is called to allow for installing accessors. Ideally, we'd + # use method overriding, but then the subclass would be responsible for + # making the attribute, which would end up with lots of code + # duplication. Even more ideally, we'd use augment/inner, but this is + # Class::MOP! + $self->_post_add_attribute($attribute) + if $self->can('_post_add_attribute'); + + return $attribute; +} + +sub has_attribute { + my ( $self, $attribute_name ) = @_; + + ( defined $attribute_name ) + || $self->_throw_exception( MustDefineAnAttributeName => class_name => $self->name ); + + exists $self->_attribute_map->{$attribute_name}; +} + +sub get_attribute { + my ( $self, $attribute_name ) = @_; + + ( defined $attribute_name ) + || $self->_throw_exception( MustDefineAnAttributeName => class_name => $self->name ); + + return $self->_attribute_map->{$attribute_name}; +} + +sub remove_attribute { + my ( $self, $attribute_name ) = @_; + + ( defined $attribute_name ) + || $self->_throw_exception( MustDefineAnAttributeName => class_name => $self->name ); + + my $removed_attribute = $self->_attribute_map->{$attribute_name}; + return unless defined $removed_attribute; + + delete $self->_attribute_map->{$attribute_name}; + + return $removed_attribute; +} + +sub get_attribute_list { + my $self = shift; + keys %{ $self->_attribute_map }; +} + +sub _restore_metaattributes_from { + my $self = shift; + my ($old_meta) = @_; + + for my $attr (sort { $a->insertion_order <=> $b->insertion_order } + map { $old_meta->get_attribute($_) } + $old_meta->get_attribute_list) { + $attr->_make_compatible_with($self->attribute_metaclass); + $self->add_attribute($attr); + } +} + +1; + +# ABSTRACT: Methods for metaclasses which have attributes + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Mixin::HasAttributes - Methods for metaclasses which have attributes + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This class implements methods for metaclasses which have attributes +(L and L). See L for +API details. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Mixin/HasMethods.pm b/lib/Class/MOP/Mixin/HasMethods.pm new file mode 100644 index 0000000..1a27b69 --- /dev/null +++ b/lib/Class/MOP/Mixin/HasMethods.pm @@ -0,0 +1,304 @@ +package Class::MOP::Mixin::HasMethods; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Class::MOP::Method::Meta; + +use Scalar::Util 'blessed', 'reftype'; +use Sub::Name 'subname'; + +use parent 'Class::MOP::Mixin'; + +sub _meta_method_class { 'Class::MOP::Method::Meta' } + +sub _add_meta_method { + my $self = shift; + my ($name) = @_; + my $existing_method = $self->can('find_method_by_name') + ? $self->find_method_by_name($name) + : $self->get_method($name); + return if $existing_method + && $existing_method->isa($self->_meta_method_class); + $self->add_method( + $name => $self->_meta_method_class->wrap( + name => $name, + package_name => $self->name, + associated_metaclass => $self, + ) + ); +} + +sub wrap_method_body { + my ( $self, %args ) = @_; + + ( $args{body} && 'CODE' eq reftype $args{body} ) + || $self->_throw_exception( CodeBlockMustBeACodeRef => instance => $self, + params => \%args + ); + $self->method_metaclass->wrap( + package_name => $self->name, + %args, + ); +} + +sub add_method { + my ( $self, $method_name, $method ) = @_; + ( defined $method_name && length $method_name ) + || $self->_throw_exception( MustDefineAMethodName => instance => $self ); + + my $package_name = $self->name; + + my $body; + if ( blessed($method) && $method->isa('Class::MOP::Method') ) { + $body = $method->body; + if ( $method->package_name ne $package_name ) { + $method = $method->clone( + package_name => $package_name, + name => $method_name, + ); + } + + $method->attach_to_class($self); + } + else { + # If a raw code reference is supplied, its method object is not created. + # The method object won't be created until required. + $body = $method; + } + + $self->_method_map->{$method_name} = $method; + + my ($current_package, $current_name) = Class::MOP::get_code_info($body); + + subname($package_name . '::' . $method_name, $body) + unless defined $current_name && $current_name !~ /^__ANON__/; + + $self->add_package_symbol("&$method_name", $body); + + # we added the method to the method map too, so it's still valid + $self->update_package_cache_flag; +} + +sub _code_is_mine { + my ( $self, $code ) = @_; + + my ( $code_package, $code_name ) = Class::MOP::get_code_info($code); + + return ( $code_package && $code_package eq $self->name ) + || ( $code_package eq 'constant' && $code_name eq '__ANON__' ); +} + +sub has_method { + my ( $self, $method_name ) = @_; + + ( defined $method_name && length $method_name ) + || $self->_throw_exception( MustDefineAMethodName => instance => $self ); + + my $method = $self->_get_maybe_raw_method($method_name) + or return; + + return defined($self->_method_map->{$method_name} = $method); +} + +sub get_method { + my ( $self, $method_name ) = @_; + + ( defined $method_name && length $method_name ) + || $self->_throw_exception( MustDefineAMethodName => instance => $self ); + + my $method = $self->_get_maybe_raw_method($method_name) + or return; + + return $method if blessed($method) && $method->isa('Class::MOP::Method'); + + return $self->_method_map->{$method_name} = $self->wrap_method_body( + body => $method, + name => $method_name, + associated_metaclass => $self, + ); +} + +sub _get_maybe_raw_method { + my ( $self, $method_name ) = @_; + + my $map_entry = $self->_method_map->{$method_name}; + return $map_entry if defined $map_entry; + + my $code = $self->get_package_symbol("&$method_name"); + + return unless $code && $self->_code_is_mine($code); + + return $code; +} + +sub remove_method { + my ( $self, $method_name ) = @_; + + ( defined $method_name && length $method_name ) + || $self->_throw_exception( MustDefineAMethodName => instance => $self ); + + my $removed_method = delete $self->_method_map->{$method_name}; + + $self->remove_package_symbol("&$method_name"); + + $removed_method->detach_from_class + if blessed($removed_method) && $removed_method->isa('Class::MOP::Method'); + + # still valid, since we just removed the method from the map + $self->update_package_cache_flag; + + return $removed_method; +} + +sub get_method_list { + my $self = shift; + + return keys %{ $self->_full_method_map }; +} + +sub _get_local_methods { + my $self = shift; + + return values %{ $self->_full_method_map }; +} + +sub _restore_metamethods_from { + my $self = shift; + my ($old_meta) = @_; + + my $package_name = $self->name; + + # Check if Perl debugger is enabled + my $debugger_enabled = ($^P & 0x10); + my $debug_method_info; + + for my $method ($old_meta->_get_local_methods) { + my $method_name = $method->name; + + # Track DB::sub information for this method if debugger is enabled. + # This contains original method filename and line numbers. + $debug_method_info = ''; + if ($debugger_enabled) { + $debug_method_info = $DB::sub{$package_name . "::" . $method_name} + } + + $method->_make_compatible_with($self->method_metaclass); + $self->add_method($method_name => $method); + + # Restore method debug information, which can be clobbered by add_method. + # Note that we handle this here instead of in add_method, because we + # only want to preserve the original debug info in cases where we are + # restoring a method, not overwriting a method. + if ($debugger_enabled && $debug_method_info) { + $DB::sub{$package_name . "::" . $method_name} = $debug_method_info; + } + } +} + +sub reset_package_cache_flag { (shift)->{'_package_cache_flag'} = undef } +sub update_package_cache_flag { + my $self = shift; + # NOTE: + # we can manually update the cache number + # since we are actually adding the method + # to our cache as well. This avoids us + # having to regenerate the method_map. + # - SL + $self->{'_package_cache_flag'} = Class::MOP::check_package_cache_flag($self->name); +} + +sub _full_method_map { + my $self = shift; + + my $pkg_gen = Class::MOP::check_package_cache_flag($self->name); + + if (($self->{_package_cache_flag_full} || -1) != $pkg_gen) { + # forcibly reify all method map entries + $self->get_method($_) + for $self->list_all_package_symbols('CODE'); + $self->{_package_cache_flag_full} = $pkg_gen; + } + + return $self->_method_map; +} + +1; + +# ABSTRACT: Methods for metaclasses which have methods + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Mixin::HasMethods - Methods for metaclasses which have methods + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This class implements methods for metaclasses which have methods +(L and L). See L for +API details. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Mixin/HasOverloads.pm b/lib/Class/MOP/Mixin/HasOverloads.pm new file mode 100644 index 0000000..057551f --- /dev/null +++ b/lib/Class/MOP/Mixin/HasOverloads.pm @@ -0,0 +1,237 @@ +package Class::MOP::Mixin::HasOverloads; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Class::MOP::Overload; + +use Devel::OverloadInfo 'overload_info'; +use Scalar::Util 'blessed'; +use Sub::Identify 'sub_name', 'stash_name'; + +use overload (); + +use parent 'Class::MOP::Mixin'; + +sub is_overloaded { + my $self = shift; + return overload::Overloaded($self->name); +} + +sub get_overload_list { + my $self = shift; + + my $info = $self->_overload_info; + return grep { $_ ne 'fallback' } keys %{$info} +} + +sub get_all_overloaded_operators { + my $self = shift; + return map { $self->_overload_for($_) } $self->get_overload_list; +} + +sub has_overloaded_operator { + my $self = shift; + my ($op) = @_; + return defined $self->_overload_info->{$op}; +} + +sub _overload_map { + $_[0]->{_overload_map} ||= {}; +} + +sub get_overloaded_operator { + my $self = shift; + my ($op) = @_; + return $self->_overload_map->{$op} ||= $self->_overload_for($op); +} + +use constant _SET_FALLBACK_EACH_TIME => $] < 5.120; + +sub add_overloaded_operator { + my $self = shift; + my ( $op, $overload ) = @_; + + my %p = ( associated_metaclass => $self ); + if ( !ref $overload ) { + %p = ( + %p, + operator => $op, + method_name => $overload, + associated_metaclass => $self, + ); + $p{method} = $self->get_method($overload) + if $self->has_method($overload); + $overload = Class::MOP::Overload->new(%p); + } + elsif ( !blessed $overload) { + $overload = Class::MOP::Overload->new( + operator => $op, + coderef => $overload, + coderef_name => sub_name($overload), + coderef_package => stash_name($overload), + %p, + ); + } + + $overload->attach_to_class($self); + $self->_overload_map->{$op} = $overload; + + my %overload = ( + $op => $overload->has_coderef + ? $overload->coderef + : $overload->method_name + ); + + # Perl 5.10 and earlier appear to have a bug where setting a new + # overloading operator wipes out the fallback value unless we pass it each + # time. + if (_SET_FALLBACK_EACH_TIME) { + $overload{fallback} = $self->get_overload_fallback_value; + } + + $self->name->overload::OVERLOAD(%overload); +} + +sub remove_overloaded_operator { + my $self = shift; + my ($op) = @_; + + delete $self->_overload_map->{$op}; + + # overload.pm provides no api for this - but the problem that makes this + # necessary has been fixed in 5.18 + $self->get_or_add_package_symbol('%OVERLOAD')->{dummy}++ + if $] < 5.017000; + + $self->remove_package_symbol('&(' . $op); +} + +sub get_overload_fallback_value { + my $self = shift; + return $self->_overload_info->{fallback}{value}; +} + +sub set_overload_fallback_value { + my $self = shift; + my $value = shift; + + $self->name->overload::OVERLOAD( fallback => $value ); +} + +# We could cache this but we'd need some logic to clear it at all the right +# times, which seems more tedious than it's worth. +sub _overload_info { + my $self = shift; + return overload_info( $self->name ) || {}; +} + +sub _overload_for { + my $self = shift; + my $op = shift; + + my $map = $self->_overload_map; + return $map->{$op} if $map->{$op}; + + my $info = $self->_overload_info->{$op}; + return unless $info; + + my %p = ( + operator => $op, + associated_metaclass => $self, + ); + + if ( $info->{code} && !$info->{method_name} ) { + $p{coderef} = $info->{code}; + @p{ 'coderef_package', 'coderef_name' } + = $info->{code_name} =~ /(.+)::([^:]+)/; + } + else { + $p{method_name} = $info->{method_name}; + if ( $self->has_method( $p{method_name} ) ) { + $p{method} = $self->get_method( $p{method_name} ); + } + } + + return $map->{$op} = Class::MOP::Overload->new(%p); +} + +1; + +# ABSTRACT: Methods for metaclasses which have overloads + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Mixin::HasOverloads - Methods for metaclasses which have overloads + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This class implements methods for metaclasses which have overloads +(L and L). See L for +API details. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Module.pm b/lib/Class/MOP/Module.pm new file mode 100644 index 0000000..ddc83f7 --- /dev/null +++ b/lib/Class/MOP/Module.pm @@ -0,0 +1,213 @@ +package Class::MOP::Module; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use parent 'Class::MOP::Package'; + +sub _new { + my $class = shift; + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $params = @_ == 1 ? $_[0] : {@_}; + return bless { + # Need to quote package to avoid a problem with PPI mis-parsing this + # as a package statement. + + # from Class::MOP::Package + 'package' => $params->{package}, + namespace => \undef, + + # attributes + version => \undef, + authority => \undef + } => $class; +} + +sub version { + my $self = shift; + ${$self->get_or_add_package_symbol('$VERSION')}; +} + +sub authority { + my $self = shift; + ${$self->get_or_add_package_symbol('$AUTHORITY')}; +} + +sub identifier { + my $self = shift; + join '-' => ( + $self->name, + ($self->version || ()), + ($self->authority || ()), + ); +} + +sub create { + my $class = shift; + my @args = @_; + + unshift @args, 'package' if @args % 2 == 1; + my %options = @args; + + my $package = delete $options{package}; + my $version = delete $options{version}; + my $authority = delete $options{authority}; + + my $meta = $class->SUPER::create($package => %options); + + $meta->_instantiate_module($version, $authority); + + return $meta; +} + +sub _anon_package_prefix { 'Class::MOP::Module::__ANON__::SERIAL::' } + +sub _anon_cache_key { + my $class = shift; + my %options = @_; + $class->_throw_exception( PackagesAndModulesAreNotCachable => class_name => $class, + params => \%options, + is_module => 1 + ); +} + +sub _instantiate_module { + my($self, $version, $authority) = @_; + my $package_name = $self->name; + + $self->add_package_symbol('$VERSION' => $version) + if defined $version; + $self->add_package_symbol('$AUTHORITY' => $authority) + if defined $authority; + + return; +} + +1; + +# ABSTRACT: Module Meta Object + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Module - Module Meta Object + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +A module is essentially a L with metadata, in our +case the version and authority. + +=head1 INHERITANCE + +B is a subclass of L. + +=head1 METHODS + +=over 4 + +=item B<< Class::MOP::Module->create($package, %options) >> + +Overrides C from L to provide these additional +options: + +=over 4 + +=item C + +A version number, to be installed in the C<$VERSION> package global variable. + +=item C + +An authority, to be installed in the C<$AUTHORITY> package global variable. + +This is a legacy field and its use is not recommended. + +=back + +=item B<< $metamodule->version >> + +This is a read-only attribute which returns the C<$VERSION> of the +package, if one exists. + +=item B<< $metamodule->authority >> + +This is a read-only attribute which returns the C<$AUTHORITY> of the +package, if one exists. + +=item B<< $metamodule->identifier >> + +This constructs a string which combines the name, version and +authority. + +=item B<< Class::MOP::Module->meta >> + +This will return a L instance for this class. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Object.pm b/lib/Class/MOP/Object.pm new file mode 100644 index 0000000..a5d0896 --- /dev/null +++ b/lib/Class/MOP/Object.pm @@ -0,0 +1,200 @@ +package Class::MOP::Object; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use parent 'Class::MOP::Mixin'; +use Scalar::Util 'blessed'; +use Module::Runtime; + +# introspection + +sub throw_error { + shift->_throw_exception( Legacy => message => join('', @_) ); +} + +sub _inline_throw_error { + my ( $self, $message ) = @_; + return 'die Module::Runtime::use_module("Moose::Exception::Legacy")->new(message => ' . $message. ')'; +} + +sub _new { + Class::MOP::class_of(shift)->new_object(@_); +} + +# RANT: +# Cmon, how many times have you written +# the following code while debugging: +# +# use Data::Dumper; +# warn Dumper $obj; +# +# It can get seriously annoying, so why +# not just do this ... +sub dump { + my $self = shift; + require Data::Dumper; + local $Data::Dumper::Maxdepth = shift || 1; + Data::Dumper::Dumper $self; +} + +sub _real_ref_name { + my $self = shift; + return blessed($self); +} + +sub _is_compatible_with { + my $self = shift; + my ($other_name) = @_; + + return $self->isa($other_name); +} + +sub _can_be_made_compatible_with { + my $self = shift; + return !$self->_is_compatible_with(@_) + && defined($self->_get_compatible_metaclass(@_)); +} + +sub _make_compatible_with { + my $self = shift; + my ($other_name) = @_; + + my $new_metaclass = $self->_get_compatible_metaclass($other_name); + + unless ( defined $new_metaclass ) { + $self->_throw_exception( CannotMakeMetaclassCompatible => superclass_name => $other_name, + class => $self, + ); + } + + # can't use rebless_instance here, because it might not be an actual + # subclass in the case of, e.g. moose role reconciliation + $new_metaclass->meta->_force_rebless_instance($self) + if blessed($self) ne $new_metaclass; + + return $self; +} + +sub _get_compatible_metaclass { + my $self = shift; + my ($other_name) = @_; + + return $self->_get_compatible_metaclass_by_subclassing($other_name); +} + +sub _get_compatible_metaclass_by_subclassing { + my $self = shift; + my ($other_name) = @_; + my $meta_name = blessed($self) ? $self->_real_ref_name : $self; + + if ($meta_name->isa($other_name)) { + return $meta_name; + } + elsif ($other_name->isa($meta_name)) { + return $other_name; + } + + return; +} + +1; + +# ABSTRACT: Base class for metaclasses + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Object - Base class for metaclasses + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +This class is a very minimal base class for metaclasses. + +=head1 METHODS + +This class provides a few methods which are useful in all metaclasses. + +=over 4 + +=item B<< Class::MOP::???->meta >> + +This returns a L object. + +=item B<< $metaobject->dump($max_depth) >> + +This method uses L to dump the object. You can pass an +optional maximum depth, which will set C<$Data::Dumper::Maxdepth>. The +default maximum depth is 1. + +=item B<< $metaclass->throw_error($message) >> + +This method calls L internally, with an object +of class L. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Overload.pm b/lib/Class/MOP/Overload.pm new file mode 100644 index 0000000..8ff81f5 --- /dev/null +++ b/lib/Class/MOP/Overload.pm @@ -0,0 +1,342 @@ +package Class::MOP::Overload; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use overload (); +use Scalar::Util qw( blessed weaken ); +use Try::Tiny; + +use parent 'Class::MOP::Object'; + +my %Operators = ( + map { $_ => 1 } + grep { $_ ne 'fallback' } + map { split /\s+/ } values %overload::ops +); + +sub new { + my ( $class, %params ) = @_; + + unless ( defined $params{operator} ) { + $class->_throw_exception('OverloadRequiresAnOperator'); + } + unless ( $Operators{ $params{operator} } ) { + $class->_throw_exception( + 'InvalidOverloadOperator', + operator => $params{operator}, + ); + } + + unless ( defined $params{method_name} || $params{coderef} ) { + $class->_throw_exception( + 'OverloadRequiresAMethodNameOrCoderef', + operator => $params{operator}, + ); + } + + if ( $params{coderef} ) { + unless ( defined $params{coderef_package} + && defined $params{coderef_name} ) { + + $class->_throw_exception('OverloadRequiresNamesForCoderef'); + } + } + + if ( $params{method} + && !try { $params{method}->isa('Class::MOP::Method') } ) { + + $class->_throw_exception('OverloadRequiresAMetaMethod'); + } + + if ( $params{associated_metaclass} + && !try { $params{associated_metaclass}->isa('Class::MOP::Module') } ) + { + + $class->_throw_exception('OverloadRequiresAMetaClass'); + } + + my @optional_attrs + = qw( method_name coderef coderef_package coderef_name method associated_metaclass ); + + return bless { + operator => $params{operator}, + map { defined $params{$_} ? ( $_ => $params{$_} ) : () } + @optional_attrs + }, + $class; +} + +sub operator { $_[0]->{operator} } + +sub method_name { $_[0]->{method_name} } +sub has_method_name { exists $_[0]->{method_name} } + +sub method { $_[0]->{method} } +sub has_method { exists $_[0]->{method} } + +sub coderef { $_[0]->{coderef} } +sub has_coderef { exists $_[0]->{coderef} } + +sub coderef_package { $_[0]->{coderef_package} } +sub has_coderef_package { exists $_[0]->{coderef_package} } + +sub coderef_name { $_[0]->{coderef_name} } +sub has_coderef_name { exists $_[0]->{coderef_name} } + +sub associated_metaclass { $_[0]->{associated_metaclass} } + +sub is_anonymous { + my $self = shift; + return $self->has_coderef && $self->coderef_name eq '__ANON__'; +} + +sub attach_to_class { + my ( $self, $class ) = @_; + $self->{associated_metaclass} = $class; + weaken $self->{associated_metaclass}; +} + +sub clone { + my $self = shift; + + my $clone = bless { %{$self}, @_ }, blessed($self); + weaken $clone->{associated_metaclass} if $clone->{associated_metaclass}; + + $clone->_set_original_overload($self); + + return $clone; +} + +sub original_overload { $_[0]->{original_overload} } +sub _set_original_overload { $_[0]->{original_overload} = $_[1] } + +sub _is_equal_to { + my $self = shift; + my $other = shift; + + if ( $self->has_coderef ) { + return unless $other->has_coderef; + return $self->coderef == $other->coderef; + } + else { + return $self->method_name eq $other->method_name; + } +} + +1; + +# ABSTRACT: Overload Meta Object + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Overload - Overload Meta Object + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + my $meta = Class->meta; + my $overload = $meta->get_overloaded_operator('+'); + + if ( $overload->has_method_name ) { + print 'Method for + is ', $overload->method_name, "\n"; + } + else { + print 'Overloading for + is implemented by ', + $overload->coderef_name, " sub\n"; + } + +=head1 DESCRIPTION + +This class provides meta information for overloading in classes and roles. + +=head1 INHERITANCE + +C is a subclass of L. + +=head1 METHODS + +This class provides the following methods: + +=head2 Class::MOP::Overload->new(%options) + +This method creates a new C object. It accepts a number +of options: + +=over 4 + +=item * operator + +This is a string that matches an operator known by the L module, +such as C<""> or C<+>. This is required. + +=item * method_name + +The name of the method which implements the overloading. Note that this does +not need to actually correspond to a real method, since it's okay to declare a +not-yet-implemented overloading. + +Either this or the C option must be passed. + +=item * method + +A L object for the method which implements the +overloading. + +This is optional. + +=item * coderef + +A coderef which implements the overloading. + +Either this or the C option must be passed. + +=item * coderef_package + +The package where the coderef was defined. + +This is required if C is passed. + +=item * coderef_name + +The name of the coderef. This can be "__ANON__". + +This is required if C is passed. + +=item * associated_metaclass + +A L object for the associated class or role. + +This is optional. + +=back + +=head2 $overload->operator + +Returns the operator for this overload object. + +=head2 $overload->method_name + +Returns the method name that implements overloading, if it has one. + +=head2 $overload->has_method_name + +Returns true if the object has a method name. + +=head2 $overload->method + +Returns the L that implements overloading, if it has one. + +=head2 $overload->has_method + +Returns true if the object has a method. + +=head2 $overload->coderef + +Returns the coderef that implements overloading, if it has one. + +=head2 $overload->has_coderef + +Returns true if the object has a coderef. + +=head2 $overload->coderef_package + +Returns the package for the coderef that implements overloading, if it has +one. + +=head2 $overload->has_coderef + +Returns true if the object has a coderef package. + +=head2 $overload->coderef_name + +Returns the sub name for the coderef that implements overloading, if it has +one. + +=head2 $overload->has_coderef_name + +Returns true if the object has a coderef name. + +=head2 $overload->is_anonymous + +Returns true if the overloading is implemented by an anonymous coderef. + +=head2 $overload->associated_metaclass + +Returns the L (class or role) that is associated with the +overload object. + +=head2 $overload->clone + +Clones the overloading object, setting C in the process. + +=head2 $overload->original_overload + +For cloned objects, this returns the L object from which +they were cloned. This can be used to determine the source of an overloading +in a class that came from a role, for example. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm new file mode 100644 index 0000000..135ad68 --- /dev/null +++ b/lib/Class/MOP/Package.pm @@ -0,0 +1,464 @@ +package Class::MOP::Package; +our $VERSION = '2.1405'; + +use strict; +use warnings; + +use Scalar::Util 'blessed', 'weaken'; +use Devel::GlobalDestruction 'in_global_destruction'; +use Module::Runtime 'module_notional_filename'; +use Package::Stash; + +use parent 'Class::MOP::Object'; + +# creation ... + +sub initialize { + my ( $class, @args ) = @_; + + unshift @args, "package" if @args % 2; + + my %options = @args; + my $package_name = delete $options{package}; + + # we hand-construct the class until we can bootstrap it + if ( my $meta = Class::MOP::get_metaclass_by_name($package_name) ) { + return $meta; + } else { + my $meta = ( ref $class || $class )->_new({ + 'package' => $package_name, + %options, + }); + Class::MOP::store_metaclass_by_name($package_name, $meta); + + Class::MOP::weaken_metaclass($package_name) if $options{weaken}; + + + return $meta; + } +} + +sub reinitialize { + my ( $class, @args ) = @_; + + unshift @args, "package" if @args % 2; + + my %options = @args; + my $package_name = delete $options{package}; + + (defined $package_name && $package_name + && (!blessed $package_name || $package_name->isa('Class::MOP::Package'))) + || $class->_throw_exception( MustPassAPackageNameOrAnExistingClassMOPPackageInstance => params => \%options, + class => $class + ); + + $package_name = $package_name->name + if blessed $package_name; + + Class::MOP::remove_metaclass_by_name($package_name); + + $class->initialize($package_name, %options); # call with first arg form for compat +} + +sub create { + my $class = shift; + my @args = @_; + + my $meta = $class->initialize(@args); + my $filename = module_notional_filename($meta->name); + $INC{$filename} = '(set by Moose)' + unless exists $INC{$filename}; + + return $meta; +} + +## ANON packages + +{ + # NOTE: + # this should be sufficient, if you have a + # use case where it is not, write a test and + # I will change it. + my $ANON_SERIAL = 0; + + my %ANON_PACKAGE_CACHE; + + # NOTE: + # we need a sufficiently annoying prefix + # this should suffice for now, this is + # used in a couple of places below, so + # need to put it up here for now. + sub _anon_package_prefix { 'Class::MOP::Package::__ANON__::SERIAL::' } + + sub is_anon { + my $self = shift; + no warnings 'uninitialized'; + my $prefix = $self->_anon_package_prefix; + $self->name =~ /^\Q$prefix/; + } + + sub create_anon { + my ($class, %options) = @_; + + my $cache_ok = delete $options{cache}; + $options{weaken} = !$cache_ok unless exists $options{weaken}; + + my $cache_key; + if ($cache_ok) { + $cache_key = $class->_anon_cache_key(%options); + undef $cache_ok if !defined($cache_key); + } + + if ($cache_ok) { + if (defined $ANON_PACKAGE_CACHE{$cache_key}) { + return $ANON_PACKAGE_CACHE{$cache_key}; + } + } + + my $package_name = $class->_anon_package_prefix . ++$ANON_SERIAL; + + my $meta = $class->create($package_name, %options); + + if ($cache_ok) { + $ANON_PACKAGE_CACHE{$cache_key} = $meta; + weaken($ANON_PACKAGE_CACHE{$cache_key}); + } + + return $meta; + } + + sub _anon_cache_key { + my $class = shift; + my %options = @_; + $class->_throw_exception( PackagesAndModulesAreNotCachable => class_name => $class, + params => \%options, + is_module => 0 + ); + } + + sub DESTROY { + my $self = shift; + + return if in_global_destruction(); # it'll happen soon anyway and this just makes things more complicated + + $self->_free_anon + if $self->is_anon; + } + + sub _free_anon { + my $self = shift; + my $name = $self->name; + + # Moose does a weird thing where it replaces the metaclass for + # class when fixing metaclass incompatibility. In that case, + # we don't want to clean out the namespace now. We can detect + # that because Moose will explicitly update the singleton + # cache in Class::MOP using store_metaclass_by_name, which + # means that the new metaclass will already exist in the cache + # by this point. + # The other options here are that $current_meta can be undef if + # remove_metaclass_by_name is called explicitly (since the hash + # entry is removed first, and then this destructor is called), + # or that $current_meta can be the same as $self, which happens + # when the metaclass goes out of scope (since the weak reference + # in the metaclass cache won't be freed until after this + # destructor runs). + my $current_meta = Class::MOP::get_metaclass_by_name($name); + return if defined($current_meta) && $current_meta ne $self; + + my ($first_fragments, $last_fragment) = ($name =~ /^(.*)::(.*)$/); + + no strict 'refs'; + # clear @ISA first, to avoid a memory leak + # see https://rt.perl.org/rt3/Public/Bug/Display.html?id=92708 + @{$name . '::ISA'} = (); + %{$name . '::'} = (); + delete ${$first_fragments . '::'}{$last_fragment . '::'}; + + Class::MOP::remove_metaclass_by_name($name); + + delete $INC{module_notional_filename($name)}; + } + +} + +sub _new { + my $class = shift; + + return Class::MOP::Class->initialize($class)->new_object(@_) + if $class ne __PACKAGE__; + + my $params = @_ == 1 ? $_[0] : {@_}; + + return bless { + # Need to quote package to avoid a problem with PPI mis-parsing this + # as a package statement. + 'package' => $params->{package}, + + # NOTE: + # because of issues with the Perl API + # to the typeglob in some versions, we + # need to just always grab a new + # reference to the hash in the accessor. + # Ideally we could just store a ref and + # it would Just Work, but oh well :\ + + namespace => \undef, + + } => $class; +} + +# Attributes + +# NOTE: +# all these attribute readers will be bootstrapped +# away in the Class::MOP bootstrap section + +sub _package_stash { + $_[0]->{_package_stash} ||= Package::Stash->new($_[0]->name) +} +sub namespace { + $_[0]->_package_stash->namespace +} + +# Class attributes + +# ... these functions have to touch the symbol table itself,.. yuk + +sub add_package_symbol { + my $self = shift; + $self->_package_stash->add_symbol(@_); +} + +sub remove_package_glob { + my $self = shift; + $self->_package_stash->remove_glob(@_); +} + +# ... these functions deal with stuff on the namespace level + +sub has_package_symbol { + my $self = shift; + $self->_package_stash->has_symbol(@_); +} + +sub get_package_symbol { + my $self = shift; + $self->_package_stash->get_symbol(@_); +} + +sub get_or_add_package_symbol { + my $self = shift; + $self->_package_stash->get_or_add_symbol(@_); +} + +sub remove_package_symbol { + my $self = shift; + $self->_package_stash->remove_symbol(@_); +} + +sub list_all_package_symbols { + my $self = shift; + $self->_package_stash->list_all_symbols(@_); +} + +sub get_all_package_symbols { + my $self = shift; + $self->_package_stash->get_all_symbols(@_); +} + +1; + +# ABSTRACT: Package Meta Object + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Class::MOP::Package - Package Meta Object + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +The Package Protocol provides an abstraction of a Perl 5 package. A +package is basically namespace, and this module provides methods for +looking at and changing that namespace's symbol table. + +=head1 METHODS + +=over 4 + +=item B<< Class::MOP::Package->initialize($package_name, %options) >> + +This method creates a new C instance which +represents specified package. If an existing metaclass object exists +for the package, that will be returned instead. No options are valid at the +package level. + +=item B<< Class::MOP::Package->reinitialize($package, %options) >> + +This method forcibly removes any existing metaclass for the package +before calling C. In contrast to C, you may +also pass an existing C instance instead of just +a package name as C<$package>. + +Do not call this unless you know what you are doing. + +=item B<< Class::MOP::Package->create($package, %options) >> + +Creates a new C instance which represents the specified +package, and also does some initialization of that package. Currently, this +just does the same thing as C, but is overridden in subclasses, +such as C. + +=item B<< Class::MOP::Package->create_anon(%options) >> + +Creates a new anonymous package. Valid keys for C<%options> are: + +=over 4 + +=item C + +If this will be C (the default is C), the instance will be cached +in C's metaclass cache. + +=item C + +If this is C (the default C when L is C), the instance +stored in C's metaclass cache will be weakened, so that the +anonymous package will be garbage collected when the returned instance goes out +of scope. + +=back + +=item B<< $metapackage->is_anon >> + +Returns true if the package is an anonymous package. + +=item B<< $metapackage->name >> + +This is returns the package's name, as passed to the constructor. + +=item B<< $metapackage->namespace >> + +This returns a hash reference to the package's symbol table. The keys +are symbol names and the values are typeglob references. + +=item B<< $metapackage->add_package_symbol($variable_name, $initial_value) >> + +This method accepts a variable name and an optional initial value. The +C<$variable_name> must contain a leading sigil. + +This method creates the variable in the package's symbol table, and +sets it to the initial value if one was provided. + +=item B<< $metapackage->get_package_symbol($variable_name) >> + +Given a variable name, this method returns the variable as a reference +or undef if it does not exist. The C<$variable_name> must contain a +leading sigil. + +=item B<< $metapackage->get_or_add_package_symbol($variable_name) >> + +Given a variable name, this method returns the variable as a reference. +If it does not exist, a default value will be generated if possible. The +C<$variable_name> must contain a leading sigil. + +=item B<< $metapackage->has_package_symbol($variable_name) >> + +Returns true if there is a package variable defined for +C<$variable_name>. The C<$variable_name> must contain a leading sigil. + +=item B<< $metapackage->remove_package_symbol($variable_name) >> + +This will remove the package variable specified C<$variable_name>. The +C<$variable_name> must contain a leading sigil. + +=item B<< $metapackage->remove_package_glob($glob_name) >> + +Given the name of a glob, this will remove that glob from the +package's symbol table. Glob names do not include a sigil. Removing +the glob removes all variables and subroutines with the specified +name. + +=item B<< $metapackage->list_all_package_symbols($type_filter) >> + +This will list all the glob names associated with the current +package. These names do not have leading sigils. + +You can provide an optional type filter, which should be one of +'SCALAR', 'ARRAY', 'HASH', or 'CODE'. + +=item B<< $metapackage->get_all_package_symbols($type_filter) >> + +This works much like C, but it returns a +hash reference. The keys are glob names and the values are references +to the value for that name. + +=item B<< Class::MOP::Package->meta >> + +This will return a L instance for this class. + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Moose.pm b/lib/Moose.pm new file mode 100644 index 0000000..d13c5f6 --- /dev/null +++ b/lib/Moose.pm @@ -0,0 +1,1277 @@ +use strict; +use warnings; +package Moose; # git description: 2.1404-10-gfb25585 +our $VERSION = '2.1405'; +our $AUTHORITY = 'cpan:STEVAN'; + +use 5.008003; + +use Scalar::Util (); +use Carp 'carp'; +use Module::Runtime 'module_notional_filename'; +use Class::Load 'is_class_loaded'; + +use Moose::Deprecated; +use Moose::Exporter; + +use Class::MOP; + +BEGIN { + die "Class::MOP version $Moose::VERSION required--this is version $Class::MOP::VERSION" + if $Moose::VERSION && $Class::MOP::VERSION ne $Moose::VERSION; +} + +use Moose::Meta::Class; +use Moose::Meta::TypeConstraint; +use Moose::Meta::TypeCoercion; +use Moose::Meta::Attribute; +use Moose::Meta::Instance; + +use Moose::Object; + +use Moose::Meta::Role; +use Moose::Meta::Role::Composite; +use Moose::Meta::Role::Application; +use Moose::Meta::Role::Application::RoleSummation; +use Moose::Meta::Role::Application::ToClass; +use Moose::Meta::Role::Application::ToRole; +use Moose::Meta::Role::Application::ToInstance; + +use Moose::Util::TypeConstraints; +use Moose::Util 'throw_exception'; + +use Moose::Meta::Attribute::Native; + +sub extends { + my $meta = shift; + + unless ( @_ ) + { + throw_exception( ExtendsMissingArgs => class_name => $meta->name ); + } + # this checks the metaclass to make sure + # it is correct, sometimes it can get out + # of sync when the classes are being built + $meta->superclasses(@_); +} + +sub with { + Moose::Util::apply_all_roles(shift, @_); +} + +sub throw_error { + shift; + Class::MOP::Object->throw_error(@_); +} + +sub has { + my $meta = shift; + my $name = shift; + + my %context = Moose::Util::_caller_info; + $context{context} = 'has declaration'; + $context{type} = 'class'; + my @options = ( definition_context => \%context, @_ ); + my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ]; + $meta->add_attribute( $_, @options ) for @$attrs; +} + +sub before { + Moose::Util::add_method_modifier(shift, 'before', \@_); +} + +sub after { + Moose::Util::add_method_modifier(shift, 'after', \@_); +} + +sub around { + Moose::Util::add_method_modifier(shift, 'around', \@_); +} + +our $SUPER_PACKAGE; +our $SUPER_BODY; +our @SUPER_ARGS; + +sub super { + if (@_) { + carp 'Arguments passed to super() are ignored'; + } + + # This check avoids a recursion loop - see + # t/bugs/super_recursion.t + return if defined $SUPER_PACKAGE && $SUPER_PACKAGE ne caller(); + return unless $SUPER_BODY; $SUPER_BODY->(@SUPER_ARGS); +} + +sub override { + my $meta = shift; + my ( $name, $method ) = @_; + $meta->add_override_method_modifier( $name => $method ); +} + +sub inner { + my $pkg = caller(); + our ( %INNER_BODY, %INNER_ARGS ); + + if ( my $body = $INNER_BODY{$pkg} ) { + my @args = @{ $INNER_ARGS{$pkg} }; + local $INNER_ARGS{$pkg}; + local $INNER_BODY{$pkg}; + return $body->(@args); + } else { + return; + } +} + +sub augment { + my $meta = shift; + my ( $name, $method ) = @_; + $meta->add_augment_method_modifier( $name => $method ); +} + +Moose::Exporter->setup_import_methods( + with_meta => [ + qw( extends with has before after around override augment ) + ], + as_is => [ + qw( super inner ), + 'Carp::confess', + 'Scalar::Util::blessed', + ], +); + +sub init_meta { + shift; + my %args = @_; + + my $class = $args{for_class} + or throw_exception( InitMetaRequiresClass => params => \%args ); + + my $base_class = $args{base_class} || 'Moose::Object'; + my $metaclass = $args{metaclass} || 'Moose::Meta::Class'; + my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta'; + + throw_exception( MetaclassNotLoaded => class_name => $metaclass ) + unless is_class_loaded($metaclass); + + throw_exception( MetaclassMustBeASubclassOfMooseMetaClass => class_name => $metaclass ) + unless $metaclass->isa('Moose::Meta::Class'); + + # make a subtype for each Moose class + class_type($class) + unless find_type_constraint($class); + + my $meta; + + if ( $meta = Class::MOP::get_metaclass_by_name($class) ) { + unless ( $meta->isa("Moose::Meta::Class") ) { + if ( $meta->isa('Moose::Meta::Role') ) { + throw_exception( MetaclassIsARoleNotASubclassOfGivenMetaclass => role_name => $class, + metaclass => $metaclass, + role => $meta + ); + } else { + throw_exception( MetaclassIsNotASubclassOfGivenMetaclass => class_name => $class, + metaclass => $metaclass, + class => $meta + ); + } + } + } else { + # no metaclass + + # now we check whether our ancestors have metaclass, and if so borrow that + my ( undef, @isa ) = @{ mro::get_linear_isa($class) }; + + foreach my $ancestor ( @isa ) { + my $ancestor_meta = Class::MOP::get_metaclass_by_name($ancestor) || next; + + my $ancestor_meta_class = $ancestor_meta->_real_ref_name; + + # if we have an ancestor metaclass that inherits $metaclass, we use + # that. This is like _fix_metaclass_incompatibility, but we can do it now. + + # the case of having an ancestry is not very common, but arises in + # e.g. Reaction + unless ( $metaclass->isa( $ancestor_meta_class ) ) { + if ( $ancestor_meta_class->isa($metaclass) ) { + $metaclass = $ancestor_meta_class; + } + } + } + + $meta = $metaclass->initialize($class); + my $filename = module_notional_filename($meta->name); + $INC{$filename} = '(set by Moose)' + unless exists $INC{$filename}; + } + + if (defined $meta_name) { + # also check for inherited non moose 'meta' method? + my $existing = $meta->get_method($meta_name); + if ($existing && !$existing->isa('Class::MOP::Method::Meta')) { + Carp::cluck "Moose is overwriting an existing method named " + . "$meta_name in class $class with a method " + . "which returns the class's metaclass. If this is " + . "actually what you want, you should remove the " + . "existing method, otherwise, you should rename or " + . "disable this generated method using the " + . "'-meta_name' option to 'use Moose'."; + } + $meta->_add_meta_method($meta_name); + } + + # make sure they inherit from Moose::Object + $meta->superclasses($base_class) + unless $meta->superclasses(); + + return $meta; +} + +# This may be used in some older MooseX extensions. +sub _get_caller { + goto &Moose::Exporter::_get_caller; +} + +## make 'em all immutable + +$_->make_immutable( + inline_constructor => 1, + constructor_name => "_new", + # these are Class::MOP accessors, so they need inlining + inline_accessors => 1 + ) for grep { $_->is_mutable } + map { $_->meta } + qw( + Moose::Meta::Attribute + Moose::Meta::Class + Moose::Meta::Instance + + Moose::Meta::TypeCoercion + Moose::Meta::TypeCoercion::Union + + Moose::Meta::Method + Moose::Meta::Method::Constructor + Moose::Meta::Method::Destructor + Moose::Meta::Method::Overridden + Moose::Meta::Method::Augmented + + Moose::Meta::Role + Moose::Meta::Role::Attribute + Moose::Meta::Role::Method + Moose::Meta::Role::Method::Required + Moose::Meta::Role::Method::Conflicting + + Moose::Meta::Role::Composite + + Moose::Meta::Role::Application + Moose::Meta::Role::Application::RoleSummation + Moose::Meta::Role::Application::ToClass + Moose::Meta::Role::Application::ToRole + Moose::Meta::Role::Application::ToInstance +); + +$_->make_immutable( + inline_constructor => 0, + constructor_name => undef, + # these are Class::MOP accessors, so they need inlining + inline_accessors => 1 + ) for grep { $_->is_mutable } + map { $_->meta } + qw( + Moose::Meta::Method::Accessor + Moose::Meta::Method::Delegation + Moose::Meta::Mixin::AttributeCore +); + +1; + +# ABSTRACT: A postmodern object system for Perl 5 + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Moose - A postmodern object system for Perl 5 + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + package Point; + use Moose; # automatically turns on strict and warnings + + has 'x' => (is => 'rw', isa => 'Int'); + has 'y' => (is => 'rw', isa => 'Int'); + + sub clear { + my $self = shift; + $self->x(0); + $self->y(0); + } + + package Point3D; + use Moose; + + extends 'Point'; + + has 'z' => (is => 'rw', isa => 'Int'); + + after 'clear' => sub { + my $self = shift; + $self->z(0); + }; + +=head1 DESCRIPTION + +Moose is an extension of the Perl 5 object system. + +The main goal of Moose is to make Perl 5 Object Oriented programming +easier, more consistent, and less tedious. With Moose you can think +more about what you want to do and less about the mechanics of OOP. + +Additionally, Moose is built on top of L, which is a +metaclass system for Perl 5. This means that Moose not only makes +building normal Perl 5 objects better, but it provides the power of +metaclass programming as well. + +=head2 New to Moose? + +If you're new to Moose, the best place to start is the +L docs, followed by the L. The intro +will show you what Moose is, and how it makes Perl 5 OO better. + +The cookbook recipes on Moose basics will get you up to speed with +many of Moose's features quickly. Once you have an idea of what Moose +can do, you can use the API documentation to get more detail on +features which interest you. + +=head2 Moose Extensions + +The C namespace is the official place to find Moose extensions. +These extensions can be found on the CPAN. The easiest way to find them +is to search for them (L), +or to examine L which aims to keep an up-to-date, easily +installable list of Moose extensions. + +=head1 TRANSLATIONS + +Much of the Moose documentation has been translated into other languages. + +=over 4 + +=item Japanese + +Japanese docs can be found at +L. The +source POD files can be found in GitHub: +L + +=back + +=head1 BUILDING CLASSES WITH MOOSE + +Moose makes every attempt to provide as much convenience as possible during +class construction/definition, but still stay out of your way if you want it +to. Here are a few items to note when building classes with Moose. + +When you C, Moose will set the class's parent class to +L, I the class using Moose already has a parent +class. In addition, specifying a parent with C will change the parent +class. + +Moose will also manage all attributes (including inherited ones) that are +defined with C. And (assuming you call C, which is inherited from +L) this includes properly initializing all instance slots, +setting defaults where appropriate, and performing any type constraint checking +or coercion. + +=head1 PROVIDED METHODS + +Moose provides a number of methods to all your classes, mostly through the +inheritance of L. There is however, one exception. By default, +Moose will install a method named C in any class which uses +C. This method returns the current class's metaclass. + +If you'd like to rename this method, you can do so by passing the +C<-meta_name> option when using Moose: + + use Moose -meta_name => 'my_meta'; + +However, the L class I provides a method named C +which does the same thing. If your class inherits from L (which +is the default), then you will still have a C method. However, if your +class inherits from a parent which provides a C method of its own, your +class will inherit that instead. + +If you'd like for Moose to not install a meta method at all, you can pass +C as the C<-meta_name> option: + + use Moose -meta_name => undef; + +Again, you will still inherit C from L in this case. + +=head1 EXPORTED FUNCTIONS + +Moose will export a number of functions into the class's namespace which +may then be used to set up the class. These functions all work directly +on the current class. + +=over 4 + +=item B + +This function will set the superclass(es) for the current class. If the parent +classes are not yet loaded, then C tries to load them. + +This approach is recommended instead of C>/C>, because +C actually Ces onto the class's C<@ISA>, whereas C will +replace it. This is important to ensure that classes which do not have +superclasses still properly inherit from L. + +Each superclass can be followed by a hash reference with options. Currently, +only L<-version|Class::MOP/Class Loading Options> is recognized: + + extends 'My::Parent' => { -version => 0.01 }, + 'My::OtherParent' => { -version => 0.03 }; + +An exception will be thrown if the version requirements are not +satisfied. + +=item B + +This will apply a given set of C<@roles> to the local class. + +Like with C, each specified role can be followed by a hash +reference with a L<-version|Class::MOP/Class Loading Options> option: + + with 'My::Role' => { -version => 0.32 }, + 'My::Otherrole' => { -version => 0.23 }; + +The specified version requirements must be satisfied, otherwise an +exception will be thrown. + +If your role takes options or arguments, they can be passed along in the +hash reference as well. + +=item B %options> + +This will install an attribute of a given C<$name> into the current class. If +the first parameter is an array reference, it will create an attribute for +every C<$name> in the list. The C<%options> will be passed to the constructor +for L (which inherits from L), +so the full documentation for the valid options can be found there. These are +the most commonly used options: + +=over 4 + +=item I 'rw'|'ro'> + +The I option accepts either I (for read/write) or I (for read +only). These will create either a read/write accessor or a read-only +accessor respectively, using the same name as the C<$name> of the attribute. + +If you need more control over how your accessors are named, you can +use the L, +L and +L options inherited from +L, however if you use those, you won't need the +I option. + +=item I $type_name> + +The I option uses Moose's type constraint facilities to set up runtime +type checking for this attribute. Moose will perform the checks during class +construction, and within any accessors. The C<$type_name> argument must be a +string. The string may be either a class name or a type defined using +Moose's type definition features. (Refer to L +for information on how to define a new type, and how to retrieve type meta-data). + +=item I (1|0)> + +This will attempt to use coercion with the supplied type constraint to change +the value passed into any accessors or constructors. You B supply a type +constraint, and that type constraint B define a coercion. See +L for an example. + +=item I $role_name> + +This will accept the name of a role which the value stored in this attribute +is expected to have consumed. + +=item I (1|0)> + +This marks the attribute as being required. This means a value must be +supplied during class construction, I the attribute must be lazy +and have either a default or a builder. Note that c does not +say anything about the attribute's value, which can be C. + +=item I (1|0)> + +This will tell the class to store the value of this attribute as a weakened +reference. If an attribute is a weakened reference, it B also be +coerced. Note that when a weak ref expires, the attribute's value becomes +undefined, and is still considered to be set for purposes of predicate, +default, etc. + +=item I (1|0)> + +This will tell the class to not create this slot until absolutely necessary. +If an attribute is marked as lazy it B have a default or builder +supplied. + +=item I $code> + +The I option is a CODE reference which will be called after +the value of the attribute is set. The CODE ref is passed the +instance itself, the updated value, and the original value if the +attribute was already set. + +You B have a trigger on a read-only attribute. + +B Triggers will only fire when you B to the attribute, +either in the constructor, or using the writer. Default and built values will +B cause the trigger to be fired. + +=item I ARRAY | HASH | REGEXP | ROLE | ROLETYPE | DUCKTYPE | CODE> + +The I option provides Moose classes with automated delegation features. +This is a pretty complex and powerful option. It accepts many different option +formats, each with its own benefits and drawbacks. + +B The class being delegated to does not need to be a Moose based class, +which is why this feature is especially useful when wrapping non-Moose classes. + +All I option formats share the following traits: + +You cannot override a locally defined method with a delegated method; an +exception will be thrown if you try. That is to say, if you define C in +your class, you cannot override it with a delegated C. This is almost never +something you would want to do, and if it is, you should do it by hand and not +use Moose. + +You cannot override any of the methods found in Moose::Object, or the C +and C methods. These will not throw an exception, but will silently +move on to the next method in the list. My reasoning for this is that you would +almost never want to do this, since it usually breaks your class. As with +overriding locally defined methods, if you do want to do this, you should do it +manually, not with Moose. + +You do not I to have a reader (or accessor) for the attribute in order +to delegate to it. Moose will create a means of accessing the value for you, +however this will be several times B efficient then if you had given +the attribute a reader (or accessor) to use. + +Below is the documentation for each option format: + +=over 4 + +=item C + +This is the most common usage for I. You basically pass a list of +method names to be delegated, and Moose will install a delegation method +for each one. + +=item C + +This is the second most common usage for I. Instead of a list of +method names, you pass a HASH ref where each key is the method name you +want installed locally, and its value is the name of the original method +in the class being delegated to. + +This can be very useful for recursive classes like trees. Here is a +quick example (soon to be expanded into a Moose::Cookbook recipe): + + package Tree; + use Moose; + + has 'node' => (is => 'rw', isa => 'Any'); + + has 'children' => ( + is => 'ro', + isa => 'ArrayRef', + default => sub { [] } + ); + + has 'parent' => ( + is => 'rw', + isa => 'Tree', + weak_ref => 1, + handles => { + parent_node => 'node', + siblings => 'children', + } + ); + +In this example, the Tree package gets C and C methods, +which delegate to the C and C methods (respectively) of the Tree +instance stored in the C slot. + +You may also use an array reference to curry arguments to the original method. + + has 'thing' => ( + ... + handles => { set_foo => [ set => 'foo' ] }, + ); + + # $self->set_foo(...) calls $self->thing->set('foo', ...) + +The first element of the array reference is the original method name, and the +rest is a list of curried arguments. + +=item C + +The regexp option works very similar to the ARRAY option, except that it builds +the list of methods for you. It starts by collecting all possible methods of the +class being delegated to, then filters that list using the regexp supplied here. + +B An I option is required when using the regexp option format. This +is so that we can determine (at compile time) the method list from the class. +Without an I this is just not possible. + +=item C or C + +With the role option, you specify the name of a role or a +L whose "interface" then becomes +the list of methods to handle. The "interface" can be defined as; the methods +of the role and any required methods of the role. It should be noted that this +does B include any method modifiers or generated attribute methods (which +is consistent with role composition). + +=item C + +With the duck type option, you pass a duck type object whose "interface" then +becomes the list of methods to handle. The "interface" can be defined as the +list of methods passed to C to create a duck type object. For more +information on C please check +L. + +=item C + +This is the option to use when you really want to do something funky. You should +only use it if you really know what you are doing, as it involves manual +metaclass twiddling. + +This takes a code reference, which should expect two arguments. The first is the +attribute meta-object this I is attached to. The second is the +metaclass of the class being delegated to. It expects you to return a hash (not +a HASH ref) of the methods you want mapped. + +=back + +=item I [ @role_names ]> + +This tells Moose to take the list of C<@role_names> and apply them to the +attribute meta-object. Custom attribute metaclass traits are useful for +extending the capabilities of the I keyword: they are the simplest way to +extend the MOP, but they are still a fairly advanced topic and too much to +cover here. + +See L for details on how a trait name is +resolved to a role name. + +Also see L for a metaclass +trait example. + +=item I => Str + +The value of this key is the name of the method that will be called to obtain +the value used to initialize the attribute. See the L and/or +L for more +information. + +=item I => SCALAR | CODE + +The value of this key is the default value which will initialize the attribute. + +NOTE: If the value is a simple scalar (string or number), then it can +be just passed as is. However, if you wish to initialize it with a +HASH or ARRAY ref, then you need to wrap that inside a CODE reference. +See the L for more +information. + +=item I => Str + +Creates a method allowing you to clear the value. See the L for more +information. + +=item I => Str + +Creates a method to perform a basic test to see if a value has been set in the +attribute. See the L for more information. + +Note that the predicate will return true even for a C attribute +whose value has expired. + +=item I => $string + +An arbitrary string that can be retrieved later by calling C<< +$attr->documentation >>. + +=back + +=item B %options> + +This is variation on the normal attribute creator C which allows you to +clone and extend an attribute from a superclass or from a role. Here is an +example of the superclass usage: + + package Foo; + use Moose; + + has 'message' => ( + is => 'rw', + isa => 'Str', + default => 'Hello, I am a Foo' + ); + + package My::Foo; + use Moose; + + extends 'Foo'; + + has '+message' => (default => 'Hello I am My::Foo'); + +What is happening here is that B is cloning the C attribute +from its parent class B, retaining the C 'rw'> and C +'Str'> characteristics, but changing the value in C. + +Here is another example, but within the context of a role: + + package Foo::Role; + use Moose::Role; + + has 'message' => ( + is => 'rw', + isa => 'Str', + default => 'Hello, I am a Foo' + ); + + package My::Foo; + use Moose; + + with 'Foo::Role'; + + has '+message' => (default => 'Hello I am My::Foo'); + +In this case, we are basically taking the attribute which the role supplied +and altering it within the bounds of this feature. + +Note that you can only extend an attribute from either a superclass or a role, +you cannot extend an attribute in a role that composes over an attribute from +another role. + +Aside from where the attributes come from (one from superclass, the other +from a role), this feature works exactly the same. This feature is restricted +somewhat, so as to try and force at least I sanity into it. Most options work the same, but there are some exceptions: + +=over 4 + +=item I + +=item I + +=item I + +=item I + +=item I + +These options can be added, but cannot override a superclass definition. + +=item I + +You are allowed to B additional traits to the C definition. +These traits will be composed into the attribute, but preexisting traits +B overridden, or removed. + +=back + +=item B sub { ... }> + +=item B sub { ... }> + +=item B sub { ... }> + +These three items are syntactic sugar for the before, after, and around method +modifier features that L provides. More information on these may be +found in L and the +L. + +=item B + +An C method is a way of explicitly saying "I am overriding this +method from my superclass". You can call C within this method, and +it will work as expected. The same thing I be accomplished with a normal +method call and the C pseudo-package; it is really your choice. + +=item B + +The keyword C is a no-op when called outside of an C method. In +the context of an C method, it will call the next most appropriate +superclass method with the same arguments as the original method. + +=item B + +An C method, is a way of explicitly saying "I am augmenting this +method from my superclass". Once again, the details of how C and +C work is best described in the +L. + +=item B + +The keyword C, much like C, is a no-op outside of the context of +an C method. You can think of C as being the inverse of +C; the details of how C and C work is best described in +the L. + +=item B + +This is the C function. It is highly recommended that +this is used instead of C anywhere you need to test for an object's class +name. + +=item B + +This is the C function, and exported here for historical +reasons. + +=back + +=head1 METACLASS + +When you use Moose, you can specify traits which will be applied to your +metaclass: + + use Moose -traits => 'My::Trait'; + +This is very similar to the attribute traits feature. When you do +this, your class's C object will have the specified traits +applied to it. See L for more +details. + +=head2 Metaclass and Trait Name Resolution + +By default, when given a trait name, Moose simply tries to load a +class of the same name. If such a class does not exist, it then looks +for a class matching +B. The C<$type> +variable here will be one of B or B, depending on +what the trait is being applied to. + +If a class with this long name exists, Moose checks to see if it has +the method C. This method is expected to +return the I class name of the trait. If there is no +C method, it will fall back to using +B as the trait name. + +The lookup method for metaclasses is the same, except that it looks +for a class matching B. + +If all this is confusing, take a look at +L, which demonstrates how to +create an attribute trait. + +=head1 UNIMPORTING FUNCTIONS + +=head2 B + +Moose offers a way to remove the keywords it exports, through the C +method. You simply have to say C 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 EXTENDING AND EMBEDDING MOOSE + +To learn more about extending Moose, we recommend checking out the +"Extending" recipes in the L, starting with +L, which provides an overview of +all the different ways you might extend Moose. L and +L are the modules which provide the majority of the +extension functionality, so reading their documentation should also be helpful. + +=head2 The MooseX:: namespace + +Generally if you're writing an extension I Moose itself you'll want +to put your extension in the C namespace. This namespace is +specifically for extensions that make Moose better or different in some +fundamental way. It is traditionally B for a package that just happens +to use Moose. This namespace follows from the examples of the C +and C namespaces that perform the same function for C and C +respectively. + +=head1 METACLASS COMPATIBILITY AND MOOSE + +Metaclass compatibility is a thorny subject. You should start by +reading the "About Metaclass compatibility" section in the +L docs. + +Moose will attempt to resolve a few cases of metaclass incompatibility +when you set the superclasses for a class, in addition to the cases that +L handles. + +Moose tries to determine if the metaclasses only "differ by roles". This +means that the parent and child's metaclass share a common ancestor in +their respective hierarchies, and that the subclasses under the common +ancestor are only different because of role applications. This case is +actually fairly common when you mix and match various C +modules, many of which apply roles to the metaclass. + +If the parent and child do differ by roles, Moose replaces the +metaclass in the child with a newly created metaclass. This metaclass +is a subclass of the parent's metaclass which does all of the roles that +the child's metaclass did before being replaced. Effectively, this +means the new metaclass does all of the roles done by both the +parent's and child's original metaclasses. + +Ultimately, this is all transparent to you except in the case of an +unresolvable conflict. + +=head1 CAVEATS + +=over 4 + +=item * + +It should be noted that C and C B be used in the same +method. However, they may be combined within the same class hierarchy; see +F for an example. + +The reason for this is that C is only valid within a method +with the C modifier, and C will never be valid within an +C method. In fact, C will skip over any C methods +when searching for its appropriate C. + +This might seem like a restriction, but I am of the opinion that keeping these +two features separate (yet interoperable) actually makes them easy to use, since +their behavior is then easier to predict. Time will tell whether I am right or +not (UPDATE: so far so good). + +=back + +=head1 GETTING HELP + +We offer both a mailing list and a very active IRC channel. + +The mailing list is L. You must be subscribed to send +a message. To subscribe, send an empty message to +L + +You can also visit us at C<#moose> on L +This channel is quite active, and questions at all levels (on Moose-related +topics ;) are welcome. + +=head1 WHAT DOES MOOSE STAND FOR? + +Moose doesn't stand for one thing in particular, however, if you want, here +are a few of our favorites. Feel free to contribute more! + +=over 4 + +=item * Make Other Object Systems Envious + +=item * Makes Object Orientation So Easy + +=item * Makes Object Orientation Spiffy- Er (sorry ingy) + +=item * Most Other Object Systems Emasculate + +=item * Moose Often Ovulate Sorta Early + +=item * Moose Offers Often Super Extensions + +=item * Meta Object Obligates Salivary Excitation + +=item * Meta Object Orientation Syntax Extensions + +=item * Moo, Only Overengineered, Slow, and Execrable (blame rjbs!) + +=item * Massive Object-Oriented Stacktrace Emitter + +=back + +=head1 ACKNOWLEDGEMENTS + +=over 4 + +=item I blame Sam Vilain for introducing me to the insanity that is meta-models. + +=item I blame Audrey Tang for then encouraging my meta-model habit in #perl6. + +=item Without Yuval "nothingmuch" Kogman this module would not be possible, +and it certainly wouldn't have this name ;P + +=item The basis of the TypeContraints module was Rob Kinyon's idea +originally, I just ran with it. + +=item Thanks to mst & chansen and the whole #moose posse for all the +early ideas/feature-requests/encouragement/bug-finding. + +=item Thanks to David "Theory" Wheeler for meta-discussions and spelling fixes. + +=back + +=head1 SEE ALSO + +=over 4 + +=item L + +This is the official web home of Moose. It contains links to our public git +repository, as well as links to a number of talks and articles on Moose and +Moose related technologies. + +=item the L + +This is an introduction to Moose which covers most of the basics. + +=item Modern Perl, by chromatic + +This is an introduction to modern Perl programming, which includes a section on +Moose. It is available in print and as a free download from +L. + +=item The Moose is flying, a tutorial by Randal Schwartz + +Part 1 - L + +Part 2 - L + +=item Several Moose extension modules in the C namespace. + +See L for extensions. + +=back + +=head2 Books + +=over 4 + +=item The Art of the MetaObject Protocol + +I mention this in the L docs too, as this book was critical in +the development of both modules and is highly recommended. + +=back + +=head2 Papers + +=over 4 + +=item L + +This paper (suggested by lbr on #moose) was what lead to the implementation +of the C/C and C/C features. If you really +want to understand them, I suggest you read this. + +=back + +=head1 BUGS + +All complex software has bugs lurking in it, and this module is no +exception. + +Please report any bugs to C, or through the web +interface at L. You can also submit a C test as a +pull request at L. + +You can also discuss feature requests or possible bugs on the Moose mailing +list (moose@perl.org) or on IRC at L. + +=head1 FEATURE REQUESTS + +We are very strict about what features we add to the Moose core, especially +the user-visible features. Instead we have made sure that the underlying +meta-system of Moose is as extensible as possible so that you can add your +own features easily. + +That said, occasionally there is a feature needed in the meta-system +to support your planned extension, in which case you should either +email the mailing list (moose@perl.org) or join us on IRC at +L to discuss. The +L has more detail about how and when you +can contribute. + +=head1 CABAL + +There are only a few people with the rights to release a new version +of Moose. The Moose Cabal are the people to go to with questions regarding +the wider purview of Moose. They help maintain not just the code +but the community as well. See the list below under C. + +=head1 CONTRIBUTORS + +Moose is a community project, and as such, involves the work of many, many +members of the community beyond just the members in the cabal. In particular: + +Dave (autarch) Rolsky wrote most of the documentation in L. + +John (jgoulah) Goulah wrote L. + +Jess (castaway) Robinson wrote L. + +Aran (bluefeet) Clary Deltac wrote +L. + +Anders (Debolaz) Nor Berle contributed L and L. + +Also, the code in L is based on code from the +L distribution, which had contributions from: + +Chris (perigrin) Prather + +Cory (gphat) Watson + +Evan Carroll + +Florian (rafl) Ragwitz + +Jason May + +Jay Hannah + +Jesse (doy) Luehrs + +Paul (frodwith) Driver + +Robert (rlb3) Boone + +Robert Buels + +Robert (phaylon) Sedlacek + +Shawn (Sartak) Moore + +Stevan Little + +Tom (dec) Lanyon + +Yuval Kogman + +Finally, these people also contributed various tests, bug fixes, +documentation, and features to the Moose codebase: + +Aankhen + +Adam (Alias) Kennedy + +Christian (chansen) Hansen + +Cory (gphat) Watson + +Dylan Hardison (doc fixes) + +Eric (ewilhelm) Wilhelm + +Evan Carroll + +Guillermo (groditi) Roditi + +Jason May + +Jay Hannah + +Jonathan (jrockway) Rockway + +Matt (mst) Trout + +Nathan (kolibrie) Gray + +Paul (frodwith) Driver + +Piotr (dexter) Roszatycki + +Robert Buels + +Robert (phaylon) Sedlacek + +Robert (rlb3) Boone + +Sam (mugwump) Vilain + +Scott (konobi) McWhirter + +Shlomi (rindolf) Fish + +Tom (dec) Lanyon + +Wallace (wreis) Reis + +... and many other #moose folks + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Moose/Conflicts.pm b/lib/Moose/Conflicts.pm new file mode 100644 index 0000000..612dc9c --- /dev/null +++ b/lib/Moose/Conflicts.pm @@ -0,0 +1,113 @@ +package # hide from PAUSE + Moose::Conflicts; + +use strict; +use warnings; + +# this module was generated with Dist::Zilla::Plugin::Conflicts 0.17 + +use Dist::CheckConflicts + -dist => 'Moose', + -conflicts => { + 'Catalyst' => '5.90049999', + 'Config::MVP' => '2.200004', + 'Devel::REPL' => '1.003020', + 'Dist::Zilla::Plugin::Git' => '2.016', + 'Fey' => '0.36', + 'Fey::ORM' => '0.42', + 'File::ChangeNotify' => '0.15', + 'HTTP::Throwable' => '0.017', + 'KiokuDB' => '0.51', + 'Markdent' => '0.16', + 'Mason' => '2.18', + 'MooseX::ABC' => '0.05', + 'MooseX::Aliases' => '0.08', + 'MooseX::AlwaysCoerce' => '0.13', + 'MooseX::App' => '1.22', + 'MooseX::Attribute::Deflator' => '2.1.7', + 'MooseX::Attribute::Dependent' => '1.1.0', + 'MooseX::Attribute::Prototype' => '0.10', + 'MooseX::AttributeHelpers' => '0.22', + 'MooseX::AttributeIndexes' => '1.0.0', + 'MooseX::AttributeInflate' => '0.02', + 'MooseX::CascadeClearing' => '0.03', + 'MooseX::ClassAttribute' => '0.26', + 'MooseX::Constructor::AllErrors' => '0.021', + 'MooseX::Declare' => '0.35', + 'MooseX::FollowPBP' => '0.02', + 'MooseX::Getopt' => '0.56', + 'MooseX::InstanceTracking' => '0.04', + 'MooseX::LazyRequire' => '0.06', + 'MooseX::Meta::Attribute::Index' => '0.04', + 'MooseX::Meta::Attribute::Lvalue' => '0.05', + 'MooseX::Method::Signatures' => '0.44', + 'MooseX::MethodAttributes' => '0.22', + 'MooseX::NonMoose' => '0.24', + 'MooseX::Object::Pluggable' => '0.0011', + 'MooseX::POE' => '0.214', + 'MooseX::Params::Validate' => '0.05', + 'MooseX::PrivateSetters' => '0.03', + 'MooseX::Role::Cmd' => '0.06', + 'MooseX::Role::Parameterized' => '1.00', + 'MooseX::Role::WithOverloading' => '0.14', + 'MooseX::Runnable' => '0.03', + 'MooseX::Scaffold' => '0.05', + 'MooseX::SemiAffordanceAccessor' => '0.05', + 'MooseX::SetOnce' => '0.100473', + 'MooseX::Singleton' => '0.25', + 'MooseX::SlurpyConstructor' => '1.1', + 'MooseX::Storage' => '0.42', + 'MooseX::StrictConstructor' => '0.12', + 'MooseX::Traits' => '0.11', + 'MooseX::Types' => '0.19', + 'MooseX::Types::Parameterizable' => '0.05', + 'MooseX::Types::Set::Object' => '0.03', + 'MooseX::Types::Signal' => '1.101930', + 'MooseX::UndefTolerant' => '0.11', + 'PRANG' => '0.14', + 'Pod::Elemental' => '0.093280', + 'Pod::Weaver' => '3.101638', + 'Reaction' => '0.002003', + 'Test::Able' => '0.10', + 'Test::CleanNamespaces' => '0.03', + 'Test::Moose::More' => '0.022', + 'Test::TempDir' => '0.05', + 'Throwable' => '0.102080', + 'namespace::autoclean' => '0.08', + }, + -also => [ qw( + Carp + Class::Load + Class::Load::XS + Data::OptList + Devel::GlobalDestruction + Devel::OverloadInfo + Devel::StackTrace + Dist::CheckConflicts + Eval::Closure + List::MoreUtils + List::Util + MRO::Compat + Module::Runtime + Module::Runtime::Conflicts + Package::DeprecationManager + Package::Stash + Package::Stash::XS + Params::Util + Scalar::Util + Sub::Exporter + Sub::Identify + Sub::Name + Task::Weaken + Try::Tiny + parent + strict + warnings + ) ], + +; + +1; + +# ABSTRACT: Provide information on conflicts for Moose +# Dist::Zilla: -PodWeaver diff --git a/lib/Moose/Cookbook.pod b/lib/Moose/Cookbook.pod new file mode 100644 index 0000000..c967e09 --- /dev/null +++ b/lib/Moose/Cookbook.pod @@ -0,0 +1,289 @@ +# PODNAME: Moose::Cookbook +# ABSTRACT: How to cook a Moose + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Moose::Cookbook - How to cook a Moose + +=head1 VERSION + +version 2.1405 + +=head1 DESCRIPTION + +The Moose cookbook is a series of recipes showing various Moose +features. Most recipes present some code demonstrating some feature, +and then explain the details of the code. + +You should probably read the L first. The manual +explains Moose concepts without being too code-heavy. + +=head1 RECIPES + +=head2 Basic Moose + +These recipes will give you a good overview of Moose's capabilities, starting +with simple attribute declaration, and moving on to more powerful features like +laziness, types, type coercion, method modifiers, and more. + +=over 4 + +=item L + +A simple Moose-based class. Demonstrates basic Moose attributes and subclassing. + +=item L + +A slightly more complex Moose class. Demonstrates using a method modifier in a +subclass. + +=item L + +Demonstrates several attribute features, including types, weak +references, predicates ("does this object have a foo?"), defaults, +laziness, and triggers. + +=item L + +Introduces the creation and use of custom types, a C method, and the +use of C in a subclass. This recipe also shows how to model a set of +classes that could be used to model companies, people, employees, etc. + +=item L + +This recipe covers more subtype creation, including the use of type coercions. + +=item L + +Making a class immutable greatly increases the speed of accessors and +object construction. + +=item L - Builder methods and lazy_build + +The builder feature provides an inheritable and role-composable way to +provide a default attribute value. + +=item L + +Demonstrates using operator overloading, coercion, and subtypes to +model how eye color is determined during reproduction. + +=item L + +This recipe demonstrates the use of C and C to hook +into object construction. + +=item L + +In this recipe, we make a Moose-based subclass of L, a +module which does not use Moose itself. + +=item L + +Demonstrates the use of C method modifiers, a way of turning +the usual method overriding style "inside-out". + +=back + +=head2 Moose Roles + +These recipes will show you how to use Moose roles. + +=over 4 + +=item L + +Demonstrates roles, which are also sometimes known as traits or +mix-ins. Roles provide a method of code re-use which is orthogonal to +subclassing. + +=item L + +Sometimes you just want to include part of a role in your +class. Sometimes you want the whole role but one of its methods +conflicts with one in your class. With method exclusion and aliasing, +you can work around these problems. + +=item L + +In this recipe, we apply a role to an existing object instance. + +=back + +=head2 Meta Moose + +These recipes show you how to write your own meta classes, which lets +you extend the object system provided by Moose. + +=over 4 + +=item L + +If you're wondering what all this "meta" stuff is, and why you should +care about it, read this "recipe". + +=item L + +Extending Moose's attribute metaclass is a great way to add +functionality. However, attributes can only have one metaclass. +Applying roles to the attribute metaclass lets you provide +composable attribute functionality. + +=item L + +This recipe takes the class metaclass we saw in the previous recipe +and reimplements it as a metaclass trait. + +=item L + +This recipe shows a custom method metaclass that implements making a +method private. + +=item L + +This recipe shows an example of how you create your own meta-instance +class. The meta-instance determines the internal structure of object +instances and provide access to attribute slots. + +In this particular instance, we use a blessed glob reference as the instance +instead of a blessed hash reference. + +=item Hooking into immutabilization (TODO) + +Moose has a feature known as "immutabilization". By calling C<< +__PACKAGE__->meta()->make_immutable() >> after defining your class +(attributes, roles, etc), you tell Moose to optimize things like +object creation, attribute access, and so on. + +If you are creating your own metaclasses, you may need to hook into +the immutabilization system. This cuts across a number of spots, +including the metaclass class, meta method classes, and possibly the +meta-instance class as well. + +This recipe shows you how to write extensions which immutabilize +properly. + +=back + +=head2 Extending Moose + +These recipes cover some more ways to extend Moose, and will be useful +if you plan to write your own C module. + +=over 4 + +=item L + +There are quite a few ways to extend Moose. This recipe provides an +overview of each method, and provides recommendations for when each is +appropriate. + +=item L + +Many base object class extensions can be implemented as roles. This +example shows how to provide a base object class debugging role that +is applied to any class that uses a notional C +module. + +=item L + +This recipe shows how to provide a replacement for C. You +may want to do this as part of the API for a C module, +especially if you want to default to a new metaclass class or base +object class. + +=back + +=head1 SNACKS + +=over 4 + +=item L + +=item L + +=back + +=head1 Legacy Recipes + +These cover topics that are no longer considered best practice. We've kept +them in case in you encounter these usages in the wild. + +=over 4 + +=item L + +=item L + +=item L + +=back + +=head1 SEE ALSO + +=over 4 + +=item L + +=back + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Moose/Cookbook/Basics/BankAccount_MethodModifiersAndSubclassing.pod b/lib/Moose/Cookbook/Basics/BankAccount_MethodModifiersAndSubclassing.pod new file mode 100644 index 0000000..f4874e4 --- /dev/null +++ b/lib/Moose/Cookbook/Basics/BankAccount_MethodModifiersAndSubclassing.pod @@ -0,0 +1,384 @@ +# PODNAME: Moose::Cookbook::Basics::BankAccount_MethodModifiersAndSubclassing +# ABSTRACT: Demonstrates the use of method modifiers in a subclass + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Moose::Cookbook::Basics::BankAccount_MethodModifiersAndSubclassing - Demonstrates the use of method modifiers in a subclass + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + package BankAccount; + use Moose; + + has 'balance' => ( isa => 'Int', is => 'rw', default => 0 ); + + sub deposit { + my ( $self, $amount ) = @_; + $self->balance( $self->balance + $amount ); + } + + sub withdraw { + my ( $self, $amount ) = @_; + my $current_balance = $self->balance(); + ( $current_balance >= $amount ) + || confess "Account overdrawn"; + $self->balance( $current_balance - $amount ); + } + + package CheckingAccount; + use Moose; + + extends 'BankAccount'; + + has 'overdraft_account' => ( isa => 'BankAccount', is => 'rw' ); + + before 'withdraw' => sub { + my ( $self, $amount ) = @_; + my $overdraft_amount = $amount - $self->balance(); + if ( $self->overdraft_account && $overdraft_amount > 0 ) { + $self->overdraft_account->withdraw($overdraft_amount); + $self->deposit($overdraft_amount); + } + }; + +=head1 DESCRIPTION + +The first recipe demonstrated how to build very basic Moose classes, +focusing on creating and manipulating attributes. The objects in that +recipe were very data-oriented, and did not have much in the way of +behavior (i.e. methods). In this recipe, we expand upon the concepts +from the first recipe to include some real behavior. In particular, we +show how you can use a method modifier to implement new behavior for a +method. + +The classes in the SYNOPSIS show two kinds of bank account. A simple +bank account has one attribute, the balance, and two behaviors, +depositing and withdrawing money. + +We then extend the basic bank account in the CheckingAccount +class. This class adds another attribute, an overdraft account. It +also adds overdraft protection to the withdraw method. If you try to +withdraw more than you have, the checking account attempts to +reconcile the difference by withdrawing money from the overdraft +account. (1) + +The first class, B, introduces a new attribute feature, a +default value: + + has 'balance' => ( isa => 'Int', is => 'rw', default => 0 ); + +This says that a B has a C attribute, which has +an C type constraint, a read/write accessor, and a default value +of C<0>. This means that every instance of B that is +created will have its C slot initialized to C<0>, unless some +other value is provided to the constructor. + +The C and C methods should be fairly +self-explanatory, as they are just plain old Perl 5 OO. (2) + +As you know from the first recipe, the keyword C sets a +class's superclass. Here we see that B C +B. The next line introduces yet another new attribute +feature, class-based type constraints: + + has 'overdraft_account' => ( isa => 'BankAccount', is => 'rw' ); + +Up until now, we have only seen the C type constraint, which (as +we saw in the first recipe) is a builtin type constraint. The +C type constraint is new, and was actually defined the +moment we created the B class itself. In fact, Moose +creates a corresponding type constraint for every class in your +program (3). + +This means that in the first recipe, constraints for both C and +C were created. In this recipe, both C and +C type constraints are created automatically. Moose +does this as a convenience so that your classes and type constraint +can be kept in sync with one another. In short, Moose makes sure that +it will just DWIM (4). + +In B, we see another method modifier, the C +modifier. + + before 'withdraw' => sub { + my ( $self, $amount ) = @_; + my $overdraft_amount = $amount - $self->balance(); + if ( $self->overdraft_account && $overdraft_amount > 0 ) { + $self->overdraft_account->withdraw($overdraft_amount); + $self->deposit($overdraft_amount); + } + }; + +Just as with the C modifier from the first recipe, Moose will +handle calling the superclass method (in this case C<< +BankAccount->withdraw >>). + +The C modifier will (obviously) run I the code from +the superclass is run. Here, C modifier implements overdraft +protection by first checking if there are available funds in the +checking account. If not (and if there is an overdraft account +available), it transfers the amount needed into the checking +account (5). + +As with the method modifier in the first recipe, we could use +C to get the same effect: + + sub withdraw { + my ( $self, $amount ) = @_; + my $overdraft_amount = $amount - $self->balance(); + if ( $self->overdraft_account && $overdraft_amount > 0 ) { + $self->overdraft_account->withdraw($overdraft_amount); + $self->deposit($overdraft_amount); + } + $self->SUPER::withdraw($amount); + } + +The benefit of taking the method modifier approach is we do not need +to remember to call C and pass it the C<$amount> +argument when writing C<< CheckingAccount->withdraw >>. + +This is actually more than just a convenience for forgetful +programmers. Using method modifiers helps isolate subclasses from +changes in the superclasses. For instance, if B<< +BankAccount->withdraw >> were to add an additional argument of some +kind, the version of B<< CheckingAccount->withdraw >> which uses +C would not pass that extra argument correctly, +whereas the method modifier version would automatically pass along all +arguments correctly. + +Just as with the first recipe, object instantiation uses the C +method, which accepts named parameters. + + my $savings_account = BankAccount->new( balance => 250 ); + + my $checking_account = CheckingAccount->new( + balance => 100, + overdraft_account => $savings_account, + ); + +And as with the first recipe, a more in-depth example can be found in +the F test file. + +=head1 CONCLUSION + +This recipe expanded on the basic concepts from the first recipe with +a more "real world" use case. + +=head1 FOOTNOTES + +=over 4 + +=item (1) + +If you're paying close attention, you might realize that there's a +circular loop waiting to happen here. A smarter example would have to +make sure that we don't accidentally create a loop between the +checking account and its overdraft account. + +=item (2) + +Note that for simple methods like these, which just manipulate some +single piece of data, it is often not necessary to write them at all. +For instance, C could be implemented via the C native +delegation for counters - see +L for more specifics, +and L for a broader overview. + +=item (3) + +In reality, this creation is sensitive to the order in which modules +are loaded. In more complicated cases, you may find that you need to +explicitly declare a class type before the corresponding class is +loaded. + +=item (4) + +Moose does not attempt to encode a class's is-a relationships within +the type constraint hierarchy. Instead, Moose just considers the class +type constraint to be a subtype of C, and specializes the +constraint check to allow for subclasses. This means that an instance +of B will pass a C type constraint +successfully. For more details, please refer to the +L documentation. + +=item (5) + +If the overdraft account does not have the amount needed, it will +throw an error. Of course, the overdraft account could also have +overdraft protection. See note 1. + +=back + +=head1 ACKNOWLEDGMENT + +The BankAccount example in this recipe is directly taken from the +examples in this chapter of "Practical Common Lisp": + +L + +=begin testing + +my $savings_account; + +{ + $savings_account = BankAccount->new( balance => 250 ); + isa_ok( $savings_account, 'BankAccount' ); + + is( $savings_account->balance, 250, '... got the right savings balance' ); + is( + exception { + $savings_account->withdraw(50); + }, + undef, + '... withdrew from savings successfully' + ); + is( $savings_account->balance, 200, + '... got the right savings balance after withdrawal' ); + + $savings_account->deposit(150); + is( $savings_account->balance, 350, + '... got the right savings balance after deposit' ); +} + +{ + my $checking_account = CheckingAccount->new( + balance => 100, + overdraft_account => $savings_account + ); + isa_ok( $checking_account, 'CheckingAccount' ); + isa_ok( $checking_account, 'BankAccount' ); + + is( $checking_account->overdraft_account, $savings_account, + '... got the right overdraft account' ); + + is( $checking_account->balance, 100, + '... got the right checkings balance' ); + + is( + exception { + $checking_account->withdraw(50); + }, + undef, + '... withdrew from checking successfully' + ); + is( $checking_account->balance, 50, + '... got the right checkings balance after withdrawal' ); + is( $savings_account->balance, 350, + '... got the right savings balance after checking withdrawal (no overdraft)' + ); + + is( + exception { + $checking_account->withdraw(200); + }, + undef, + '... withdrew from checking successfully' + ); + is( $checking_account->balance, 0, + '... got the right checkings balance after withdrawal' ); + is( $savings_account->balance, 200, + '... got the right savings balance after overdraft withdrawal' ); +} + +{ + my $checking_account = CheckingAccount->new( + balance => 100 + + # no overdraft account + ); + isa_ok( $checking_account, 'CheckingAccount' ); + isa_ok( $checking_account, 'BankAccount' ); + + is( $checking_account->overdraft_account, undef, + '... no overdraft account' ); + + is( $checking_account->balance, 100, + '... got the right checkings balance' ); + + is( + exception { + $checking_account->withdraw(50); + }, + undef, + '... withdrew from checking successfully' + ); + is( $checking_account->balance, 50, + '... got the right checkings balance after withdrawal' ); + + isnt( + exception { + $checking_account->withdraw(200); + }, + undef, + '... withdrawal failed due to attempted overdraft' + ); + is( $checking_account->balance, 50, + '... got the right checkings balance after withdrawal failure' ); +} + +=end testing + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Moose/Cookbook/Basics/BinaryTree_AttributeFeatures.pod b/lib/Moose/Cookbook/Basics/BinaryTree_AttributeFeatures.pod new file mode 100644 index 0000000..09cdf3f --- /dev/null +++ b/lib/Moose/Cookbook/Basics/BinaryTree_AttributeFeatures.pod @@ -0,0 +1,397 @@ +# PODNAME: Moose::Cookbook::Basics::BinaryTree_AttributeFeatures +# ABSTRACT: Demonstrates various attribute features including lazy, predicates, weak refs, and more + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Moose::Cookbook::Basics::BinaryTree_AttributeFeatures - Demonstrates various attribute features including lazy, predicates, weak refs, and more + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + package BinaryTree; + use Moose; + + has 'node' => ( is => 'rw', isa => 'Any' ); + + has 'parent' => ( + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_parent', + weak_ref => 1, + ); + + has 'left' => ( + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_left', + lazy => 1, + default => sub { BinaryTree->new( parent => $_[0] ) }, + trigger => \&_set_parent_for_child + ); + + has 'right' => ( + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_right', + lazy => 1, + default => sub { BinaryTree->new( parent => $_[0] ) }, + trigger => \&_set_parent_for_child + ); + + sub _set_parent_for_child { + my ( $self, $child ) = @_; + + confess "You cannot insert a tree which already has a parent" + if $child->has_parent; + + $child->parent($self); + } + +=head1 DESCRIPTION + +This recipe shows how various advanced attribute features can be used +to create complex and powerful behaviors. In particular, we introduce +a number of new attribute options, including C, C, +and C. + +The example class is a classic binary tree. Each node in the tree is +itself an instance of C. It has a C, which holds +some arbitrary value. It has C and C attributes, which +refer to its child trees, and a C. + +Let's take a look at the C attribute: + + has 'node' => ( is => 'rw', isa => 'Any' ); + +Moose generates a read-write accessor for this attribute. The type +constraint is C, which literally means it can contain anything. + +We could have left out the C option, but in this case, we are +including it for the benefit of other programmers, not the computer. + +Next, let's move on to the C attribute: + + has 'parent' => ( + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_parent', + weak_ref => 1, + ); + +Again, we have a read-write accessor. This time, the C option +says that this attribute must always be an instance of +C. In the second recipe, we saw that every time we create +a Moose-based class, we also get a corresponding class type +constraint. + +The C option is new. It creates a method which can be used +to check whether or not a given attribute has been initialized. In +this case, the method is named C. + +This brings us to our last attribute option, C. Since +C is a circular reference (the tree in C should +already have a reference to this one, in its C or C +attribute), we want to make sure that we weaken the reference to avoid +memory leaks. If C is true, it alters the accessor function +so that the reference is weakened when it is set. + +Finally, we have the C and C attributes. They are +essentially identical except for their names, so we'll just look at +C: + + has 'left' => ( + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_left', + lazy => 1, + default => sub { BinaryTree->new( parent => $_[0] ) }, + trigger => \&_set_parent_for_child + ); + +There are three new options here, C, C, and +C. The C and C options are linked. In fact, +you cannot have a C attribute unless it has a C +(or a C, but we'll cover that later). If you try to make an +attribute lazy without a default, class creation will fail with an +exception. (2) + +In the second recipe the B's C attribute had a +default value of C<0>. Given a non-reference, Perl copies the +I. However, given a reference, it does not do a deep clone, +instead simply copying the reference. If you just specified a simple +reference for a default, Perl would create it once and it would be +shared by all objects with that attribute. + +As a workaround, we use an anonymous subroutine to generate a new +reference every time the default is called. + + has 'foo' => ( is => 'rw', default => sub { [] } ); + +In fact, using a non-subroutine reference as a default is illegal in Moose. + + # will fail + has 'foo' => ( is => 'rw', default => [] ); + +This will blow up, so don't do it. + +You'll notice that we use C<$_[0]> in our default sub. When the +default subroutine is executed, it is called as a method on the +object. + +In our case, we're making a new C object in our default, +with the current tree as the parent. + +Normally, when an object is instantiated, any defaults are evaluated +immediately. With our C class, this would be a big +problem! We'd create the first object, which would immediately try to +populate its C and C attributes, which would create a new +C, which would populate I C and C +slots. Kaboom! + +By making our C and C attributes C, we avoid this +problem. If the attribute has a value when it is read, the default is +never executed at all. + +We still have one last bit of behavior to add. The autogenerated +C and C accessors are not quite correct. When one of +these is set, we want to make sure that we update the parent of the +C or C attribute's tree. + +We could write our own accessors, but then why use Moose at all? +Instead, we use a C. A C accepts a subroutine +reference, which will be called as a method whenever the attribute is +set. This can happen both during object construction or later by +passing a new object to the attribute's accessor method. However, it +is not called when a value is provided by a C or C. + + sub _set_parent_for_child { + my ( $self, $child ) = @_; + + confess "You cannot insert a tree which already has a parent" + if $child->has_parent; + + $child->parent($self); + } + +This trigger does two things. First, it ensures that the new child +node does not already have a parent. This is done for the sake of +simplifying the example. If we wanted to be more clever, we would +remove the child from its old parent tree and add it to the new one. + +If the child has no parent, we will add it to the current tree, and we +ensure that is has the correct value for its C attribute. + +As with all the other recipes, B can be used just like any +other Perl 5 class. A more detailed example of its usage can be found +in F. + +=head1 CONCLUSION + +This recipe introduced several of Moose's advanced features. We hope +that this inspires you to think of other ways these features can be +used to simplify your code. + +=head1 FOOTNOTES + +=over 4 + +=item (1) + +Weak references are tricky things, and should be used sparingly and +appropriately (such as in the case of circular refs). If you are not +careful, attribute values could disappear "mysteriously" because +Perl's reference counting garbage collector has gone and removed the +item you are weak-referencing. + +In short, don't use them unless you know what you are doing :) + +=item (2) + +You I use the C option without the C option if you +like, as we showed in the second recipe. + +Also, you can use C instead of C. See +L for details. + +=back + +=begin testing + +use Scalar::Util 'isweak'; + +my $root = BinaryTree->new(node => 'root'); +isa_ok($root, 'BinaryTree'); + +is($root->node, 'root', '... got the right node value'); + +ok(!$root->has_left, '... no left node yet'); +ok(!$root->has_right, '... no right node yet'); + +ok(!$root->has_parent, '... no parent for root node'); + +# make a left node + +my $left = $root->left; +isa_ok($left, 'BinaryTree'); + +is($root->left, $left, '... got the same node (and it is $left)'); +ok($root->has_left, '... we have a left node now'); + +ok($left->has_parent, '... lefts has a parent'); +is($left->parent, $root, '... lefts parent is the root'); + +ok(isweak($left->{parent}), '... parent is a weakened ref'); + +ok(!$left->has_left, '... $left no left node yet'); +ok(!$left->has_right, '... $left no right node yet'); + +is($left->node, undef, '... left has got no node value'); + +is( + exception { + $left->node('left'); + }, + undef, + '... assign to lefts node' +); + +is($left->node, 'left', '... left now has a node value'); + +# make a right node + +ok(!$root->has_right, '... still no right node yet'); + +is($root->right->node, undef, '... right has got no node value'); + +ok($root->has_right, '... now we have a right node'); + +my $right = $root->right; +isa_ok($right, 'BinaryTree'); + +is( + exception { + $right->node('right'); + }, + undef, + '... assign to rights node' +); + +is($right->node, 'right', '... left now has a node value'); + +is($root->right, $right, '... got the same node (and it is $right)'); +ok($root->has_right, '... we have a right node now'); + +ok($right->has_parent, '... rights has a parent'); +is($right->parent, $root, '... rights parent is the root'); + +ok(isweak($right->{parent}), '... parent is a weakened ref'); + +# make a left node of the left node + +my $left_left = $left->left; +isa_ok($left_left, 'BinaryTree'); + +ok($left_left->has_parent, '... left does have a parent'); + +is($left_left->parent, $left, '... got a parent node (and it is $left)'); +ok($left->has_left, '... we have a left node now'); +is($left->left, $left_left, '... got a left node (and it is $left_left)'); + +ok(isweak($left_left->{parent}), '... parent is a weakened ref'); + +# make a right node of the left node + +my $left_right = BinaryTree->new; +isa_ok($left_right, 'BinaryTree'); + +is( + exception { + $left->right($left_right); + }, + undef, + '... assign to rights node' +); + +ok($left_right->has_parent, '... left does have a parent'); + +is($left_right->parent, $left, '... got a parent node (and it is $left)'); +ok($left->has_right, '... we have a left node now'); +is($left->right, $left_right, '... got a left node (and it is $left_left)'); + +ok(isweak($left_right->{parent}), '... parent is a weakened ref'); + +# and check the error + +isnt( + exception { + $left_right->right($left_left); + }, + undef, + '... cannot assign a node which already has a parent' +); + +=end testing + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Moose/Cookbook/Basics/BinaryTree_BuilderAndLazyBuild.pod b/lib/Moose/Cookbook/Basics/BinaryTree_BuilderAndLazyBuild.pod new file mode 100644 index 0000000..025968a --- /dev/null +++ b/lib/Moose/Cookbook/Basics/BinaryTree_BuilderAndLazyBuild.pod @@ -0,0 +1,176 @@ +# PODNAME: Moose::Cookbook::Basics::BinaryTree_BuilderAndLazyBuild +# ABSTRACT: Builder methods and lazy_build + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Moose::Cookbook::Basics::BinaryTree_BuilderAndLazyBuild - Builder methods and lazy_build + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + package BinaryTree; + use Moose; + + has 'node' => (is => 'rw', isa => 'Any'); + + has 'parent' => ( + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_parent', + weak_ref => 1, + ); + + has 'left' => ( + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_left', + lazy => 1, + builder => '_build_child_tree', + ); + + has 'right' => ( + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_right', + lazy => 1, + builder => '_build_child_tree', + ); + + before 'right', 'left' => sub { + my ($self, $tree) = @_; + $tree->parent($self) if defined $tree; + }; + + sub _build_child_tree { + my $self = shift; + + return BinaryTree->new( parent => $self ); + } + +=head1 DESCRIPTION + +If you've already read +L, then this example +should look very familiar. In fact, all we've done here is replace the +attribute's C parameter with a C. + +In this particular case, the C and C options act in +exactly the same way. When the C or C attribute is read, +Moose calls the builder method to initialize the attribute. + +Note that Moose calls the builder method I. Here's an example: + + my $tree = BinaryTree->new(); + + my $left = $tree->left(); + +When C<< $tree->left() >> is called, Moose calls C<< +$tree->_build_child_tree() >> in order to populate the C +attribute. If we had passed C to the original constructor, the +builder would not be called. + +There are some differences between C and C. Notably, +a builder is subclassable, and can be composed from a role. See +L for more details. + +=head2 The lazy_build shortcut + +The C attribute option can be used as sugar to specify +a whole set of attribute options at once: + + has 'animal' => ( + is => 'ro', + isa => 'Animal', + lazy_build => 1, + ); + +This is a shorthand for: + + has 'animal' => ( + is => 'ro', + isa => 'Animal', + required => 1, + lazy => 1, + builder => '_build_animal', + predicate => 'has_animal', + clearer => 'clear_animal', + ); + +If your attribute starts with an underscore, Moose is smart and will +do the right thing with the C and C, making them +both start with an underscore. The C method I starts +with an underscore. + +You can read more about C in L + +=head1 CONCLUSION + +The C option is a more OO-friendly version of the C +functionality. It also separates the default-generating code into a +well-defined method. Sprinkling your attribute definitions with +anonymous subroutines can be quite ugly and hard to follow. + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Moose/Cookbook/Basics/Company_Subtypes.pod b/lib/Moose/Cookbook/Basics/Company_Subtypes.pod new file mode 100644 index 0000000..1b062f5 --- /dev/null +++ b/lib/Moose/Cookbook/Basics/Company_Subtypes.pod @@ -0,0 +1,602 @@ +# PODNAME: Moose::Cookbook::Basics::Company_Subtypes +# ABSTRACT: Demonstrates the use of subtypes and how to model classes related to companies, people, employees, etc. + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Moose::Cookbook::Basics::Company_Subtypes - Demonstrates the use of subtypes and how to model classes related to companies, people, employees, etc. + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + package Address; + use Moose; + use Moose::Util::TypeConstraints; + + use Locale::US; + use Regexp::Common 'zip'; + + my $STATES = Locale::US->new; + subtype 'USState' + => as Str + => where { + ( exists $STATES->{code2state}{ uc($_) } + || exists $STATES->{state2code}{ uc($_) } ); + }; + + subtype 'USZipCode' + => as Value + => where { + /^$RE{zip}{US}{-extended => 'allow'}$/; + }; + + has 'street' => ( is => 'rw', isa => 'Str' ); + has 'city' => ( is => 'rw', isa => 'Str' ); + has 'state' => ( is => 'rw', isa => 'USState' ); + has 'zip_code' => ( is => 'rw', isa => 'USZipCode' ); + + package Company; + use Moose; + use Moose::Util::TypeConstraints; + + has 'name' => ( is => 'rw', isa => 'Str', required => 1 ); + has 'address' => ( is => 'rw', isa => 'Address' ); + has 'employees' => ( + is => 'rw', + isa => 'ArrayRef[Employee]', + default => sub { [] }, + ); + + sub BUILD { + my ( $self, $params ) = @_; + foreach my $employee ( @{ $self->employees } ) { + $employee->employer($self); + } + } + + after 'employees' => sub { + my ( $self, $employees ) = @_; + return unless $employees; + foreach my $employee ( @$employees ) { + $employee->employer($self); + } + }; + + package Person; + use Moose; + + has 'first_name' => ( is => 'rw', isa => 'Str', required => 1 ); + has 'last_name' => ( is => 'rw', isa => 'Str', required => 1 ); + has 'middle_initial' => ( + is => 'rw', isa => 'Str', + predicate => 'has_middle_initial' + ); + has 'address' => ( is => 'rw', isa => 'Address' ); + + sub full_name { + my $self = shift; + return $self->first_name + . ( + $self->has_middle_initial + ? ' ' . $self->middle_initial . '. ' + : ' ' + ) . $self->last_name; + } + + package Employee; + use Moose; + + extends 'Person'; + + has 'title' => ( is => 'rw', isa => 'Str', required => 1 ); + has 'employer' => ( is => 'rw', isa => 'Company', weak_ref => 1 ); + + override 'full_name' => sub { + my $self = shift; + super() . ', ' . $self->title; + }; + +=head1 DESCRIPTION + +This recipe introduces the C sugar function from +L. The C function lets you +declaratively create type constraints without building an entire +class. + +In the recipe we also make use of L and L +to build constraints, showing how constraints can make use of existing +CPAN tools for data validation. + +Finally, we introduce the C attribute option. + +In the C
class we define two subtypes. The first uses the +L module to check the validity of a state. It accepts +either a state abbreviation of full name. + +A state will be passed in as a string, so we make our C type +a subtype of Moose's builtin C type. This is done using the C +sugar. The actual constraint is defined using C. This function +accepts a single subroutine reference. That subroutine will be called +with the value to be checked in C<$_> (1). It is expected to return a +true or false value indicating whether the value is valid for the +type. + +We can now use the C type just like Moose's builtin types: + + has 'state' => ( is => 'rw', isa => 'USState' ); + +When the C attribute is set, the value is checked against the +C constraint. If the value is not valid, an exception will be +thrown. + +The next C, C, uses +L. L includes a regex for validating +US zip codes. We use this constraint for the C attribute. + + subtype 'USZipCode' + => as Value + => where { + /^$RE{zip}{US}{-extended => 'allow'}$/; + }; + +Using a subtype instead of requiring a class for each type greatly +simplifies the code. We don't really need a class for these types, as +they're just strings, but we do want to ensure that they're valid. + +The type constraints we created are reusable. Type constraints are +stored by name in a global registry, which means that we can refer to +them in other classes. Because the registry is global, we do recommend +that you use some sort of namespacing in real applications, +like C (just as you would do with class names). + +These two subtypes allow us to define a simple C
class. + +Then we define our C class, which has an address. As we saw +in earlier recipes, Moose automatically creates a type constraint for +each our classes, so we can use that for the C class's +C
attribute: + + has 'address' => ( is => 'rw', isa => 'Address' ); + +A company also needs a name: + + has 'name' => ( is => 'rw', isa => 'Str', required => 1 ); + +This introduces a new attribute option, C. If an attribute +is required, then it must be passed to the class's constructor, or an +exception will be thrown. It's important to understand that a +C attribute can still be false or C, if its type +constraint allows that. + +The next attribute, C, uses a I type +constraint: + + has 'employees' => ( + is => 'rw', + isa => 'ArrayRef[Employee]' + default => sub { [] }, + ); + +This constraint says that C must be an array reference +where each element of the array is an C object. It's worth +noting that an I array reference also satisfies this +constraint, such as the value given as the default here. + +Parameterizable type constraints (or "container types"), such as +C, can be made more specific with a type parameter. In +fact, we can arbitrarily nest these types, producing something like +C. However, you can also just use the type by +itself, so C is legal. (2) + +If you jump down to the definition of the C class, you will +see that it has an C attribute. + +When we set the C for a C we want to make sure +that each of these employee objects refers back to the right +C in its C attribute. + +To do that, we need to hook into object construction. Moose lets us do +this by writing a C method in our class. When your class +defines a C method, it will be called by the constructor +immediately after object construction, but before the object is returned +to the caller. Note that all C methods in your class hierarchy +will be called automatically; there is no need to (and you should not) +call the superclass C method. + +The C class uses the C method to ensure that each +employee of a company has the proper C object in its +C attribute: + + sub BUILD { + my ( $self, $params ) = @_; + foreach my $employee ( @{ $self->employees } ) { + $employee->employer($self); + } + } + +The C method is executed after type constraints are checked, so it is +safe to assume that if C<< $self->employees >> has a value, it will be an +array reference, and that the elements of that array reference will be +C objects. + +We also want to make sure that whenever the C attribute for +a C is changed, we also update the C for each +employee. + +To do this we can use an C modifier: + + after 'employees' => sub { + my ( $self, $employees ) = @_; + return unless $employees; + foreach my $employee ( @$employees ) { + $employee->employer($self); + } + }; + +Again, as with the C method, we know that the type constraint check has +already happened, so we know that if C<$employees> is defined it will contain +an array reference of C objects. + +Note that C is a read/write accessor, so we must return early if +it's called as a reader. + +The B class does not really demonstrate anything new. It has several +C attributes. It also has a C method, which we +first used in L. + +The only new feature in the C class is the C +method modifier: + + override 'full_name' => sub { + my $self = shift; + super() . ', ' . $self->title; + }; + +This is just a sugary alternative to Perl's built in C +feature. However, there is one difference. You cannot pass any +arguments to C. Instead, Moose simply passes the same +parameters that were passed to the method. + +A more detailed example of usage can be found in +F. + +=for testing-SETUP use Test::Requires { + 'Locale::US' => '0', + 'Regexp::Common' => '0', +}; + +=head1 CONCLUSION + +This recipe was intentionally longer and more complex. It illustrates +how Moose classes can be used together with type constraints, as well +as the density of information that you can get out of a small amount +of typing when using Moose. + +This recipe also introduced the C function, the C +attribute, and the C method modifier. + +We will revisit type constraints in future recipes, and cover type +coercion as well. + +=head1 FOOTNOTES + +=over 4 + +=item (1) + +The value being checked is also passed as the first argument to +the C block, so it can be accessed as C<$_[0]>. + +=item (2) + +Note that C will not work. Moose will not parse this as a +container type, and instead you will have a new type named +"ArrayRef[]", which doesn't make any sense. + +=back + +=begin testing + +{ + package Company; + + sub get_employee_count { scalar @{(shift)->employees} } +} + +use Scalar::Util 'isweak'; + +my $ii; +is( + exception { + $ii = Company->new( + { + name => 'Infinity Interactive', + address => Address->new( + street => '565 Plandome Rd., Suite 307', + city => 'Manhasset', + state => 'NY', + zip_code => '11030' + ), + employees => [ + Employee->new( + first_name => 'Jeremy', + last_name => 'Shao', + title => 'President / Senior Consultant', + address => Address->new( + city => 'Manhasset', state => 'NY' + ) + ), + Employee->new( + first_name => 'Tommy', + last_name => 'Lee', + title => 'Vice President / Senior Developer', + address => + Address->new( city => 'New York', state => 'NY' ) + ), + Employee->new( + first_name => 'Stevan', + middle_initial => 'C', + last_name => 'Little', + title => 'Senior Developer', + address => + Address->new( city => 'Madison', state => 'CT' ) + ), + ] + } + ); + }, + undef, + '... created the entire company successfully' +); + +isa_ok( $ii, 'Company' ); + +is( $ii->name, 'Infinity Interactive', + '... got the right name for the company' ); + +isa_ok( $ii->address, 'Address' ); +is( $ii->address->street, '565 Plandome Rd., Suite 307', + '... got the right street address' ); +is( $ii->address->city, 'Manhasset', '... got the right city' ); +is( $ii->address->state, 'NY', '... got the right state' ); +is( $ii->address->zip_code, 11030, '... got the zip code' ); + +is( $ii->get_employee_count, 3, '... got the right employee count' ); + +# employee #1 + +isa_ok( $ii->employees->[0], 'Employee' ); +isa_ok( $ii->employees->[0], 'Person' ); + +is( $ii->employees->[0]->first_name, 'Jeremy', + '... got the right first name' ); +is( $ii->employees->[0]->last_name, 'Shao', '... got the right last name' ); +ok( !$ii->employees->[0]->has_middle_initial, '... no middle initial' ); +is( $ii->employees->[0]->middle_initial, undef, + '... got the right middle initial value' ); +is( $ii->employees->[0]->full_name, + 'Jeremy Shao, President / Senior Consultant', + '... got the right full name' ); +is( $ii->employees->[0]->title, 'President / Senior Consultant', + '... got the right title' ); +is( $ii->employees->[0]->employer, $ii, '... got the right company' ); +ok( isweak( $ii->employees->[0]->{employer} ), + '... the company is a weak-ref' ); + +isa_ok( $ii->employees->[0]->address, 'Address' ); +is( $ii->employees->[0]->address->city, 'Manhasset', + '... got the right city' ); +is( $ii->employees->[0]->address->state, 'NY', '... got the right state' ); + +# employee #2 + +isa_ok( $ii->employees->[1], 'Employee' ); +isa_ok( $ii->employees->[1], 'Person' ); + +is( $ii->employees->[1]->first_name, 'Tommy', + '... got the right first name' ); +is( $ii->employees->[1]->last_name, 'Lee', '... got the right last name' ); +ok( !$ii->employees->[1]->has_middle_initial, '... no middle initial' ); +is( $ii->employees->[1]->middle_initial, undef, + '... got the right middle initial value' ); +is( $ii->employees->[1]->full_name, + 'Tommy Lee, Vice President / Senior Developer', + '... got the right full name' ); +is( $ii->employees->[1]->title, 'Vice President / Senior Developer', + '... got the right title' ); +is( $ii->employees->[1]->employer, $ii, '... got the right company' ); +ok( isweak( $ii->employees->[1]->{employer} ), + '... the company is a weak-ref' ); + +isa_ok( $ii->employees->[1]->address, 'Address' ); +is( $ii->employees->[1]->address->city, 'New York', + '... got the right city' ); +is( $ii->employees->[1]->address->state, 'NY', '... got the right state' ); + +# employee #3 + +isa_ok( $ii->employees->[2], 'Employee' ); +isa_ok( $ii->employees->[2], 'Person' ); + +is( $ii->employees->[2]->first_name, 'Stevan', + '... got the right first name' ); +is( $ii->employees->[2]->last_name, 'Little', '... got the right last name' ); +ok( $ii->employees->[2]->has_middle_initial, '... got middle initial' ); +is( $ii->employees->[2]->middle_initial, 'C', + '... got the right middle initial value' ); +is( $ii->employees->[2]->full_name, 'Stevan C. Little, Senior Developer', + '... got the right full name' ); +is( $ii->employees->[2]->title, 'Senior Developer', + '... got the right title' ); +is( $ii->employees->[2]->employer, $ii, '... got the right company' ); +ok( isweak( $ii->employees->[2]->{employer} ), + '... the company is a weak-ref' ); + +isa_ok( $ii->employees->[2]->address, 'Address' ); +is( $ii->employees->[2]->address->city, 'Madison', '... got the right city' ); +is( $ii->employees->[2]->address->state, 'CT', '... got the right state' ); + +# create new company + +my $new_company + = Company->new( name => 'Infinity Interactive International' ); +isa_ok( $new_company, 'Company' ); + +my $ii_employees = $ii->employees; +foreach my $employee (@$ii_employees) { + is( $employee->employer, $ii, '... has the ii company' ); +} + +$new_company->employees($ii_employees); + +foreach my $employee ( @{ $new_company->employees } ) { + is( $employee->employer, $new_company, + '... has the different company now' ); +} + +## check some error conditions for the subtypes + +isnt( + exception { + Address->new( street => {} ),; + }, + undef, + '... we die correctly with bad args' +); + +isnt( + exception { + Address->new( city => {} ),; + }, + undef, + '... we die correctly with bad args' +); + +isnt( + exception { + Address->new( state => 'British Columbia' ),; + }, + undef, + '... we die correctly with bad args' +); + +is( + exception { + Address->new( state => 'Connecticut' ),; + }, + undef, + '... we live correctly with good args' +); + +isnt( + exception { + Address->new( zip_code => 'AF5J6$' ),; + }, + undef, + '... we die correctly with bad args' +); + +is( + exception { + Address->new( zip_code => '06443' ),; + }, + undef, + '... we live correctly with good args' +); + +isnt( + exception { + Company->new(),; + }, + undef, + '... we die correctly without good args' +); + +is( + exception { + Company->new( name => 'Foo' ),; + }, + undef, + '... we live correctly without good args' +); + +isnt( + exception { + Company->new( name => 'Foo', employees => [ Person->new ] ),; + }, + undef, + '... we die correctly with good args' +); + +is( + exception { + Company->new( name => 'Foo', employees => [] ),; + }, + undef, + '... we live correctly with good args' +); + +=end testing + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Moose/Cookbook/Basics/DateTime_ExtendingNonMooseParent.pod b/lib/Moose/Cookbook/Basics/DateTime_ExtendingNonMooseParent.pod new file mode 100644 index 0000000..89ef739 --- /dev/null +++ b/lib/Moose/Cookbook/Basics/DateTime_ExtendingNonMooseParent.pod @@ -0,0 +1,134 @@ +# PODNAME: Moose::Cookbook::Basics::DateTime_ExtendingNonMooseParent +# ABSTRACT: Extending a non-Moose parent class + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Moose::Cookbook::Basics::DateTime_ExtendingNonMooseParent - Extending a non-Moose parent class + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + package My::DateTime; + + use Moose; + use MooseX::NonMoose; + use DateTime::Calendar::Mayan; + extends qw( DateTime ); + + has 'mayan_date' => ( + is => 'ro', + isa => 'DateTime::Calendar::Mayan', + init_arg => undef, + lazy => 1, + builder => '_build_mayan_date', + clearer => '_clear_mayan_date', + predicate => 'has_mayan_date', + ); + + after 'set' => sub { + $_[0]->_clear_mayan_date; + }; + + sub _build_mayan_date { + DateTime::Calendar::Mayan->from_object( object => $_[0] ); + } + +=head1 DESCRIPTION + +This recipe demonstrates how to use Moose to subclass a parent which +is not Moose based. This recipe only works if the parent class uses a +blessed hash reference for object instances. If your parent is doing +something funkier, you should check out L and L. + +The meat of this recipe is contained in L, which does all +the grunt work for you. + +=begin testing-SETUP + +# because MooseX::NonMoose has a version requirement +BEGIN { $Moose::Role::VERSION = 9999 unless $Moose::Role::VERSION } + +use Test::Requires { + 'DateTime' => '0', + 'DateTime::Calendar::Mayan' => '0', + 'MooseX::NonMoose' => '0.25', +}; + +=end testing-SETUP + +=begin testing + +my $dt = My::DateTime->new( year => 1970, month => 2, day => 24 ); + +can_ok( $dt, 'mayan_date' ); +isa_ok( $dt->mayan_date, 'DateTime::Calendar::Mayan' ); +is( $dt->mayan_date->date, '12.17.16.9.19', 'got expected mayan date' ); + +$dt->set( year => 2009 ); +ok( ! $dt->has_mayan_date, 'mayan_date is cleared after call to ->set' ); + +=end testing + +=head1 AUTHORS + +=over 4 + +=item * + +Stevan Little + +=item * + +Dave Rolsky + +=item * + +Jesse Luehrs + +=item * + +Shawn M Moore + +=item * + +יובל קוג'מן (Yuval Kogman) + +=item * + +Karen Etheridge + +=item * + +Florian Ragwitz + +=item * + +Hans Dieter Pearcey + +=item * + +Chris Prather + +=item * + +Matt S Trout + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2006 by Infinity Interactive, Inc.. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff --git a/lib/Moose/Cookbook/Basics/Document_AugmentAndInner.pod b/lib/Moose/Cookbook/Basics/Document_AugmentAndInner.pod new file mode 100644 index 0000000..1551745 --- /dev/null +++ b/lib/Moose/Cookbook/Basics/Document_AugmentAndInner.pod @@ -0,0 +1,197 @@ +# PODNAME: Moose::Cookbook::Basics::Document_AugmentAndInner +# ABSTRACT: The augment modifier, which turns normal method overriding "inside-out" + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Moose::Cookbook::Basics::Document_AugmentAndInner - The augment modifier, which turns normal method overriding "inside-out" + +=head1 VERSION + +version 2.1405 + +=head1 SYNOPSIS + + package Document::Page; + use Moose; + + has 'body' => ( is => 'rw', isa => 'Str', default => sub {''} ); + + sub create { + my $self = shift; + $self->open_page; + inner(); + $self->close_page; + } + + sub append_body { + my ( $self, $appendage ) = @_; + $self->body( $self->body . $appendage ); + } + + sub open_page { (shift)->append_body('') } + sub close_page { (shift)->append_body('') } + + package Document::PageWithHeadersAndFooters; + use Moose; + + extends 'Document::Page'; + + augment 'create' => sub { + my $self = shift; + $self->create_header; + inner(); + $self->create_footer; + }; + + sub create_header { (shift)->append_body('
') } + sub create_footer { (shift)->append_body('