~ubuntu-branches/ubuntu/saucy/libfile-fu-perl/saucy

« back to all changes in this revision

Viewing changes to lib/File/Fu/Dir/Temp.pm

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann, Jonathan Yu, Salvatore Bonaccorso, Ryan Niebur, gregor herrmann
  • Date: 2010-03-06 20:02:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100306200211-tj6mzzjkofmp8kg3
Tags: 0.0.7-1
[ Jonathan Yu ]
* New upstream release
* Standards-Version 3.8.4 (no changes)
* Rewrite control description

[ Salvatore Bonaccorso ]
* debian/control: Changed: Replace versioned (build-)dependency on
  perl (>= 5.6.0-{12,16}) with an unversioned dependency on perl (as
  permitted by Debian Policy 3.8.3).

[ Ryan Niebur ]
* Update jawnsy's email address

[ gregor herrmann ]
* debian/control: Changed: (build-)depend on perl instead of perl-
  modules.
* Add /me to Uploaders.
* Convert to source format 3.0 (quilt).
* Add patch to fix a spelling mistake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package File::Fu::Dir::Temp;
2
 
$VERSION = v0.0.6;
 
2
$VERSION = v0.0.7;
3
3
 
4
4
use warnings;
5
5
use strict;
73
73
}} # end subroutine new definition
74
74
########################################################################
75
75
 
 
76
=head2 chdir
 
77
 
 
78
  my $dir = $dir->chdir;
 
79
 
 
80
=cut
 
81
 
 
82
sub chdir {
 
83
  my $self = shift;
 
84
 
 
85
  my $dir = $self->SUPER::chdir;
 
86
  $dir->{temp_parent} = $self;
 
87
  return($dir);
 
88
} # chdir ##############################################################
 
89
 
76
90
=for nit head2 clone
77
91
Because clone doesn't call new :-/
78
92
  $not_temp = $temp->clone;
86
100
} # end subroutine clone definition
87
101
########################################################################
88
102
 
 
103
=head2 rename
 
104
 
 
105
Same as the base rename(), but promotes the temp dir to a regular Dir
 
106
object (prevents any cleanup actions.)
 
107
 
 
108
  $temp = $temp->rename($dest);
 
109
 
 
110
=cut
 
111
 
 
112
sub rename {
 
113
  my $self = shift->SUPER::rename(@_);
 
114
  bless($self, $self->dir_class);
 
115
  return($self);
 
116
}
 
117
 
89
118
# TODO File::Fu->temp_dir->chdir causes immediate deletion?
90
119
 
91
120
=head2 nocleanup
115
144
sub DESTROY {
116
145
  my $self = shift;
117
146
 
118
 
  # ? should this have: return unless($self->auto_delete);
 
147
  # ? should this have:
 
148
  return unless($self->auto_delete);
119
149
 
120
150
  # forked case
121
151
  return unless($$ == $self->{_proc});