view release on metacpan or search on metacpan
lib/Amon2/Plugin/Web/CSRFDefender.pm view on Meta::CPAN
$html =~ s!($form_regexp)!qq{$1\n<input type="hidden" name="csrf_token" value="}.$self->get_csrf_defender_token().qq{" />}!ge;
return $html;
},
);
}
unless ($conf->{no_validate_hook}) {
$c->add_trigger(
BEFORE_DISPATCH => sub {
my $self = shift;
if (not $self->validate_csrf()) {
return $self->create_response(
403,
[
'Content-Type' => 'text/html',
'Content-Length' => length($ERROR_HTML)
lib/Amon2/Plugin/Web/CSRFDefender.pm view on Meta::CPAN
my $token = $csrf_token_generator->($self);
$self->session->set('csrf_token' => $token);
$token;
}
});
Amon2::Util::add_method($c, 'validate_csrf', \&validate_csrf);
}
sub validate_csrf {
my $self = shift;
if ( $self->req->method eq 'POST' ) {
my $r_token = $self->req->param('csrf_token') || $self->req->header('x-csrf-token');
my $session_token = $self->session->get('csrf_token');
lib/Amon2/Plugin/Web/CSRFDefender.pm view on Meta::CPAN
=item $c->get_csrf_defender_token()
Get a CSRF defender token. This method is useful to add token for AJAX request.
=item $c->validate_csrf()
You can validate CSRF token manually.
=back
=head1 PARAMETERS
=over 4
=item no_validate_hook
Do not run validation automatically.
=item no_html_filter
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2/Plugin/Web/FormValidator/Simple.pm view on Meta::CPAN
initial setup.
=item C<< $c->form() >>
validate form/query parameters.
=item C<< $c->set_invalid_form() >>
set error from manual validation.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amp/DbPoolClient.pm view on Meta::CPAN
# find all the ? positions to replace
while ($sql =~ m/\?/g) {
push @replacements, pos($sql);
}
# validate the params given match the number of ? to replace
if (scalar(@replacements) != scalar(@params)) {
die "SQL has " . scalar(@replacements) . " parameters but " . scalar(@params) . " were given\n";
}
# Set the index mark to match the size of the @params for iterating through the replacements
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Analizo/Command.pm view on Meta::CPAN
options to every analizo tool:
analizo <tool> --help
analizo <tool> --usage
Any analizo tool should implement B<validate()>, method which is called by
B<validate_args()> implemented here. See L<App::Cmd::Command> for details about
B<validate_args()>.
=cut
sub validate_args {
my ($self, $opt, $args) = @_;
if ($self->app->global_options->version) {
$self->usage_error("Invalid option: --version");
}
elsif ($self->app->global_options->usage) {
print $self->app->usage, "\n", $self->usage;
exit 0;
}
$self->validate($opt, $args);
}
sub version_information {
my ($self) = @_;
sprintf("%s version %s", $self->app->arg0, $Analizo::VERSION);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Component.pm view on Meta::CPAN
package Anansi::ComponentManagerExample::ComponentExample;
use base qw(Anansi::Component);
sub validate {
return 1;
}
sub doSomething {
my ($self, $channel, %parameters) = @_;
}
Anansi::Component::addChannel(
'Anansi::ComponentManagerExample::ComponentExample',
'VALIDATE_AS_APPROPRIATE' => Anansi::ComponentManagerExample::ComponentExample->validate
);
Anansi::Component::addChannel(
'Anansi::ComponentManagerExample::ComponentExample',
'SOME_COMPONENT_CHANNEL' => Anansi::ComponentManagerExample::ComponentExample->doSomething
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/ComponentManager.pm view on Meta::CPAN
'Anansi::ComponentManagerExample::AndSoOnComponentExample' => -1,
};
return $PRIORITY;
}
sub validate {
my ($self, $channel, %parameters) = @_;
return 1;
}
sub doSomething {
lib/Anansi/ComponentManager.pm view on Meta::CPAN
'Anansi::ComponentManagerExample::ComponentExample',
'PRIORITY_OF_VALIDATE' => Anansi::ComponentManagerExample::ComponentExample->priority
);
Anansi::Component::addChannel(
'Anansi::ComponentManagerExample::ComponentExample',
'VALIDATE_AS_APPROPRIATE' => Anansi::ComponentManagerExample::ComponentExample->validate
);
Anansi::Component::addChannel(
'Anansi::ComponentManagerExample::ComponentExample',
'SOME_COMPONENT_CHANNEL' => Anansi::ComponentManagerExample::ComponentExample->doSomething
);
lib/Anansi/ComponentManager.pm view on Meta::CPAN
the implementer of the component manager. A unique identifier for the object
may either be supplied or automatically generated and is returned as a means of
referencing the object.
Note: The process of selecting the component to use requires each component to
validate it's own appropriateness. Therefore this process makes use of a
VALIDATE_AS_APPROPRIATE component channel which is expected to return either a
B<1> I<(one)> or a B<0> I<(zero)> representing B<appropriate> or
B<inappropriate>. If this component channel does not exist it is assumed that
the component is not designed to be implemented in this way. A component may
also provide a PRIORITY_OF_VALIDATE component channel to aid in validating where
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Database/MySQL.pm view on Meta::CPAN
Anansi::Database::MySQL - A manager for MySQL databases.
=head1 SYNOPSIS
use Anansi::Database::MySQL;
if(Anansi::Database::MySQL->validate(
undef,
DRIVER => 'MySQL',
)) {
my $OBJECT = Anansi::Database::MySQL->new();
if($OBJECT->connect(
lib/Anansi/Database/MySQL.pm view on Meta::CPAN
Anansi::Component::addChannel('Anansi::Database::MySQL', 'STATEMENT' => 'Anansi::DatabaseComponent::statement');
=head3 validate
See L<Anansi::DatabaseComponent::validate|Anansi::DatabaseComponent/"validate"> for details. Overridden by L<Anansi::Database::MySQL::validate|Anansi::Database::MySQL/"validate">.
=cut
=head2 connect
lib/Anansi/Database/MySQL.pm view on Meta::CPAN
Anansi::Component::addChannel('Anansi::Database::MySQL', 'CONNECT' => 'connect');
=head2 validate
if(1 == Anansi::Database::MySQL::validate($OBJECT, undef));
if(1 == Anansi::Database::MySQL::channel($OBJECT, 'VALIDATE_AS_APPROPRIATE'));
if(1 == Anansi::Database::MySQL->validate(undef));
if(1 == Anansi::Database::MySQL->channel('VALIDATE_AS_APPROPRIATE'));
if(1 == $OBJECT->validate(undef, DRIVER => 'MySQL'));
if(1 == $OBJECT->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'MySQL'));
if(1 == Anansi::Database::MySQL->validate(undef, DRIVER => 'MySQL'));
if(1 == Anansi::Database::MySQL->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'MySQL'));
=over 4
lib/Anansi/Database/MySQL.pm view on Meta::CPAN
=back
=back
Overrides L<Anansi::DatabaseComponent::validate|Anansi::DatabaseComponent/"validate">.
=cut
sub validate {
my ($self, $channel, %parameters) = @_;
$parameters{DRIVERS} = 'MySQL';
return $self->SUPER::validate(undef, (%parameters));
}
Anansi::Component::addChannel('Anansi::Database::MySQL', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Database/Oracle.pm view on Meta::CPAN
Anansi::Database::Oracle - A manager for Oracle databases.
=head1 SYNOPSIS
use Anansi::Database::Oracle;
if(Anansi::Database::Oracle->validate(
undef,
DRIVER => 'Oracle',
)) {
my $OBJECT = Anansi::Database::Oracle->new();
if($OBJECT->connect(
lib/Anansi/Database/Oracle.pm view on Meta::CPAN
Anansi::Component::addChannel('Anansi::Database::Oracle', 'STATEMENT' => 'Anansi::DatabaseComponent::statement');
=head3 validate
See L<Anansi::DatabaseComponent::validate|Anansi::DatabaseComponent/"validate"> for details. Overridden by L<Anansi::Database::Oracle::validate|Anansi::Database::Oracle/"validate">.
=cut
=head2 connect
lib/Anansi/Database/Oracle.pm view on Meta::CPAN
}
Anansi::Component::addChannel('Anansi::Database::Oracle', 'CONNECT' => 'connect');
=head2 validate
if(1 == Anansi::Database::Oracle::validate($OBJECT, undef));
if(1 == Anansi::Database::Oracle::channel($OBJECT, 'VALIDATE_AS_APPROPRIATE'));
if(1 == Anansi::Database::Oracle->validate(undef));
if(1 == Anansi::Database::Oracle->channel('VALIDATE_AS_APPROPRIATE'));
if(1 == $OBJECT->validate(undef, DRIVER => 'Oracle'));
if(1 == $OBJECT->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'Oracle'));
if(1 == Anansi::Database::Oracle->validate(undef, DRIVER => 'Oracle'));
if(1 == Anansi::Database::Oracle->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'Oracle'));
=over 4
lib/Anansi/Database/Oracle.pm view on Meta::CPAN
=back
=back
Overrides L<Anansi::DatabaseComponent::validate|Anansi::DatabaseComponent/"validate">.
=cut
sub validate {
my ($self, $channel, %parameters) = @_;
$parameters{DRIVERS} = 'Oracle';
return $self->SUPER::validate(undef, (%parameters));
}
Anansi::Component::addChannel('Anansi::Database::Oracle', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Database/PostgreSQL.pm view on Meta::CPAN
Anansi::Database::PostgreSQL - A manager for PostgreSQL databases.
=head1 SYNOPSIS
use Anansi::Database::PostgreSQL;
if(Anansi::Database::PostgreSQL->validate(
undef,
DRIVER => 'PostgreSQL',
)) {
my $OBJECT = Anansi::Database::PostgreSQL->new();
if($OBJECT->connect(
lib/Anansi/Database/PostgreSQL.pm view on Meta::CPAN
Anansi::Component::addChannel('Anansi::Database::PostgreSQL', 'STATEMENT' => 'Anansi::DatabaseComponent::statement');
=head3 validate
See L<Anansi::DatabaseComponent::validate|Anansi::DatabaseComponent/"validate"> for details. Overridden by L<Anansi::Database::PostgreSQL::validate|Anansi::Database::PostgreSQL/"validate">.
=cut
=head2 connect
lib/Anansi/Database/PostgreSQL.pm view on Meta::CPAN
}
Anansi::Component::addChannel('Anansi::Database::PostgreSQL', 'CONNECT' => 'connect');
=head2 validate
if(1 == Anansi::Database::PostgreSQL::validate($OBJECT, undef));
if(1 == Anansi::Database::PostgreSQL::channel($OBJECT, 'VALIDATE_AS_APPROPRIATE'));
if(1 == Anansi::Database::PostgreSQL->validate(undef));
if(1 == Anansi::Database::PostgreSQL->channel('VALIDATE_AS_APPROPRIATE'));
if(1 == $OBJECT->validate(undef, DRIVER => 'PostgreSQL'));
if(1 == $OBJECT->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'PostgreSQL'));
if(1 == Anansi::Database::PostgreSQL->validate(undef, DRIVER => 'PostgreSQL'));
if(1 == Anansi::Database::PostgreSQL->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'PostgreSQL'));
=over 4
lib/Anansi/Database/PostgreSQL.pm view on Meta::CPAN
=back
=back
Overrides L<Anansi::DatabaseComponent::validate|Anansi::DatabaseComponent/"validate">.
=cut
sub validate {
my ($self, $channel, %parameters) = @_;
$parameters{DRIVERS} = [
'Pg',
'Postgres',
'PostgreSQL'
];
return $self->SUPER::validate(undef, (%parameters));
}
Anansi::Component::addChannel('Anansi::Database::PostgreSQL', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/DatabaseComponent.pm view on Meta::CPAN
],
(%parameters),
);
}
sub validate {
my ($self, $channel, %parameters) = @_;
$parameters{DRIVER} = 'Example';
return Anansi::DatabaseComponent::validate(undef, %parameters);
}
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'AUTOCOMMIT' => 'Anansi::DatabaseComponent::autocommit');
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'COMMIT' => 'Anansi::DatabaseComponent::commit');
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'CONNECT' => 'connect');
lib/Anansi/DatabaseComponent.pm view on Meta::CPAN
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'FINISH' => 'Anansi::DatabaseComponent::finish');
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'HANDLE' => 'Anansi::DatabaseComponent::handle');
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'PREPARE' => 'Anansi::DatabaseComponent::prepare');
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'ROLLBACK' => 'Anansi::DatabaseComponent::rollback');
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'STATEMENT' => 'Anansi::DatabaseComponent::statement');
Anansi::DatabaseComponent::addChannel('Anansi::Database::Example', 'VALIDATE_AS_APPROPRIATE' => 'validate');
1;
package main;
lib/Anansi/DatabaseComponent.pm view on Meta::CPAN
=back
Verifies that the supplied parameters are all hashes and that they each contain
a I<NAME> key with a string value. Returns B<1> I<(one)> when validity is
confirmed and B<0> I<(zero)> when an invalid structure is determined. Used to
validate the I<INPUT> parameter of the B<bind> method.
=cut
sub binding {
lib/Anansi/DatabaseComponent.pm view on Meta::CPAN
The name of the parameter that contains the value to use.
=item REF I<(Array B<or> String, Optional)>
The data types used to validate the value to use.
=back
=back
lib/Anansi/DatabaseComponent.pm view on Meta::CPAN
}
Anansi::DatabaseComponent::addChannel('Anansi::DatabaseComponent', 'STATEMENT' => 'statement');
=head2 validate
if(1 == Anansi::DatabaseComponent::validate($OBJECT, undef));
if(1 == Anansi::DatabaseComponent::channel($OBJECT, 'VALIDATE_AS_APPROPRIATE'));
if(1 == Anansi::DatabaseComponent->validate(undef, DRIVERS => ['some::driver::module', 'anotherDriver']));
if(1 == Anansi::DatabaseComponent->channel('VALIDATE_AS_APPROPRIATE'));
if(1 == $OBJECT->validate(undef, DRIVER => 'Example'));
if(1 == $OBJECT->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'Example'));
if(1 == Anansi::DatabaseComponent->validate(undef, DRIVER => 'Example', DRIVERS => 'some::driver'));
if(1 == Anansi::DatabaseComponent->channel('VALIDATE_AS_APPROPRIATE', DRIVER => 'Example'));
=over 4
lib/Anansi/DatabaseComponent.pm view on Meta::CPAN
supplied. Returns B<1> I<(one)> for valid and B<0> I<(zero)> for invalid.
=cut
sub validate {
my ($self, $channel, %parameters) = @_;
my $package = $self;
$package = ref($self) if(ref($self) !~ /^$/);
my %modules = Anansi::Actor->modules();
return 0 if(!defined($modules{'Bundle::DBI'}));
lib/Anansi/DatabaseComponent.pm view on Meta::CPAN
}
}
return 1;
}
Anansi::DatabaseComponent::addChannel('Anansi::DatabaseComponent', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Script/CGI.pm view on Meta::CPAN
}
print "\n";
}
=head2 validate
my $valid = $OBJECT->validate();
my $valid = $OBJECT->channel('VALIDATE_AS_APPROPRIATE');
Determines whether this module is the correct one to use for handling Perl
script execution.
=cut
sub validate {
my $self = shift(@_);
my $channel;
$channel = shift(@_) if(0 < scalar(@_));
return 1 if(exists($ENV{'MOD_PERL'}));
return 1 if(exists($ENV{'GATEWAY_INTERFACE'}));
return 0;
}
Anansi::ScriptComponent::addChannel('Anansi::Script::CGI', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Script/JSON.pm view on Meta::CPAN
}
Anansi::ScriptComponent::addChannel('Anansi::Script::JSON', 'PRIORITY_OF_VALIDATE' => 'priority');
=head2 validate
my $valid = $OBJECT->validate();
my $valid = $OBJECT->channel('VALIDATE_AS_APPROPRIATE');
Determines whether this module is the correct one to use for handling Perl
script execution.
=cut
sub validate {
my ($self, %parameters) = @_;
my $channel;
$channel = shift(@_) if(0 < scalar(@_));
return 0 if(!defined($ENV{'HTTP_HOST'}));
my $CGI = CGI->new();
return 0 if(!defined($CGI->http('Content-Type')));
return 0 if($CGI->http('Content-Type') !~ /^application\/json(request|-rpc)?(;.*)?$/i);
return 1;
}
Anansi::ScriptComponent::addChannel('Anansi::Script::JSON', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Script/SOAP.pm view on Meta::CPAN
}
Anansi::ScriptComponent::addChannel('Anansi::Script::SOAP', 'PRIORITY_OF_VALIDATE' => 'priority');
=head2 validate
my $valid = $OBJECT->validate();
my $valid = $OBJECT->channel('VALIDATE_AS_APPROPRIATE');
Determines whether this module is the correct one to use for handling Perl
script execution.
=cut
sub validate {
my ($self, %parameters) = @_;
my $channel;
$channel = shift(@_) if(0 < scalar(@_));
return 0 if(!defined($ENV{'HTTP_HOST'}));
my $CGI = CGI->new();
lib/Anansi/Script/SOAP.pm view on Meta::CPAN
return 0 if(!defined($CGI->http('Content-Type')));
return 0 if($CGI->http('Content-Type') !~ /^application\/soap\+xml(;.*)?$/i);
return 1;
}
Anansi::ScriptComponent::addChannel('Anansi::Script::SOAP', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Script/Shell.pm view on Meta::CPAN
}
Anansi::ScriptComponent::addChannel('Anansi::Script::Shell', 'PARAMETER' => 'parameter');
=head2 validate
my $valid = $OBJECT->validate();
my $valid = $OBJECT->channel('VALIDATE_AS_APPROPRIATE');
Determines whether this module is the correct one to use for handling Perl
script execution.
=cut
sub validate {
my $self = shift(@_);
my $channel;
$channel = shift(@_) if(0 < scalar(@_));
return 1;
}
Anansi::ScriptComponent::addChannel('Anansi::Script::Shell', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Script/XML.pm view on Meta::CPAN
}
Anansi::ScriptComponent::addChannel('Anansi::Script::XML', 'PRIORITY_OF_VALIDATE' => 'priority');
=head2 validate
my $valid = $OBJECT->validate();
my $valid = $OBJECT->channel('VALIDATE_AS_APPROPRIATE');
Determines whether this module is the correct one to use for handling Perl
script execution.
=cut
sub validate {
my ($self, %parameters) = @_;
my $channel;
$channel = shift(@_) if(0 < scalar(@_));
return 0 if(!defined($ENV{'HTTP_HOST'}));
my $CGI = CGI->new();
return 0 if(!defined($CGI->http('Content-Type')));
return 0 if($CGI->http('Content-Type') !~ /^(application|text)?\/xml(;.*)?$/i);
return 1;
}
Anansi::ScriptComponent::addChannel('Anansi::Script::XML', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 NOTES
This module is designed to make it simple, easy and quite fast to code your
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/ScriptComponent.pm view on Meta::CPAN
package Anansi::Script::Example;
use base qw(Anansi::ScriptComponent);
sub validate {
my ($self, $channel, %parameters) = @_;
return $self->SUPER::validate(undef);
}
Anansi::ScriptComponent::addChannel('Anansi::Script::Example', 'VALIDATE_AS_APPROPRIATE' => 'validate');
1;
=head1 DESCRIPTION
lib/Anansi/ScriptComponent.pm view on Meta::CPAN
=head1 METHODS
=cut
=head2 validate
if(1 == Anansi::ScriptComponent::validate($OBJECT, undef));
if(1 == Anansi::ScriptComponent::channel($OBJECT, 'VALIDATE_AS_APPROPRIATE'));
if(1 == Anansi::ScriptComponent->validate(undef));
if(1 == Anansi::ScriptComponent->channel('VALIDATE_AS_APPROPRIATE'));
if(1 == $OBJECT->validate(undef));
if(1 == $OBJECT->channel('VALIDATE_AS_APPROPRIATE'));
=over 4
lib/Anansi/ScriptComponent.pm view on Meta::CPAN
Returns B<1> I<(one)> for yes and B<0> I<(zero)> for no.
=cut
sub validate {
my ($self, $channel, %parameters) = @_;
my $package = $self;
$package = ref($self) if(ref($self) !~ /^$/);
return 1;
}
Anansi::Component::addChannel('Anansi::ScriptComponent', 'VALIDATE_AS_APPROPRIATE' => 'validate');
=head1 METHODS
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Android/Build.pm view on Meta::CPAN
sdkmanager 'platforms;android-25' 'build-tools;25.0.3
END
}
sub getPlatform # Get and validate the SDK Platform folder
{my ($a) = @_;
my $f = $a->platformX;
$f or confess <<END.getInstructions;
"platform" parameter required - it should be the name of the folder containing
lib/Android/Build.pm view on Meta::CPAN
$f
END
$f
}
sub getBuildTools # Get and validate the SDK Platform build-tools folder
{my ($a) = @_;
my $f = $a->buildToolsX;
$f or confess <<END.getInstructions;
"buildTools" parameter required - it should be the name of the folder
lib/Android/Build.pm view on Meta::CPAN
$f
END
$f
}
sub getPlatformTools # Get and validate the SDK Platform tools folder
{my ($a) = @_;
my $f = $a->platformToolsX;
$f or confess <<END.getInstructions;
"platformTools" parameter required - it should be the name of the folder
lib/Android/Build.pm view on Meta::CPAN
my $a = filePath($p, qw(android.jar));
-e $a or confess "Cannot find android.jar via file:\n$a\n";
$a
}
sub getPackage # Get and validate the package name for this app
{my ($a) = @_;
my $d = $a->package;
$d or confess <<END =~ s/\n/ /gsr;
"package" parameter required - it should be the value used on the package
statement in the Activity for this app
view all matches for this distribution
view release on metacpan or search on metacpan
xt/live/370-get_current_location.t view on Meta::CPAN
ok(exists($provres->{$k}), 'Android::ElectricSheep::Automator->dump_current_location()'." : result contains key '$k' for provider '$aprov'.") or BAIL_OUT(perl2dump($res)."no it does not, see above");
ok(defined($provres->{$k}), 'Android::ElectricSheep::Automator->dump_current_location()'." : result contains key '$k' and it is defined, for provider '${aprov}'.") or BAIL_OUT(perl2dump($res)."no it does not, see above");
# some providers may be 'null' meaning no available
# for those we will have an entry but lat/lon will be <na>
next if $provres->{$k} eq '<na>';
ok($provres->{$k}=~/\d+\.\d+/, 'Android::ElectricSheep::Automator->dump_current_location()'." : result contains key '$k' and it validates as a real number, for provider '${aprov}'.") or BAIL_OUT(perl2dump($res)."no it does not, see above");
}
for my $k (qw/provider/){
ok(exists($provres->{$k}), 'Android::ElectricSheep::Automator->dump_current_location()'." : result contains key '$k' for provider '$aprov'.") or BAIL_OUT(perl2dump($res)."no it does not, see above");
ok(defined($provres->{$k}), 'Android::ElectricSheep::Automator->dump_current_location()'." : result contains key '$k' and it is defined, for provider '${aprov}'.") or BAIL_OUT(perl2dump($res)."no it does not, see above");
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anki/Import.pm view on Meta::CPAN
# pad data with a blank line to make it easier to process
push @lines, '';
# do the stuff we came here for
validate_src_file(); logd(\@notes);
generate_importable_files($pd);
# print a success message
unless ($args->{'quiet'}) {
set_log_level('info');
lib/Anki/Import.pm view on Meta::CPAN
# fin
}
# functions for first pass parsing of source data
sub validate_src_file {
logi('Validating source file');
# throw error if file is empty
logf('Source data file is empty.') if !$lines[0];
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
src/ppport.h view on Meta::CPAN
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
valid_utf8_to_uvchr|||
valid_utf8_to_uvuni||5.015009|
validate_proto|||
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vform||5.006000|
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Antispam/Toolkit/Role/BerkeleyDB.pm view on Meta::CPAN
die 'The ' . __PACKAGE__ . ' role requires a BerkeleyDB linked against Berkeley DB 4.4+'
unless $BerkeleyDB::db_version >= 4.4;
}
use Moose::Role;
use MooseX::Params::Validate qw( validated_list );
with 'Antispam::Toolkit::Role::Database';
has database => (
is => 'ro',
lib/Antispam/Toolkit/Role/BerkeleyDB.pm view on Meta::CPAN
->iso8601();
}
sub build {
my $class = shift;
my ( $file, $database, $update ) = validated_list(
\@_,
file => {
isa => DataFile,
coerce => 1,
},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Any/Daemon/FCGI.pod view on Meta::CPAN
=head1 DESCRIPTION
The Fast CGI protocol connects a generic front-end web-server (like
Apache or NGinx) with an backe-end daemon. The communication reuses
connections. The front-end server validates and throttles requests to
the back-end daemon. This module is the base for such back-end daemon.
This module extends the network side of a socket. During L<accept()|Any::Daemon::FCGI/"Actions">,
each incoming connection will create a new
L<Any::Daemon::FCGI::ClientConn|Any::Daemon::FCGI::ClientConn> object which handles the requests.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Any/Renderer/Template.pm view on Meta::CPAN
Any::Renderer::Template renders any Perl data structure passed to it with
Any::Template. The Any::Template backend used depends on the 'format' parameter passed to
the object constructor.
Templates expressed as filenames are cached using a package-level in-memory cache with Cache::AgainstFile.
This will stat the file to validate the cache before using the cached object, so if the template is updated,
this will be immediately picked up by all processes holding a cached copy.
=head1 FORMATS
All the formats supported by Any::Template. Try this to find out what's available on your system:
view all matches for this distribution
view release on metacpan or search on metacpan
MYMETA.yml
README
t/00_compile.t
t/01_simple.t
t/02_trim.t
t/03_validate.t
t/04_eof.t
xt/live.t
xt/pod.t
xt/pod_coverage.t
xt/pod_spell.t
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
);
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
$pattern =~ s{\s+}{\\s+}g;
if ( $license_text =~ /\b$pattern\b/i ) {
if ( $osi and $license_text =~ /All rights reserved/i ) {
print "WARNING: 'All rights reserved' in copyright may invalidate Open Source license.\n";
}
$self->license($license);
return 1;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
- fix cookie format documentation.
2.24 Thu Aug 30 03:23:03 CEST 2018
- bring cookie management more in line with RFC 6265; implement idn
matching for cookie domains.
- update cookie_jar version to 2, invalidate existing cookie jars.
- preserve original cookie domain attribute.
- also expire old cookie jars in cookie parser, just in case.
- further improve relative redirection code.
- comment out code that tried to detect possible bugs with persistent
connection caching, but since it never triggered, it's probably
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/DNS.pm view on Meta::CPAN
my ($res) = @_;
if ($res->{tc}) {
# success, but truncated, so use tcp
AnyEvent::Socket::tcp_connect (AnyEvent::Socket::format_address ($server), DOMAIN_PORT, sub {
return unless $do_retry; # some other request could have invalidated us already
my ($fh) = @_
or return &$do_retry;
require AnyEvent::Handle;
lib/AnyEvent/DNS.pm view on Meta::CPAN
my $handle; $handle = new AnyEvent::Handle
fh => $fh,
timeout => $timeout,
on_error => sub {
undef $handle;
return unless $do_retry; # some other request could have invalidated us already
# failure, try next
&$do_retry;
};
$handle->push_write (pack "n/a*", $req->[0]);
view all matches for this distribution