Ignore:
Timestamp:
05/29/12 10:25:51 (12 years ago)
Author:
nanardon
Message:
  • complete POD

This patch a basic documentation to all functions.
It also add two test to ensure all POD syntax are correct and coverage is full.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Utils.pm

    r959 r1023  
    1111our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 
    1212 
     13=head1 NAME 
     14 
     15LATMOS::Accounts::Utils - Utils functions 
     16 
     17=head1 FUNCTIONS 
     18 
     19=cut 
     20 
    1321@ISA = qw(Exporter); 
    1422@EXPORT = qw(to_ascii exec_command switch_user run_via_sudo); 
    1523@EXPORT_OK = qw(to_ascii exec_command switch_user run_via_sudo); 
     24 
     25=head2 to_ascii($text) 
     26 
     27Replace in C<$text> non ascii caracters from iso-8859-15 table to ascii 
     28equivalent caracter. 
     29 
     30=cut 
    1631 
    1732sub to_ascii { 
     
    2641    $text 
    2742}  
     43 
     44=head2 exec_command($command, $env) 
     45 
     46Execute C<$command> and redirect output to log system. 
     47 
     48C<$env> is a hashref containing environment variable to set, all variables are 
     49prefixed by 'LA_'. 
     50 
     51=cut 
    2852 
    2953sub exec_command { 
     
    80104} 
    81105 
     106=head2 parse_obj_file($handle) 
     107 
     108Read file content from C<$handle> and return hash containing parsed attributes 
     109 
     110=cut 
     111 
    82112sub parse_obj_file { 
    83113    my ($handle) = @_; 
     
    107137} 
    108138 
     139=head2 dump_read_temp_file($writecb, $readcb) 
     140 
     141Create a temporary file, call C<$writecb()> function, run editor and if file get 
     142modified call C<$readcb>. 
     143 
     144=cut 
     145 
    109146sub dump_read_temp_file { 
    110147    my ($writecb, $readcb) = @_; 
     
    137174} 
    138175 
     176=head2 check_oid_validity($name) 
     177 
     178Check C<$name> is suitable to be used as object identifier. Return the error 
     179text, undef if no error. 
     180 
     181=cut 
     182 
    139183sub check_oid_validity { 
    140184    my ($name) = @_; 
     
    145189    return; 
    146190} 
     191 
     192=head2 check_ug_validity($name) 
     193 
     194Check C<$name> is suitable to used as user or group identifier. 
     195 
     196=cut 
    147197 
    148198sub check_ug_validity { 
     
    157207    return check_oid_validity($name); 
    158208} 
     209 
     210=head2 switch_user($runas) 
     211 
     212Switch effective id of the process to user named C<$runas> 
     213 
     214=cut 
    159215 
    160216sub switch_user { 
     
    173229} 
    174230 
     231=head2 run_via_sudo($runas) 
     232 
     233Rerun current programme as C<$runas> user using sudo 
     234 
     235=cut 
     236 
    175237sub run_via_sudo { 
    176238    my ($runas) = @_; 
     
    186248 
    1872491; 
     250 
     251__END__ 
     252 
     253=head1 SEE ALSO 
     254 
     255L<sudo> 
     256 
     257=head1 AUTHOR 
     258 
     259Olivier Thauvin, E<lt>olivier.thauvin@aerov.jussieu.frE<gt> 
     260 
     261=head1 COPYRIGHT AND LICENSE 
     262 
     263Copyright (C) 2008, 2009, 2010, 2011, 2012 CNRS SA/CETP/LATMOS 
     264 
     265This library is free software; you can redistribute it and/or modify 
     266it under the same terms as Perl itself, either Perl version 5.10.0 or, 
     267at your option, any later version of Perl 5 you may have available. 
     268 
     269=cut 
Note: See TracChangeset for help on using the changeset viewer.