« blib/lib/Code/TidyAll/Plugin/PHPCodeSniffer.pm
↑ Summary
blib/lib/Code/TidyAll/Config/INI/Reader.pm »
| 1 | package Code::TidyAll::SVN::Util; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use Cwd qw(realpath); | ||
| 7 | use IPC::System::Simple qw(capturex); | ||
| 8 | |||
| 9 | use Exporter qw(import); | ||
| 10 | |||
| 11 | our $VERSION = '0.83'; | ||
| 12 | |||
| 13 | our @EXPORT_OK = qw(svn_uncommitted_files); | ||
| 14 | |||
| 15 | sub svn_uncommitted_files { | ||
| 16 | my ($dir) = @_; | ||
| 17 | |||
| 18 | $dir = realpath($dir); | ||
| 19 | my $output = capturex( 'svn', 'status', $dir ); | ||
| 20 | my @lines = grep {/^[AM]/} split( "\n", $output ); | ||
| 21 | my (@files) = grep {-f} ( $output =~ m{^[AM]\s+(.*)$}gm ); | ||
| 22 | return @files; | ||
| 23 | } | ||
| 24 | |||
| 25 | 1; | ||
| 26 | |||
| 27 | # ABSTRACT: Utility functions for SVN hooks | ||
| 28 | |||
| 29 | __END__ | ||
| 30 | |||
| 31 | =pod | ||
| 32 | |||
| 33 | =encoding UTF-8 | ||
| 34 | |||
| 35 | =head1 NAME | ||
| 36 | |||
| 37 | Code::TidyAll::SVN::Util - Utility functions for SVN hooks | ||
| 38 | |||
| 39 | =head1 VERSION | ||
| 40 | |||
| 41 | version 0.83 | ||
| 42 | |||
| 43 | =head1 SUPPORT | ||
| 44 | |||
| 45 | Bugs may be submitted at L<https://github.com/houseabsolute/perl-code-tidyall/issues>. | ||
| 46 | |||
| 47 | =head1 SOURCE | ||
| 48 | |||
| 49 | The source code repository for Code-TidyAll can be found at L<https://github.com/houseabsolute/perl-code-tidyall>. | ||
| 50 | |||
| 51 | =head1 AUTHORS | ||
| 52 | |||
| 53 | =over 4 | ||
| 54 | |||
| 55 | =item * | ||
| 56 | |||
| 57 | Jonathan Swartz <swartz@pobox.com> | ||
| 58 | |||
| 59 | =item * | ||
| 60 | |||
| 61 | Dave Rolsky <autarch@urth.org> | ||
| 62 | |||
| 63 | =back | ||
| 64 | |||
| 65 | =head1 COPYRIGHT AND LICENSE | ||
| 66 | |||
| 67 | This software is copyright (c) 2011 - 2022 by Jonathan Swartz. | ||
| 68 | |||
| 69 | This is free software; you can redistribute it and/or modify it under | ||
| 70 | the same terms as the Perl 5 programming language system itself. | ||
| 71 | |||
| 72 | The full text of the license can be found in the | ||
| 73 | F<LICENSE> file included with this distribution. | ||
| 74 | |||
| 75 | =cut |