Result:
found more than 570 distributions - search limited to the first 2001 files matching your query ( run in 0.815 )


App-LastStats

 view release on metacpan or  search on metacpan

lib/App/LastStats.pm  view on Meta::CPAN

      'count=i'     => \$count,
      'api-key=s'   => \$api_key,
      'api-secret=s'=> \$api_secret,
    );

    $self->validate;
    $self->laststats;
    $self->render;
  }

  method validate {
    $period = lc $period;
    $format = lc $format;

    my @valid_periods = qw(overall 7day 1month 3month 6month 12month);
    unless (grep { $_ eq $period } @valid_periods) {

lib/App/LastStats.pm  view on Meta::CPAN


=head2 run

Fetches and displays the Last.fm statistics based on the provided options.

=head2 validate

Validates the provided options.

=head2 render_text

 view all matches for this distribution


App-Lazyd

 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


App-LedgerSMB-Admin

 view release on metacpan or  search on metacpan

bin/lsmb_reload  view on Meta::CPAN

   $passwd = <>;
}

$username ||= 'postgres';

## validate paths and set up versions

my $lsmbversions = {};

my $line;
if ($path13) {

 view all matches for this distribution


App-Licensecheck

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

 - have module methods return lists, and print to STDOUT in main script
 - modernize class instantiations to use field and :param and ADJUST (not
   has and BUILD)
 - parse shortname schemes in main script, slightly simplifying modules
 - refactor to iterate files in main script
 - rename parameter shortname_scheme -> schemes, and validate
 - stop include path in log messages within method parse_license
 - use Feature::Compat::Class (not Object::Pad)
 - use Feature::Compat::Try (not Try::Tiny)
 - use Object::Pad 0.74

 view all matches for this distribution


App-LintPrereqs

 view release on metacpan or  search on metacpan

script/lint-prereqs  view on Meta::CPAN


You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...

You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...

To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:

 [plugin=DumpArgs]
 -event=before_validate_args
 -prio=99
 
 [plugin=Foo]
 -event=after_validate_args
 arg1=val1
 arg2=val2

 

which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.

List of available configuration parameters:

 core_prereqs (see --no-core-prereqs)
 extra_runtime_dirs (see --extra-runtime-dir)

 view all matches for this distribution


App-ListPerlReleases

 view release on metacpan or  search on metacpan

script/list-perl-releases  view on Meta::CPAN


You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...

You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...

To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:

 [plugin=DumpArgs]
 -event=before_validate_args
 -prio=99
 
 [plugin=Foo]
 -event=after_validate_args
 arg1=val1
 arg2=val2

 

which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.

List of available configuration parameters:

 detail (see --detail)
 exclude_fields (see --exclude-field)

 view all matches for this distribution


App-ListSoftwareLicenses

 view release on metacpan or  search on metacpan

script/list-software-licenses  view on Meta::CPAN


You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...

You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...

To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:

 [plugin=DumpArgs]
 -event=before_validate_args
 -prio=99
 
 [plugin=Foo]
 -event=after_validate_args
 arg1=val1
 arg2=val2

 

which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.

List of available configuration parameters:

 detail (see --detail)
 exclude_fields (see --exclude-field)

 view all matches for this distribution


App-LogStats

 view release on metacpan or  search on metacpan

lib/App/LogStats.pm  view on Meta::CPAN

        },
    ) or $self->_show_usage(2);

    push @{$config->{file}}, @{$argv};

    $self->_validate_config($config);
}

sub _show_usage {
    my ($self, $exitval) = @_;

    require Pod::Usage;
    Pod::Usage::pod2usage($exitval);
}

