| 1 | #!/usr/bin/env perl | ||
| 2 | #Copyright (c) 2010 Joachim Bargsten <code at bargsten dot org>. All rights reserved. | ||
| 3 | |||
| 4 | package Bio::Gonzales::Util::Development::Module; | ||
| 5 | use Carp; | ||
| 6 | |||
| 7 | use File::Spec; | ||
| 8 | use Path::Class; | ||
| 9 | use Path::Class::Dir; | ||
| 10 | use Path::Class::File; | ||
| 11 | use Bio::Gonzales::Util::Development::File qw/find_root/; | ||
| 12 | use File::Find; | ||
| 13 | use List::MoreUtils qw/any/; | ||
| 14 | use Cwd; | ||
| 15 | |||
| 16 | use base 'Exporter'; | ||
| 17 | our ( @EXPORT, @EXPORT_OK, %EXPORT_TAGS ); | ||
| 18 | our $VERSION = '0.058'; # VERSION | ||
| 19 | |||
| 20 | @EXPORT = qw(); | ||
| 21 | %EXPORT_TAGS = (); | ||
| 22 | @EXPORT_OK = qw(find_module_root); | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | Bio::Gonzales::Util::Development::Module - functions handy for module development | ||
| 27 | |||
| 28 | =head1 SYNOPSIS | ||
| 29 | |||
| 30 | use Bio::Gonzales::Util::Development::Module qw/find_module_root/; | ||
| 31 | my $module_path = find_module_root("/path/under/module/file"); | ||
| 32 | |||
| 33 | =head1 EXPORT | ||
| 34 | |||
| 35 | =over 4 | ||
| 36 | |||
| 37 | =item find_module_root | ||
| 38 | |||
| 39 | =back | ||
| 40 | |||
| 41 | =head1 SUBROUTINES/METHODS | ||
| 42 | |||
| 43 | =head2 find_module_root | ||
| 44 | |||
| 45 | tires to find a module root for a given file or dir. returns undef, if not successfull | ||
| 46 | |||
| 47 | =cut | ||
| 48 | sub find_module_root { | ||
| 49 | find_root( { location => $_[0], files => [], dirs => [ 'lib', 't' ] } ); | ||
| 50 | } | ||
| 51 | |||
| 52 | 1; |