apocalypse/perl-dist-zilla-plugin-authority — pull request #5 by kentfredric (2013-01-06 16:44:32+00:00)
Title: Pkg block syntax support

This patchset, amongst other things, adds better support for v5.14+

```perl
package Foo {
# body
}
1;
```

Style notation.
As-is, it erroneously places the AUTHORITY declaration **after** the ```1``` at the end, like so:

```perl
package Foo {
# body
}
1;
BEGIN {
$Foo::AUTHORITY = 'cpan:kentnl';
}
```
Which is rather bad, and the augmented code now instead does:
```perl
package Foo {
BEGIN {
$Foo::AUTHORITY = 'cpan:kentnl';
}

# body
}
1;
```

In the process of doing so, I incidentally discovered the code that inserted the `our $AUTHORITY` stanzas caused Authority.pm to self-positive when scanning itself:

```
[DZ] beginning to build Dist-Zilla-Plugin-Authority
[@Filter/Git::NextVersion] Bumping version from 1.006 to 1.007
[DZ] guessing dist's main_module is lib/Dist/Zilla/Plugin/Authority.pm
[DZ] extracting distribution abstract from lib/Dist/Zilla/Plugin/Authority.pm
[@Filter/Authority] skipping lib/Dist/Zilla/Plugin/Authority.pm: assigns to $AUTHORITY ## <---
[DZ] writing Dist-Zilla-Plugin-Authority in Dist-Zilla-Plugin-Authority-1.007
[DZ] building archive with Archive::Tar; install Archive::Tar::Wrapper for improved speed
[DZ] writing archive to Dist-Zilla-Plugin-Authority-1.007.tar.gz
```

And additionally, the code was a little hard to parse as to what was doing what, so I refactored the hell out of it, and it now uses templates ( sprintf ) to avoid detection instead of a silly \x20 hack.

I also in my travels noticed the code has several indentation styles, and could much do with a bundled .perltidyrc file that can be gauranteed upon, but have left my already-tided form of the same in a seperate branch.