sub _validate_config {
    my ($self, $config) = @_;

    if (!$config->{digit} || $config->{digit} !~ m!^\d+$!) {
        $config->{digit} = 2;
    }

 view all matches for this distribution


App-MARC-Validator

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

NAME
    marc-validator - Tool to validate records in MARC file.

SYNOPSIS
     marc-validator [-d] [-h] [-l] [-o output_file] [-p] [-v] [--version] marc_xml_file..

DESCRIPTION
    Tool to validate dataset from MARC record collections.

    It supports MARC XML files now.

ARGUMENTS
    *       "-d"

 view all matches for this distribution


App-MBUtiny

 view release on metacpan or  search on metacpan

lib/App/MBUtiny.pm  view on Meta::CPAN

        $self->debug($step);
        my $storage = new App::MBUtiny::Storage(
                name => $name, # Backup name
                host => $host, # Host config section
                path => $self->rstdir, # Where is located restored backup archive
                validate => sub {
                    my $strg = shift; # storage object
                    my $file = shift; # fetched file
                    if ($info{size}) { # Valid sizes
                        my $size = filesize($file) // 0;
                        unless ($size == $info{size}) {

 view all matches for this distribution


App-MFILE-WWW

 view release on metacpan or  search on metacpan

lib/App/MFILE/WWW.pm  view on Meta::CPAN

FIXME: This code could be moved into the startup script.

=cut

sub init {
    my %ARGS = validate( @_, { 
        mode => { type => SCALAR, optional => 1 }, # 'STANDALONE' or 'DDIST', defaults to 'STANDALONE'
        ddist_sharedir => { type => SCALAR, optional => 1 },
        sitedir => { type => SCALAR, optional => 1 },
        debug_mode => { type => SCALAR, optional => 1 },
    } );

 view all matches for this distribution


App-MFILE

 view release on metacpan or  search on metacpan

lib/App/MFILE/HTTP.pm  view on Meta::CPAN

sub rest_req {

    # process arguments
    my $ua = shift;
    die "Bad user agent object" unless ref( $ua ) eq 'LWP::UserAgent';
    my %ARGS = validate( @_, {
        server =>   { type => SCALAR,  default => 'http://localhost:5000' },
        method =>   { type => SCALAR,  default => 'GET', regex => qr/^(GET|POST|PUT|DELETE)$/ },
        nick =>     { type => SCALAR,  optional => 1 },
        password => { type => SCALAR,  default => '' },
        path =>     { type => SCALAR,  default => '/' },

lib/App/MFILE/HTTP.pm  view on Meta::CPAN

session was last seen.

=cut

sub _is_fresh {
    my ( $session ) = validate_pos( @_, { type => HASHREF } );

    return 0 unless my $last_seen = $session->{'last_seen'};

    return ( time - $last_seen > $site->MFILE_WWW_SESSION_EXPIRATION_TIME )
        ? 0

 view all matches for this distribution


App-MHFS

 view release on metacpan or  search on metacpan

share/public_html/static/music_inc/src/miniaudio.h  view on Meta::CPAN

MA_SUCCESS if successful; any other error code otherwise.


Thread Safety
-------------
Unsafe. Since each call to this function invalidates the pointers from the previous call, you should not be calling this simultaneously across multiple
threads. Instead, you need to make a copy of the returned data with your own higher level synchronization.


Remarks
-------

share/public_html/static/music_inc/src/miniaudio.h  view on Meta::CPAN

                }
            } else {
                ma_uint32 i;

                /*
                Excess channels use defaults. Do an initial fill with defaults, overwrite the first pChmap->channels, validate to ensure there are no duplicate
                channels. If validation fails, fall back to defaults.
                */
                ma_bool32 isValid = MA_TRUE;

                /* Fill with defaults. */

share/public_html/static/music_inc/src/miniaudio.h  view on Meta::CPAN

            #endif
            }
        }
    } else {
        /* This is the deinterleaved case. We need to update each buffer in groups of internalChannels. This assumes each buffer is the same size. */
        MA_ASSERT(pDevice->playback.internalChannels <= MA_MAX_CHANNELS);   /* This should heve been validated at initialization time. */
        
        /*
        For safety we'll check that the internal channels is a multiple of the buffer count. If it's not it means something
        very strange has happened and we're not going to support it.
        */

share/public_html/static/music_inc/src/miniaudio.h  view on Meta::CPAN

            #endif
            }
        }
    } else {
        /* This is the deinterleaved case. We need to interleave the audio data before sending it to the client. This assumes each buffer is the same size. */
        MA_ASSERT(pDevice->capture.internalChannels <= MA_MAX_CHANNELS);    /* This should have been validated at initialization time. */
        
        /*
        For safety we'll check that the internal channels is a multiple of the buffer count. If it's not it means something
        very strange has happened and we're not going to support it.
        */

share/public_html/static/music_inc/src/miniaudio.h  view on Meta::CPAN

    /* Make sure we're not asking for too many channels. */
    if (pConfig->channels > MA_MAX_CHANNELS) {
        return MA_INVALID_ARGS;
    }

    /* The internal channels should have already been validated at a higher level, but we'll do it again explicitly here for safety. */
    if (pDecoder->internalChannels > MA_MAX_CHANNELS) {
        return MA_INVALID_ARGS;
    }


 view all matches for this distribution


App-MP4Meta

 view release on metacpan or  search on metacpan

lib/App/MP4Meta/Command/film.pm  view on Meta::CPAN

"Continue to process even if we can not find any information on the internet"
        ],
    );
}

sub validate_args {
    my ( $self, $opt, $args ) = @_;

    # we need at least one file to work with
    $self->usage_error("too few arguments") unless @$args;

 view all matches for this distribution


App-MacVictimUtils

 view release on metacpan or  search on metacpan

script/delete-ds-store  view on Meta::CPAN


You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...

You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...

To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:

 [plugin=DumpArgs]
 -event=before_validate_args
 -prio=99
 
 [plugin=Foo]
 -event=after_validate_args
 arg1=val1
 arg2=val2

 

which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.

List of available configuration parameters:

 dirs (see --dirs)
 format (see --format)

 view all matches for this distribution


App-ManagePoolStyleRepo

 view release on metacpan or  search on metacpan

script/manage-pool-style-repo  view on Meta::CPAN


You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...

You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...

To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:

 [plugin=DumpArgs]
 -event=before_validate_args
 -prio=99
 
 [plugin=Foo]
 -event=after_validate_args
 arg1=val1
 arg2=val2

 

which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.

List of available configuration parameters:

=head2 Common for all subcommands

 view all matches for this distribution


App-MediaPi

 view release on metacpan or  search on metacpan

t/001-cpanfile.t  view on Meta::CPAN

BEGIN {
  # This module seems to have trouble installing on some platform, so it’s
  # optional in the cpanfile and we skip the test if it’s not installed.
  eval 'use CPAN::Common::Index::Mux::Ordered';  ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval)
  if ($EVAL_ERROR) {
    skip_all('CPAN::Common::Index::Mux::Ordered required to validate the CPAN file');
  }
}

cpanfile_has_all_used_modules(
  perl_version => 5.024,

 view all matches for this distribution


App-Memcached-CLI

 view release on metacpan or  search on metacpan

lib/App/Memcached/CLI/Help.pm  view on Meta::CPAN

    > delete <KEY>
EODESC
    },
    +{
        command => 'flush_all',
        summary => 'Invalidate whole data',
        description => <<'EODESC',
Usage:
    > flush_all [<DELAY>]
    > flush_all           # Invalidate immediately
    > flush_all 60        # Invalidate after 60 seconds
EODESC
    },
    +{
        command => 'call',
        summary => 'Execute any command',

 view all matches for this distribution


App-Mimosa

 view release on metacpan or  search on metacpan

lib/App/Mimosa/Controller/Root.pm  view on Meta::CPAN

    my $file = $tmp_base->file( @_ );

    return "$file";
}

sub validate : Private {
    my ( $self, $c ) = @_;

    if( $c->req->param('program') eq 'none' ) {
        $c->stash->{error} = "You must select a BLAST program to generate your report with.";
        $c->detach('/input_error');

lib/App/Mimosa/Controller/Root.pm  view on Meta::CPAN

            $c->stash->{error} = "Sequence input too short. Must have a length of at least $min_length";
            $c->detach('/input_error');
        }
        $c->stash->{sequence} = $s;
        $c->stash->{program}  = $program;
        $c->forward('validate_sequence');
    }
}

sub validate_sequence : Private {
    my ($self, $c) = @_;
    my $sequence = $c->stash->{sequence};
    my $program  = $c->stash->{program};

    try {
        $sequence->validate_seq();
    } catch {
        $c->stash->{error} = "Sequence is not a valid BioPerl sequence";
        $c->detach('/input_error');
    };

    unless ($program) {
        $c->stash->{error} = "Invalid program";
        $c->detach('/input_error');
    }

    my %validate   = (
        blastn  => qr/^([ACGTURYKMSWBDHVN]+)$/i,
        tblastx => qr/^([GAVLIPFYCMHKRWSTDENQBZ\.X\*]+)$/i,
        tblastn => qr/^([GAVLIPFYCMHKRWSTDENQBZ\.X\*]+)$/i,
    );
    my $seq = $sequence->seq();
    unless ($seq =~ $validate{$program}){
        my $encseq = encode_entities($seq);
        $c->stash->{error} = "Sequence $encseq contains illegal characters for $program";
        $c->detach('/input_error');
    }

lib/App/Mimosa/Controller/Root.pm  view on Meta::CPAN

    $c->stash->{report_format} = $alignment_view;

    # prevent race conditions
    stat $input_file;

    $c->forward('validate');

    my @ss_ids;

    if ($ids =~ m/,/){
        (@ss_ids) = split /,/, $ids;

 view all matches for this distribution


App-MiseEnPlace

 view release on metacpan or  search on metacpan

lib/App/MiseEnPlace.pm  view on Meta::CPAN

    [ 'verbose|v'          => 'be verbose' ] ,
    [ 'version|V'          => 'show version' ] ,
  );
}

sub validate_args {
  my( $self , $opt , $args ) = @_;

  $self->usage_error( "No args needed" ) if @$args;

  if ( $opt->{version} ) {

 view all matches for this distribution


App-Module-Template

 view release on metacpan or  search on metacpan

lib/App/Module/Template.pm  view on Meta::CPAN

    _get_template_path
    _module_path_exists
    _process_dirs
    _process_file
    _process_template
    _validate_module_name
);
%EXPORT_TAGS = (
    ALL => [ @EXPORT_OK ],
);

lib/App/Module/Template.pm  view on Meta::CPAN

    my $file     = $module; $file =~ s/.*:://msx; $file .= '.pm';
    my $dist_dir = File::Spec->catdir( File::Spec->curdir, $dist );
    my $tmpl_vars;

    try {
        _validate_module_name($module);
    } catch {
        croak "$_ module-template. exiting...";
    };

    if ( _module_path_exists($dist_dir) ) {

lib/App/Module/Template.pm  view on Meta::CPAN

#
# 1. No top-level namespaces
# 2. No all lower case names
# 3. Match XXX::XXX
#-------------------------------------------------------------------------------
sub _validate_module_name {
    my ($module_name) = @_;

    given ( $module_name ) {
        when ( $module_name =~ m/\A[A-Za-z]+\z/msx )
        {

 view all matches for this distribution


App-MojoSlides

 view release on metacpan or  search on metacpan

lib/App/MojoSlides/files/public/bootstrap.min.js  view on Meta::CPAN

/**
* bootstrap.js v3.0.0 by @fat and @mdo
* Copyright 2013 Twitter Inc.
* http://www.apache.org/licenses/LICENSE-2.0
*/
if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionen...

 view all matches for this distribution


App-MtAws

 view release on metacpan or  search on metacpan

lib/App/MtAws/ConfigDefinition.pm  view on Meta::CPAN

				} else {
					custom('name-type', 'rel-filename'), mandatory('set-rel-filename'), custom('relfilename', value('set-rel-filename'));
				}
			} elsif (present('dir')) {
				custom('relfilename', do {
					validate 'dir', 'filename';
					if (valid('dir') && valid('filename')) {

						my $b_dir = binary_abs_path(binaryfilename value('dir'));
						my $b_file = binary_abs_path(binaryfilename value('filename'));

lib/App/MtAws/ConfigDefinition.pm  view on Meta::CPAN

			my $mt = 'mtmsg';
			validation(option('format', default => $fh),
				message(qq{%option a% must be "$fh" or "$mt"}), sub { /^(\Q$fh\E|\Q$mt\E)$/ });
		}

		command 'create-vault' => sub { validate(optional('config'), mandatory(@encodings), mandatory('vault-name'), mandatory(@config_opts), check_https)};
		command 'delete-vault' => sub { validate(optional('config'), mandatory(@encodings), mandatory('vault-name'), mandatory(@config_opts), check_https)};
		command 'list-vaults' => sub {
			validate(optional('config'), mandatory(@encodings), optional('dry-run'), mandatory(@config_opts), check_https, mandatory('format'))
		};

		command 'sync' => sub {
			validate(mandatory(
				optional('config'), mandatory(@encodings), @config_opts, sync_opts, detect_opts, check_https,
				qw/dir vault concurrency partsize/, writable_journal('journal'),
				optional(qw/max-number-of-files leaf-optimization follow/),
				filter_options, optional('dry-run')
			))
		};

		command 'upload-file' => sub {
			validate(mandatory(  optional('config'), mandatory(@encodings), @config_opts, check_https, qw/vault concurrency/, writable_journal('journal'),
				check_dir_or_relname, check_base_dir, mandatory('partsize'), check_max_size  ))
		};


		command 'purge-vault' => sub {
			validate(mandatory(
				optional('config'), mandatory(@encodings), @config_opts, check_https, qw/vault concurrency/,
				writable_journal(existing_journal('journal')),
				deprecated('dir'), filter_options, optional('dry-run')
			))
		};

		command 'restore' => sub {
			validate(mandatory(
				optional('config'), mandatory(@encodings), @config_opts, check_https, qw/dir vault max-number-of-files concurrency/,
				writable_journal(existing_journal('journal')),
				filter_options, optional('dry-run')
			))
		};

		command 'restore-completed' => sub {
			validate(mandatory(
				optional('config'), mandatory(@encodings), @config_opts, check_https, qw/dir vault concurrency/, existing_journal('journal'),
				filter_options, optional('dry-run'), http_download_options
			))
		};

		command 'check-local-hash' => sub {
			validate(mandatory(
				optional('config'), mandatory(@encodings), @config_opts, check_https, qw/dir/, existing_journal('journal'), deprecated('vault'),
				filter_options, optional('dry-run')
			))
		};

		command 'retrieve-inventory' => sub {
			validate(mandatory(optional('config'), mandatory(@encodings), 'request-inventory-format', @config_opts, check_https, qw/vault/))
		};

		command 'download-inventory' => sub {
			validate(mandatory(optional('config'), mandatory(@encodings), @config_opts, check_https, 'vault', empty_journal('new-journal')))
		};
	});
	return $c;
}

 view all matches for this distribution


App-MultiModule-Tasks-DocGateway

 view release on metacpan or  search on metacpan

lib/App/MultiModule/Tasks/DocGateway.pm  view on Meta::CPAN

    my $message = shift;
    my %args = @_;
    $self->debug('message', message => $message)
        if $self->{debug} > 5;
    my $state = $self->{state};
    #TODO: validate document_database, document_collection, document_method here
    $self->_find($message) if $message->{document_method} eq 'find';
    $self->_insert($message) if $message->{document_method} eq 'insert';
    $self->_remove($message) if $message->{document_method} eq 'remove';
    $self->_upsert($message) if $message->{document_method} eq 'upsert';
}

sub _upsert {
    my $self = shift;
    my $message = shift;
    #TODO: validate $message->{document_filter} here
    eval {
        local $SIG{ALRM} = sub { die "timed out\n"; };
        my $timeout = $self->{config}->{pg_upsert_timeout} || 2;
        alarm $timeout;
        my $c = $self->_get_connection();

lib/App/MultiModule/Tasks/DocGateway.pm  view on Meta::CPAN

}

sub _remove {
    my $self = shift;
    my $message = shift;
    #TODO: validate $message->{document_filter} here
    eval {
        local $SIG{ALRM} = sub { die "timed out\n"; };
        my $timeout = $self->{config}->{pg_remove_timeout} || 2;
        alarm $timeout;
        my $c = $self->_get_connection();

lib/App/MultiModule/Tasks/DocGateway.pm  view on Meta::CPAN

}

sub _find {
    my $self = shift;
    my $message = shift;
    #TODO: validate $message->{document_filter} here
    #TODO: variant that emits once per return document
    my @emits = eval {
        local $SIG{ALRM} = sub { die "timed out\n"; };
        my $timeout = $self->{config}->{pg_find_timeout} || 7;
        alarm $timeout;

 view all matches for this distribution


App-MultiModule-Tasks-NagiosCmd

 view release on metacpan or  search on metacpan

lib/App/MultiModule/Tasks/NagiosCmd.pm  view on Meta::CPAN


sub _write_tick {
    my $self = shift;
    my $nagios_commands = $self->{state}->{nagios_commands};
    return unless scalar @$nagios_commands; #no work
    if(my $command_file_err = _validate_command_file($self->{state}->{command_file})) {
        $self->error("App::MultiModule::Tasks::NagiosCmd::_write_tick: $command_file_err");
        return;
    }
    WHILE:
    while($nagios_commands->[0]) {

lib/App/MultiModule/Tasks/NagiosCmd.pm  view on Meta::CPAN

        $self->_cmd_log($cmd);
        shift @$nagios_commands;
    }
}

sub _validate_command_file {    #return false means good
                                #true return is the text of the problem
    my $command_file = shift;

    my $ret = eval {
        local $SIG{ALRM} = sub { die "timed out\n"; };

lib/App/MultiModule/Tasks/NagiosCmd.pm  view on Meta::CPAN

        return "command_file $command_file is not of file type pipe"
            unless -p $command_file;
        return 0;
    };
    alarm 0;
    return "command_file $command_file _validate_command_file exception: $@"
        if $@;
    return $ret;
}

sub _cmd_log {

lib/App/MultiModule/Tasks/NagiosCmd.pm  view on Meta::CPAN

        unless $self->{state}->{nagios_commands};
    if(not $self->{config}->{command_file}) {
        $self->error("App::MultiModule::Tasks::NagiosCmd::set_config: required config 'command_file' not found");
        return;
    }
    if(my $command_file_err = _validate_command_file($self->{config}->{command_file})) {
        $self->error("App::MultiModule::Tasks::NagiosCmd::set_config: $command_file_err");
        return;
    }
    $self->{state}->{command_file} = $self->{config}->{command_file};
    $self->named_recur(

 view all matches for this distribution


App-MultiModule-Tasks-SmartMerge

 view release on metacpan or  search on metacpan

t/basic.t  view on Meta::CPAN

IPC::Transit::send(qname => 'SmartMerge', message => {
    x => 'y', a => 'b'
});

message_is(
    'first validate pass-through',
    {
        x => 'y',
        a => 'b',
        source => 'SmartMerge',
    },

 view all matches for this distribution


App-MultiModule

 view release on metacpan or  search on metacpan

t/repeated-task-crash.t  view on Meta::CPAN

        qname => $OtherExternalModule->{task_name},
        message => $crash_message
    );
};

#crash it and validate it's back several times
for (1..10) {
    my $rand = int rand 4;
    print STDERR "\$rand=$rand\n";
    ok $crash->() if $rand == 0;
    print STDERR '$OtherExternalModule->send();' . "\n";

 view all matches for this distribution


App-Mxpress-PDF

 view release on metacpan or  search on metacpan

lib/App/Mxpress/Client.pm  view on Meta::CPAN

use Types::Standard qw/Object Str StrMatch Enum Optional HashRef Bool/;
use Future::HTTP;
use HTTP::CookieJar;
use JSON;

our ($validate, $session);
BEGIN {
	$validate = cpo(
		login => {
			username => Str,
			password => Str
		},
		generate => {

lib/App/Mxpress/Client.pm  view on Meta::CPAN

	});
}

sub login {
	my $self = shift;
	my $params = $validate->login->(@_);
	$self->session->then(sub {
		return $self->ua->http_post(
			sprintf("%s/api/login", $self->host),
			$self->json->encode({%$params}),
			headers => {

lib/App/Mxpress/Client.pm  view on Meta::CPAN

	})->get;
}

sub generate {
	my $self = shift;
	my $params = $validate->generate->(@_);
	$self->ua->http_post(
		sprintf("%s/api/generate/pdf", $self->host),
		$self->json->encode({
			name => $params->name,
			size => $params->size,

lib/App/Mxpress/Client.pm  view on Meta::CPAN

	})->get;
}

sub pod {
	my $self = shift;
	my $params = $validate->pod->(@_);
	$params->{name} = $params->name 
		? $params->name
		: $params->{$params->type}; 
	$params->{styles} = {} if !$params->styles;
	$params->{styles} = $self->json->encode($params->styles);

lib/App/Mxpress/Client.pm  view on Meta::CPAN

		return Future->new->done($_[0]);
	})->get;
}

sub save {
	my ($self, $params, $body) = $validate->save->(@_);
	my $file = sprintf("%s/%s.pdf", $params->save, $params->filename || $params->name);
	open my $fh, '>', $file or die "cannot open file to write $file";
	print $fh $body;
	close $fh;
	return Future->new->done($file);

 view all matches for this distribution


App-MysqlUtils

 view release on metacpan or  search on metacpan

script/mysql-copy-rows-adjust-pk  view on Meta::CPAN


You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...

You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...

To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:

 [plugin=DumpArgs]
 -event=before_validate_args
 -prio=99
 
 [plugin=Foo]
 -event=after_validate_args
 arg1=val1
 arg2=val2

 

which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.

List of available configuration parameters:

 adjust (see --adjust)
 database (see --database)

 view all matches for this distribution


( run in 0.815 second using v1.01-cache-2.11-cpan-beeb90c9504 )