File Coverage

blib/lib/Perl/Tidy/Komodo.pm
Criterion Covered Total %
statement 9 20 45.0
branch 0 4 0.0
condition 0 3 0.0
subroutine 3 5 60.0
pod 1 1 100.0
total 13 33 39.3


line stmt bran cond sub pod time code
1 1     1   85995 use strictures;
  1         2  
  1         8  
2              
3             package Perl::Tidy::Komodo;
4              
5             our $VERSION = '1.120910'; # VERSION
6              
7             # ABSTRACT: tidy perl files in Komodo with a project rc
8              
9             #
10             # This file is part of Perl-Tidy-Komodo
11             #
12             #
13             # Christian Walde has dedicated the work to the Commons by waiving all of his
14             # or her rights to the work worldwide under copyright law and all related or
15             # neighboring legal rights he or she had in the work, to the extent allowable by
16             # law.
17             #
18             # Works under CC0 do not require attribution. When citing the work, you should
19             # not imply endorsement by the author.
20             #
21              
22 1     1   6017 use Perl::Tidy;
  1         205175  
  1         302  
23 1     1   11 use File::chdir;
  1         2  
  1         296  
24              
25              
26             sub run {
27 0     0 1   _try_set_perltidy_env();
28 0           Perl::Tidy::perltidy();
29             }
30              
31             sub _try_set_perltidy_env {
32 0 0   0     return if exists $ENV{PERLTIDY};
33 0           my @cwd_store = @CWD;
34 0           while ( $CWD[0] ) {
35 0 0 0       if ( -d 'lib' and -f '.perltidyrc' ) {
36 0           $ENV{PERLTIDY} = $CWD;
37 0           last;
38             }
39 0           pop @CWD;
40             }
41 0           @CWD = @cwd_store;
42 0           return;
43             }
44              
45             1;
46              
47             __END__
48             =pod
49              
50             =head1 NAME
51              
52             Perl::Tidy::Komodo - tidy perl files in Komodo with a project rc
53              
54             =head1 VERSION
55              
56             version 1.120910
57              
58             =head1 METHODS
59              
60             =head2 run
61              
62             Tries to find a directory that looks like a project directory, upwards
63             from CWD and stores its path in $ENV{PERLTIDY}. Then Perl::Tidy itself is
64             run.
65              
66             =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
67              
68             =head1 SUPPORT
69              
70             =head2 Bugs / Feature Requests
71              
72             Please report any bugs or feature requests through the issue tracker
73             at L<http://rt.cpan.org/Public/Dist/Display.html?Name=Perl-Tidy-Komodo>.
74             You will be notified automatically of any progress on your issue.
75              
76             =head2 Source Code
77              
78             This is open source software. The code repository is available for
79             public review and contribution under the terms of the license.
80              
81             L<https://github.com/wchristian/perl-tidy-komodo>
82              
83             git clone https://github.com/wchristian/perl-tidy-komodo.git
84              
85             =head1 AUTHOR
86              
87             Christian Walde <walde.christian@googlemail.com>
88              
89             =head1 COPYRIGHT AND LICENSE
90              
91              
92             Christian Walde has dedicated the work to the Commons by waiving all of his
93             or her rights to the work worldwide under copyright law and all related or
94             neighboring legal rights he or she had in the work, to the extent allowable by
95             law.
96              
97             Works under CC0 do not require attribution. When citing the work, you should
98             not imply endorsement by the author.
99              
100             =cut
101