From: Guillermo Roditi Date: Sun, 24 Feb 2008 01:25:11 +0000 (+0000) Subject: added POD to AutoDoc, changed some things, updated tests fixed a view bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec75fdb021d009ae0c44b576982273822bfc820d;p=gitmo%2FMooseX-AutoDoc.git added POD to AutoDoc, changed some things, updated tests fixed a view bug --- diff --git a/META.yml b/META.yml index 88c4f9d..d7e060b 100644 --- a/META.yml +++ b/META.yml @@ -1,11 +1,12 @@ --- abstract: Automatically generate documentation stubs for Moose-based classes. -author: ~ +author: + - =over 4 build_requires: Test::More: 0 distribution_type: module generated_by: Module::Install version 0.68 -license: unknown +license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.3.html version: 1.3 diff --git a/Makefile b/Makefile index 8ca5e97..2c14898 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ # MakeMaker Parameters: # ABSTRACT => q[Automatically generate documentation stubs for Moose-based classes.] +# AUTHOR => q[=over 4] # DIR => [] # DISTNAME => q[MooseX-AutoDoc] # NAME => q[MooseX::AutoDoc] @@ -162,7 +163,8 @@ C_FILES = O_FILES = H_FILES = MAN1PODS = -MAN3PODS = lib/MooseX/AutoDoc/View/TT.pm +MAN3PODS = lib/MooseX/AutoDoc.pm \ + lib/MooseX/AutoDoc/View/TT.pm # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h @@ -186,9 +188,12 @@ PERL_ARCHIVE_AFTER = TO_INST_PM = lib/MooseX/AutoDoc.pm \ lib/MooseX/AutoDoc/View.pm \ - lib/MooseX/AutoDoc/View/TT.pm + lib/MooseX/AutoDoc/View/TT.pm \ + make_docs.pl -PM_TO_BLIB = lib/MooseX/AutoDoc/View/TT.pm \ +PM_TO_BLIB = make_docs.pl \ + $(INST_LIB)/MooseX/make_docs.pl \ + lib/MooseX/AutoDoc/View/TT.pm \ blib/lib/MooseX/AutoDoc/View/TT.pm \ lib/MooseX/AutoDoc/View.pm \ blib/lib/MooseX/AutoDoc/View.pm \ @@ -413,9 +418,11 @@ POD2MAN = $(POD2MAN_EXE) manifypods : pure_all \ - lib/MooseX/AutoDoc/View/TT.pm + lib/MooseX/AutoDoc/View/TT.pm \ + lib/MooseX/AutoDoc.pm $(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW) \ - lib/MooseX/AutoDoc/View/TT.pm $(INST_MAN3DIR)/MooseX::AutoDoc::View::TT.$(MAN3EXT) + lib/MooseX/AutoDoc/View/TT.pm $(INST_MAN3DIR)/MooseX::AutoDoc::View::TT.$(MAN3EXT) \ + lib/MooseX/AutoDoc.pm $(INST_MAN3DIR)/MooseX::AutoDoc.$(MAN3EXT) @@ -771,7 +778,7 @@ ppd : $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd $(NOECHO) $(ECHO) ' $(DISTNAME)' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' Automatically generate documentation stubs for Moose-based classes.' >> $(DISTNAME).ppd - $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' =over 4' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd @@ -787,6 +794,7 @@ ppd : pm_to_blib : $(TO_INST_PM) $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' -- \ + make_docs.pl $(INST_LIB)/MooseX/make_docs.pl \ lib/MooseX/AutoDoc/View/TT.pm blib/lib/MooseX/AutoDoc/View/TT.pm \ lib/MooseX/AutoDoc/View.pm blib/lib/MooseX/AutoDoc/View.pm \ lib/MooseX/AutoDoc.pm blib/lib/MooseX/AutoDoc.pm diff --git a/blib/lib/MooseX/AutoDoc.pm b/blib/lib/MooseX/AutoDoc.pm index 5701536..20d1264 100644 --- a/blib/lib/MooseX/AutoDoc.pm +++ b/blib/lib/MooseX/AutoDoc.pm @@ -51,7 +51,6 @@ sub _build_tc_to_lib_map { sub _build_ignored_method_metaclasses { return { - 'Moose::Meta::Role::Method' => 1, 'Moose::Meta::Method::Accessor' => 1, 'Moose::Meta::Method::Constructor' => 1, 'Class::MOP::Method::Accessor' => 1, @@ -59,8 +58,10 @@ sub _build_ignored_method_metaclasses { 'Class::MOP::Method::Constructor' => 1, }; +# 'Moose::Meta::Role::Method' => 1, # 'Moose::Meta::Method::Overridden' => 1, # 'Class::MOP::Method::Wrapped' => 1, + } sub _build_license_text { @@ -105,7 +106,7 @@ sub generate_pod_for_class { # *_info methods -sub role_info { +sub _role_info { my ($self, $role) = @_; my (@roles_to_apply, $rmeta, $original_apply); @@ -129,15 +130,13 @@ sub role_info { my @attributes = map{ $anon->get_attribute($_) } sort $anon->get_attribute_list; - my %ignored_method_metaclasses = %{ $self->ignored_method_metaclasses }; - delete $ignored_method_metaclasses{'Moose::Meta::Role::Method'}; my @methods = - grep{ ! exists $ignored_method_metaclasses{$_->meta->name} } + grep{ ! exists $self->ignored_method_metaclasses->{$_->meta->name} } map { $anon->get_method($_) } grep { $_ ne 'meta' } #it wasnt getting filtered on the anon class.. sort $anon->get_method_list; - my @method_specs = map{ $self->method_info($_) } @methods; - my @attribute_specs = map{ $self->attribute_info($_) } @attributes; + my @method_specs = map{ $self->_method_info($_) } @methods; + my @attribute_specs = map{ $self->_attribute_info($_) } @attributes; { #fix Moose::Meta::Role and apply the roles that were delayed $rmeta->remove_method("apply"); @@ -151,7 +150,7 @@ sub role_info { map { $_->isa("Moose::Meta::Role::Composite") ? @{$_->get_roles} : $_ } @{ $meta->get_roles }; - my @role_specs = map{ $self->consumed_role_info($_) } @roles; + my @role_specs = map{ $self->_consumed_role_info($_) } @roles; my $spec = { name => $meta->name, @@ -164,7 +163,7 @@ sub role_info { } -sub class_info { +sub _class_info { my ($self, $class) = @_; my (@roles_to_apply, $rmeta, $original_apply); @@ -194,9 +193,9 @@ sub class_info { grep { $_ ne 'meta' } #it wasnt getting filtered on the anon class.. sort $meta->get_method_list; - my @method_specs = map{ $self->method_info($_) } @methods; - my @attribute_specs = map{ $self->attribute_info($_) } @attributes; - my @superclass_specs = map{ $self->superclass_info($_) } @superclasses; + my @method_specs = map{ $self->_method_info($_) } @methods; + my @attribute_specs = map{ $self->_attribute_info($_) } @attributes; + my @superclass_specs = map{ $self->_superclass_info($_) } @superclasses; { #fix Moose::Meta::Role and apply the roles that were delayed $rmeta->remove_method("apply"); @@ -208,7 +207,7 @@ sub class_info { my @roles = sort{ $a->name cmp $b->name } map { $_->isa("Moose::Meta::Role::Composite") ? @{$_->get_roles} : $_ } @{ $meta->roles }; - my @role_specs = map{ $self->consumed_role_info($_) } @roles; + my @role_specs = map{ $self->_consumed_role_info($_) } @roles; my $spec = { name => $meta->name, @@ -221,7 +220,7 @@ sub class_info { return $spec; } -sub attribute_info{ +sub _attribute_info{ my($self, $attr) = @_;; my $attr_name = $attr->name; my $spec = { name => $attr_name }; @@ -294,19 +293,19 @@ sub attribute_info{ return $spec; } -sub superclass_info { +sub _superclass_info { my($self, $superclass) = @_; my $spec = { name => $superclass->name }; return $spec; } -sub method_info { +sub _method_info { my($self, $method) = @_; my $spec = { name => $method->name }; return $spec; } -sub consumed_role_info { +sub _consumed_role_info { my($self, $role) = @_;; my $spec = { name => $role->name }; return $spec; @@ -316,5 +315,211 @@ sub consumed_role_info { __END__; +=head1 NAME + +MooseX::AutoDoc - Automatically generate documentation for Moose-based classes + +=head1 SYNOPSYS + + use MooseX::AutoDoc; + my $autodoc = MooseX::AutoDoc->new + ( + authors => + [ + { + name => "Guillermo Roditi", + email => 'groditi@cpan.org', + handle => "groditi", + } + ], + ); + + my $class_pod = $autodoc->generate_pod_for_class("MyClass"); + my $role_pod = $autodoc->generate_pod_for_role("MyRole"); + +=head1 DESCRIPTION + +MooseX::AutoDoc allows you to automatically generate POD documentation from +your Moose based objects by introspecting them and creating a + +=head1 NOTICE REGARDING ROLE CONSUMPTION + +To accurantely detect which methods and attributes are part of the class / role +being examined and which are part of a consumed role the +L and L methods need to +delay role consumption. If your role or class has been loaded prior to calling +these methods you run a risk of recieving inacurate data and a warning will be +emitted. + +=head1 ATTRIBUTES + +Unless noted otherwise, you may set any of these attributes at C time by +passing key / value pairs to C where the key is the name of the attribute +you wish to set. Unless noted otherwise accessor methods for attributes also +share the same name as the attribute. + +=head2 authors + +=over 4 + +=item B - has_authors + +=back + +Optional read-write value of type +L representing the authors of +the class / role being documented. These values are passed directly to the view +and the default TT view accepts entries in the following form +(all fields optional) + + { + name => 'Guillermo Roditi', + handle => 'groditi', + email => '', + } + +=head2 ignored_method_metaclasses + +=over 4 + +=item B - _build_ignored_method_metaclasses + +Default to the Moose and Class::MOP method metaclasses for generated methods, +accessors, and constructors. + +=item B - clear_ignored_method_metaclasses + +=item B - has_ignored_method_metaclasses + +=back + +Required read-write lazy-building value of type +L where the keys are method metaclasses +MooseX::AutoDoc should ignore when creating a method list. + +=head2 license_text + +=over 4 + +=item B - _build_license_text + +=item B - clear_license_text + +=item B - has_license_text + +=back + +Required read-write lazy-building value of type +L. By default it will use the following text: + + This library is free software; you can redistribute it and/or modify it + under the same terms as Perl itself. + +=head2 tc_to_lib_map + +=over 4 + +=item B - _build_tc_to_lib_map + +=item B - clear_tc_to_lib_map + +=item B - has_tc_to_lib_map + +=back + +Required read-write lazy-building value of type +L. The keys refer to type constraint +names and the values to the module where the documentation available for that +type is. Please note that if you are using MooseX::Types libraries the links +will be automatically generated if the library class can be found (most cases). + +=head2 view + +=over 4 + +=item B - _build_view + +Returns 'MooseX::AutoDoc::View::TT' + +=item B - clear_view + +=item B - has_view + +=back + +Required read-write lazy-building value of type AutoDocView. The AutoDocView +type will accept an Object that isa L. This attribute +will attempt to coerce string values to instances by treating them as class +names and attempting to load and instantiate a class of the same name. + +=head1 METHODS + +=head2 new $key => $value + +Instantiate a new object. Please refer to L for a list of valid +key options. + +=head2 generate_pod_for_class $class_name, $view_args + +Returns a string containing the Pod for the class. To make sure the data is +accurate please make sure the class has not been loaded prior to this step. +for more info see L + +=head2 generate_pod_for_role $role_name, $view_args + +Returns a string containing the Pod for the role.To make sure the data is +accurate please make sure the role has not been loaded prior to this step. +for more info see L + +=head2 _class_info $class_name + +Will return a hashref representing the documentation components of the class +with the keys C, C, C, C and, +C; the latter four representing array refs of the hashrefs returned +by L, L, L, and +L + +=head2 _role_info $role_name + +Will return a hashref representing the documentation components of the role +with the keys C, C, C and, C; the +latter three representing array refs of the hashrefs returned by +L, L, and L + +=head2 _attribute_info $attr + +Accepts one argument, an attribute metaclass instance. +Returns a hashref representing the documentation components of the +attribute with the keys C, C, and C, a hashref +of additional information. + +=head2 _consumed_role_info $role + +Accepts one argument, a role metaclass instance. Returns a hashref representing +the documentation components of the role with the key C. + +=head2 _method_info $method + +Accepts one argument, a method metaclass instance. Returns a hashref +representing the documentation components of the role with the key C. + +=head2 _superclass_info $class + +Accepts one argument, the metaclass instance of a superclass. Returns a hashref +representing the documentation components of the role with the key C. + +=head2 meta + +Retrieve the metaclass instance. Please see L and +L for more information. + +=head1 AUTHORS + +Guillermo Roditi (Guillermo Roditi) + +=head1 COPYRIGHT AND LICENSE +This library is free software; you can redistribute it and/or modify it under +the same terms as Perl itself. +=cut diff --git a/blib/lib/MooseX/AutoDoc/View/TT.pm b/blib/lib/MooseX/AutoDoc/View/TT.pm index aa46923..0145be8 100644 --- a/blib/lib/MooseX/AutoDoc/View/TT.pm +++ b/blib/lib/MooseX/AutoDoc/View/TT.pm @@ -143,7 +143,7 @@ END; =over 4 [% FOREACH pair IN attribute.info.pairs %] -=item B<[% pair.key %]> - [% pair.value %] +=item B<[% pair.key %]> - [% pair.value %] [% END %] =back [%- END; %] diff --git a/lib/MooseX/AutoDoc.pm b/lib/MooseX/AutoDoc.pm index 5701536..20d1264 100644 --- a/lib/MooseX/AutoDoc.pm +++ b/lib/MooseX/AutoDoc.pm @@ -51,7 +51,6 @@ sub _build_tc_to_lib_map { sub _build_ignored_method_metaclasses { return { - 'Moose::Meta::Role::Method' => 1, 'Moose::Meta::Method::Accessor' => 1, 'Moose::Meta::Method::Constructor' => 1, 'Class::MOP::Method::Accessor' => 1, @@ -59,8 +58,10 @@ sub _build_ignored_method_metaclasses { 'Class::MOP::Method::Constructor' => 1, }; +# 'Moose::Meta::Role::Method' => 1, # 'Moose::Meta::Method::Overridden' => 1, # 'Class::MOP::Method::Wrapped' => 1, + } sub _build_license_text { @@ -105,7 +106,7 @@ sub generate_pod_for_class { # *_info methods -sub role_info { +sub _role_info { my ($self, $role) = @_; my (@roles_to_apply, $rmeta, $original_apply); @@ -129,15 +130,13 @@ sub role_info { my @attributes = map{ $anon->get_attribute($_) } sort $anon->get_attribute_list; - my %ignored_method_metaclasses = %{ $self->ignored_method_metaclasses }; - delete $ignored_method_metaclasses{'Moose::Meta::Role::Method'}; my @methods = - grep{ ! exists $ignored_method_metaclasses{$_->meta->name} } + grep{ ! exists $self->ignored_method_metaclasses->{$_->meta->name} } map { $anon->get_method($_) } grep { $_ ne 'meta' } #it wasnt getting filtered on the anon class.. sort $anon->get_method_list; - my @method_specs = map{ $self->method_info($_) } @methods; - my @attribute_specs = map{ $self->attribute_info($_) } @attributes; + my @method_specs = map{ $self->_method_info($_) } @methods; + my @attribute_specs = map{ $self->_attribute_info($_) } @attributes; { #fix Moose::Meta::Role and apply the roles that were delayed $rmeta->remove_method("apply"); @@ -151,7 +150,7 @@ sub role_info { map { $_->isa("Moose::Meta::Role::Composite") ? @{$_->get_roles} : $_ } @{ $meta->get_roles }; - my @role_specs = map{ $self->consumed_role_info($_) } @roles; + my @role_specs = map{ $self->_consumed_role_info($_) } @roles; my $spec = { name => $meta->name, @@ -164,7 +163,7 @@ sub role_info { } -sub class_info { +sub _class_info { my ($self, $class) = @_; my (@roles_to_apply, $rmeta, $original_apply); @@ -194,9 +193,9 @@ sub class_info { grep { $_ ne 'meta' } #it wasnt getting filtered on the anon class.. sort $meta->get_method_list; - my @method_specs = map{ $self->method_info($_) } @methods; - my @attribute_specs = map{ $self->attribute_info($_) } @attributes; - my @superclass_specs = map{ $self->superclass_info($_) } @superclasses; + my @method_specs = map{ $self->_method_info($_) } @methods; + my @attribute_specs = map{ $self->_attribute_info($_) } @attributes; + my @superclass_specs = map{ $self->_superclass_info($_) } @superclasses; { #fix Moose::Meta::Role and apply the roles that were delayed $rmeta->remove_method("apply"); @@ -208,7 +207,7 @@ sub class_info { my @roles = sort{ $a->name cmp $b->name } map { $_->isa("Moose::Meta::Role::Composite") ? @{$_->get_roles} : $_ } @{ $meta->roles }; - my @role_specs = map{ $self->consumed_role_info($_) } @roles; + my @role_specs = map{ $self->_consumed_role_info($_) } @roles; my $spec = { name => $meta->name, @@ -221,7 +220,7 @@ sub class_info { return $spec; } -sub attribute_info{ +sub _attribute_info{ my($self, $attr) = @_;; my $attr_name = $attr->name; my $spec = { name => $attr_name }; @@ -294,19 +293,19 @@ sub attribute_info{ return $spec; } -sub superclass_info { +sub _superclass_info { my($self, $superclass) = @_; my $spec = { name => $superclass->name }; return $spec; } -sub method_info { +sub _method_info { my($self, $method) = @_; my $spec = { name => $method->name }; return $spec; } -sub consumed_role_info { +sub _consumed_role_info { my($self, $role) = @_;; my $spec = { name => $role->name }; return $spec; @@ -316,5 +315,211 @@ sub consumed_role_info { __END__; +=head1 NAME + +MooseX::AutoDoc - Automatically generate documentation for Moose-based classes + +=head1 SYNOPSYS + + use MooseX::AutoDoc; + my $autodoc = MooseX::AutoDoc->new + ( + authors => + [ + { + name => "Guillermo Roditi", + email => 'groditi@cpan.org', + handle => "groditi", + } + ], + ); + + my $class_pod = $autodoc->generate_pod_for_class("MyClass"); + my $role_pod = $autodoc->generate_pod_for_role("MyRole"); + +=head1 DESCRIPTION + +MooseX::AutoDoc allows you to automatically generate POD documentation from +your Moose based objects by introspecting them and creating a + +=head1 NOTICE REGARDING ROLE CONSUMPTION + +To accurantely detect which methods and attributes are part of the class / role +being examined and which are part of a consumed role the +L and L methods need to +delay role consumption. If your role or class has been loaded prior to calling +these methods you run a risk of recieving inacurate data and a warning will be +emitted. + +=head1 ATTRIBUTES + +Unless noted otherwise, you may set any of these attributes at C time by +passing key / value pairs to C where the key is the name of the attribute +you wish to set. Unless noted otherwise accessor methods for attributes also +share the same name as the attribute. + +=head2 authors + +=over 4 + +=item B - has_authors + +=back + +Optional read-write value of type +L representing the authors of +the class / role being documented. These values are passed directly to the view +and the default TT view accepts entries in the following form +(all fields optional) + + { + name => 'Guillermo Roditi', + handle => 'groditi', + email => '', + } + +=head2 ignored_method_metaclasses + +=over 4 + +=item B - _build_ignored_method_metaclasses + +Default to the Moose and Class::MOP method metaclasses for generated methods, +accessors, and constructors. + +=item B - clear_ignored_method_metaclasses + +=item B - has_ignored_method_metaclasses + +=back + +Required read-write lazy-building value of type +L where the keys are method metaclasses +MooseX::AutoDoc should ignore when creating a method list. + +=head2 license_text + +=over 4 + +=item B - _build_license_text + +=item B - clear_license_text + +=item B - has_license_text + +=back + +Required read-write lazy-building value of type +L. By default it will use the following text: + + This library is free software; you can redistribute it and/or modify it + under the same terms as Perl itself. + +=head2 tc_to_lib_map + +=over 4 + +=item B - _build_tc_to_lib_map + +=item B - clear_tc_to_lib_map + +=item B - has_tc_to_lib_map + +=back + +Required read-write lazy-building value of type +L. The keys refer to type constraint +names and the values to the module where the documentation available for that +type is. Please note that if you are using MooseX::Types libraries the links +will be automatically generated if the library class can be found (most cases). + +=head2 view + +=over 4 + +=item B - _build_view + +Returns 'MooseX::AutoDoc::View::TT' + +=item B - clear_view + +=item B - has_view + +=back + +Required read-write lazy-building value of type AutoDocView. The AutoDocView +type will accept an Object that isa L. This attribute +will attempt to coerce string values to instances by treating them as class +names and attempting to load and instantiate a class of the same name. + +=head1 METHODS + +=head2 new $key => $value + +Instantiate a new object. Please refer to L for a list of valid +key options. + +=head2 generate_pod_for_class $class_name, $view_args + +Returns a string containing the Pod for the class. To make sure the data is +accurate please make sure the class has not been loaded prior to this step. +for more info see L + +=head2 generate_pod_for_role $role_name, $view_args + +Returns a string containing the Pod for the role.To make sure the data is +accurate please make sure the role has not been loaded prior to this step. +for more info see L + +=head2 _class_info $class_name + +Will return a hashref representing the documentation components of the class +with the keys C, C, C, C and, +C; the latter four representing array refs of the hashrefs returned +by L, L, L, and +L + +=head2 _role_info $role_name + +Will return a hashref representing the documentation components of the role +with the keys C, C, C and, C; the +latter three representing array refs of the hashrefs returned by +L, L, and L + +=head2 _attribute_info $attr + +Accepts one argument, an attribute metaclass instance. +Returns a hashref representing the documentation components of the +attribute with the keys C, C, and C, a hashref +of additional information. + +=head2 _consumed_role_info $role + +Accepts one argument, a role metaclass instance. Returns a hashref representing +the documentation components of the role with the key C. + +=head2 _method_info $method + +Accepts one argument, a method metaclass instance. Returns a hashref +representing the documentation components of the role with the key C. + +=head2 _superclass_info $class + +Accepts one argument, the metaclass instance of a superclass. Returns a hashref +representing the documentation components of the role with the key C. + +=head2 meta + +Retrieve the metaclass instance. Please see L and +L for more information. + +=head1 AUTHORS + +Guillermo Roditi (Guillermo Roditi) + +=head1 COPYRIGHT AND LICENSE +This library is free software; you can redistribute it and/or modify it under +the same terms as Perl itself. +=cut diff --git a/lib/MooseX/AutoDoc/View/TT.pm b/lib/MooseX/AutoDoc/View/TT.pm index aa46923..0145be8 100644 --- a/lib/MooseX/AutoDoc/View/TT.pm +++ b/lib/MooseX/AutoDoc/View/TT.pm @@ -143,7 +143,7 @@ END; =over 4 [% FOREACH pair IN attribute.info.pairs %] -=item B<[% pair.key %]> - [% pair.value %] +=item B<[% pair.key %]> - [% pair.value %] [% END %] =back [%- END; %] diff --git a/t/002-attributes.t b/t/002-attributes.t index 6ca793d..29d0960 100644 --- a/t/002-attributes.t +++ b/t/002-attributes.t @@ -23,7 +23,7 @@ my %attributes = map { $_ => $meta->get_attribute($_) } description => 'Optional read-only value' }; - my $spec = $autodoc->attribute_info($attributes{attr1}); + my $spec = $autodoc->_attribute_info($attributes{attr1}); is_deeply($spec, $target); } @@ -37,7 +37,7 @@ my %attributes = map { $_ => $meta->get_attribute($_) } description => 'Optional read-write value of type L' }; - my $spec = $autodoc->attribute_info($attributes{attr2}); + my $spec = $autodoc->_attribute_info($attributes{attr2}); is_deeply($spec, $target); } @@ -51,7 +51,7 @@ my %attributes = map { $_ => $meta->get_attribute($_) } 'description' => 'Optional read-write value of type L' }; - my $spec = $autodoc->attribute_info($attributes{attr3}); + my $spec = $autodoc->_attribute_info($attributes{attr3}); is_deeply($spec, $target); } @@ -65,7 +65,7 @@ my %attributes = map { $_ => $meta->get_attribute($_) } 'description' => 'Required read-write value of type L' }; - my $spec = $autodoc->attribute_info($attributes{attr4}); + my $spec = $autodoc->_attribute_info($attributes{attr4}); is_deeply($spec, $target); } @@ -79,7 +79,7 @@ my %attributes = map { $_ => $meta->get_attribute($_) } 'description' => 'Required read-write value of type L that will be automatically dereferenced by the reader / accessor' }; - my $spec = $autodoc->attribute_info($attributes{attr5}); + my $spec = $autodoc->_attribute_info($attributes{attr5}); is_deeply($spec, $target); } @@ -97,7 +97,7 @@ my %attributes = map { $_ => $meta->get_attribute($_) } 'description' => 'Required read-write lazy-building value' }; - my $spec = $autodoc->attribute_info($attributes{attr6}); + my $spec = $autodoc->_attribute_info($attributes{attr6}); is_deeply($spec, $target); } @@ -115,7 +115,7 @@ my %attributes = map { $_ => $meta->get_attribute($_) } 'description' => 'Optional value' }; - my $spec = $autodoc->attribute_info($attributes{attr7}); + my $spec = $autodoc->_attribute_info($attributes{attr7}); is_deeply($spec, $target); } diff --git a/t/003-moosex-types.t b/t/003-moosex-types.t index b30dcc6..55839ee 100644 --- a/t/003-moosex-types.t +++ b/t/003-moosex-types.t @@ -19,7 +19,7 @@ Class::MOP::load_class("AutoDocTest7"); plan tests => 1; my $autodoc = MooseX::AutoDoc->new; my $attr = AutoDocTest7->meta->get_attribute("typed_attr"); -my $spec = $autodoc->attribute_info($attr); +my $spec = $autodoc->_attribute_info($attr); my $target = 'Optional value of type L{description}, qr/$target/; diff --git a/t/100-class.t b/t/100-class.t index 4357657..a92b3e1 100644 --- a/t/100-class.t +++ b/t/100-class.t @@ -8,7 +8,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->class_info("AutoDocTest1"); +my $spec = $autodoc->_class_info("AutoDocTest1"); #we already tested this.. delete $spec->{attributes}; diff --git a/t/101-class.t b/t/101-class.t index fb6e197..80aa998 100644 --- a/t/101-class.t +++ b/t/101-class.t @@ -9,7 +9,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->class_info("AutoDocTest2"); +my $spec = $autodoc->_class_info("AutoDocTest2"); my $target = { name => 'AutoDocTest2', diff --git a/t/102-class.t b/t/102-class.t index b003edf..62b753f 100644 --- a/t/102-class.t +++ b/t/102-class.t @@ -8,7 +8,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->class_info("AutoDocTest3"); +my $spec = $autodoc->_class_info("AutoDocTest3"); my $target = { name => 'AutoDocTest3', diff --git a/t/103-class.t b/t/103-class.t index afb0999..77c65ec 100644 --- a/t/103-class.t +++ b/t/103-class.t @@ -8,7 +8,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->class_info("AutoDocTest4"); +my $spec = $autodoc->_class_info("AutoDocTest4"); my $target = { name => 'AutoDocTest4', diff --git a/t/104-class.t b/t/104-class.t index b87a4dd..2fb4347 100644 --- a/t/104-class.t +++ b/t/104-class.t @@ -8,7 +8,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->class_info("AutoDocTest5"); +my $spec = $autodoc->_class_info("AutoDocTest5"); my $target = { name => 'AutoDocTest5', diff --git a/t/105-class.t b/t/105-class.t index 92c9c1b..d46da94 100644 --- a/t/105-class.t +++ b/t/105-class.t @@ -8,7 +8,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->class_info("AutoDocTest6"); +my $spec = $autodoc->_class_info("AutoDocTest6"); my $target = { name => 'AutoDocTest6', diff --git a/t/200-role.t b/t/200-role.t index 0e50f44..98701a0 100644 --- a/t/200-role.t +++ b/t/200-role.t @@ -8,7 +8,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->role_info("AutoDocTest::Role::Role1"); +my $spec = $autodoc->_role_info("AutoDocTest::Role::Role1"); my $target = { name => 'AutoDocTest::Role::Role1', diff --git a/t/201-role.t b/t/201-role.t index 18b5c22..4667b9a 100644 --- a/t/201-role.t +++ b/t/201-role.t @@ -8,7 +8,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->role_info("AutoDocTest::Role::Role2"); +my $spec = $autodoc->_role_info("AutoDocTest::Role::Role2"); my $target = { name => 'AutoDocTest::Role::Role2', diff --git a/t/202-role.t b/t/202-role.t index e070193..e4ab9dc 100644 --- a/t/202-role.t +++ b/t/202-role.t @@ -8,7 +8,7 @@ use lib "$Bin/lib"; use Test::More tests => 1; my $autodoc = MooseX::AutoDoc->new; -my $spec = $autodoc->role_info("AutoDocTest::Role::Role3"); +my $spec = $autodoc->_role_info("AutoDocTest::Role::Role3"); my $target = { name => 'AutoDocTest::Role::Role3',