| 1 | # | ||||||||||
| 2 | # This file is part of Dist-Zilla-PluginBundle-GRS | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is copyright (c) 2013 by celogeek <me@celogeek.com>. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||
| 8 | # | ||||||||||
| 9 | package Dist::Zilla::PluginBundle::GRS; | ||||||||||
| 10 | |||||||||||
| 11 | # ABSTRACT: Dist::Zilla like GRS | ||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 1 | our $VERSION = '0.08'; # VERSION | |||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 1 | ▶ | use Class::MOP; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 1 | with 'Dist::Zilla::Role::PluginBundle::Easy', | |||||||||
| 21 | 'Dist::Zilla::Role::PluginBundle::PluginRemover'; | ||||||||||
| 22 | |||||||||||
| 23 | 1 | my $PERLTIDY_SAMPLE = <<'EOF' | |||||||||
| 24 | #Perl Best Practice Conf | ||||||||||
| 25 | -l=78 | ||||||||||
| 26 | -i=4 | ||||||||||
| 27 | -ci=4 | ||||||||||
| 28 | #-st | ||||||||||
| 29 | -se | ||||||||||
| 30 | -vt=2 | ||||||||||
| 31 | -cti=0 | ||||||||||
| 32 | -pt=1 | ||||||||||
| 33 | -bt=1 | ||||||||||
| 34 | -sbt=1 | ||||||||||
| 35 | -bbt=1 | ||||||||||
| 36 | -nsfs | ||||||||||
| 37 | -nolq | ||||||||||
| 38 | -wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=" | ||||||||||
| 39 | EOF | ||||||||||
| 40 | ; | ||||||||||
| 41 | 1 | my $PERLCRITIC_SAMPLE = <<'EOF' | |||||||||
| 42 | severity = 3 | ||||||||||
| 43 | verbose = 6 | ||||||||||
| 44 | top = 50 | ||||||||||
| 45 | theme = pbp || core || bugs || security || maintenance | ||||||||||
| 46 | criticism-fatal = 1 | ||||||||||
| 47 | color = 1 | ||||||||||
| 48 | allow-unsafe = 1 | ||||||||||
| 49 | EOF | ||||||||||
| 50 | ; | ||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub before_build { | ||||||||
|
Subroutine
before_build: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||
| 53 | 0 | my $self = shift; | |||||||||
| 54 | 0 | ▶ | unless ( -d 'xt' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | 0 | mkdir('xt'); | |||||||||
| 56 | } | ||||||||||
| 57 | 0 | ▶ | unless ( -e 'xt/perltidy.rc' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | 0 | ▶ | if ( open my $f, '>', 'xt/perltidy.rc' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 0 | print $f $PERLTIDY_SAMPLE; | |||||||||
| 60 | 0 | close $f; | |||||||||
| 61 | } | ||||||||||
| 62 | } | ||||||||||
| 63 | 0 | ▶ | unless ( -e 'xt/perlcritic.rc' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 64 | 0 | ▶ | if ( open my $f, '>', 'xt/perlcritic.rc' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | 0 | print $f $PERLCRITIC_SAMPLE; | |||||||||
| 66 | 0 | close $f; | |||||||||
| 67 | } | ||||||||||
| 68 | } | ||||||||||
| 69 | 0 | return; | |||||||||
| 70 | } | ||||||||||
| 71 | |||||||||||
| 72 | 0 | ▶ | sub configure { | ||||||||
|
Subroutine
configure: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 73 | 0 | my $self = shift; | |||||||||
| 74 | |||||||||||
| 75 | #init some file like perltidy and perlcritic rc files | ||||||||||
| 76 | 0 | $self->before_build; | |||||||||
| 77 | |||||||||||
| 78 | 0 | $self->add_bundle( 'Filter', | |||||||||
| 79 | { bundle => '@Basic', remove => [ 'MakeMaker', 'UploadToCPAN' ] } ); | ||||||||||
| 80 | 0 | $self->add_plugins( | |||||||||
| 81 | 'ModuleBuild', | ||||||||||
| 82 | 'ReportVersions', | ||||||||||
| 83 | 'OurPkgVersion', | ||||||||||
| 84 | [ 'Prepender' => { copyright => 1 } ], | ||||||||||
| 85 | 'AutoPrereqs', | ||||||||||
| 86 | 'Prereqs', | ||||||||||
| 87 | 'MinimumPerl', | ||||||||||
| 88 | 'Test::Compile', | ||||||||||
| 89 | 'Test::UnusedVars', | ||||||||||
| 90 | 'PodCoverageTests', | ||||||||||
| 91 | 'PruneFiles', | ||||||||||
| 92 | 'ReadmeMarkdownFromPod', | ||||||||||
| 93 | 'MetaJSON', | ||||||||||
| 94 | [ 'MetaResourcesFromGit' => | ||||||||||
| 95 | { 'bugtracker.web' => 'https://github.com/%a/%r/issues' } | ||||||||||
| 96 | ], | ||||||||||
| 97 | 'MetaConfig', | ||||||||||
| 98 | [ 'PodWeaver' => { 'config_plugin' => '@GRS' } ], | ||||||||||
| 99 | [ 'PerlTidy' => { 'perltidyrc' => 'xt/perltidy.rc' } ], | ||||||||||
| 100 | [ 'Test::Perl::Critic' => { 'critic_config' => 'xt/perlcritic.rc' } ], | ||||||||||
| 101 | ['Test::Kwalitee::Extra'], | ||||||||||
| 102 | ); | ||||||||||
| 103 | |||||||||||
| 104 | 0 | return; | |||||||||
| 105 | } | ||||||||||
| 106 | |||||||||||
| 107 | 1 | 1; | |||||||||
| 108 | |||||||||||
| 109 | __END__ | ||||||||||