Просмотр исходного кода

Make developing easier on a new machine

Andy Baugh 1 год назад
Родитель
Сommit
9a74e45405
3 измененных файлов с 20 добавлено и 12 удалено
  1. 9 2
      Makefile
  2. 1 0
      githooks/pre-commit
  3. 10 10
      lib/Net/OpenSSH/More.pm

+ 9 - 2
Makefile

@@ -1,7 +1,9 @@
+all: install-githooks depend
+
 install-githooks:
 	install githooks/* .git/hooks/
 
-test: compilecheck
+test: depend testdepend compilecheck
 	prove -mv t/*.t
 
 FILES2CHECK := $(shell find lib/ -name '*.pm')
@@ -12,4 +14,9 @@ tidy:
 	$(foreach FILE,$(FILES2CHECK),perltidy -b $(FILE) &&) /bin/true
 	perltidy -b t/*.t
 
-.PHONY: compilecheck test tidy install-githooks
+depend:
+	sudo cpanm Net::OpenSSH Net::SFTP::Foreign File::Slurper Data::UUID Expect File::HomeDir File::Temp IO::Pty IO::Socket::INET IO::Socket::INET6 IO::Stty List::Util Net::DNS::Resolver Net::IP Time::HiRes Term::ANSIColor
+
+testdepend:
+	sudo cpanm Test2::V0 Test2::Tools::Explain Test2::Tools::Subtest Test2::Plugin::NoWarnings Test::MockModule
+.PHONY: compilecheck test tidy install-githooks depend testdepend

+ 1 - 0
githooks/pre-commit

@@ -1,3 +1,4 @@
 #!/bin/sh
 make test
 make tidy
+git add -u

+ 10 - 10
lib/Net/OpenSSH/More.pm

@@ -7,16 +7,16 @@ use warnings;
 
 use parent 'Net::OpenSSH';
 
-use Data::UUID        ();
-use Expect            ();
-use File::HomeDir     ();
-use File::Temp        ();
-use Fcntl             ();
-use IO::Pty           ();
-use IO::Socket::INET  ();
-use IO::Socket::INET6 ();
-use IO::Stty          ();
-use List::Util qw{first};
+use Data::UUID         ();
+use Expect             ();
+use File::HomeDir      ();
+use File::Temp         ();
+use Fcntl              ();
+use IO::Pty            ();
+use IO::Socket::INET   ();
+use IO::Socket::INET6  ();
+use IO::Stty           ();
+use List::Util         qw{first};
 use Net::DNS::Resolver ();
 use Net::IP            ();
 use Time::HiRes        ();