view release on metacpan or search on metacpan
t/boilerplate.t view on Meta::CPAN
use 5.006;
use strict;
use warnings;
use Test::More tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
t/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
TODO: {
local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/ACL/Lite.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
t/boilerplate.t view on Meta::CPAN
use 5.006;
use strict;
use warnings;
use Test::More tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
t/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
TODO: {
local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/ACME/MBHall.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
t/boilerplate.t view on Meta::CPAN
use strict;
use warnings;
use Test::More tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
t/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
TODO: {
local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/ACME/MSDN/SPUtility.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
t/boilerplate.t view on Meta::CPAN
use warnings;
use Test::More tests => 3;
use File::Basename qw/dirname/;
use File::Spec;
sub not_in_file_ok {
my ($filename, %regex) = @_;
my $file = File::Spec->catfile((dirname(__FILE__), '..'), $filename);
open( my $fh, '<', $file )
or die "couldn't open $file for reading: $!";
t/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/ACME/QuoteDB.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
xt/boilerplate.t view on Meta::CPAN
use warnings;
use Test::More;
plan tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
xt/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
TODO: {
local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/ACME/THEDANIEL/Utils.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ADAMK/Release.pm view on Meta::CPAN
*.pod
} )->file;
}
sub find_executable {
File::Find::Rule->name('*.exe')->not_executable->file;
}
sub find_localize {
File::Find::Rule->file->not_binary->writable;
}
sub file_localize {
File::LocalizeNewlines->new(
filter => $_[0]->find_localize,
view all matches for this distribution
view release on metacpan or search on metacpan
t/boilerplate.t view on Meta::CPAN
use strict;
use warnings;
use Test::More tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
t/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
TODO: {
# local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/AE/AdHoc.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
ninstr|||n
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
noperl_die|||vn
not_a_number|||
not_incrementable|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
oopsAV|||
oopsHV|||
watch|||
whichsig_pvn||5.015004|
whichsig_pv||5.015004|
whichsig_sv||5.015004|
whichsig|||
win32_croak_not_implemented|||n
with_queued_errors|||
wrap_op_checker||5.015008|
write_to_stderr|||
xs_boot_epilog|||
xs_handshake|||vn
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
# define PERL_PATCHLEVEL_H_IMPLICIT
# include <patchlevel.h>
# endif
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
# include <could_not_find_Perl_patchlevel.h>
# endif
# ifndef PERL_REVISION
# define PERL_REVISION (5)
/* Replace: 1 */
# define PERL_VERSION PATCHLEVEL
view all matches for this distribution
view release on metacpan or search on metacpan
Changes.html view on Meta::CPAN
<LI><A HREF="#Enhancements">Enhancements</A>
<LI><A HREF="#Changes_in_1_8">Changes in 1.8</A>
<LI><A HREF="#Bug_Fixes">Bug Fixes</A>
<UL>
<LI><A HREF="#vos_examine_did_not_pick_up_the_">vos examine did not pick up the LOCKED flag</A>
<LI><A HREF="#pts_membership_error_checking_wa">pts membership error checking was bogus</A>
</UL>
<LI><A HREF="#Changes_in_1_7">Changes in 1.7</A>
<LI><A HREF="#Enhancements">Enhancements</A>
Changes.html view on Meta::CPAN
<H1><A NAME="Bug_Fixes">Bug Fixes
</A></H1>
<P>
<HR>
<H2><A NAME="vos_examine_did_not_pick_up_the_">vos examine did not pick up the LOCKED flag
</A></H2>
The code to parse the VLDB header was missing the LOCKED flag, if it was
present, so this attribute was not being set properly. It is now.
view all matches for this distribution
view release on metacpan or search on metacpan
i = 1.0/j;
return 1;
}
#endif /* AFS_PTHREAD_ENV*/
static int32 not_here(s)
char *s;
{
croak("%s not implemented on this architecture or under this AFS version", s);
return -1;
}
char *hostName
int32 verbose
CODE:
{
#if defined(AFS_3_4)
not_here("AFS::Utils::get_server_version");
#else
struct sockaddr_in taddr;
struct in_addr hostAddr;
struct hostent *th;
int32 host;
if (code == 0) {
bcopy((char *) space, &flag, sizeof(int32));
sv_setiv(ST(0), flag);
}
#else
not_here("AFS::CM::getcrypt");
#endif
}
int32
fs_setcrypt(as)
vi.out_size = 0;
code = pioctl(0, VIOC_SETRXKCRYPT, &vi, 1);
SETCODE(code);
RETVAL = (code == 0);
#else
not_here("AFS::CM::setcrypt");
#endif
}
OUTPUT:
RETVAL
RETVAL = 1;
done:
;
#else
not_here("AFS::VOS::setfields");
#endif
}
OUTPUT:
RETVAL
RETVAL = 1;
done:
;
#else
not_here("AFS::VLDB::changeloc");
#endif
}
OUTPUT:
RETVAL
PREINIT:
int32 code = 0;
int32 flag;
CODE:
{
not_here("AFS::BOS::setauth");
RETVAL = 42;
if (strcmp(tp, "on") == 0)
flag = 0; /* auth req.: noauthflag is false */
else if (strcmp(tp, "off") == 0)
struct ktc_encryptionKey tkey;
char *tcell = (char *) 0; /* use current cell */
char buf[BUFSIZ], ver[BUFSIZ];
CODE:
{
not_here("AFS::BOS::addkey");
Zero(&tkey, 1, struct ktc_encryptionKey);
RETVAL = 42;
if (string)
PREINIT:
int32 code = 0;
int32 temp;
CODE:
{
not_here("AFS::BOS::removekey");
if (SvIOK(object)) {
temp = (int32) SvIV(object);
code = BOZO_DeleteKey(self, temp);
}
char *name
PREINIT:
int32 code = 0;
CODE:
{
not_here("AFS::BOS::setcellname");
code = BOZO_SetCellName(self, name);
if (code) {
char buffer[256];
sprintf(buffer, "AFS::BOS: failed to set cell (%s)\n", em(code));
BSETCODE(code, buffer);
}
RETVAL = val;
#else
RETVAL = 0;
not_here("AFS::BOS::getrestricted");
#endif
}
OUTPUT:
RETVAL
BSETCODE(code, buffer);
}
RETVAL = (code == 0);
#else
RETVAL = 0;
not_here("AFS::BOS::setrestricted");
#endif
}
OUTPUT:
RETVAL
extern struct ubik_client *cstruct;
afs_int32 curGoal, mrafs = 0;
char *tp;
CODE:
{
not_here("AFS::BOS::salvage");
if (partition && strlen(partition) == 0)
partition = NULL;
if (volume && strlen(volume) == 0)
volume = NULL;
view all matches for this distribution
view release on metacpan or search on metacpan
t/boilerplate.t view on Meta::CPAN
use strict;
use warnings;
use Test::More tests => 4;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
t/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
TODO: {
local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/AI/CBR/Case.pm');
module_boilerplate_ok('lib/AI/CBR/Sim.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AI/Classifier/Text/FileLearner.pm view on Meta::CPAN
has iterator => ( is => 'ro', lazy_build => 1 );
sub _build_iterator {
my $self = shift;
my $rule = File::Find::Rule->new( );
$rule->file;
$rule->not_name('*.data');
$rule->start( $self->training_dir );
return $rule;
}
sub get_category {
view all matches for this distribution
view release on metacpan or search on metacpan
t/09population.t view on Meta::CPAN
my $scorer2 = "[ @]22M^]21M^]20M^" . (' 'x605);
my $scorer3 = "[@ <]02M^]20M^]11M^" . (' 'x605);
my $popid = -10;
my @population = map { Blueprint->new( code => $_, dimensions => 4, id => $popid++, host => 'test' ) }
($quit1,$quit1,$concede1,$concede1,$dier1,$dier1,$scorer3,$scorer1,$scorer2, $scorer2);
$population[3]{host} = 'not_test';
$population[6]{host} = 'not_test1';
$population[7]{host} = 'not_test2';
$population[8]{host} = 'not_test';
seed(0.3, 0, 0.7, oneish);
$population->blueprints([@population]);
$population->fight();
@population = @{$population->blueprints};
is(scalar @population, 3, 'population reduced to 25% of its original size');
BEGIN { $num_tests += 1 };
my @expected_results = (
{id => -4, code => $scorer3, fitness => 3, host => 'not_test1'},
{id => -2, code => $scorer2, fitness => 2, host => 'not_test'},
{id => -10, code => $quit1, fitness => 1, host => 'test'},
);
my $ref = $population->blueprints;
for my $id (0..@expected_results-1) {
is($$ref[$id]{id}, $expected_results[$id]{id}, "sorted $id id right");
t/09population.t view on Meta::CPAN
is(new_popid(), 23, '$population->load gets popid right');
$ref = $population->blueprints;
is(scalar @$ref, 3, '$population->load returned the right number of blueprints');
BEGIN { $num_tests += 6 };
@expected_results = (
{id => -4, code => $scorer3, fitness => 3, host => 'not_test1'},
{id => -2, code => $scorer2, fitness => 2, host => 'not_test'},
{id => -10, code => $quit1, fitness => 1, host => 'test'},
);
for my $id (0..@expected_results-1) {
is($$ref[$id]{id}, $expected_results[$id]{id}, "loaded $id id right");
is($$ref[$id]{host}, $expected_results[$id]{host}, "loaded $id host right");
view all matches for this distribution
view release on metacpan or search on metacpan
nextchar|||
ninstr|||
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
not_a_number|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
offer_nice_chunk|||
oopsAV|||
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
# define PERL_PATCHLEVEL_H_IMPLICIT
# include <patchlevel.h>
# endif
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
# include <could_not_find_Perl_patchlevel.h>
# endif
# ifndef PERL_REVISION
# define PERL_REVISION (5)
/* Replace: 1 */
# define PERL_VERSION PATCHLEVEL
view all matches for this distribution
view release on metacpan or search on metacpan
LibNeural.xs view on Meta::CPAN
#include <nnwork.h>
#include <neuron.h>
static int
not_here(char *s)
{
croak("%s not implemented on this architecture", s);
return -1;
}
LibNeural.xs view on Meta::CPAN
case 'A':
if (strEQ(name + 0, "ALL")) { /* removed */
#ifdef ALL
return ALL;
#else
goto not_there;
#endif
}
case 'H':
if (strEQ(name + 0, "HIDDEN")) { /* removed */
#ifdef HIDDEN
return HIDDEN;
#else
goto not_there;
#endif
}
case 'I':
if (strEQ(name + 0, "INPUT")) { /* removed */
#ifdef INPUT
return INPUT;
#else
goto not_there;
#endif
}
case 'O':
if (strEQ(name + 0, "OUTPUT")) { /* removed */
#ifdef OUTPUT
return OUTPUT;
#else
goto not_there;
#endif
}
}
errno = EINVAL;
return 0;
not_there:
errno = ENOENT;
return 0;
}
/* function that takes an array reference and convert it into an equivelent
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AI/MXNet/NDArray.pm view on Meta::CPAN
'/=' => \&idivide,
'%' => \&modulo,
'%=' => \&imodulo,
'**' => \&power,
'==' => \&equal,
'!=' => \¬_equal,
'>' => \&greater,
'>=' => \&greater_equal,
'<' => \&lesser,
'<=' => \&lesser_equal,
'.=' => \&set,
lib/AI/MXNet/NDArray.pm view on Meta::CPAN
$other,
qw/broadcast_equal _equal_scalar/
);
}
method not_equal(AI::MXNet::NDArray|Num $other, $reverse=)
{
return _ufunc_helper(
$self,
$other,
qw/broadcast_not_equal _not_equal_scalar/
);
}
method greater(AI::MXNet::NDArray|Num $other, $reverse=)
{
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/More.pm view on Meta::CPAN
$tb->_unoverload_str(\$e1, \$e2);
# Either they're both references or both not.
my $same_ref = !(!ref $e1 xor !ref $e2);
my $not_ref = (!ref $e1 and !ref $e2);
if( defined $e1 xor defined $e2 ) {
$ok = 0;
}
elsif ( _dne($e1) xor _dne($e2) ) {
$ok = 0;
}
elsif ( $same_ref and ($e1 eq $e2) ) {
$ok = 1;
}
elsif ( $not_ref ) {
push @Data_Stack, { type => '', vals => [$e1, $e2] };
$ok = 0;
}
else {
if( $Refs_Seen{$e1} ) {
view all matches for this distribution
view release on metacpan or search on metacpan
#include "XSUB.h"
#include "megahal.h"
static int
not_here(char *s)
{
croak("%s not implemented on this architecture", s);
return -1;
}
case 'M':
if (strEQ(name, "MEGAHAL_H"))
#ifdef MEGAHAL_H
return MEGAHAL_H;
#else
goto not_there;
#endif
break;
case 'N':
break;
case 'O':
break;
}
errno = EINVAL;
return 0;
not_there:
errno = ENOENT;
return 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
nextchar|||
ninstr|||
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
not_a_number|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
offer_nice_chunk|||
oopsAV|||
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
# define PERL_PATCHLEVEL_H_IMPLICIT
# include <patchlevel.h>
# endif
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
# include <could_not_find_Perl_patchlevel.h>
# endif
# ifndef PERL_REVISION
# define PERL_REVISION (5)
/* Replace: 1 */
# define PERL_VERSION PATCHLEVEL
view all matches for this distribution
view release on metacpan or search on metacpan
xt/boilerplate.t view on Meta::CPAN
use warnings;
use Test::More;
plan tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
xt/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
TODO: {
local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/AI/Perceptron/Simple.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
t/70builtins.t view on Meta::CPAN
'... and it should return the correct results';
ok ! $prolog->results, '... and halt backtracking appropriately';
$prolog = Prolog->new(<<'END_PROLOG');
test_var(VAR,X) :-
if(var(VAR), eq(X,is_var), eq(X,not_var)).
END_PROLOG
$prolog->query('test_var(X, Y)');
is $prolog->results, 'test_var(A, is_var)', 'var(X) should evaluate to true';
$prolog->query('test_var(42, Y)');
is $prolog->results, 'test_var(42, not_var)',
'... and var(42) should evaluate to not true';
$prolog->query('test_var(ovid, Y)');
is $prolog->results, 'test_var(ovid, not_var)',
'... and var(ovid) should evaluate to not true';
{
my $faux_kb = Test::MockModule->new(KnowledgeBase);
my @stdout;
view all matches for this distribution
view release on metacpan or search on metacpan
nextchar|||
ninstr|||
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
not_a_number|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
oopsAV|||
oopsCV|||
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
# define PERL_PATCHLEVEL_H_IMPLICIT
# include <patchlevel.h>
# endif
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
# include <could_not_find_Perl_patchlevel.h>
# endif
# ifndef PERL_REVISION
# define PERL_REVISION (5)
/* Replace: 1 */
# define PERL_VERSION PATCHLEVEL
view all matches for this distribution
view release on metacpan or search on metacpan
nextchar|||
ninstr|||
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
not_a_number|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
oopsAV|||
oopsCV|||
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
# define PERL_PATCHLEVEL_H_IMPLICIT
# include <patchlevel.h>
# endif
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
# include <could_not_find_Perl_patchlevel.h>
# endif
# ifndef PERL_REVISION
# define PERL_REVISION (5)
/* Replace: 1 */
# define PERL_VERSION PATCHLEVEL
view all matches for this distribution
view release on metacpan or search on metacpan
nextchar|||
ninstr|||
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
not_a_number|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
offer_nice_chunk|||
oopsAV|||
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
# define PERL_PATCHLEVEL_H_IMPLICIT
# include <patchlevel.h>
# endif
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
# include <could_not_find_Perl_patchlevel.h>
# endif
# ifndef PERL_REVISION
# define PERL_REVISION (5)
/* Replace: 1 */
# define PERL_VERSION PATCHLEVEL
view all matches for this distribution
view release on metacpan or search on metacpan
( my $test_dir ) = ( $Bin =~ m:^(.*?/t)$: );
( my $dist_dir ) = Cwd::realpath( File::Spec->catfile( $test_dir, '..' ) );
use File::Find;
sub not_in_file_ok {
my ( $filename, %regex ) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
find(
sub {
return if -d $File::Find::name;
return unless /\.pm$/;
diag($File::Find::name);
not_in_file_ok( $File::Find::name, "TODO" => qr/TODO/, );
},
File::Spec->catfile( $dist_dir, 'lib' )
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
xt/boilerplate.t view on Meta::CPAN
use warnings;
use Test::More;
plan tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
xt/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
TODO: {
local $TODO = "Need to replace the boilerplate text";
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/ANSI/Palette.pm');
view all matches for this distribution
view release on metacpan or search on metacpan
xt/boilerplate.t view on Meta::CPAN
use warnings;
use Test::More;
plan tests => 3;
sub not_in_file_ok {
my ($filename, %regex) = @_;
open( my $fh, '<', $filename )
or die "couldn't open $filename for reading: $!";
my %violated;
xt/boilerplate.t view on Meta::CPAN
}
}
sub module_boilerplate_ok {
my ($module) = @_;
not_in_file_ok($module =>
'the great new $MODULENAME' => qr/ - The great new /,
'boilerplate description' => qr/Quick summary of what the module/,
'stub function definition' => qr/function[12]/,
);
}
{
not_in_file_ok(README =>
"The README is used..." => qr/The README is used/,
"'version information here'" => qr/to provide version information/,
);
not_in_file_ok(Changes =>
"placeholder date/time" => qr(Date/time)
);
module_boilerplate_ok('lib/API/Drip/Request.pm');
}
view all matches for this distribution
view release on metacpan or search on metacpan
$filename = 'config.json';
}
if (-e $filename) {
say "File $filename exists";
input_if_not_exists(['gapi/client_id', 'gapi/client_secret']);
runserver();
} else {
say "JSON file $filename with API tokens not found. Creating new file...";
setup();
runserver();
tie my @array, 'Tie::File', $filename or die $!;
shift @array;
untie @array;
};
sub input_if_not_exists {
my $fields = shift;
my $config = Config::JSON->new($filename);
for my $i (@$fields) {
if (!defined $config->get($i) ) {
print "$i: ";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/API/Instagram.pm view on Meta::CPAN
for ( @access_token_fields ) {
carp "ERROR: $_ required for generating access token." and return unless defined $self->$_;
}
my $data = { map { $_ => $self->$_ } @access_token_fields };
my $json = $self->_request( 'post', $self->_access_token_url, $data, { token_not_required => 1 } );
wantarray ? ( $json->{access_token}, $self->user( $json->{user} ) ) : $json->{access_token};
}
lib/API/Instagram.pm view on Meta::CPAN
sub _request {
my ( $self, $method, $url, $params, $opts ) = @_;
# Verifies access requirements
unless ( defined $self->access_token ) {
if ( !$opts->{token_not_required} or !defined $self->client_id ) {
carp "A valid access_token is required";
return {}
}
}
view all matches for this distribution