App-ClusterSSH
view release on metacpan or search on metacpan
return $self;
}
sub ACTION_dist {
my ($self, @args) = @_;
print "Creating README", $/;
qx{ $^X bin_PL/cssh --generate-pod | pod2text > README };
$self->SUPER::ACTION_dist;
}
sub ACTION_clean {
my ($self, @args) = @_;
for my $file (keys %{ $self->script_files } ) {
if( -e $file) {
print "Removing '$file'",$/;
unlink $file;
}
}
$self->SUPER::ACTION_clean;
}
},
);
my $build = $class->new(
meta_merge => {
resources => {
Repository => [
#'http://clusterssh.git.sourceforge.net/',
lib/App/ClusterSSH.pm view on Meta::CPAN
# load cfg files from options
# overlay rest of cmd line args onto options
# record all clusters
# parse given tags/hostnames and resolve to connections
# open terminals
# optionally open console if required
sub new {
my ( $class, %args ) = @_;
my $self = $class->SUPER::new(%args);
$self->{cluster} = App::ClusterSSH::Cluster->new( parent => $self, );
$self->{options} = App::ClusterSSH::Getopt->new( parent => $self, );
$self->{config} = App::ClusterSSH::Config->new( parent => $self, );
$self->{helper} = App::ClusterSSH::Helper->new( parent => $self, );
$self->set_config( $self->config );
# catch and reap any zombies
$SIG{CHLD} = sub {
lib/App/ClusterSSH/Base.pm view on Meta::CPAN
App::ClusterSSH::Base - Base object provding utility functions
=head1 SYNOPSIS
use base qw/ App::ClusterSSH::Base /;
# in object new method
sub new {
( $class, $arg_ref ) = @_;
my $self = $class->SUPER::new($arg_ref);
return $self;
}
=head1 DESCRIPTION
Base object to provide some utility functions on objects - should not be
used directly
=head1 METHODS
lib/App/ClusterSSH/Cluster.pm view on Meta::CPAN
use base qw/ App::ClusterSSH::Base /;
use App::ClusterSSH::Range;
our $master_object_ref;
sub new {
my ( $class, %args ) = @_;
if ( !$master_object_ref ) {
$master_object_ref = $class->SUPER::new(%args);
}
return $master_object_ref;
}
sub get_cluster_entries {
my ( $self, @files ) = @_;
for my $file ( '/etc/clusters', $ENV{HOME} . '/.clusterssh/clusters',
@files )
lib/App/ClusterSSH/Config.pm view on Meta::CPAN
rows => -1,
cols => -1,
fillscreen => "no",
);
sub new {
my ( $class, %args ) = @_;
my $self = $class->SUPER::new(%default_config);
( my $comms = $Script ) =~ s/^c//;
$comms = 'telnet' if ( $comms eq 'tel' );
$comms = 'console' if ( $comms eq 'con' );
$comms = 'ssh' if ( $comms eq 'lusterssh' );
$comms = 'sftp' if ( $comms eq 'sftp' );
# list of allowed comms methods
if ( 'ssh rsh telnet sftp console' !~ m/\b$comms\b/ ) {
lib/App/ClusterSSH/Getopt.pm view on Meta::CPAN
my ( $class, %args ) = @_;
# basic setup that is over-rideable by each script as needs may be
# different depending on the command used
my %setup = (
usage => [
'-h|--help', '[options] [[user@]<server>[:port]|<tag>] [...] ',
],
);
my $self = $class->SUPER::new( %setup, %args );
# options common to all connection types
$self->{command_options} = {};
$self->add_common_options;
return $self;
}
sub add_option {
my ( $self, %args ) = @_;
lib/App/ClusterSSH/Helper.pm view on Meta::CPAN
our $VERSION = version->new('0.02');
use Carp;
use Try::Tiny;
use base qw/ App::ClusterSSH::Base /;
sub new {
my ( $class, %args ) = @_;
my $self = $class->SUPER::new(%args);
return $self;
}
sub script {
my ( $self, $config ) = @_;
if ( !defined $config
|| !ref $config
|| ref $config ne "App::ClusterSSH::Config" )
lib/App/ClusterSSH/Host.pm view on Meta::CPAN
}
# remove any keys undef values - must be a better way...
foreach my $remove (qw/ port username geometry /) {
if ( !$args{$remove} && grep {/^$remove$/} keys(%args) ) {
delete( $args{$remove} );
}
}
my $self
= $class->SUPER::new( ssh_config => "$ENV{HOME}/.ssh/config", %args );
# load in ssh hostname for later use
if ( !%ssh_hostname_for || !$ssh_configs_read{ $self->{ssh_config} } ) {
$self->read_ssh_file( $self->{ssh_config} );
$self->debug( 5, 'Have the following ssh hostnames' );
$self->debug( 5, ' "', $_, '"' )
foreach ( sort keys %ssh_hostname_for );
}
( run in 1.306 second using v1.01-cache-2.11-cpan-49f99fa48dc )