App-KGB
view release on metacpan or search on metacpan
lib/App/KGB/Change.pm view on Meta::CPAN
It can take a hashref with keys all the field names (See L<|FIELDS>).
Or, it can take a single string, which is de-composed into components.
See L<|SYNOPSIS> for examples.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new();
my $h = shift;
if ( ref($h) ) {
defined( $self->action( delete $h->{action} ) )
or confess "'action' is required";
defined( $self->path( delete $h->{path} ) )
or confess "'path' is required";
$self->prop_change( delete $h->{prop_change} );
}
else {
lib/App/KGB/Client.pm view on Meta::CPAN
}
);
See L<|FIELDS> above.
=cut
sub new {
my ( $class, $init ) = @_;
my $self = $class->SUPER::new(
{ use_color => 1,
%$init,
}
);
print "Configuration: " . YAML::Dump(@_) if $self->verbose;
defined( $self->repo_id )
or confess "'repo_id' is mandatory";
$self->br_mod_re( [ $self->br_mod_re // () ] )
lib/App/KGB/Client/CVS.pm view on Meta::CPAN
require v5.10.0;
use base 'App::KGB::Client';
use App::KGB::Change;
use App::KGB::Commit;
use Carp qw(confess);
__PACKAGE__->mk_accessors(qw( _called author cvs_root directory ));
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->_called(0);
defined( $self->cvs_root )
or confess "'cvs_root' is mandatory";
return $self;
}
use Fcntl qw(:flock);
lib/App/KGB/Client/Fake.pm view on Meta::CPAN
require v5.10.0;
use base 'App::KGB::Client';
use App::KGB::Change;
use App::KGB::Commit;
use Carp qw(confess);
use Digest::SHA qw(sha1_hex);
__PACKAGE__->mk_accessors(qw( _called ));
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->_called(0);
return $self;
}
sub describe_commit {
my ($self) = @_;
return undef if $self->_called;
lib/App/KGB/Client/Git.pm view on Meta::CPAN
If you don't like this, set it to false.
The default is C<true>.
=back
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->git_dir( $ENV{GIT_DIR} )
unless defined( $self->git_dir );
defined( $self->git_dir )
or confess
"'git_dir' is mandatory; either supply it or define GIT_DIR in the environment";
$self->_git(
lib/App/KGB/Client/RelayMsg.pm view on Meta::CPAN
=cut
require v5.10.0;
use base 'App::KGB::Client';
use Carp qw(confess);
__PACKAGE__->mk_accessors(qw( relay_message));
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
defined( $self->relay_message ) or confess "relay_message is mandatory";
return $self;
}
sub process {
my $self = shift;
my @servers = $self->shuffle_servers;
lib/App/KGB/Client/ServerRef.pm view on Meta::CPAN
use base 'Class::Accessor::Fast';
__PACKAGE__->mk_accessors( qw( uri proxy password timeout verbose dry_run ) );
use utf8;
use Carp qw(confess);
use Digest::SHA qw(sha1_hex);
use YAML ();
sub new {
my $self = shift->SUPER::new( @_ );
defined( $self->uri )
or confess "'uri' is mandatory";
defined( $self->proxy )
or $self->proxy( $self->uri . '?session=KGB' );
defined( $self->password )
or confess "'password' is mandatory";
return $self;
}
lib/App/KGB/Client/Subversion.pm view on Meta::CPAN
use Carp qw(confess);
use SVN::Core;
use SVN::Fs;
use SVN::Repos;
__PACKAGE__->mk_accessors(qw( _called repo_path revision ));
use constant rev_prefix => 'r';
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->_called(0);
defined( $self->repo_path )
or confess "'repo_path' is mandatory";
return $self;
}
sub describe_commit {
my ($self) = @_;
lib/App/KGB/Commit.pm view on Meta::CPAN
=head1 CONSTRUCTOR
=head2 new ( { I<initial field values> } )
Standard constructor. Accepts a hashref with field values.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
not defined( $self->changes )
or ref( $self->changes ) and ref( $self->changes ) eq 'ARRAY'
or confess "'changes' must be an arrayref";
my $log = $self->log;
utf8::decode($log)
or $log = "(log message is not valid UTF-8)"
if defined($log);
$self->log($log);
lib/App/KGB/Painter.pm view on Meta::CPAN
B<color_codes> is a hash with the special symbols interpreted as coloring
commands by IRC clients.
B<item_colors> is another hash describing what colors to apply to different parts of
the messages.
=cut
sub new {
my $self = shift->SUPER::new(@_);
# default colors
$self->color_codes( \%color_codes ) unless $self->color_codes;
my $c = $self->color_codes;
while ( my ($k,$v) = each %color_codes ) {
$c->{$k} = $v unless exists $c->{$k};
}
# default styles
$self->item_colors( \%item_colors ) unless $self->item_colors;
( run in 1.173 second using v1.01-cache-2.11-cpan-49f99fa48dc )