line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
951045
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
68
|
|
2
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
108
|
|
3
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::BumpVersionFromGit; |
4
|
|
|
|
|
|
|
# ABSTRACT: DEPRECATED -- use Dist::Zilla::Plugin::Git::NextVersion instead |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.010'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
21
|
use Dist::Zilla 4 (); |
|
2
|
|
|
|
|
35
|
|
|
2
|
|
|
|
|
29
|
|
9
|
2
|
|
|
2
|
|
7
|
use Git::Wrapper; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
37
|
|
10
|
2
|
|
|
2
|
|
5
|
use version 0.80 (); |
|
2
|
|
|
|
|
36
|
|
|
2
|
|
|
|
|
25
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
6
|
use Moose; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11
|
|
13
|
2
|
|
|
2
|
|
8618
|
use namespace::autoclean 0.09; |
|
2
|
|
|
|
|
45
|
|
|
2
|
|
|
|
|
11
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::VersionProvider'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# -- attributes |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has version_regexp => ( is => 'ro', isa=>'Str', default => '^v(.+)$' ); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has first_version => ( is => 'ro', isa=>'Str', default => '0.001' ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# -- role implementation |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub provide_version { |
26
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
require Version::Next; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# override (or maybe needed to initialize) |
31
|
0
|
0
|
|
|
|
|
return $ENV{V} if exists $ENV{V}; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $git = Git::Wrapper->new('.'); |
34
|
0
|
|
|
|
|
|
my $regexp = $self->version_regexp; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my @tags = $git->tag; |
37
|
0
|
0
|
|
|
|
|
return $self->first_version unless @tags; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# find highest version from tags |
40
|
0
|
|
|
|
|
|
my ($last_ver) = sort { version->parse($b) <=> version->parse($a) } |
41
|
0
|
0
|
|
|
|
|
grep { eval { version->parse($_) } } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
map { /$regexp/ ? $1 : () } @tags; |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
|
|
|
$self->log_fatal("Could not determine last version from tags") |
45
|
|
|
|
|
|
|
unless defined $last_ver; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
my $new_ver = Version::Next::next_version($last_ver); |
48
|
0
|
|
|
|
|
|
$self->log("Bumping version from $last_ver to $new_ver"); |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
$self->zilla->version("$new_ver"); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
54
|
2
|
|
|
2
|
|
585
|
no Moose; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
8
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=pod |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=encoding UTF-8 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 NAME |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Dist::Zilla::Plugin::BumpVersionFromGit - DEPRECATED -- use Dist::Zilla::Plugin::Git::NextVersion instead |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 VERSION |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
version 0.010 |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SYNOPSIS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
In your F<dist.ini>: |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
[BumpVersionFromGit] |
76
|
|
|
|
|
|
|
first_version = 0.001 ; this is the default |
77
|
|
|
|
|
|
|
version_regexp = ^v(.+)$ ; this is the default |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 DESCRIPTION |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
B<NOTE> This distribution is B<deprecated>. The module has been |
82
|
|
|
|
|
|
|
reborn as L<Dist::Zilla::Plugin::Git::NextVersion> and included in the |
83
|
|
|
|
|
|
|
L<Dist::Zilla::Plugin::Git> distribution. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=for Pod::Coverage provide_version |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 SUPPORT |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 Bugs / Feature Requests |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Please report any bugs or feature requests through the issue tracker |
94
|
|
|
|
|
|
|
at L<https://github.com/dagolden/Dist-Zilla-Plugin-BumpVersionFromGit/issues>. |
95
|
|
|
|
|
|
|
You will be notified automatically of any progress on your issue. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 Source Code |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
This is open source software. The code repository is available for |
100
|
|
|
|
|
|
|
public review and contribution under the terms of the license. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
L<https://github.com/dagolden/Dist-Zilla-Plugin-BumpVersionFromGit> |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
git clone https://github.com/dagolden/Dist-Zilla-Plugin-BumpVersionFromGit.git |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 AUTHOR |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
David Golden <dagolden@cpan.org> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 CONTRIBUTOR |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=for stopwords Karen Etheridge |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Karen Etheridge <ether@cpan.org> |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This software is Copyright (c) 2015 by David Golden. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This is free software, licensed under: |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
The Apache License, Version 2.0, January 2004 |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut |