c9s/Git-Hook-PostReceive — pull request #2 by nichtich (2013-08-13 08:52:56+00:00)
Title: Extended to version 0.2

I further extended some bits for version 0.2:

* argument to `read_stdin` is now optional
* decode utf8 on request - **should this be enable by default?!**
* increased test code coverage to 100%

With this changes one can create a post-recieve hook that emulates GitHub webhooks:

~~~
use Git::Hook::PostReceive 0.2;
use LWP::UserAgent;
use JSON;

my $ua = LWP::UserAgent->new;
for (Git::Hook::PostReceive->new( utf8 => 1 )->read_stdin) {
$ua->post( "http://example.org/webhook", { 'payload' => to_json($_) } );
}
~~~

To release at CPAN when your applications have been tested:

dzil authordeps | cpanm
dzil release