From: Dave Rolsky Date: Tue, 29 Jul 2008 17:45:41 +0000 (+0000) Subject: Reorganized all the recipes so they're broken into subsections, and X-Git-Tag: 0_55~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=021b8139fcacfbd1c0d4dc26e07936457f1ba12b;p=gitmo%2FMoose.git Reorganized all the recipes so they're broken into subsections, and numbered internally in each subsection, as opposed to globally. --- diff --git a/Changes b/Changes index 2996f0a..0a785c0 100644 --- a/Changes +++ b/Changes @@ -11,8 +11,12 @@ Revision history for Perl extension Moose the type constraints (RT #37569) - added tests for this (Charles Alderman) - * Moose::Cookbook::Recipe12 - - A new recipe that shows off operator overloading + * Moose::Cookbook + - reorganized the recipes into sections - Basics, Roles, Meta + (Dave Rolsky) + + * Moose::Cookbook::Basics::Recipe10 + - A new recipe that demonstrates operator overloading in combination with Moose. (bluefeet) 0.54 Thurs. July 3, 2008 diff --git a/MANIFEST b/MANIFEST index cf41243..d83b67f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -13,19 +13,20 @@ inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/Moose.pm lib/Moose/Cookbook.pod +lib/Moose/Cookbook/Basics/Recipe1.pod +lib/Moose/Cookbook/Basics/Recipe10.pod +lib/Moose/Cookbook/Basics/Recipe2.pod +lib/Moose/Cookbook/Basics/Recipe3.pod +lib/Moose/Cookbook/Basics/Recipe4.pod +lib/Moose/Cookbook/Basics/Recipe5.pod +lib/Moose/Cookbook/Basics/Recipe6.pod +lib/Moose/Cookbook/Basics/Recipe7.pod +lib/Moose/Cookbook/Basics/Recipe9.pod lib/Moose/Cookbook/FAQ.pod -lib/Moose/Cookbook/Recipe1.pod -lib/Moose/Cookbook/Recipe10.pod -lib/Moose/Cookbook/Recipe11.pod -lib/Moose/Cookbook/Recipe2.pod -lib/Moose/Cookbook/Recipe21.pod -lib/Moose/Cookbook/Recipe22.pod -lib/Moose/Cookbook/Recipe3.pod -lib/Moose/Cookbook/Recipe4.pod -lib/Moose/Cookbook/Recipe5.pod -lib/Moose/Cookbook/Recipe6.pod -lib/Moose/Cookbook/Recipe7.pod -lib/Moose/Cookbook/Recipe9.pod +lib/Moose/Cookbook/Meta/Recipe2.pod +lib/Moose/Cookbook/Meta/Recipe3.pod +lib/Moose/Cookbook/Roles/Recipe1.pod +lib/Moose/Cookbook/Roles/Recipe2.pod lib/Moose/Cookbook/Snack/Keywords.pod lib/Moose/Cookbook/Snack/Types.pod lib/Moose/Cookbook/Style.pod @@ -72,16 +73,17 @@ MANIFEST.SKIP META.yml README t/000_load.t -t/000_recipes/001_point.t -t/000_recipes/002_bank_account.t -t/000_recipes/003_binary_tree.t -t/000_recipes/004_company.t -t/000_recipes/005_coercion.t -t/000_recipes/006_augment_inner.t -t/000_recipes/010_roles.t -t/000_recipes/011_advanced_role_composition.t -t/000_recipes/021_meta_attribute.t -t/000_recipes/022_attribute_trait.t +t/000_recipes/basics/001_point.t +t/000_recipes/basics/002_bank_account.t +t/000_recipes/basics/003_binary_tree.t +t/000_recipes/basics/004_company.t +t/000_recipes/basics/005_coercion.t +t/000_recipes/basics/006_augment_inner.t +t/000_recipes/basics/010_genes.t +t/000_recipes/meta/002_meta_attribute.t +t/000_recipes/meta/003_attribute_trait.t +t/000_recipes/roles/001_roles.t +t/000_recipes/roles/002_advanced_role_composition.t t/010_basics/001_basic_class_setup.t t/010_basics/002_require_superclasses.t t/010_basics/003_super_and_override.t @@ -137,6 +139,7 @@ t/030_roles/015_runtime_roles_and_attrs.t t/030_roles/016_runtime_roles_and_nonmoose.t t/030_roles/017_extending_role_attrs.t t/030_roles/018_runtime_roles_w_params.t +t/030_roles/019_build.t t/030_roles/020_role_composite.t t/030_roles/021_role_composite_exclusion.t t/030_roles/022_role_composition_req_methods.t @@ -193,6 +196,8 @@ t/100_bugs/012_DEMOLISH_eats_mini.t t/100_bugs/013_lazybuild_required_undef.t t/100_bugs/014_DEMOLISHALL.t t/100_bugs/016_inheriting_from_roles.t +t/100_bugs/017_type_constraint_messages.t +t/100_bugs/018_immutable_metaclass_does_role.t t/200_examples/001_example.t t/200_examples/002_example_Moose_POOP.t t/200_examples/003_example.t @@ -217,6 +222,11 @@ t/500_test_moose/001_test_moose.t t/500_test_moose/002_test_moose_does_ok.t t/500_test_moose/003_test_moose_has_attribute_ok.t t/500_test_moose/004_test_moose_meta_ok.t +t/600_todo_tests/001_exception_reflects_failed_constraint.t +t/600_todo_tests/002_various_role_shit.t +t/600_todo_tests/003_immutable_n_around.t +t/600_todo_tests/004_inlined_constructor_modified_new.t +t/600_todo_tests/005_moose_and_threads.t t/lib/Bar.pm t/lib/Foo.pm t/lib/MyMooseA.pm diff --git a/lib/Moose/Cookbook.pod b/lib/Moose/Cookbook.pod index 2c8c167..597fde8 100644 --- a/lib/Moose/Cookbook.pod +++ b/lib/Moose/Cookbook.pod @@ -21,52 +21,52 @@ for common questions and problems people have with Moose. =over 4 -=item L - The (always classic) B example +=item L - The (always classic) B example A simple Moose-based class. Demonstrated Moose attributes and subclassing. -=item L - A simple B example +=item L - A simple B example A slightly more complex Moose class. Demonstrates using a method modifier in a subclass. -=item L - A lazy B example +=item L - A lazy B example Demonstrates several attribute features, including types, weak references, predicates ("does this object have a foo?"), defaults, and lazy attribute construction. -=item L - Subtypes, and modeling a simple B class hierarchy +=item L - Subtypes, and modeling a simple B class hierarchy Introduces the creation and use of custom types, a C method, and the use of C in a subclass. -=item L - More subtypes, coercion in a B class +=item L - More subtypes, coercion in a B class More type examples, including the use of type coercions. -=item L - The augment/inner example +=item L - The augment/inner example Demonstrates the use of C method modifiers, a way of turning the usual method overriding style "inside-out". -=item L - Making Moose fast with immutable +=item L - Making Moose fast with immutable Making a class immutable greatly increases the speed of accessors and object construction. -=item L - Managing complex relations with trigger (TODO) +=item L - Managing complex relations with trigger (TODO) I Work off of this http://code2.0beta.co.uk/moose/svn/Moose/trunk/t/200_examples/007_Child_Parent_attr_inherit.t -=item L - Builder methods and lazy_build +=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 - Create Humans and their Spawn +=item L - Create Humans and their Spawn Shows how operator overloading, coercion, and sub types can be used to mimmick the human reproductive system (well, the selection of genes @@ -78,20 +78,20 @@ at least). Assumes a basic understanding of Moose. =over 4 -=item L - The Moose::Role example +=item L - The Moose::Role example 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 - Advanced Role Composition - method exclusion and aliasing +=item L - Advanced Role Composition - method exclusion and aliasing Sometimes you just want to include part of a role in your class. Sometimes you want the whole role but one if its methods conflicts with one in your class. With method exclusion and aliasing, you can work around these problems. -=item L - Runtime Role Composition (TODO) +=item L - Runtime Role Composition (TODO) I @@ -101,25 +101,25 @@ I =over 4 -=item L - Welcome to the meta-world (TODO) +=item L - Welcome to the meta-world (TODO) I -=item L - The meta-attribute example +=item L - The meta-attribute example One way to extend Moose is to provide your own attribute metaclasses. Attribute metaclasses let you extend attribute declarations (with C) and behavior to provide additional attribute functionality. -=item L - The meta-attribute trait example +=item L - The meta-attribute trait example 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 - The meta-instance example (TODO) +=item L - The meta-instance example (TODO) I diff --git a/lib/Moose/Cookbook/Recipe1.pod b/lib/Moose/Cookbook/Basics/Recipe1.pod similarity index 98% rename from lib/Moose/Cookbook/Recipe1.pod rename to lib/Moose/Cookbook/Basics/Recipe1.pod index 04c2c80..bfcec7e 100644 --- a/lib/Moose/Cookbook/Recipe1.pod +++ b/lib/Moose/Cookbook/Basics/Recipe1.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe1 - The (always classic) B example. +Moose::Cookbook::Basics::Recipe1 - The (always classic) B example. =head1 SYNOPSIS diff --git a/lib/Moose/Cookbook/Recipe12.pod b/lib/Moose/Cookbook/Basics/Recipe10.pod similarity index 97% rename from lib/Moose/Cookbook/Recipe12.pod rename to lib/Moose/Cookbook/Basics/Recipe10.pod index 7913e77..ae15b0e 100644 --- a/lib/Moose/Cookbook/Recipe12.pod +++ b/lib/Moose/Cookbook/Basics/Recipe10.pod @@ -3,8 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe12 - Create humans and their spawn using operator -overloading, subtypes, and coercion. +Moose::Cookbook::Basics::Recipe10 - Operator overloading, subtypes, and coercion. =head1 SYNOPSIS @@ -86,7 +85,7 @@ L. Int, Str, and CodeRef are all examples. Subtypes give you the ability to inherit the constraints of an existing type, and adding additional constraints on that type. An introduction to type constraints -is available in the L. +is available in the L. =head2 Coercion @@ -95,7 +94,7 @@ is checked to validate the value. Normally, if the value does not pass the constraint, an exception will be thrown. But, it is possible with Moose to define the rules to coerce values from one type to another. A good introduction to -this can be found in L. +this can be found in L. =head1 GENES diff --git a/lib/Moose/Cookbook/Recipe2.pod b/lib/Moose/Cookbook/Basics/Recipe2.pod similarity index 99% rename from lib/Moose/Cookbook/Recipe2.pod rename to lib/Moose/Cookbook/Basics/Recipe2.pod index 9bb2c93..2fa9f9e 100644 --- a/lib/Moose/Cookbook/Recipe2.pod +++ b/lib/Moose/Cookbook/Basics/Recipe2.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe2 - A simple B example +Moose::Cookbook::Basics::Recipe2 - A simple B example =head1 SYNOPSIS diff --git a/lib/Moose/Cookbook/Recipe3.pod b/lib/Moose/Cookbook/Basics/Recipe3.pod similarity index 98% rename from lib/Moose/Cookbook/Recipe3.pod rename to lib/Moose/Cookbook/Basics/Recipe3.pod index 16836bb..9782548 100644 --- a/lib/Moose/Cookbook/Recipe3.pod +++ b/lib/Moose/Cookbook/Basics/Recipe3.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe3 - A lazy B example +Moose::Cookbook::Basics::Recipe3 - A lazy B example =head1 SYNOPSIS @@ -220,7 +220,7 @@ You I use the C option without the C option if you like, as we showed in the second recipe. And actually, you can use C instead of C. See -L for details. +L for details. =back diff --git a/lib/Moose/Cookbook/Recipe4.pod b/lib/Moose/Cookbook/Basics/Recipe4.pod similarity index 99% rename from lib/Moose/Cookbook/Recipe4.pod rename to lib/Moose/Cookbook/Basics/Recipe4.pod index ad088fd..3b8b0e6 100644 --- a/lib/Moose/Cookbook/Recipe4.pod +++ b/lib/Moose/Cookbook/Basics/Recipe4.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe4 - Subtypes, and modeling a simple B class hierarchy +Moose::Cookbook::Basics::Recipe4 - Subtypes, and modeling a simple B class hierarchy =head1 SYNOPSIS diff --git a/lib/Moose/Cookbook/Recipe5.pod b/lib/Moose/Cookbook/Basics/Recipe5.pod similarity index 98% rename from lib/Moose/Cookbook/Recipe5.pod rename to lib/Moose/Cookbook/Basics/Recipe5.pod index f0bac8a..a54af7a 100644 --- a/lib/Moose/Cookbook/Recipe5.pod +++ b/lib/Moose/Cookbook/Basics/Recipe5.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe5 - More subtypes, coercion in a B class +Moose::Cookbook::Basics::Recipe5 - More subtypes, coercion in a B class =head1 SYNOPSIS diff --git a/lib/Moose/Cookbook/Recipe6.pod b/lib/Moose/Cookbook/Basics/Recipe6.pod similarity index 96% rename from lib/Moose/Cookbook/Recipe6.pod rename to lib/Moose/Cookbook/Basics/Recipe6.pod index 6381776..bce383d 100644 --- a/lib/Moose/Cookbook/Recipe6.pod +++ b/lib/Moose/Cookbook/Basics/Recipe6.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe6 - The augment/inner example +Moose::Cookbook::Basics::Recipe6 - The augment/inner example =head1 SYNOPSIS diff --git a/lib/Moose/Cookbook/Recipe7.pod b/lib/Moose/Cookbook/Basics/Recipe7.pod similarity index 96% rename from lib/Moose/Cookbook/Recipe7.pod rename to lib/Moose/Cookbook/Basics/Recipe7.pod index 44b5c62..fdb0f1c 100644 --- a/lib/Moose/Cookbook/Recipe7.pod +++ b/lib/Moose/Cookbook/Basics/Recipe7.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe7 - Making Moose fast with immutable +Moose::Cookbook::Basics::Recipe7 - Making Moose fast with immutable =head1 SYNOPSIS diff --git a/lib/Moose/Cookbook/Recipe9.pod b/lib/Moose/Cookbook/Basics/Recipe9.pod similarity index 97% rename from lib/Moose/Cookbook/Recipe9.pod rename to lib/Moose/Cookbook/Basics/Recipe9.pod index 9ccf92a..a73748e 100644 --- a/lib/Moose/Cookbook/Recipe9.pod +++ b/lib/Moose/Cookbook/Basics/Recipe9.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe9 - Builder methods and lazy_build +Moose::Cookbook::Basics::Recipe9 - Builder methods and lazy_build =head1 SYNOPSIS @@ -48,7 +48,7 @@ Moose::Cookbook::Recipe9 - Builder methods and lazy_build =head1 DESCRIPTION -If you've already read L, then this example +If you've already read L, then this example should look awfully familiar. In fact, all we've done here is replace the attribute C with a C method. diff --git a/lib/Moose/Cookbook/Recipe21.pod b/lib/Moose/Cookbook/Meta/Recipe2.pod similarity index 99% rename from lib/Moose/Cookbook/Recipe21.pod rename to lib/Moose/Cookbook/Meta/Recipe2.pod index 7196f0f..75b1f93 100644 --- a/lib/Moose/Cookbook/Recipe21.pod +++ b/lib/Moose/Cookbook/Meta/Recipe2.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe21 - The meta-attribute example +Moose::Cookbook::Meta::Recipe2 - The meta-attribute example =head1 SYNOPSIS diff --git a/lib/Moose/Cookbook/Recipe22.pod b/lib/Moose/Cookbook/Meta/Recipe3.pod similarity index 97% rename from lib/Moose/Cookbook/Recipe22.pod rename to lib/Moose/Cookbook/Meta/Recipe3.pod index a0868a6..ccccdd2 100644 --- a/lib/Moose/Cookbook/Recipe22.pod +++ b/lib/Moose/Cookbook/Meta/Recipe3.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe22 - The attribute trait example +Moose::Cookbook::Meta::Recipe3 - The attribute trait example =head1 SYNOPSIS @@ -64,7 +64,7 @@ Moose::Cookbook::Recipe22 - The attribute trait example =head1 BUT FIRST -This recipe is a continuation of L. Please read that +This recipe is a continuation of L. Please read that first. =head1 MOTIVATION diff --git a/lib/Moose/Cookbook/Recipe10.pod b/lib/Moose/Cookbook/Roles/Recipe1.pod similarity index 99% rename from lib/Moose/Cookbook/Recipe10.pod rename to lib/Moose/Cookbook/Roles/Recipe1.pod index ebdb439..eca8887 100644 --- a/lib/Moose/Cookbook/Recipe10.pod +++ b/lib/Moose/Cookbook/Roles/Recipe1.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe10 - The Moose::Role example +Moose::Cookbook::Roles::Recipe1 - The Moose::Role example =head1 SYNOPSIS diff --git a/lib/Moose/Cookbook/Recipe11.pod b/lib/Moose/Cookbook/Roles/Recipe2.pod similarity index 96% rename from lib/Moose/Cookbook/Recipe11.pod rename to lib/Moose/Cookbook/Roles/Recipe2.pod index 5f3734a..63836b1 100644 --- a/lib/Moose/Cookbook/Recipe11.pod +++ b/lib/Moose/Cookbook/Roles/Recipe2.pod @@ -3,7 +3,7 @@ =head1 NAME -Moose::Cookbook::Recipe11 - Advanced Role Composition - method exclusion and aliasing +Moose::Cookbook::Roles::Recipe2 - Advanced Role Composition - method exclusion and aliasing =head1 SYNOPSIS diff --git a/t/000_recipes/001_point.t b/t/000_recipes/basics/001_point.t similarity index 100% rename from t/000_recipes/001_point.t rename to t/000_recipes/basics/001_point.t diff --git a/t/000_recipes/002_bank_account.t b/t/000_recipes/basics/002_bank_account.t similarity index 100% rename from t/000_recipes/002_bank_account.t rename to t/000_recipes/basics/002_bank_account.t diff --git a/t/000_recipes/003_binary_tree.t b/t/000_recipes/basics/003_binary_tree.t similarity index 100% rename from t/000_recipes/003_binary_tree.t rename to t/000_recipes/basics/003_binary_tree.t diff --git a/t/000_recipes/004_company.t b/t/000_recipes/basics/004_company.t similarity index 100% rename from t/000_recipes/004_company.t rename to t/000_recipes/basics/004_company.t diff --git a/t/000_recipes/005_coercion.t b/t/000_recipes/basics/005_coercion.t similarity index 100% rename from t/000_recipes/005_coercion.t rename to t/000_recipes/basics/005_coercion.t diff --git a/t/000_recipes/006_augment_inner.t b/t/000_recipes/basics/006_augment_inner.t similarity index 100% rename from t/000_recipes/006_augment_inner.t rename to t/000_recipes/basics/006_augment_inner.t diff --git a/t/000_recipes/012_genes.t b/t/000_recipes/basics/010_genes.t similarity index 100% rename from t/000_recipes/012_genes.t rename to t/000_recipes/basics/010_genes.t diff --git a/t/000_recipes/021_meta_attribute.t b/t/000_recipes/meta/002_meta_attribute.t similarity index 100% rename from t/000_recipes/021_meta_attribute.t rename to t/000_recipes/meta/002_meta_attribute.t diff --git a/t/000_recipes/022_attribute_trait.t b/t/000_recipes/meta/003_attribute_trait.t similarity index 100% rename from t/000_recipes/022_attribute_trait.t rename to t/000_recipes/meta/003_attribute_trait.t diff --git a/t/000_recipes/010_roles.t b/t/000_recipes/roles/001_roles.t similarity index 100% rename from t/000_recipes/010_roles.t rename to t/000_recipes/roles/001_roles.t diff --git a/t/000_recipes/011_advanced_role_composition.t b/t/000_recipes/roles/002_advanced_role_composition.t similarity index 100% rename from t/000_recipes/011_advanced_role_composition.t rename to t/000_recipes/roles/002_advanced_role_composition.t