line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
123242
|
use strict; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
45
|
|
2
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
52
|
|
3
|
|
|
|
|
|
|
package Git::Open; |
4
|
2
|
|
|
2
|
|
933
|
use Moose; |
|
2
|
|
|
|
|
798710
|
|
|
2
|
|
|
|
|
12
|
|
5
|
2
|
|
|
2
|
|
13376
|
use Git::Open::Util; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
66
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
14
|
use Moose::Util::TypeConstraints; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
17
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'MooseX::Getopt::Usage'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.1.12'; # VERSION: generated by DZP::OurPkgVersion |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
subtype 'MaybeStr' |
14
|
|
|
|
|
|
|
=> as 'Str' |
15
|
|
|
|
|
|
|
=> where { defined $_ }; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
MooseX::Getopt::OptionTypeMap->add_option_type_to_map( |
18
|
|
|
|
|
|
|
'MaybeStr' => ':s' |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has compare => ( |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
isa => 'MaybeStr', |
24
|
|
|
|
|
|
|
documentation => 'To open compare view, ex: --compare master-develop' |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has 'branch' => ( |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
isa => 'MaybeStr', |
30
|
|
|
|
|
|
|
documentation => 'To open branch view: --branch develop' |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has generator => ( |
34
|
|
|
|
|
|
|
is => 'ro', |
35
|
|
|
|
|
|
|
metaclass => 'NoGetopt', |
36
|
|
|
|
|
|
|
isa => 'Git::Open::Util', |
37
|
|
|
|
|
|
|
default => sub { |
38
|
|
|
|
|
|
|
return Git::Open::Util->new(); |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
handles => { |
41
|
|
|
|
|
|
|
url => 'generate_url' |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# ABSTRACT: The totally cool way to open repository page, sometime it's hard to remember and open via browser manually. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub run { |
49
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
0
|
my $url = $self->get_url(); |
52
|
0
|
|
|
|
|
0
|
system("git web--browse $url"); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub get_url { |
56
|
6
|
|
|
6
|
0
|
5381
|
my $self = shift; |
57
|
|
|
|
|
|
|
|
58
|
6
|
|
|
|
|
14
|
my @opts = qw( compare branch ); |
59
|
|
|
|
|
|
|
|
60
|
6
|
|
|
|
|
8
|
my $args; |
61
|
6
|
|
|
|
|
11
|
foreach my $opt ( @opts ) { |
62
|
12
|
|
|
|
|
34
|
my $value = $self->meta->get_attribute($opt)->get_value($self); |
63
|
12
|
100
|
|
|
|
1449
|
$args->{$opt} = $value if defined $value; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
6
|
|
|
|
|
19
|
return $self->url( $args ); |
67
|
|
|
|
|
|
|
}; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=pod |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=encoding UTF-8 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 NAME |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Git::Open - The totally cool way to open repository page, sometime it's hard to remember and open via browser manually. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 VERSION |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
version 0.1.12 |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 USAGE |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
git open # it will open homepage of your repository |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
git open --compare # it will open compare page |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
git open --compare master-develop # Open compare page betwee master and develop |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
git open --branch master # Open master branch's page |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
git open --branch # Open current branch's page |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 AUTHOR |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Pattarawat Chormai <pat.chormai@gmail.com> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Pattarawat Chormai. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
106
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=cut |