[libdist-zilla-role-bootstrap-perl] 06/07: Improve docs
Axel Beckert
abe at deuxchevaux.org
Sat Aug 8 11:58:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
abe pushed a commit to annotated tag 0.1.0-source
in repository libdist-zilla-role-bootstrap-perl.
commit 02ce015874d0241079720d4c72cc36ad7ccf8ad6
Author: Kent Fredric <kentfredric at gmail.com>
Date: Wed Sep 4 23:21:14 2013 +1200
Improve docs
---
README.mkdn | 70 ++++++++++++++++++++++++++++++++++++++++
lib/Dist/Zilla/Role/Bootstrap.pm | 45 +++++++++++++++++++++++++-
weaver.ini | 5 +++
3 files changed, 119 insertions(+), 1 deletion(-)
diff --git a/README.mkdn b/README.mkdn
new file mode 100644
index 0000000..931a3c8
--- /dev/null
+++ b/README.mkdn
@@ -0,0 +1,70 @@
+# NAME
+
+Dist::Zilla::Role::Bootstrap - Shared logic for boostrap things.
+
+# VERSION
+
+version 0.1.0
+
+# SYNOPSIS
+
+For consuming plugins:
+
+ use Moose;
+ with 'Dist::Zilla::Role::Bootstrap';
+
+ sub bootstrap {
+ my $bootstrap_root = $_[0]->_bootstrap_root;
+ # Do the actual bootstrap work here
+ $_[0]->_add_inc('./some/path/here');
+ }
+
+For users of plugins:
+
+ [Some::Plugin::Name]
+ try_built = 0 ; # use / as the root to bootstrap
+ try_built = 1 ; # try to use /Dist-Name-.*/ instead of /
+
+ fallback = 0 ; # don't bootstrap at all if /Dist-Name-.*/ matches != 1 things
+ fallback = 1 ; # fallback to / if /Dist-Name-.*/ matches != 1 things
+
+# REQUIRED METHODS
+
+## `bootstrap`
+
+# ATTRIBUTES
+
+## `distname`
+
+## `try_built`
+
+## `fallback`
+
+# PRIVATE ATTRIBUTES
+
+## `_cwd`
+
+## `_bootstrap_root`
+
+# PRIVATE METHODS
+
+## `_add_inc`
+
+{
+ "namespace":"Dist::Zilla::Role::Bootstrap",
+ "interface":"role",
+ "does":"Dist::Zilla::Role::Plugin"
+}
+
+
+
+# AUTHOR
+
+Kent Fredric <kentfredric at gmail.com>
+
+# COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2013 by Kent Fredric <kentfredric at gmail.com>.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Dist/Zilla/Role/Bootstrap.pm b/lib/Dist/Zilla/Role/Bootstrap.pm
index e1b98e0..541a6c9 100644
--- a/lib/Dist/Zilla/Role/Bootstrap.pm
+++ b/lib/Dist/Zilla/Role/Bootstrap.pm
@@ -20,6 +20,31 @@ use MooseX::AttributeShortcuts;
=cut
+=head1 SYNOPSIS
+
+For consuming plugins:
+
+ use Moose;
+ with 'Dist::Zilla::Role::Bootstrap';
+
+ sub bootstrap {
+ my $bootstrap_root = $_[0]->_bootstrap_root;
+ # Do the actual bootstrap work here
+ $_[0]->_add_inc('./some/path/here');
+ }
+
+For users of plugins:
+
+ [Some::Plugin::Name]
+ try_built = 0 ; # use / as the root to bootstrap
+ try_built = 1 ; # try to use /Dist-Name-.*/ instead of /
+
+ fallback = 0 ; # don't bootstrap at all if /Dist-Name-.*/ matches != 1 things
+ fallback = 1 ; # fallback to / if /Dist-Name-.*/ matches != 1 things
+
+
+=cut
+
with 'Dist::Zilla::Role::Plugin';
around 'dump_config' => sub {
@@ -39,7 +64,15 @@ around 'dump_config' => sub {
return $config;
};
-has distname => ( is => ro =>, lazy => 1, builder => sub { $_[0]->zilla->name; }, );
+=attr C<distname>
+
+=cut
+
+has distname => ( isa => 'Str', is => ro =>, lazy => 1, builder => sub { $_[0]->zilla->name; }, );
+
+=p_attr C<_cwd>
+
+=cut
has _cwd => (
is => ro =>,
@@ -56,6 +89,7 @@ has _cwd => (
=cut
has try_built => (
+ isa => 'Bool',
is => ro =>,
lazy => 1,
builder => sub { return },
@@ -66,6 +100,7 @@ has try_built => (
=cut
has fallback => (
+ isa => 'Bool',
is => ro =>,
lazy => 1,
builder => sub { return 1 },
@@ -101,6 +136,10 @@ has _bootstrap_root => (
},
);
+=p_method C<_add_inc>
+
+=cut
+
sub _add_inc {
my ( $self, $import ) = @_;
if ( not ref $import ) {
@@ -110,6 +149,10 @@ sub _add_inc {
die "At this time, _add_inc(arg) only supports scalar values of arg";
}
+=requires C<bootstrap>
+
+=cut
+
requires 'bootstrap';
around plugin_from_config => sub {
diff --git a/weaver.ini b/weaver.ini
index 7fb633e..735607b 100644
--- a/weaver.ini
+++ b/weaver.ini
@@ -12,6 +12,11 @@
;[Generic / METHODS]
;[Collect / METHODS]
+
+[Collect / REQUIRES]
+command = requires
+header = REQUIRED METHODS
+
[Collect / METHODS]
command = method
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdist-zilla-role-bootstrap-perl.git
More information about the Pkg-perl-cvs-commits
mailing list