line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::TagVersion::App; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2368
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
4
|
1
|
|
|
1
|
|
6581
|
use Moose::Util::TypeConstraints; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.01'; # VERSION |
7
|
|
|
|
|
|
|
# ABSTRACT: commandline wrapper for Git::TagVersion |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends 'Git::TagVersion'; |
10
|
|
|
|
|
|
|
with 'MooseX::Getopt'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has '+root' => ( traits => [ 'NoGetopt' ] ); |
13
|
|
|
|
|
|
|
has '+repo' => ( traits => [ 'NoGetopt' ] ); |
14
|
|
|
|
|
|
|
has '+last_version' => ( traits => [ 'NoGetopt' ] ); |
15
|
|
|
|
|
|
|
has '+version_regex' => ( traits => [ 'NoGetopt' ] ); |
16
|
|
|
|
|
|
|
has '+versions' => ( traits => [ 'NoGetopt' ] ); |
17
|
|
|
|
|
|
|
has '+next_version' => ( traits => [ 'NoGetopt' ] ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has '+fetch' => ( |
20
|
|
|
|
|
|
|
traits => [ 'Getopt' ], |
21
|
|
|
|
|
|
|
cmd_aliases => 'f', |
22
|
|
|
|
|
|
|
documentation => 'fetch remote refs before finding last version', |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has '+push' => ( |
26
|
|
|
|
|
|
|
traits => [ 'Getopt' ], |
27
|
|
|
|
|
|
|
cmd_aliases => 'p', |
28
|
|
|
|
|
|
|
documentation => 'push new created tag to remote', |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has 'all' => ( |
32
|
|
|
|
|
|
|
is => 'ro', isa => 'Bool', default => 0, |
33
|
|
|
|
|
|
|
traits => [ 'Getopt' ], |
34
|
|
|
|
|
|
|
cmd_aliases => [ 'a', 'list-all' ], |
35
|
|
|
|
|
|
|
documentation => 'list all existing versions', |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
has 'last' => ( |
39
|
|
|
|
|
|
|
is => 'ro', isa => 'Bool', default => 0, |
40
|
|
|
|
|
|
|
traits => [ 'Getopt' ], |
41
|
|
|
|
|
|
|
cmd_aliases => [ 'l', 'last-version' ], |
42
|
|
|
|
|
|
|
documentation => 'display last version', |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
subtype 'IncrOption' => as 'Int'; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
MooseX::Getopt::OptionTypeMap->add_option_type_to_map( |
48
|
|
|
|
|
|
|
'IncrOption' => '+' |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has '+incr_level' => ( |
52
|
|
|
|
|
|
|
is => 'ro', isa => 'IncrOption', default => 0, |
53
|
|
|
|
|
|
|
traits => [ 'Getopt' ], |
54
|
|
|
|
|
|
|
cmd_aliases => [ 'major', 'm' ], |
55
|
|
|
|
|
|
|
documentation => 'do a (more) major release', |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
has '+add_level' => ( |
59
|
|
|
|
|
|
|
is => 'ro', isa => 'IncrOption', default => 0, |
60
|
|
|
|
|
|
|
traits => [ 'Getopt' ], |
61
|
|
|
|
|
|
|
cmd_aliases => [ 'minor' ], |
62
|
|
|
|
|
|
|
documentation => 'add a new minor version level', |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
has 'next' => ( |
66
|
|
|
|
|
|
|
is => 'ro', isa => 'Bool', default => 0, |
67
|
|
|
|
|
|
|
traits => [ 'Getopt' ], |
68
|
|
|
|
|
|
|
cmd_aliases => [ 'n', 'next-version' ], |
69
|
|
|
|
|
|
|
documentation => 'display next version', |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
has 'tag' => ( |
73
|
|
|
|
|
|
|
is => 'ro', isa => 'Bool', default => 0, |
74
|
|
|
|
|
|
|
traits => [ 'Getopt' ], |
75
|
|
|
|
|
|
|
cmd_aliases => [ 't', 'tag-next-version' ], |
76
|
|
|
|
|
|
|
documentation => 'create tag for next version', |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub run { |
80
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
81
|
|
|
|
|
|
|
|
82
|
0
|
0
|
|
|
|
|
if( $self->all ) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
83
|
0
|
|
|
|
|
|
$self->print_versions; |
84
|
|
|
|
|
|
|
} elsif( $self->last ) { |
85
|
0
|
|
|
|
|
|
$self->print_last_version |
86
|
|
|
|
|
|
|
} elsif( $self->next ) { |
87
|
0
|
|
|
|
|
|
$self->print_next_version |
88
|
|
|
|
|
|
|
} elsif( $self->tag ) { |
89
|
0
|
|
|
|
|
|
$self->print_tag_next_version |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
return; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub print_tag_next_version { |
96
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
my $tag = $self->tag_next_version; |
99
|
0
|
|
|
|
|
|
print "tagged $tag\n"; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
return; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub print_next_version { |
105
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
106
|
|
|
|
|
|
|
|
107
|
0
|
0
|
|
|
|
|
if( defined $self->next_version ) { |
108
|
0
|
|
|
|
|
|
print $self->next_version->as_string."\n"; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
return; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub print_last_version { |
115
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
116
|
|
|
|
|
|
|
|
117
|
0
|
0
|
|
|
|
|
if( defined $self->last_version ) { |
118
|
0
|
|
|
|
|
|
print $self->last_version->as_string."\n"; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
|
return; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub print_versions { |
125
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
126
|
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
|
foreach my $v ( @{$self->versions} ) { |
|
0
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
print $v->as_string."\n"; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
0
|
|
|
|
|
|
return; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
1; |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
__END__ |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=pod |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=encoding UTF-8 |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 NAME |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Git::TagVersion::App - commandline wrapper for Git::TagVersion |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 VERSION |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
version 1.01 |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 AUTHOR |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Markus Benning <ich@markusbenning.de> |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Markus Benning <ich@markusbenning.de>. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
159
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=cut |