Changeset 24362 for trunk/Nebulous-Server/lib/Nebulous/Key.pm
- Timestamp:
- Jun 9, 2009, 2:42:18 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/lib/Nebulous/Key.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Key.pm
r24306 r24362 8 8 use warnings FATAL => qw( all ); 9 9 10 our $VERSION = '0.0 2';10 our $VERSION = '0.03'; 11 11 12 12 use base qw( Exporter Class::Accessor::Fast ); … … 23 23 ); 24 24 25 __PACKAGE__->mk_ro_accessors(qw( path volume soft_volume ));25 __PACKAGE__->mk_ro_accessors(qw( path volume hard_volume )); 26 26 27 27 sub parse_neb_key … … 42 42 43 43 my $volume_name; 44 my $ soft_volume;44 my $hard_volume; 45 45 # if this is a valid uri 46 46 if (defined $scheme) { … … 71 71 if (defined $volume_info->{volume} and $volume_info->{volume} ne 'any') { 72 72 $volume_name = $volume_info->{volume}; 73 $ soft_volume = $volume_info->{soft_volume};73 $hard_volume = $volume_info->{hard_volume}; 74 74 } 75 75 … … 84 84 if (defined $volume_info->{volume} and $volume_info->{volume} ne 'any') { 85 85 $volume_name = $volume_info->{volume}; 86 $ soft_volume = $volume_info->{soft_volume};86 $hard_volume = $volume_info->{hard_volume}; 87 87 } 88 88 } … … 99 99 return __PACKAGE__->new({ 100 100 volume => $volume_name, 101 soft_volume => $soft_volume,101 hard_volume => $hard_volume, 102 102 path => $path, 103 103 }); … … 110 110 return unless defined $volume; 111 111 112 my $ soft_volume;112 my $hard_volume; 113 113 # check to see if there is a tilde and remove it if found 114 unless(defined $volume and $volume =~ s/^~//) {115 $ soft_volume = 1;114 if (defined $volume and $volume =~ s/^~//) { 115 $hard_volume = 1; 116 116 } 117 117 118 return({ volume => $volume, soft_volume => $soft_volume });118 return({ volume => $volume, hard_volume => $hard_volume }); 119 119 } 120 120 … … 125 125 126 126 my $path = $self->path; 127 my $volume = $self->volume || "";128 my $ soft_volume = $self->soft_volume ? '~' : "";129 130 return "neb://${ soft_volume}${volume}/$path";127 my $volume = $self->volume || ''; 128 my $hard_volume = $self->hard_volume ? '~' : ''; 129 130 return "neb://${hard_volume}${volume}/$path"; 131 131 } 132 132
Note:
See TracChangeset
for help on using the changeset viewer.
