Alien-InteractiveBrokers
view release on metacpan or search on metacpan
bin/ibapi-config view on Meta::CPAN
my $exitval = defined( $_[0] ) ? $_[0] : 42;
print prog_header(), "\n";
print "Usage:\n\t\$ $PROGNAME OPTION\n\n";
print "Options:\n";
for( @args )
{
my @opts = split( /\|/, $args{$_}->{optspec} );
$opts[0] =~ s/[\=\:].*//;
my( $single ) = grep { length( $_ ) <= 2 } @opts;
$single = substr( $opts[0], 0, 1 )
unless( $single );
printf( " --%s | -%s:\n %s\n\n",
$opts[0], $single, $args{$_}->{desc} );
}
exit( $exitval );
}
__END__
inc/MY/Build.pm view on Meta::CPAN
Connection => 'close',
Accept => '*/*',
}
}
);
unless( $response->{success} )
{
my $content = ( exists( $response->{content} ) and
defined( $response->{content} ) and
length( $response->{content} ) )
? substr( $response->{content}, 0, 8*1024 )
: "empty";
chomp $content;
die sprintf( "\nUnable to fetch archive: %s %s; Content was%s\n",
$response->{status}, $response->{reason},
":\n'" . $content . "'\n" );
}
# Write it to disk
open my $fd, '>', $self->ibapi_archive()
or die "\nCannot write to " . $self->ibapi_archive() . ": $!";
binmode( $fd );
my $bytes = syswrite( $fd, $response->{content} );
die "\nError writing to " . $self->ibapi_archive() . ": $!"
unless( $bytes == length( $response->{content} ) );
close( $fd );
print "OK\n";
}
sub install_ibapi {
my $self = shift;
return if( -d $self->ibapi_target_dir() );
require Archive::Extract;
t/10-Alien-InteractiveBrokers.t view on Meta::CPAN
# Test: all methods
# Expected: PASS
# Set up some junk
my $aib_path = $INC{ join( '/', 'Alien', 'InteractiveBrokers.pm' ) };
$aib_path =~ s{\.pm$}{};
my $aib_base = catdir( $aib_path, 'IBJts' );
# Check correct version looked up
my $version = get_api_version( $aib_base );
cmp_ok( length( $obj->version() ), '>', 0, 'version()' );
diag( "API Version " . $obj->version() );
# Check correct path
is( $obj->path(), $aib_base, 'path()' );
# Check correct classpath
my $classpath = catfile( $aib_base, 'jtsclient.jar' );
is( $obj->classpath(), $classpath, 'classpath()' );
# Check correct includes
( run in 0.602 second using v1.01-cache-2.11-cpan-65fba6d93b7 )