Skip to content
Browse files

Initial commit, copy of old bundle + adding Changes from git

  • Loading branch information...
0 parents commit 12b8777318e41936f635ff376aa450374c07b31a @Getty committed Jul 5, 2012
Showing with 253 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +26 −0 dist.ini
  3. +159 −0 lib/Dist/Zilla/PluginBundle/Author/GETTY.pm
  4. +59 −0 lib/Pod/Weaver/PluginBundle/Author/GETTY.pm
  5. +7 −0 t/compile.t
2 .gitignore
@@ -0,0 +1,2 @@
+Dist-Zilla-PluginBundle-Author-GETTY-*
+.build
26 dist.ini
@@ -0,0 +1,26 @@
+name = Dist-Zilla-PluginBundle-Author-GETTY
+author = Torsten Raudssus <torsten@raudss.us> L<http://www.raudss.us/>
+license = Perl_5
+copyright_holder = Torsten Raudssus L<http://www.raudss.us/>
+copyright_year = 2012
+
+[@Author::GETTY]
+
+[Prereqs]
+Dist::Zilla = 1.092990 ; new-style bundle expansion
+Pod::Elemental = 0.092970
+Pod::Weaver = 3.100310 ; =func, compat fixes
+Dist::Zilla::Plugin::PodWeaver = 3.092971
+Dist::Zilla::Plugin::Repository = 0
+Dist::Zilla::Plugin::TaskWeaver = 0.093330
+Dist::Zilla::Plugin::BumpVersionFromGit = 0
+Dist::Zilla::Plugin::GithubMeta = 0
+Dist::Zilla::Plugin::InstallRelease = 0.007
+Dist::Zilla::Plugin::Authority = 0
+Dist::Zilla::Plugin::ChangelogFromGit = 0
+Dist::Zilla::PluginBundle::Git = 0
+Pod::Elemental::Transformer::List = 0
+App::cpanminus = 0
+
+[Prereqs / TestRequires]
+Test::More = 0.90
159 lib/Dist/Zilla/PluginBundle/Author/GETTY.pm
@@ -0,0 +1,159 @@
+package Dist::Zilla::PluginBundle::Author::GETTY;
+# ABSTRACT: BeLike::GETTY when you build your dists
+
+use Moose;
+use Moose::Autobox;
+use Dist::Zilla 2.100922; # TestRelease
+with 'Dist::Zilla::Role::PluginBundle::Easy';
+
+=head1 DESCRIPTION
+
+This is the plugin bundle that GETTY uses. It is equivalent to:
+
+ [@Basic]
+
+ [Git::NextVersion]
+ [PkgVersion]
+ [MetaConfig]
+ [MetaJSON]
+ [NextRelease]
+ [PodSyntaxTests]
+ [GithubMeta]
+ [InstallRelease]
+ install_command = cpanm .
+
+ [Authority]
+ authority = cpan:GETTY
+ do_metadata = 1
+
+ [PodWeaver]
+ config_plugin = @GETTY
+
+ [Repository]
+
+ [@Git]
+ tag_format = %v
+ push_to = origin
+
+If the C<task> argument is given to the bundle, PodWeaver is replaced with
+TaskWeaver and Git::NextVersion is replaced with AutoVersion. If the
+C<manual_version> argument is given, AutoVersion is omitted.
+
+=cut
+
+use Dist::Zilla::PluginBundle::Basic;
+use Dist::Zilla::PluginBundle::Git;
+
+has manual_version => (
+ is => 'ro',
+ isa => 'Bool',
+ lazy => 1,
+ default => sub { $_[0]->payload->{manual_version} },
+);
+
+has major_version => (
+ is => 'ro',
+ isa => 'Int',
+ lazy => 1,
+ default => sub { $_[0]->payload->{version} || 0 },
+);
+
+has is_task => (
+ is => 'ro',
+ isa => 'Bool',
+ lazy => 1,
+ default => sub { $_[0]->payload->{task} },
+);
+
+has weaver_config => (
+ is => 'ro',
+ isa => 'Str',
+ lazy => 1,
+ default => sub { $_[0]->payload->{weaver_config} || '@Author::GETTY' },
+);
+
+sub configure {
+ my ($self) = @_;
+
+ $self->log_fatal("you must not specify both weaver_config and is_task")
+ if $self->is_task and $self->weaver_config ne '@Author::GETTY';
+
+ $self->add_bundle('@Basic');
+
+ unless ($self->manual_version) {
+ if ($self->is_task) {
+ my $v_format = q<{{cldr('yyyyMMdd')}}>
+ . sprintf('.%03u', ($ENV{N} || 0));
+
+ $self->add_plugins([
+ AutoVersion => {
+ major => $self->major_version,
+ format => $v_format,
+ }
+ ]);
+ } else {
+ $self->add_plugins([
+ 'Git::NextVersion' => {
+ version_regexp => '^([0-9]+\.[0-9]+)$',
+ }
+ ]);
+ }
+ }
+
+ $self->add_plugins(qw(
+ PkgVersion
+ MetaConfig
+ MetaJSON
+ PodSyntaxTests
+ Repository
+ GithubMeta
+ ));
+
+ $self->add_plugins([
+ 'InstallRelease' => {
+ install_command => 'cpanm .',
+ }
+ ]);
+
+ $self->add_plugins([
+ 'Authority' => {
+ authority => 'cpan:GETTY',
+ do_metadata => 1,
+ }
+ ]);
+
+ $self->add_plugins(
+ [ Prereqs => 'TestMoreWithSubtests' => {
+ -phase => 'test',
+ -type => 'requires',
+ 'Test::More' => '0.96'
+ } ],
+ );
+
+ $self->add_plugins([
+ 'ChangelogFromGit' => {
+ max_age => 99999,
+ tag_regexp => '^v(.+)$',
+ file_name => 'Changes',
+ wrap_column => 74,
+ debug => 0,
+ }
+ ]);
+
+ if ($self->is_task) {
+ $self->add_plugins('TaskWeaver');
+ } else {
+ $self->add_plugins([
+ PodWeaver => { config_plugin => $self->weaver_config }
+ ]);
+ }
+
+ $self->add_bundle('@Git' => {
+ tag_format => '%v',
+ push_to => [ qw(origin) ],
+ });
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
59 lib/Pod/Weaver/PluginBundle/Author/GETTY.pm
@@ -0,0 +1,59 @@
+use strict;
+use warnings;
+package Pod::Weaver::PluginBundle::Author::GETTY;
+# ABSTRACT: GETTY's default Pod::Weaver config
+
+=head1 DESCRIPTION
+
+So far just a fork of L<Pod::Weaver::PluginBundle::RJBS>
+
+=head1 OVERVIEW
+
+Roughly equivalent to:
+
+=for :list
+* C<@Default>
+* C<-Transformer> with L<Pod::Elemental::Transformer::List>
+
+=cut
+
+use Pod::Weaver::Config::Assembler;
+sub _exp { Pod::Weaver::Config::Assembler->expand_package($_[0]) }
+
+sub mvp_bundle_config {
+ my @plugins;
+ push @plugins, (
+ [ '@GETTY/CorePrep', _exp('@CorePrep'), {} ],
+ [ '@GETTY/Name', _exp('Name'), {} ],
+ [ '@GETTY/Version', _exp('Version'), {} ],
+
+ [ '@GETTY/Prelude', _exp('Region'), { region_name => 'prelude' } ],
+ [ '@GETTY/Synopsis', _exp('Generic'), { header => 'SYNOPSIS' } ],
+ [ '@GETTY/Description', _exp('Generic'), { header => 'DESCRIPTION' } ],
+ [ '@GETTY/Overview', _exp('Generic'), { header => 'OVERVIEW' } ],
+
+ [ '@GETTY/Stability', _exp('Generic'), { header => 'STABILITY' } ],
+ );
+
+ for my $plugin (
+ [ 'Attributes', _exp('Collect'), { command => 'attr' } ],
+ [ 'Methods', _exp('Collect'), { command => 'method' } ],
+ [ 'Functions', _exp('Collect'), { command => 'func' } ],
+ ) {
+ $plugin->[2]{header} = uc $plugin->[0];
+ push @plugins, $plugin;
+ }
+
+ push @plugins, (
+ [ '@GETTY/Leftovers', _exp('Leftovers'), {} ],
+ [ '@GETTY/postlude', _exp('Region'), { region_name => 'postlude' } ],
+ [ '@GETTY/Bugs', _exp('Bugs'), {} ],
+ [ '@GETTY/Authors', _exp('Authors'), {} ],
+ [ '@GETTY/Legal', _exp('Legal'), {} ],
+ [ '@GETTY/List', _exp('-Transformer'), { 'transformer' => 'List' } ],
+ );
+
+ return @plugins;
+}
+
+1;
7 t/compile.t
@@ -0,0 +1,7 @@
+use strict;
+use warnings;
+use Test::More;
+
+require_ok('Dist::Zilla::PluginBundle::Author::GETTY');
+
+done_testing;

0 comments on commit 12b8777

Please sign in to comment.
Something went wrong with that request. Please try again.