view release on metacpan or search on metacpan
lib/Acme/FishFarm.pm view on Meta::CPAN
=head1 SYSTEM INSTALLATION RELATED SUBROUTINES
=head2 install_all_systems
Installs all the available systems the default way and returns them as a list of C<Acme::FishFarm::*> objects in the following sequence:
(Feeder, OxygenMaintainer, WaterConditionMonitor, WaterLevelMaintainer, WaterFiltration)
=cut
lib/Acme/FishFarm.pm view on Meta::CPAN
=head2 check_feeder ( $feeder, $verbose )
This checks, performs necessary actions and outputs the condition of the feeder. Each call will tick the clock inside the feeder. See C<Acme::FishFarm::Feeder> for more info.
If the food tank is empty, it will be filled to the default. So if you want to fill a different amount, please set the amount before hand. See C<Acme::FishFarm::Feeder>.
Setting C<$verbose> to 1 will give more output about the empty food tank.
Take note that this process B<DOES NOT> trigger the LED and buzzer if abnormal condition is present.
lib/Acme/FishFarm.pm view on Meta::CPAN
print $feeder->time_remaining, " hours left until it's time to feed the fish.\n";
}
if ( $feeder->food_remaining <= 0 ) {
print " !! Food tank empty!\n";
$feeder->refill; # default back to 500 cm^3
print " Refilled food tank back to ", $feeder->food_tank_capacity, " cm^3.\n";
}
print " Food Remaining: ", $feeder->food_remaining, "cm^3.\n";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/AuthorTests.pm view on Meta::CPAN
my ($self, $dirs, $recurse) = @_;
return unless $Module::Install::AUTHOR;
my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
# XXX: pick a default, later -- rjbs, 2008-02-24
my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
@dirs = grep { -d } @dirs;
if ($recurse) {
require File::Find;
view all matches for this distribution
view release on metacpan or search on metacpan
Release history for Acme-Flat
0.001001 2017-03-07T15:34:24Z d6f7869
- Bugfix: fix test failure with -Ddefault_inc_excludes_dot
[Dependencies::Stats]
- Dependencies changed since 0.001000, see misc/*.deps* for details
- develop: +5 â2 -1 (suggests: â2)
- test: â1
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing, always use defaults
if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/API/ChuckNorris.pm view on Meta::CPAN
shell>cnq categories | xargs -I% cnq random --category %
=item C<random [--category STRING]>
The command that returns the random Chuch Noris quote. It is the default
command if none is specified:
shell> cnq random
Chuck Norris dunks onion rings in his morning coffee.
shell> nq random
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/Advice/Slip.pm view on Meta::CPAN
#
use overload '""' => sub ( $s, $u, $b ) { $s->{advice} // () };
#
sub _http ($uri) {
state $http
//= HTTP::Tiny->new( default_headers => { Accept => 'application/json' }, agent => sprintf '%s/%.2f ', __PACKAGE__, our $VERSION );
my $res = $http->get($uri); # {success} is true even when advice is not found but we'll at least know when we have valid JSON
$res->{success} ? decode_json( $res->{content} ) : ();
}
#
sub advice ( $slip_id //= () ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/Advice/Unsolicited.pm view on Meta::CPAN
#
use overload '""' => sub ( $s, $u, $b ) { $s->{advice} // () };
#
sub _http ($uri) {
state $http
//= HTTP::Tiny->new( default_headers => { Accept => 'application/json' }, agent => sprintf '%s/%.2f ', __PACKAGE__, our $VERSION );
my $res = $http->get($uri); # {success} is true even when advice is not found but we'll at least know when we have valid JSON
$res->{success} ? decode_json( $res->{content} ) : ();
}
#
sub advice ( $advice_id //= () ) {
view all matches for this distribution
view release on metacpan or search on metacpan
my $subcommand = shift @ARGV;
my $fletch = Acme::Free::Dog::API->new;
#>>>
dispatch {
xdefault shift, q{random};
}
$subcommand,
breeds => sub { exit do_breeds() },
help => sub { exit do_help() },
images => sub { exit do_images( \@ARGV ) },
view all matches for this distribution
view release on metacpan or search on metacpan
bin/freeapi view on Meta::CPAN
my $subcommand = shift @ARGV;
#>>>
dispatch {
xdefault shift, q{random};
}
$subcommand,
apis => sub { exit do_apis( \@ARGV ) },
random => sub { exit do_random( \@ARGV ) },
help => \&do_help,
view all matches for this distribution
view release on metacpan or search on metacpan
CONTRIBUTING view on Meta::CPAN
attach a diff file to a bug report. Unless otherwise stated, I'll
assume that your contributions are licensed under the same terms as
the rest of the project.
(If using git, feel free to work in a branch. For Mercurial, I'd
prefer bookmarks within the default branch.)
* Documentation
If there's anything unclear in the documentation, please submit this
as a bug report or patch as above.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Ghost.pm view on Meta::CPAN
=head2 logfile
logfile => '/var/log/myDaemon.log',
This attribute sets log file path. By default all log entries will be printed to syslog
See L<Acme::Ghost::Log/file>
=head2 logger
lib/Acme/Ghost.pm view on Meta::CPAN
This attribute perfoms to set predefined logger, eg. Mojo::Log.
If you set this attribute, the specified logger will be used as the preferred logger
=head2 loghandle
Log filehandle, defaults to opening "file" or uses syslog if file not specified
See L<Acme::Ghost::Log/handle>
=head2 loglevel
lib/Acme/Ghost.pm view on Meta::CPAN
=head2 flush
$self = $self->flush;
This internal method flush (resets) process counters to defaults. Please do not use this method in your inherits
=head2 is_daemonized
$g->is_daemonized or die "Your ghost process really is not a daemon"
lib/Acme/Ghost.pm view on Meta::CPAN
This example shows how to forced suppress reloading (disable send users signals to daemon)
=head2 reload
$exit_code = $g->reload; # SIGHUP (by default)
$exit_code = $g->reload('USR2'); # SIGUSR2
$exit_code = $g->reload(12); # SIGUSR2 too
say "Reloading ". $g->pid;
This method performs sending signal to Your daemon and return C<0> as exit code.
lib/Acme/Ghost.pm view on Meta::CPAN
1;
=item ghost_nobody.pl
This example shows how to start daemons over nobody user and logging to syslog (default)
my $g = MyGhost->new(
pidfile => '/tmp/daemon.pid',
user => 'nobody',
group => 'nogroup',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Github/Test.pm view on Meta::CPAN
This method prints the string scalar "Freep!" on standard out. It takes no input values. Returns a true
value.
=item * frobulate()
Takes an optional scalar value as input. The value '42' is the default value for this method. Returns the
passed value or the default. (That means if you pass 0 or some other untrue scalar value, the return value
will be false.)
=back
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
v0.001
- make it work
v0.002
- forgot to enfore 5.10 as a min
v0.03
- updated docs and test to show how to do a default
v0.05
- update to turn off warnings for smartmatch in 5.18
view all matches for this distribution
view release on metacpan or search on metacpan
},
{
"class" : "Dist::Zilla::Plugin::MakeMaker",
"config" : {
"Dist::Zilla::Role::TestRunner" : {
"default_jobs" : 1
}
},
"name" : "@Starter/MakeMaker",
"version" : "6.009"
},
},
{
"class" : "Dist::Zilla::Plugin::RunExtraTests",
"config" : {
"Dist::Zilla::Role::TestRunner" : {
"default_jobs" : 1
}
},
"name" : "@Starter/RunExtraTests",
"version" : "0.029"
},
view all matches for this distribution
view release on metacpan or search on metacpan
exclude_filename = README.pod ; skip this generated file
exclude_filename = README.mkdn ; skip this generated file
exclude_filename = META.json ; skip this generated file
exclude_filename = cpanfile ; skip this generated file
[PruneCruft] ; default stuff to skip
;[ManifestSkip] ; if -f MANIFEST.SKIP, skip those, too
; file modifications
[InsertCopyright] ; add copyright at "# COPYRIGHT"
; [PodWeaver] ; generate Pod
; build system
[ExecDir] ; include 'bin/*' as executables
[ShareDir] ; include 'share/' for File::ShareDir
[MakeMaker] ; create Makefile.PL
eumm_version = 6.17
default_jobs = 5
; manifest (after all generated files)
[Manifest] ; create MANIFEST
; copy cpanfile back to repo dis
[CheckMetaResources] ; ensure META has 'resources' data
[CheckPrereqsIndexed] ; ensure prereqs are on CPAN
[CheckChangesHasContent] ; ensure Changes has been updated
[RunExtraTests] ; ensure xt/ tests pass
default_jobs = 5
[TestRelease] ; ensure t/ tests pass
[ConfirmRelease] ; prompt before uploading
; releaser
view all matches for this distribution
view release on metacpan or search on metacpan
BEGIN {
use Exporter ();
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = 0.01;
@ISA = qw (Exporter);
#Give a hoot don't pollute, do not export more than needed by default
@EXPORT = qw (gotol);
@EXPORT_OK = qw (gotol);
%EXPORT_TAGS = ();
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/window.pl view on Meta::CPAN
widget Window => contain {
info id => 'window';
set position => 'center';
prop title => 'Window Example';
prop opacity => 0.8;
prop 'default-width' => 640;
prop 'default-height' => 480;
on delete_event => \&quit;
};
};
$app->find('window')->show_all;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Has/Tiny.pm view on Meta::CPAN
$_->($hash) for @validator;
return $hash;
}
my $default_buildargs = sub
{
my $class = shift;
return +{
(@_ == 1 && ref($_[0]) eq q(HASH)) ? %{$_[0]} : @_
};
lib/Acme/Has/Tiny.pm view on Meta::CPAN
my $me = shift;
my ($method, %options) = @_;
my $class = $options{class} || caller;
my $build = $options{build};
my $buildargs = $options{buildargs} || $default_buildargs;
my $code = sub
{
my $class = shift;
my $self = bless($class->$buildargs(@_), $class);
lib/Acme/Has/Tiny.pm view on Meta::CPAN
my @code;
for my $a (sort keys %$attributes)
{
my $spec = $attributes->{$a};
if ($spec->{default})
{
push @code, sprintf(
'exists($self->{%s}) or $self->{%s} = $Acme::Has::Tiny::ATTRIBUTES{%s}{%s}{default}->();',
map perlstring($_), $a, $a, $class, $a,
);
}
elsif ($spec->{required})
{
lib/Acme/Has/Tiny.pm view on Meta::CPAN
Defaults to "ro".
=item C<< required => 1 >>
=item C<< default => $coderef >>
Defaults are always eager (not lazy).
=item C<< builder => $coderef | $method_name | 1 >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Hello.pm view on Meta::CPAN
This document describes version 0.04 of B<Acme::Hello>.
=head1 SYNOPSIS
use Acme::Hello; # exports hello() by default
hello(); # procedure call interface
my $obj = Acme::Hello->new;
$obj->hello; # object-oriented interface
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/AuthorTests.pm view on Meta::CPAN
my ($self, $dirs, $recurse) = @_;
return unless $Module::Install::AUTHOR;
my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
# XXX: pick a default, later -- rjbs, 2008-02-24
my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
@dirs = grep { -d } @dirs;
if ($recurse) {
require File::Find;
view all matches for this distribution
view release on metacpan or search on metacpan
an object (i.e. a blessed reference).
=head2 EXPORT
By default, B<Acme::Holy> exports the method B<holy()> into the current
namespace. Aliases for B<holy()> (see below) may be imported upon request.
=head2 Methods
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Honkidasu.pm view on Meta::CPAN
add conversion specifier character '%(' to æ¬æ°åºãã
=head1 EXAMPLES
æ¬æ°åºã per hour. (default: per month)
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Hospital/Bed.pm view on Meta::CPAN
]
)
=head3 total_num_of_beds
Configure the total number of beds needed to win the game. The default is 20.
=head3 lifes
Configure the total number of lifes the player is allowed. The default is 3.
=head3 names
Configure the list of names used to generate patients. This is expected as an ArrayRef.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $HasCPANPLUS );
my ( $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly );
my ( $PostambleActions, $PostambleUsed );
# See if it's a testing or non-interactive session
_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
_init();
sub _accept_default {
$AcceptDefault = shift;
}
sub missing_modules {
return @Missing;
inc/Module/AutoInstall.pm view on Meta::CPAN
}
elsif ( $arg =~ /^--installdeps=(.*)$/ ) {
__PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
exit 0;
}
elsif ( $arg =~ /^--default(?:deps)?$/ ) {
$AcceptDefault = 1;
}
elsif ( $arg =~ /^--check(?:deps)?$/ ) {
$CheckOnly = 1;
}
inc/Module/AutoInstall.pm view on Meta::CPAN
$TestOnly = 1;
}
}
}
# overrides MakeMaker's prompt() to automatically accept the default choice
sub _prompt {
goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
my ( $prompt, $default ) = @_;
my $y = ( $default =~ /^[Yy]/ );
print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
print "$default\n";
return $default;
}
# the workhorse
sub import {
my $class = shift;
inc/Module/AutoInstall.pm view on Meta::CPAN
)[0]
);
while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
my ( @required, @tests, @skiptests );
my $default = 1;
my $conflict = 0;
if ( $feature =~ m/^-(\w+)$/ ) {
my $option = lc($1);
inc/Module/AutoInstall.pm view on Meta::CPAN
print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n";
$modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' );
unshift @$modules, -default => &{ shift(@$modules) }
if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward combatability
while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) {
if ( $mod =~ m/^-(\w+)$/ ) {
my $option = lc($1);
$default = $arg if ( $option eq 'default' );
$conflict = $arg if ( $option eq 'conflict' );
@tests = @{$arg} if ( $option eq 'tests' );
@skiptests = @{$arg} if ( $option eq 'skiptests' );
next;
inc/Module/AutoInstall.pm view on Meta::CPAN
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
. ( $mandatory ? ' mandatory' : ' optional' )
. qq{ module(s) from CPAN?},
$default ? 'y' : 'n',
) =~ /^[Yy]/
)
)
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/ICan/tSpell.pm view on Meta::CPAN
use HTTP::Tiny;
use URI::Escape;
use Carp qw/croak/;
attributes (
tiny => [Object, {lzy, default => sub {HTTP::Tiny->new}}],
base_url => [Str, {lzy, default => 'http://www.google.com/search?gws_rd=ssl&hl=en&q='}],
);
validate_subs (
get => { params => [ [Str] ], returns => [[HashRef]] },
spell_check => {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/ID/CompanyName.pm view on Meta::CPAN
v => 1.1,
summary => 'Generate nice-sounding, generic Indonesian company names',
args => {
type => {
schema => 'str*',
default => 'PT',
summary => 'Just a string to be prepended before the name',
cmdline_aliases => {t=>{}},
},
num_names => {
schema => ['int*', min=>0],
default => 1,
cmdline_aliases => {n=>{}},
pos => 0,
},
num_words => {
schema => ['int*', min=>1],
default => 3,
cmdline_aliases => {w=>{}},
},
add_prefixes => {
schema => ['bool*'],
default => 1,
},
add_suffixes => {
schema => ['bool*'],
default => 1,
},
# XXX option to use some more specific words & suffixes/prefixes
desired_initials => {
schema => ['str*', min_len=>1, match=>qr/\A[A-Za-z]+\z/],
},
lib/Acme/ID/CompanyName.pm view on Meta::CPAN
"PT Asaindo Cakra Mandala Elang",
]
=back
This function is not exported by default, but exportable.
Arguments ('*' denotes required arguments):
=over 4
=item * B<add_prefixes> => I<bool> (default: 1)
=item * B<add_suffixes> => I<bool> (default: 1)
=item * B<desired_initials> => I<str>
=item * B<num_names> => I<int> (default: 1)
=item * B<num_words> => I<int> (default: 3)
=item * B<type> => I<str> (default: "PT")
Just a string to be prepended before the name.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/IEnumerable.pm view on Meta::CPAN
my ($self) = @_;
croak unless $self->count;
$self->element_at($self->count - 1);
}
sub last_or_default {
my ($self, $default) = @_;
return $default unless $self->count;
$self->element_at($self->count - 1);
}
sub first {
my ($self) = @_;
croak "No elements for 'first'" unless $self->count;
$self->element_at(0);
}
sub first_or_default {
my ($self, $default) = @_;
return $default unless $self->count;
$self->element_at(0);
}
sub from_list {
my $class = shift;
lib/Acme/IEnumerable.pm view on Meta::CPAN
sub first {
$_[0]->element_at(0);
}
sub first_or_default {
my ($self, $default) = @_;
my $base = $self->new();
my $item = $base->();
return $default unless ref $item;
return $$item;
}
sub last_or_default {
my ($self, $default) = @_;
my $base = $self->new();
my $item = $base->();
return $default unless ref $item;
while (1) {
my $next = $base->();
return $$item unless ref $next;
$item = $next;
}
lib/Acme/IEnumerable.pm view on Meta::CPAN
# sub sequence_equal { ... }
# sub distinct { ... }
# sub union { ... }
# sub except { ... }
# sub intersect { ... }
# sub default_if_empty { ... }
# sub single_or_default { ... }
# sub concat { ... }
# sub group_join { ... }
# sub join { ... }
# sub empty { ... }
# sub cast { ... }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/IRC/Art.pm view on Meta::CPAN
BEGIN {
use Exporter ();
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = 0.2;
@ISA = qw (Exporter);
#Give a hoot don't pollute, do not export more than needed by default
@EXPORT = qw ();
@EXPORT_OK = qw ();
%EXPORT_TAGS = ();
}
view all matches for this distribution
view release on metacpan or search on metacpan
require_ok( $module ) or exit;
my @oldinc = @INC;
$module->import();
isa_ok( $INC[0], 'CODE',
'default import() should install something in @INC that' );
is( $INC[0], \&Acme::Incorporated::fine_products,
'... a reference to fine_products()' );
{
my $non_random = \&Acme::Incorporated::empty_box;
view all matches for this distribution