view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Info.pm view on Meta::CPAN
$VERSION = '0.57';
##############################################################################
##############################################################################
# This code ref is used by the abstract methods to throw an exception when
# they're called directly.
my $croak = sub {
my ($caller, $meth) = @_;
$caller = ref $caller || $caller;
if ($caller eq __PACKAGE__) {
lib/App/Info.pm view on Meta::CPAN
my @handlers = $app->on_error;
$app->on_error(@handlers);
Error events are triggered when the App::Info subclass runs into an unexpected
but not fatal problem. (Note that fatal problems will likely throw an
exception.) By default, these events are ignored. A common way of handling
these events is to print them to STDERR, once again using the
L<App::Info::Handler::Print|App::Info::Handler::Print> class included with the
App::Info distribution:
lib/App/Info.pm view on Meta::CPAN
Here we've used the C<info()> method to display a status message to let the
user know what we're doing. Then we used the C<error()> method when something
unexpected happened, which in this case was that we weren't able to find the
version number in the file.
Note the C<_find_file()> method we've thrown in. This might be a method that
we call whenever we need to find a file that might be in one of a list of
directories. This method, too, will be an appropriate place for an C<info()>
method call. But rather than call the C<error()> method when the file can't be
found, you might want to give an event handler a chance to supply that value
for you. Use the C<unknown()> method for a case such as this:
lib/App/Info.pm view on Meta::CPAN
subclass.
=item *
Use the C<error()> event triggering method to alert users of unexpected
conditions. Fatal errors should still be fatal; use C<Carp::croak()> to throw
exceptions for fatal errors.
=item *
Use the C<unknown()> event triggering method when a meta data or other
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Iops.pm view on Meta::CPAN
use App::Iops;
App::Iops->new( 'help' )->run;
Prints the help and exits. This is very side-effectful. This might
throw exceptions.
=item pid => $pid
use App::Iops;
App::Iops->new( pid => $a_pid )->run;
view all matches for this distribution
view release on metacpan or search on metacpan
my $jesp = App::JESP->new({ dsn => 'dbi:SQLite:dbname=:memory:',
username => undef,
password => undef,
home => './t/home/'
});
throws_ok(sub{ $jesp->deploy() } , qr/ERROR querying meta/ );
# Time to install
$jesp->install();
my $status = $jesp->status();
is( scalar( @{$status->{plan_patches}} ) , 4, "Ok 4 patches in plan");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/JobLog/Command/info.pm view on Meta::CPAN
All other configuration is done through the B<@{[App::JobLog::Command::configure->name]}> command.
==head1 Time Expressions
B<Job Log> goes to considerable trouble to interpret whatever time expressions you might throw at it.
For example, it understands all of the following:
1
11/24 to today
17 dec, 2024
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/KGB/Client.pm view on Meta::CPAN
An array of servers, each an instance of L<App::KGB::Client::ServerRef> class.
When several servers are configured, the list is shuffled and then the servers
are tried one after another until a successful request is done, or the list is
exhausted, in which case an exception is thrown.
When shuffling, preference is added to the last server used by the client, or
by other clients (given C<status_dir> is configured).
=item B<batch_messages>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Kit/Obj/DB.pm view on Meta::CPAN
the dbh() hash (from args or conf file) is missing the required dbd_driver param
=item C<< Could not connect to database: %s >>
conn() throws this when its DBI->connect() fails
%s is DBI->errstr
=back
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
kritika.fatpack view on Meta::CPAN
$json = $json->allow_unknown ([$enable])
$enabled = $json->get_allow_unknown
If C<$enable> is true (or missing), then C<encode> will I<not> throw an
exception when it encounters values it cannot represent in JSON (for
example, filehandles) but instead will encode a JSON C<null> value. Note
that blessed objects are not included here and are handled separately by
c<allow_nonref>.
If C<$enable> is false (the default), then C<encode> will throw an
exception when it encounters anything it cannot encode as JSON.
This option does not affect C<decode> in any way, and it is recommended to
leave it off unless you know your communications partner.
kritika.fatpack view on Meta::CPAN
If C<$enable> is true (or missing), then the C<encode> method will not
barf when it encounters a blessed reference that it cannot convert
otherwise. Instead, a JSON C<null> value is encoded instead of the object.
If C<$enable> is false (the default), then C<encode> will throw an
exception when it encounters a blessed object that it cannot convert
otherwise.
This setting has no effect on C<decode>.
kritika.fatpack view on Meta::CPAN
Example, convert all JSON objects into the integer 5:
my $js = JSON->new->filter_json_object (sub { 5 });
# returns [5]
$js->decode ('[{}]'); # the given subroutine takes a hash reference.
# throw an exception because allow_nonref is not enabled
# so a lone 5 is not allowed.
$js->decode ('{"a":1, "b":2}');
=head2 filter_json_single_key_object
kritika.fatpack view on Meta::CPAN
$max_size = $json->get_max_size
Set the maximum length a JSON text may have (in bytes) where decoding is
being attempted. The default is C<0>, meaning no limit. When C<decode>
is called on a string that is longer then this many bytes, it will not
attempt to decode the string but throw an exception. This setting has no
effect on C<encode> (yet).
If no argument is given, the limit check will be deactivated (same as when
C<0> is specified).
kritika.fatpack view on Meta::CPAN
Perl array references become JSON arrays.
=item other references
Other unblessed references are generally not allowed and will cause an
exception to be thrown, except for references to the integers C<0> and
C<1>, which get turned into C<false> and C<true> atoms in JSON. You can
also use C<JSON::false> and C<JSON::true> to improve readability.
encode_json [\0,JSON::true] # yields [false,true]
kritika.fatpack view on Meta::CPAN
The object will be serialised as a JSON null value.
=item 3. none of the above
If none of the settings are enabled or the respective methods are missing,
this module throws an exception.
=back
=head1 ENCODING/CODESET FLAG NOTES
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
stdout_is { $stats->run; } '', 'just run';
}
{
my $stats = App::LogStats->new;
throws_ok {
$stats->run('_no_exists_file_');
} qr/^_no_exists_file_: No such file/, 'no_exists_file';
}
test_stats('');
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
share/js/core/ajax.js view on Meta::CPAN
lib.displayError(data.payload.message);
}
return;
}
console.log("AJAX unexpected success response ->" + textStatus + "<- with data", data);
throw textStatus;
})
.fail(function (data, textStatus) {
console.log("AJAX failure", data);
lib.displayResult(textStatus);
logout();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MHFS.pm view on Meta::CPAN
my $self = _new(@_);
$cb->($self->{fulfill}, $self->{reject});
return $self;
}
sub throw {
return MHFS::Promise::FakeException->new(@_);
}
sub handleResolved {
my ($self, $deferred) = @_;
lib/App/MHFS.pm view on Meta::CPAN
return;
}
# thumb or fanart
my $imagepartial = ($metadatatype eq 'thumb') ? $_[0]->{results}[0]{poster_path} : $_[0]->{results}[0]{backdrop_path};
if (!$imagepartial || $imagepartial !~ /(\.[^\.]+)$/) {
return MHFS::Promise::throw('path not matched');
}
my $ext = $1;
make_path($metadir);
return MHFS::Promise->new($request->{client}{server}{evp}, sub {
my ($resolve, $reject) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Test/App/MP4Meta/Source/Base.pm view on Meta::CPAN
sub get_film : Test(1) {
my $self = shift;
my $base = $self->{base};
throws_ok { $base->get_film( {} ) } qr/no title/, 'no title';
}
sub get_tv_episode : Test(3) {
my $self = shift;
my $base = $self->{base};
throws_ok { $base->get_tv_episode( {} ) } qr/no title/, 'no title';
throws_ok { $base->get_tv_episode( { show_title => 'foo' } ) }
qr/no season/,
'no season';
throws_ok { $base->get_tv_episode( { show_title => 'foo', season => 1 } ) }
qr/no episode/, 'no episode';
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MaMGal.pm view on Meta::CPAN
};
my $e;
if ($e = Exception::Class->caught('App::MaMGal::SystemException')) {
$self->{logger}->log_exception($e);
} elsif ($e = Exception::Class->caught) {
ref $e ? $e->rethrow : die $e;
}
1;
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MatrixTool/Command/client/list_rooms.pm view on Meta::CPAN
{
my $self = shift;
# the Matrix spec doesn't have a nice way to ask what rooms I'm a member
# of. About the best we can do is a /sync request with a filter that asks
# for just the m.room.create event in each room while throwing away all the
# timeline, account_data and presence.
# See also
# https://github.com/matrix-org/matrix-doc/issues/734
$self->do_json( GET => "/_matrix/client/r0/sync",
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for App-MechaCPAN
0.30 2023-08-22 22:29:58 EDT
- Document the new prebuilt binary feature
- Make the binary download feature not the default for the time being
- Improve the binary download process not to throw an error when not found
- Move --build-reusable to a global option --build-reusable-perl
0.29 2023-04-18 23:32:58 EDT
- Add support to install from a cpanfile without using Deploy
- Add feature to download prebuilt binries for popular linux distros
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
view all matches for this distribution
view release on metacpan or search on metacpan
anything else that DBI supports) and set various paramters. Here is a partial list:
### min_sequence_input_length 6
This sets the smallest sequence input length. If a sequence smaller than this length
is submitted, an exception is thrown and an error page is shown to the user.
### allow_anonymous 1
Whether to allow anonymous people (those that have not authenticated) to submit
jobs for reports.
view all matches for this distribution
view release on metacpan or search on metacpan
t/get_config.t view on Meta::CPAN
use_ok( 'App::Module::Template', '_get_config' );
ok( my $config_file = File::Spec->catfile( File::Spec->curdir, 't/.module-template/config' ), 'set config file' );
throws_ok{ _get_config() } qr/\ACould not read configuration file/, 'fails without config file';
ok( my $cfg = _get_config($config_file), 'get config file' );
is( ref $cfg, 'HASH', 'returns hash reference' );
view all matches for this distribution