]> git.etc.gen.nz Git - app-bcvi-autoinstall.git/commitdiff
First commit.
authorAndrew Ruthven <andrew@etc.gen.nz>
Tue, 7 Sep 2010 00:22:42 +0000 (12:22 +1200)
committerAndrew Ruthven <andrew@etc.gen.nz>
Tue, 7 Sep 2010 00:22:55 +0000 (12:22 +1200)
Changes [new file with mode: 0644]
MANIFEST [new file with mode: 0644]
META.yml [new file with mode: 0644]
Makefile.PL [new file with mode: 0644]
README [new file with mode: 0644]
lib/App/BCVI/AutoInstall.pm [new file with mode: 0644]
t/00-load.t [new file with mode: 0644]
t/pod.t [new file with mode: 0644]

diff --git a/Changes b/Changes
new file mode 100644 (file)
index 0000000..9700e0b
--- /dev/null
+++ b/Changes
@@ -0,0 +1,5 @@
+Revision history for App-BCVI-AutoInstall
+
+0.1     2010-08-07
+        - first version, based on App::BCVI::InstallManager
+
diff --git a/MANIFEST b/MANIFEST
new file mode 100644 (file)
index 0000000..c5ddf94
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,8 @@
+Changes
+lib/App/BCVI/AutoInstall.pm
+Makefile.PL
+MANIFEST
+README
+t/00-load.t
+t/pod.t
+META.yml                                 Module meta-data (added by MakeMaker)
diff --git a/META.yml b/META.yml
new file mode 100644 (file)
index 0000000..11df8a6
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,14 @@
+--- #YAML:1.0
+name:                App-BCVI-AutoInstall
+version:             0.1
+abstract:            Automatically install bcvi on new servers.
+license:             ~
+author:              
+    - Andrew Ruthven <andrew@etc.gen.nz>
+generated_by:        ExtUtils::MakeMaker version 6.42
+distribution_type:   module
+requires:     
+    Test::More:                    0
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644 (file)
index 0000000..848a4f3
--- /dev/null
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME                => 'App::BCVI::AutoInstall',
+    AUTHOR              => 'Andrew Ruthven <andrew@etc.gen.nz>',
+    VERSION_FROM        => 'lib/App/BCVI/AutoInstall.pm',
+    ABSTRACT_FROM       => 'lib/App/BCVI/AutoInstall.pm',
+    PL_FILES            => {},
+    PREREQ_PM => {
+        'Test::More' => 0,
+    },
+    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+    clean               => { FILES => 'App-BCVI-AutoInstall-*' },
+);
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..4f2c3dc
--- /dev/null
+++ b/README
@@ -0,0 +1,36 @@
+NAME
+    App::BCVI::AutoInstall - Automatically install bcvi on a new host
+
+DESCRIPTION
+    This module is a plugin for "bcvi" (see: App::BCVI). If you are
+    connecting to a server for the first time it will install the required
+    files for you.
+
+    It requires App::BCVI::InstallManager for tracking which servers you've
+    already installed the bcvi files on.
+
+SUPPORT
+    You can look for information at:
+
+    *   RT: CPAN's request tracker
+
+        <http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-BCVI-AutoInstall>
+
+    *   AnnoCPAN: Annotated CPAN documentation
+
+        <http://annocpan.org/dist/App-BCVI-AutoInstall>
+
+    *   CPAN Ratings
+
+        <http://cpanratings.perl.org/d/App-BCVI-AutoInstall>
+
+    *   Search CPAN
+
+        <http://search.cpan.org/dist/App-BCVI-AutoInstall>
+
+COPYRIGHT & LICENSE
+    Copyright 2010 Andrew Ruthven <andrew@etc.gen.nz>
+
+    This program is free software; you can redistribute it and/or modify it
+    under the same terms as Perl itself.
+
diff --git a/lib/App/BCVI/AutoInstall.pm b/lib/App/BCVI/AutoInstall.pm
new file mode 100644 (file)
index 0000000..6de81e5
--- /dev/null
@@ -0,0 +1,72 @@
+package App::BCVI::AutoInstall;
+
+use warnings;
+use strict;
+
+use App::BCVI::InstallManager;
+
+our $VERSION = '0.1';
+
+sub wrap_ssh {
+    my ($self, @args_in) = @_;
+
+    my $sig = $self->get_install_signature($host);
+    if (! defined $sig) {
+      $self->install_to_host($host);
+    }
+    $self->SUPER::wrap_ssh(@args_in);
+}
+
+App::BCVI->hook_client_class();
+
+1;
+
+__END__
+
+=head1 NAME
+
+App::BCVI::AutoInstall - Automatically install bcvi on a new host
+
+
+=head1 DESCRIPTION
+
+This module is a plugin for C<bcvi> (see: L<App::BCVI>).  If you are connecting
+to a server for the first time it will install the required files for you.
+
+It requires App::BCVI::InstallManager for tracking which servers you've already
+installed the bcvi files on.
+
+=head1 SUPPORT
+
+You can look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-BCVI-AutoInstall>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/App-BCVI-AutoInstall>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/App-BCVI-AutoInstall>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/App-BCVI-AutoInstall>
+
+=back
+
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2010 Andrew Ruthven E<lt>andrew@etc.gen.nzE<gt>
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=cut
+
diff --git a/t/00-load.t b/t/00-load.t
new file mode 100644 (file)
index 0000000..1ee3733
--- /dev/null
@@ -0,0 +1,34 @@
+#!perl
+
+use File::Spec qw();
+use Test::More tests => 1;
+
+my $bin_file = find_bcvi();
+
+if(not $bin_file) {
+    diag 'App::BCVI does not appear to be installed';
+    ok(1);
+    exit(0);
+}
+
+eval { require $bin_file };
+if($@) {
+    diag qq{Your bcvi installation ($bin_file) appears to be old/broken: "$@"};
+    ok(1);
+    exit(0);
+}
+
+use_ok('App::BCVI::AutoInstall');
+
+exit;
+
+
+
+sub find_bcvi {
+    foreach my $dir (File::Spec->path) {
+        my $path = File::Spec->catfile($dir, 'bcvi');
+        return $path if -x $path;
+    }
+    return;
+}
+
diff --git a/t/pod.t b/t/pod.t
new file mode 100644 (file)
index 0000000..ee8b18a
--- /dev/null
+++ b/t/pod.t
@@ -0,0 +1,12 @@
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More;
+
+# Ensure a recent version of Test::Pod
+my $min_tp = 1.22;
+eval "use Test::Pod $min_tp";
+plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
+
+all_pod_files_ok();