0.19
* Moose::Util::TypeConstraints
- type now supports messages as well
- (thanks to phaylon for finding this)
+ thanks to phaylon for finding this
- added tests for this
- added list_all_type_constraints and
list_all_builtin_type_constraints
- fixed regexp 'handles' declarations
to build the list of delegated methods
correctly (and not override important
- things like &new)
+ 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::TypeConstraint
- added test for this
* misc.
- - added test for working with Module::Refresh
+ - 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 compatability sucks *cough* ;)
0.18 Sat. March 10, 2007
~~ Many, many documentation updates ~~
-
- - We now use Class::MOP::load_class to
- load all classes.
+
+ * 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
!! You must have Class::MOP 0.37_001 !!
reader => 'handles',
predicate => 'has_handles',
));
+__PACKAGE__->meta->add_attribute('documentation' => (
+ reader => 'documentation',
+ predicate => 'has_documentation',
+));
sub new {
my ($class, $name, %options) = @_;
sub clone_and_inherit_options {
my ($self, %options) = @_;
- # you can change default, required and coerce
+ # you can change default, required, coerce and documentation
my %actual_options;
- foreach my $legal_option (qw(default coerce required)) {
+ foreach my $legal_option (qw(default coerce required documentation)) {
if (exists $options{$legal_option}) {
$actual_options{$legal_option} = $options{$legal_option};
delete $options{$legal_option};
the invocant and the new value. This can be used to handle I<basic>
bi-directional relations.
+=item B<documentation>
+
+This is a string which contains the documentation for this attribute.
+It serves no direct purpose right now, but it might in the future
+in some kind of automated documentation system perhaps.
+
+=item B<has_documentation>
+
+Returns true if this meta-attribute has any documentation.
+
=back
=head1 BUGS
use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 6;
use Test::Exception;
BEGIN {
{
{
+ package Test::Attribute::Inline::Documentation;
+ use Moose;
+
+ has 'foo' => (
+ documentation => q{
+ The 'foo' attribute is my favorite
+ attribute in the whole wide world.
+ }
+ );
+ }
+
+ my $foo_attr = Test::Attribute::Inline::Documentation->meta->get_attribute('foo');
+
+ ok($foo_attr->has_documentation, '... the foo has docs');
+ is($foo_attr->documentation,
+ q{
+ The 'foo' attribute is my favorite
+ attribute in the whole wide world.
+ },
+ '... got the foo docs');
+}
+
+{
+ {
package Test::For::Lazy::TypeConstraint;
use Moose;
use Moose::Util::TypeConstraints;
BEGIN {
eval "use DBM::Deep 0.983; use DateTime::Format::MySQL;";
- plan skip_all => "DBM::Deep and DateTime::Format::MySQL required for this test" if $@;
+ if ($@ && DBM::Deep->VERSION < 1.0) {
+ plan skip_all => "DBM::Deep (< 1.0) and DateTime::Format::MySQL required for this test";
+ }
plan tests => 89;
}