Arch

 view release on metacpan or  search on metacpan

perllib/Arch/Util.pm  view on Meta::CPAN

=item B<load_file> I<file_name> I<scalar_ref>

=item B<load_file> I<file_name> I<array_ref>

Load the given I<file_name>. Return the file content if the returning value
is expected. As a side effect, may modify the I<scalar_ref> or I<array_ref>
if given, in the last case all file lines are split and B<chomp>-ed.

=item B<save_file> I<file_name> I<content>

Save the given I<content> in the given I<file_name>. The I<content> may be
either scalar, scalar ref, or array ref (see B<load_file>).

=item B<copy_dir> I<dir1> I<dir2>

Copy I<dir1> to I<dir2> recursivelly, preserving as many attributes as
possible.

=item B<remove_dir> I<dir> ..

Remove I<dir> (or dirs) recusivelly. Please be careful.

=item B<setup_config_dir>

=item B<setup_config_dir> I<dir>

=item B<setup_config_dir> I<dir> I<subdir> ...

Create (if needed) the configuration I<dir> that defaults to either
$ARCH_MAGIC_DIR or I<~/.arch-magic> or I</tmp/.arch-magic> if $HOME is
unset.

If one or more consecutive I<subdir> given, repeat the same procedure
for the sub-directory (including creating and diagnostics if needed).

Return a name of the existing directory (including sub-directories if any).

=item B<standardize_date> I<default_unix_date_string>

Try to convert the given date string to "yyyy-mm-dd HH:MM:SS TMZ".
If failed, the original string is returned.

=item B<date2daysago> I<date_string>

Convert a date string to time difference to now in full days.

In list content, return (num_days_ago, unix_time, timezone_str).

=item B<date2age> I<date_string>

Like B<date2daysago>, but return a human readable string, like "5 days"
or "-6 weeks" or "7 months" or "3 years".

=item B<parse_creator_email> I<my_id>

Try to parse the I<arch> B<my-id> of the patch creator. Return a list of
his/her name and email.

=item B<adjacent_revision> I<full_revision> I<offset>

Given the I<full_revision> and positive or negative offset, try to guess the
full name of the adjacent revision.

=back

=head1 BUGS

Awaiting for your reports.

=head1 AUTHORS

Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).

=head1 SEE ALSO

For more information, see L<tla>, L<Arch>.

=cut



( run in 1.470 second using v1.01-cache-2.11-cpan-5c0b1e786e0 )