Skip to content

Commit

Permalink
closes #9; exec file is now generated by File::Temp
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieb9 committed Mar 15, 2016
1 parent eae639e commit 27b1a4b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,5 +1,8 @@
Revision history for Test-BrewBuild

0.04 - the exec file is now auto-generated with File::Temp, and unlinked
after use (closes #9)

0.03
- App::cpanminus now a prereq
- fixed issue in split in results() (fixes #6)
Expand Down
10 changes: 0 additions & 10 deletions exec.pl

This file was deleted.

22 changes: 21 additions & 1 deletion lib/Test/BrewBuild.pm
Expand Up @@ -174,8 +174,16 @@ sub exec {
my (@a, @b);
my $self = shift;

my $wfh = File::Temp->new(UNLINK => 1);
my $fname = $wfh->filename;

while(<DATA>){
print $wfh $_;
}
close $wfh;

my $brew = $self->is_win ? 'berrybrew' : 'perlbrew';
return `$brew exec perl exec.pl`;
return `$brew exec perl $fname`;
}
sub brew_info {
my $self = shift;
Expand Down Expand Up @@ -291,3 +299,15 @@ See L<http://dev.perl.org/licenses/> for more information.
=cut

1; # End of Test::BrewBuild

__DATA__
#!/usr/bin/perl
use warnings;
use strict;
if ($^O ne 'MSWin32'){
system "cpanm --installdeps . && make && make test";
}
else {
system "cpanm --installdeps . && dmake && dmake test";
}

0 comments on commit 27b1a4b

Please sign in to comment.