[carton] 283/472: refactor CLI with Moo

Lucas Kanashiro kanashiro-guest at moszumanska.debian.org
Fri Jul 24 00:38:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

kanashiro-guest pushed a commit to branch master
in repository carton.

commit 0a26b6729b8d2ddd65a6c9e1270b18c3ea6e2d11
Author: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
Date:   Wed Jun 5 14:59:33 2013 +0900

    refactor CLI with Moo
---
 xt/CLI.pm | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/xt/CLI.pm b/xt/CLI.pm
index ad64001..70ce360 100644
--- a/xt/CLI.pm
+++ b/xt/CLI.pm
@@ -21,6 +21,9 @@ extends 'Carton::CLI';
 $Carton::CLI::UseSystem = 1;
 
 has dir => (is => 'rw');
+has output => (is => 'rw');
+has system_output => (is => 'rw');
+has system_error  => (is => 'rw');
 
 sub print {
     my $self = shift;
@@ -29,26 +32,17 @@ sub print {
 
 sub run {
     my($self, @args) = @_;
-    my $pushd = File::pushd::pushd $self->{dir};
+
+    my $pushd = File::pushd::pushd $self->dir;
+
     $self->{output} = '';
-    ($self->{system_output}, $self->{system_error}) = capture {
+
+    my @capture = capture {
         eval { $self->SUPER::run(@args) };
     };
-}
 
-sub output {
-    my $self = shift;
-    $self->{output};
-}
-
-sub system_output {
-    my $self = shift;
-    $self->{system_output};
-}
-
-sub system_error {
-    my $self = shift;
-    $self->{system_error};
+    $self->system_output($capture[0]);
+    $self->system_error($capture[1]);
 }
 
 sub clean_local {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/carton.git



More information about the Pkg-perl-cvs-commits mailing list