Parse::Gitignore - parse .gitignore files
produces output
(This example is included as synopsis.pl in the distribution.)
This documents Parse::Gitignore version 0.04 corresponding to git commit eef29c685b26d8cd9b28ff74e5e2388e751fd23e released on Mon Oct 9 14:00:13 2017 +0900.
Parse a .gitignore file and check whether a file matches it.
my $pg = Parse::Gitignore->new ('./.gitignore');
if ($pg->ignored ('./Makefile')) { print "Makefile is ignored.\n"; }
Check whether a file matches a .gitignore.
$pg->read_gitignore ('.gitignore');
Read a .gitignore file. You can read as many as you like and they are accumulated.
$pg->excludesfile ('/home/user/.gitignore');
Read an excludesfile which is applied to all directories where .git is found.
I wrote this because I wanted to have a way to ignore generated files for a desktop file search application.
Ben Bullock, <bkb@cpan.org>
This package and associated files are copyright (C) 2016-2017 Ben Bullock.
You can use, copy, modify and redistribute this package and associated files under the Perl Artistic Licence or the GNU General Public Licence.
To install Parse::Gitignore, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parse::Gitignore
CPAN shell
perl -MCPAN -e shell install Parse::Gitignore
For more information on module installation, please visit the detailed CPAN module installation guide.