Deal with authorship properly, in a future-sustainable fashion
[dbsrgits/DBIx-Class.git] / maint / gen_pod_authors
diff --git a/maint/gen_pod_authors b/maint/gen_pod_authors
new file mode 100755 (executable)
index 0000000..0bfa32c
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+# we will be outputting *ENCODED* utf8, hence the raw open below
+# the file is already sanity-checked by xt/authors.t
+my @known_authors = do {
+  open (my $fh, '<:raw', 'AUTHORS') or die "Unable to open AUTHORS - can't happen: $!\n";
+  map { chomp; ( ( ! $_ or $_ =~ /^\s*\#/ ) ? () : $_ ) } <$fh>;
+} or die "Known AUTHORS file seems empty... can't happen...";
+
+$_ =~ s!( \b https? :// [^\s\>]+ )!L<$1|$1>!x
+  for @known_authors;
+
+print join "\n\n",
+  '=encoding utf8',
+  '=over',
+  @known_authors,
+  '=back',
+  '',
+;
+
+1;