| SVN-Class documentation | Contained in the SVN-Class distribution. |
SVN::Class::Info - Subversion workspace info
use SVN::Class; my $file = svn_file( 'path/to/file' ); my $info = $file->info; printf "repository URL = %s\n", $info->url;
SVN::Class::Info represents the output of the svn info command.
SVN::Class::Info does not inherit from SVN::Class, but only Class::Accessor::Fast.
Creates new SVN::Class::Info instance. The lone argument should be an array ref of output from a call to the SVN::Class object's info() method.
You normally do not need to use this method directly. See the SVN::Class info() method.
Returns dump() of the object, just like SVN::Class->dump().
Get the URL value. Returns a SVN::Class::Repos object.
Get/set the info params. These are really only useful as accessors (getters).
Peter Karman, <karman at cpan.org>
Please report any bugs or feature requests to
bug-svn-class at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SVN-Class.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc SVN::Class
You can also look for information at:
I looked at SVN::Agent before starting this project. It has a different API, more like SVN::Client in the SVN::Core, but I cribbed some of the ideas.
The Minnesota Supercomputing Institute http://www.msi.umn.edu/
sponsored the development of this software.
Copyright 2008 by the Regents of the University of Minnesota.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Path::Class, Class::Accessor::Fast, SVN::Agent, IPC::Cmd
| SVN-Class documentation | Contained in the SVN-Class distribution. |
package SVN::Class::Info; use strict; use warnings; use base qw( Rose::Object ); use Rose::Object::MakeMethods::Generic ( scalar => [ qw( path name _url root rev node schedule author last_rev date updated checksum uuid ) ] ); use Carp; use Data::Dump; use SVN::Class::Repos; our $VERSION = '0.16';
sub new { my $class = shift; my $buf = shift; if ( !$buf or !ref($buf) or ref($buf) ne 'ARRAY' ) { croak "need array ref of 'svn info' output"; } return $class->SUPER::new( _make_hash(@$buf) ); }
sub dump { return Data::Dump::dump(@_); } my %fieldmap = ( Path => 'path', Name => 'name', URL => '_url', 'Repository Root' => 'root', 'Repository UUID' => 'uuid', 'Revision' => 'rev', 'Node Kind' => 'node', 'Schedule' => 'schedule', 'Last Changed Author' => 'author', 'Last Changed Rev' => 'last_rev', 'Last Changed Date' => 'date', 'Text Last Updated' => 'updated', 'Checksum' => 'checksum' ); sub _make_hash { my %hash; for (@_) { my ( $field, $value ) = (m/^([^:]+):\ (.+)$/); if ( !exists $fieldmap{$field} ) { croak "unknown field name in svn info: $field"; } $hash{ $fieldmap{$field} } = $value; } return %hash; }
sub url { my $self = shift; return SVN::Class::Repos->new( $self->_url ); }
1; __END__