From 651303c26d6978ceffca7e3cc99957eee46ef098 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 13 Jun 2010 14:35:48 -0500 Subject: implementation --- lib/Dist/Zilla/PluginBundle/DOY.pm | 154 ++++++++++++++++++++++++++----------- 1 file changed, 111 insertions(+), 43 deletions(-) (limited to 'lib') diff --git a/lib/Dist/Zilla/PluginBundle/DOY.pm b/lib/Dist/Zilla/PluginBundle/DOY.pm index 061e3dc..8fbecfd 100644 --- a/lib/Dist/Zilla/PluginBundle/DOY.pm +++ b/lib/Dist/Zilla/PluginBundle/DOY.pm @@ -1,71 +1,139 @@ package Dist::Zilla::PluginBundle::DOY; use Moose; +# ABSTRACT: Dist::Zilla plugins for me -=head1 NAME - -Dist::Zilla::PluginBundle::DOY - +use Dist::Zilla; +with 'Dist::Zilla::Role::PluginBundle::Easy'; =head1 SYNOPSIS + # dist.ini + [@DOY] + dist = Dist-Zilla-PluginBundle-DOY =head1 DESCRIPTION +My plugin bundle. Roughly equivalent to: -=cut - -__PACKAGE__->meta->make_immutable; -no Moose; - -=head1 BUGS - -No known bugs. - -Please report any bugs through RT: email -C, or browse to -L. - -=head1 SEE ALSO - + [@Basic] -=head1 SUPPORT + [MetaConfig] + [MetaJSON] -You can find this documentation for this module with the perldoc command. + [NextRelease] + format = %-5v %{yyyy-MM-dd}d - perldoc Dist::Zilla::PluginBundle::DOY + [PkgVersion] -You can also look for information at: + [PodCoverageTests] + [PodSyntaxTests] + [NoTabsTests] + [EOLTests] + [CompileTests] -=over 4 + [Repository] + git_remote = git://github.com/doy/${lowercase_dist} + github_http = 0 -=item * AnnoCPAN: Annotated CPAN documentation + [Git::Check] + allow_dirty = + [Git::Tag] + tag_format = %v + tag_message = + [BumpVersionFromGit] + version_regexp = \d+\.\d+ + first_version = 0.01 -L + [PodWeaver] -=item * CPAN Ratings - -L - -=item * RT: CPAN's request tracker - -L - -=item * Search CPAN - -L +=cut -=back +has dist => ( + is => 'ro', + isa => 'Str', + required => 1, +); + +has is_task => ( + is => 'ro', + isa => 'Bool', + lazy => 1, + default => sub { shift->dist =~ /^Task-/ ? 1 : 0 }, +); + +has is_test_dist => ( + is => 'ro', + isa => 'Bool', + lazy => 1, + default => sub { shift->dist =~ /^Foo-/ ? 1 : 0 }, +); + +has github_url => ( + is => 'ro', + isa => 'Str', + lazy => 1, + default => sub { + my $self = shift; + my $dist = $self->dist; + $dist = lc($dist); + "git://github.com/doy/$dist.git"; + }, +); + +around BUILDARGS => sub { + my $orig = shift; + my $class = shift; + my $args = $class->$orig(@_); + return { %{ $args->{payload} }, %{ $args } }; +}; + +sub configure { + my $self = shift; + + if ($self->is_test_dist) { + $self->add_bundle( + '@Filter' => { bundle => '@Basic', remove => ['UploadToCPAN'] } + ); + $self->add_plugins('FakeRelease'); + } + else { + $self->add_bundle('@Basic'); + } + + $self->add_plugins( + 'MetaConfig', + 'MetaJSON', + ['NextRelease' => { format => '%-5v %{yyyy-MM-dd}d' }], + 'PkgVersion', + 'PodCoverageTests', + 'PodSyntaxTests', + 'NoTabsTests', + 'EOLTests', + 'CompileTests', + ['Repository' => { git_remote => $self->github_url, github_http => 0 }], + ['Git::Check' => { allow_dirty => '' }], + ['Git::Tag' => { tag_format => '%v', tag_message => '' }], + ['BumpVersionFromGit' => { version_regexp => '\d+\.\d+', first_version => '0.01'}], + 'PodWeaver', + ); + + $self->add_plugins('TaskWeaver') if $self->is_task; +} -=head1 AUTHOR +=head1 SEE ALSO - Jesse Luehrs +L +L -=head1 COPYRIGHT AND LICENSE +=begin Pod::Coverage -This software is copyright (c) 2010 by Jesse Luehrs. + configure -This is free software; you can redistribute it and/or modify it under -the same terms as perl itself. +=end Pod::Coverage =cut +__PACKAGE__->meta->make_immutable; +no Moose; + 1; -- cgit v1.2.3-54-g00ecf