numbered internally in each subsection, as opposed to globally.
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
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
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
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
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
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
=over 4
-=item L<Moose::Cookbook::Recipe1> - The (always classic) B<Point> example
+=item L<Moose::Cookbook::Basics::Recipe1> - The (always classic) B<Point> example
A simple Moose-based class. Demonstrated Moose attributes and subclassing.
-=item L<Moose::Cookbook::Recipe2> - A simple B<BankAccount> example
+=item L<Moose::Cookbook::Basics::Recipe2> - A simple B<BankAccount> example
A slightly more complex Moose class. Demonstrates using a method
modifier in a subclass.
-=item L<Moose::Cookbook::Recipe3> - A lazy B<BinaryTree> example
+=item L<Moose::Cookbook::Basics::Recipe3> - A lazy B<BinaryTree> example
Demonstrates several attribute features, including types, weak
references, predicates ("does this object have a foo?"), defaults, and
lazy attribute construction.
-=item L<Moose::Cookbook::Recipe4> - Subtypes, and modeling a simple B<Company> class hierarchy
+=item L<Moose::Cookbook::Basics::Recipe4> - Subtypes, and modeling a simple B<Company> class hierarchy
Introduces the creation and use of custom types, a C<BUILD> method,
and the use of C<override> in a subclass.
-=item L<Moose::Cookbook::Recipe5> - More subtypes, coercion in a B<Request> class
+=item L<Moose::Cookbook::Basics::Recipe5> - More subtypes, coercion in a B<Request> class
More type examples, including the use of type coercions.
-=item L<Moose::Cookbook::Recipe6> - The augment/inner example
+=item L<Moose::Cookbook::Basics::Recipe6> - The augment/inner example
Demonstrates the use of C<augment> method modifiers, a way of turning
the usual method overriding style "inside-out".
-=item L<Moose::Cookbook::Recipe7> - Making Moose fast with immutable
+=item L<Moose::Cookbook::Basics::Recipe7> - Making Moose fast with immutable
Making a class immutable greatly increases the speed of accessors and
object construction.
-=item L<Moose::Cookbook::Recipe8> - Managing complex relations with trigger (TODO)
+=item L<Moose::Cookbook::Basics::Recipe8> - Managing complex relations with trigger (TODO)
I<abstract goes here>
Work off of this http://code2.0beta.co.uk/moose/svn/Moose/trunk/t/200_examples/007_Child_Parent_attr_inherit.t
-=item L<Moose::Cookbook::Recipe9> - Builder methods and lazy_build
+=item L<Moose::Cookbook::Basics::Recipe9> - Builder methods and lazy_build
The builder feature provides an inheritable and role-composable way to
provide a default attribute value.
-=item L<Moose::Cookbook::Recipe12> - Create Humans and their Spawn
+=item L<Moose::Cookbook::Basics::Recipe10> - 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
=over 4
-=item L<Moose::Cookbook::Recipe10> - The Moose::Role example
+=item L<Moose::Cookbook::Role::Recipe1> - 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<Moose::Cookbook::Recipe11> - Advanced Role Composition - method exclusion and aliasing
+=item L<Moose::Cookbook::Role::Recipe2> - 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<Moose::Cookbook::Recipe12> - Runtime Role Composition (TODO)
+=item L<Moose::Cookbook::Role::Recipe3> - Runtime Role Composition (TODO)
I<abstract goes here>
=over 4
-=item L<Moose::Cookbook::Recipe20> - Welcome to the meta-world (TODO)
+=item L<Moose::Cookbook::Meta::Recipe1> - Welcome to the meta-world (TODO)
I<abstract goes here>
-=item L<Moose::Cookbook::Recipe21> - The meta-attribute example
+=item L<Moose::Cookbook::Meta::Recipe2> - 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<has>) and behavior to provide additional
attribute functionality.
-=item L<Moose::Cookbook::Recipe22> - The meta-attribute trait example
+=item L<Moose::Cookbook::Meta::Recipe3> - 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<Moose::Cookbook::Recipe23> - The meta-instance example (TODO)
+=item L<Moose::Cookbook::Meta::Recipe4> - The meta-instance example (TODO)
I<abstract goes here>
=head1 NAME
-Moose::Cookbook::Recipe1 - The (always classic) B<Point> example.
+Moose::Cookbook::Basics::Recipe1 - The (always classic) B<Point> example.
=head1 SYNOPSIS
=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
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<Moose::Cookbook::Recipe4>.
+is available in the L<Moose::Cookbook::Basics::Recipe4>.
=head2 Coercion
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<Moose::Cookbook::Recipe5>.
+this can be found in L<Moose::Cookbook::Basics::Recipe5>.
=head1 GENES
=head1 NAME
-Moose::Cookbook::Recipe2 - A simple B<BankAccount> example
+Moose::Cookbook::Basics::Recipe2 - A simple B<BankAccount> example
=head1 SYNOPSIS
=head1 NAME
-Moose::Cookbook::Recipe3 - A lazy B<BinaryTree> example
+Moose::Cookbook::Basics::Recipe3 - A lazy B<BinaryTree> example
=head1 SYNOPSIS
you like, as we showed in the second recipe.
And actually, you can use C<builder> instead of C<default>. See
-L<Moose::Cookbook::Recipe9> for details.
+L<Moose::Cookbook::Basics::Recipe9> for details.
=back
=head1 NAME
-Moose::Cookbook::Recipe4 - Subtypes, and modeling a simple B<Company> class hierarchy
+Moose::Cookbook::Basics::Recipe4 - Subtypes, and modeling a simple B<Company> class hierarchy
=head1 SYNOPSIS
=head1 NAME
-Moose::Cookbook::Recipe5 - More subtypes, coercion in a B<Request> class
+Moose::Cookbook::Basics::Recipe5 - More subtypes, coercion in a B<Request> class
=head1 SYNOPSIS
=head1 NAME
-Moose::Cookbook::Recipe6 - The augment/inner example
+Moose::Cookbook::Basics::Recipe6 - The augment/inner example
=head1 SYNOPSIS
=head1 NAME
-Moose::Cookbook::Recipe7 - Making Moose fast with immutable
+Moose::Cookbook::Basics::Recipe7 - Making Moose fast with immutable
=head1 SYNOPSIS
=head1 NAME
-Moose::Cookbook::Recipe9 - Builder methods and lazy_build
+Moose::Cookbook::Basics::Recipe9 - Builder methods and lazy_build
=head1 SYNOPSIS
=head1 DESCRIPTION
-If you've already read L<Moose::Cookbook::Recipe3>, then this example
+If you've already read L<Moose::Cookbook::Basics::Recipe3>, then this example
should look awfully familiar. In fact, all we've done here is replace
the attribute C<default> with a C<builder> method.
=head1 NAME
-Moose::Cookbook::Recipe21 - The meta-attribute example
+Moose::Cookbook::Meta::Recipe2 - The meta-attribute example
=head1 SYNOPSIS
=head1 NAME
-Moose::Cookbook::Recipe22 - The attribute trait example
+Moose::Cookbook::Meta::Recipe3 - The attribute trait example
=head1 SYNOPSIS
=head1 BUT FIRST
-This recipe is a continuation of L<Moose::Cookbook::Recipe21>. Please read that
+This recipe is a continuation of L<Moose::Cookbook::Meta::Recipe21>. Please read that
first.
=head1 MOTIVATION
=head1 NAME
-Moose::Cookbook::Recipe10 - The Moose::Role example
+Moose::Cookbook::Roles::Recipe1 - The Moose::Role example
=head1 SYNOPSIS
=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