File Coverage

blib/lib/App/Git/Workflow/Command/Cat.pm
Criterion Covered Total %
statement 21 27 77.7
branch n/a
condition 0 2 0.0
subroutine 7 8 87.5
pod 1 1 100.0
total 29 38 76.3


line stmt bran cond sub pod time code
1             package App::Git::Workflow::Command::Cat;
2              
3             # Created on: 2015-06-18 16:41:14
4             # Create by: Ivan Wills
5             # $Id$
6             # $Revision$, $HeadURL$, $Date$
7             # $Revision$, $Source$, $Date$
8              
9 1     1   22977 use strict;
  1         2  
  1         41  
10 1     1   6 use warnings;
  1         3  
  1         39  
11 1     1   851 use Pod::Usage ();
  1         63872  
  1         49  
12 1     1   1017 use Data::Dumper qw/Dumper/;
  1         8049  
  1         115  
13 1     1   974 use English qw/ -no_match_vars /;
  1         4795  
  1         9  
14 1     1   1367 use App::Git::Workflow;
  1         59143  
  1         96  
15 1     1   954 use App::Git::Workflow::Command qw/get_options/;
  1         16310  
  1         312  
16              
17             our $VERSION = 0.2;
18             our $workflow = App::Git::Workflow->new;
19             our ($name) = $PROGRAM_NAME =~ m{^.*/(.*?)$}mxs;
20             our %option;
21              
22             sub run {
23 0     0 1   my ($self) = @_;
24              
25 0           get_options(
26             \%option,
27             'revision|r=s',
28             'quiet|q',
29             );
30              
31 0   0       my $revision = $option{revision} || 'HEAD';
32 0           my $file = shift @ARGV;
33              
34 0           print scalar $workflow->git->show("$revision:$file");
35              
36 0           return;
37             }
38              
39             1;
40              
41             __DATA__
42              
43             =head1 NAME
44              
45             App::Git::Workflow::Command::Cat - Show the content of a git file.
46              
47             =head1 VERSION
48              
49             This documentation refers to App::Git::Workflow::Command::Cat version 0.2
50              
51             =head1 SYNOPSIS
52              
53             git-since-release [option]
54              
55             OPTIONS:
56             -q --quiet Suppress notifying of files changed
57              
58             -v --verbose Show more detailed option
59             --VERSION Prints the version information
60             --help Prints this help information
61             --man Prints the full documentation for git-since-release
62              
63             =head1 DESCRIPTION
64              
65             C<git-since-release> finds out how many commits the repository is since the
66             latest release (determined by the latest tag).
67              
68             =head1 SUBROUTINES/METHODS
69              
70             =head2 C<run ()>
71              
72             Run the command
73              
74             =head1 DIAGNOSTICS
75              
76             =head1 CONFIGURATION AND ENVIRONMENT
77              
78             =head1 DEPENDENCIES
79              
80             =head1 INCOMPATIBILITIES
81              
82             =head1 BUGS AND LIMITATIONS
83              
84             There are no known bugs in this module.
85              
86             Please report problems to Ivan Wills (ivan.wills@gmail.com).
87              
88             Patches are welcome.
89              
90             =head1 AUTHOR
91              
92             Ivan Wills - (ivan.wills@gmail.com)
93              
94             =head1 LICENSE AND COPYRIGHT
95              
96             Copyright (c) 2015 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
97             All rights reserved.
98              
99             This module is free software; you can redistribute it and/or modify it under
100             the same terms as Perl itself. See L<perlartistic>. This program is
101             distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
102             without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
103             PARTICULAR PURPOSE.
104              
105             =cut