App-TestOnTap

 view release on metacpan or  search on metacpan

lib/App/TestOnTap/PackInfo.pm  view on Meta::CPAN

###

sub getEnv
{
	my \$env = '';
	\$env .= "\$_ => '\$ENV{\$_}'\\n" foreach (sort(keys(\%ENV)));
	
	return \$env;
}

sub find_modules
{
	my \$ei = ExtUtils::Installed->new(skip_cwd => 1);

	my \$modules = '';
	foreach my \$module (sort(\$ei->modules()))
	{
		my \$ver = \$ei->version(\$module);
		\$modules .= "\$module => \$ver\\n";
	}
		
	return \$modules;
}

sub slashify
{
	my \$s = shift;
	my \$fsep = shift || '$x_fsep';

	my \$dblStart = \$s =~ s#^[\\\\/]{2}##;
	\$s =~ s#[/\\\\]+#\$fsep#g;

	return \$dblStart ? "\$fsep\$fsep\$s" : \$s;
}

sub usage
{
	print <<USAGE;
Usage: \$0
          [--outfile <file>]
          [--verbose || --no-verbose];
          [--info || --no-info]

Creates a testontap binary with a default name of '$x_output'.
Use '--outfile' to change.

Use '--verbose' or '--no-verbose' to turn on/off verboseness.
Defaults to verboseness when script was created (currently '$x_verbose').

By default a number of information parts is embedded in the packed file (to be printed
with '--_pp_info'). Use '--no-info' to embed blank data only. 
USAGE
	exit(42);
}
SCRIPT

	write_file($scriptFile, $script) || die("Failed to write '$scriptFile': $!\n");
	
	if (!$IS_WINDOWS)
	{
		my $mode = (stat($scriptFile))[2];
		$mode |= 0100;
		chmod($mode, $scriptFile);
	}
	 
	return $scriptFile;
}

1;



( run in 5.214 seconds using v1.01-cache-2.11-cpan-5837b0d9d2c )