[libdist-zilla-plugin-githubmeta-perl] 01/02: add the possibility to custom the remote branch
Axel Beckert
abe at deuxchevaux.org
Sun Apr 26 22:25:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
abe pushed a commit to annotated tag 0.10
in repository libdist-zilla-plugin-githubmeta-perl.
commit 2219dda78a844e09f12c539e34e43447fc1f9557
Author: Yanick Champoux <yanick at babyl.dyndns.org>
Date: Sun Jun 20 00:12:38 2010 +0800
add the possibility to custom the remote branch
---
lib/Dist/Zilla/Plugin/GithubMeta.pm | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/lib/Dist/Zilla/Plugin/GithubMeta.pm b/lib/Dist/Zilla/Plugin/GithubMeta.pm
index 435290a..a061a40 100644
--- a/lib/Dist/Zilla/Plugin/GithubMeta.pm
+++ b/lib/Dist/Zilla/Plugin/GithubMeta.pm
@@ -15,11 +15,17 @@ has 'homepage' => (
coerce => 1,
);
+has remote => (
+ is => 'ro',
+ default => 'origin',
+);
+
sub metadata {
my $self = shift;
return unless _under_git();
return unless can_run('git');
- return unless my ($git_url) = `git remote show -n origin` =~ /URL: (.*)$/m;
+ my $origin = $self->remote;
+ return unless my ($git_url) = `git remote show -n $origin` =~ /URL: (.*)$/m;
return unless $git_url =~ /github\.com/; # Not a Github repository
my $web_url = $git_url;
$git_url =~ s![\w\-]+\@([^:]+):!git://$1/!;
@@ -70,6 +76,10 @@ Dist::Zilla::Plugin::GithubMeta - Automatically include GitHub meta information
[GithubMeta]
homepage = http://some.sort.of.url/project/
+ # to override the github remote repo (defaults to 'origin')
+ [GithubMeta]
+ remote=github
+
=head1 DESCRIPTION
Dist::Zilla::Plugin::GithubMeta is a L<Dist::Zilla> plugin to include GitHub L<http://github.com> meta
@@ -77,12 +87,17 @@ information in C<META.yml>.
It automatically detects if the distribution directory is under C<git> version control and whether the
C<origin> is a GitHub repository and will set the C<repository> and C<homepage> meta in C<META.yml> to the
-appropriate URLs for GitHub.
+appropriate URLs for GitHub.
=head2 ATTRIBUTES
=over
+=item C<remote>
+
+The GitHub remote repo can be overriden with this attribute. If not
+provided, it defaults to C<origin>.
+
=item C<homepage>
You may override the C<homepage> setting by specifying this attribute. This should be a valid URL as
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdist-zilla-plugin-githubmeta-perl.git
More information about the Pkg-perl-cvs-commits
mailing list