--- trunk/lib/Frey/Introspect.pm 2008/12/06 12:22:36 735 +++ trunk/lib/Frey/Introspect.pm 2009/01/11 12:09:58 993 @@ -18,6 +18,12 @@ with 'Frey::Web'; with 'Frey::Storage'; +=head1 DESCRIPTION + +Provide introspection on any perl class installed on system + +=cut + has 'class' => ( is => 'rw', isa => 'Str', @@ -54,7 +60,9 @@ $out .= "\t\t\t$_: {\n"; my $attr = $meta->get_attribute($_); - my $is = $attr->_is_metadata; + my $is = eval { $attr->_is_metadata; }; + return if $@; + $out .= "\t\t\t\tis: \"$is\",\n" if defined $is; $out .= "\t\t\t\tlazy: true,\n" if $attr->is_lazy; $out .= "\t\t\t\trequired: true,\n" if $attr->is_required; @@ -108,6 +116,7 @@ my ( $meta, $is_role ) = $self->class_meta; my $class = $self->class; + $self->title( $class ); my $introspect_path = "var/introspect/$class.yaml"; $self->mkbasepath( $introspect_path ); @@ -121,7 +130,9 @@ map { my $name = $_->meta->name; $introspect->{superclass}->{$name} = {}; - $self->dropdown( $name, $_->meta ) + + qq|$name| . + $self->dropdown( qq|?|, $_->meta ) } #grep { $_ ne 'Moose::Object' } $meta->superclasses @@ -141,11 +152,18 @@ $introspect->{roles}->{$name} = {}; $method_from_role->{ $_ }->{$name} = $role_nr foreach $_->get_method_list; $attribute_from_role->{ $_ }->{$name} = $role_nr foreach $_->get_attribute_list; - $self->dropdown( $name, $name->meta ) . qq|| . $role_nr++ . qq||; + + qq|$name| +# . qq|| . $self->dropdown( $role_nr++, $name->meta ) . qq|| + . $self->dropdown( + qq|| . $role_nr++ . qq||, + $name->meta + ) + ; } $meta->calculate_all_roles ); - $roles = qq| with roles: $roles| if $roles; + $roles = qq|with roles: $roles| if $roles; } warn "# method_from_role ",dump( $method_from_role ); @@ -160,7 +178,9 @@ $introspect->{methods}->{$name} = {}; } qq|
$v
|
+ ;
}
$properties .= ' ';
}
@@ -210,12 +231,14 @@
span.documentation {
background: #eee;
padding: 0.25em;
+ float: left;
+ clear: left;
}
|);
$introspect->{action}->{$name}->{documentation} = $doc;
}
- qq|