From: Stevan Little Date: Sat, 8 Apr 2006 15:40:33 +0000 (+0000) Subject: moosedoc X-Git-Tag: 0_05~45 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=20cf91c1709e499d00f01d159efc246258ab4199;p=gitmo%2FMoose.git moosedoc --- diff --git a/bin/moosedoc.pl b/bin/moosedoc.pl new file mode 100644 index 0000000..8e88e69 --- /dev/null +++ b/bin/moosedoc.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use lib './lib'; + +use Moose; + +=pod + +=head1 ROADMAP + +This is the roadmap for the moosedoc utility. It is just a rough +sketch of what I am thinking for this. + +First question, should it be source-file oriented? or class oriented? + +In other words, should I have to do this: + + > moosedoc --target ./my_project/lib/ + +And have moosedoc traverse the ./my_project/lib/ directory looking for +.pm files, loading each one and then creating a .pod for it based on the +moose introspection? + +Or should it do this: + + > moosedoc --target ./my_project/script.pl + +And have moosedoc then ask Moose what classes/types/subtypes/etc. I +loaded, and create some kind of .pod for them? + +Second question, should I create a large source repository like javadoc? +or should it just be a file-per-file thing? + +If I do it like javadoc, then I would need an index file, a frameset, a +file for all types/subtypes made, one for all classes, one for all roles, +etc. At that point, POD may not make sense, and we are into pure HTML +(for the hyperlinking of course). This then restricts the type of output. + +Hmmm,.. gotta do some thinking. + +=cut diff --git a/lib/Moose/Cookbook/Recipe6.pod b/lib/Moose/Cookbook/Recipe6.pod index ed8d572..0e3b0a3 100644 --- a/lib/Moose/Cookbook/Recipe6.pod +++ b/lib/Moose/Cookbook/Recipe6.pod @@ -17,12 +17,8 @@ Moose::Cookbook::Recipe6 - The Moose::Role example around 'validate' => sub { my $c = shift; my ($self, $field) = @_; - if ($c->($self, $self->validation_value($field))) { - return undef; - } - else { - return $self->error_message; - } + return undef if $c->($self, $self->validation_value($field)); + return $self->error_message; }; sub validation_value { diff --git a/t/006_basic.t b/t/006_basic.t index c62a801..d256933 100644 --- a/t/006_basic.t +++ b/t/006_basic.t @@ -23,12 +23,8 @@ BEGIN { around 'validate' => sub { my $c = shift; my ($self, $field) = @_; - if ($c->($self, $self->validation_value($field))) { - return undef; - } - else { - return $self->error_message; - } + return undef if $c->($self, $self->validation_value($field)); + return $self->error_message; }; sub validation_value {