~ubuntu-branches/ubuntu/raring/libpath-class-perl/raring

« back to all changes in this revision

Viewing changes to lib/Path/Class/Entity.pm

  • Committer: Bazaar Package Importer
  • Author(s): Salvatore Bonaccorso, gregor herrmann, Ryan Niebur, Nathan Handler, Salvatore Bonaccorso
  • Date: 2009-06-17 22:15:32 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090617221532-atk0kf6m7mb5oq25
Tags: 0.17-1
[ gregor herrmann ]
* Take over for the Debian Perl Group with maintainer's permission
  (http://lists.debian.org/debian-perl/2008/06/msg00039.html)
* debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
  field (source stanza); Homepage field (source stanza). Changed:
  Maintainer set to Debian Perl Group <pkg-perl-
  maintainers@lists.alioth.debian.org> (was: Florian Ragwitz
  <rafl@debian.org>); Florian Ragwitz <rafl@debian.org> moved to
  Uploaders.
* Add debian/watch.
* Refresh debian/rules, no functional changes; except: don't create
  .packlist file any more.
* Set debhelper compatibility level to 5.
* Set Standards-Version to 3.8.0 (no changes).
* debian/copyright: use author-independent upstream source URL and add years
  of copyright.
* debian/control: Changed: Switched Vcs-Browser field to ViewSVN
  (source stanza).
* debian/control: Added: ${misc:Depends} to Depends: field.

[ Ryan Niebur ]
* Remove Florian Ragwitz from Uploaders
* Close ITA (Closes: #523198)

[ Nathan Handler ]
* debian/watch: Update to ignore development releases.

[ Salvatore Bonaccorso ]
* New upstream release
* Add myself to Uploaders
* debian/control:
  - Bump Standards-Version to 3.8.2.
  - Build-Depends on debhelper (>= 7).
  - Drop Build-Depends on libmodule-build-perl
* debian/rules: use tiny rules file and use Makefile.PL now.
* debian/compat: Set debhelper compatibility level to 7. 
* debian/copyright: switch to new machine readable format. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package Path::Class::Entity;
2
2
 
 
3
$VERSION = '0.17';
 
4
 
3
5
use strict;
4
6
use File::Spec;
5
7
use File::stat ();
 
8
use Cwd;
6
9
 
7
10
use overload
8
11
  (
9
12
   q[""] => 'stringify',
 
13
   'bool' => 'boolify',
10
14
   fallback => 1,
11
15
  );
12
16
 
36
40
}
37
41
 
38
42
sub _spec { $_[0]->{file_spec_class} || 'File::Spec' }
 
43
 
 
44
sub boolify { 1 }
39
45
  
40
46
sub is_absolute { 
41
 
    # 5.6.0 has a bug with regexes and stringification that's ticked by
42
 
    # file_name_is_absolute().  Help it along.
43
 
    $_[0]->_spec->file_name_is_absolute($_[0]->stringify) 
 
47
  # 5.6.0 has a bug with regexes and stringification that's ticked by
 
48
  # file_name_is_absolute().  Help it along with an explicit stringify().
 
49
  $_[0]->_spec->file_name_is_absolute($_[0]->stringify) 
44
50
}
45
51
 
 
52
sub is_relative { ! $_[0]->is_absolute }
 
53
 
46
54
sub cleanup {
47
55
  my $self = shift;
48
56
  my $cleaned = $self->new( $self->_spec->canonpath($self) );
50
58
  return $self;
51
59
}
52
60
 
 
61
sub resolve {
 
62
  my $self = shift;
 
63
  my $cleaned = $self->new( Cwd::realpath($self->stringify) );
 
64
 
 
65
  # realpath() always returns absolute path, kind of annoying
 
66
  $cleaned = $cleaned->relative if $self->is_relative;
 
67
 
 
68
  %$self = %$cleaned;
 
69
  return $self;
 
70
}
 
71
 
53
72
sub absolute {
54
73
  my $self = shift;
55
74
  return $self if $self->is_absolute;