view release on metacpan or search on metacpan
bin/download view on Meta::CPAN
# subs
sub exit_with_error_message {
my ($msg) = @_;
say colored($msg, 'red');
exit 1;
}
sub run_cmd {
my ($cmd) = @_;
say colored('$ ' . $cmd, 'green');
my $exit_code = system($cmd);
if ($exit_code != '0') {
exit_with_error_message('Error. Command exited with non zero exit code');
}
bin/download view on Meta::CPAN
if ($opt->commit() ne 'HEAD') {
run_cmd("cd $tempdir; git checkout " . $opt->commit());
}
say colored('Copying files', 'green');
my $cp_count = 0;
find(
{
wanted => sub {
bin/download view on Meta::CPAN
$File::Find::name =~ m{$tempdir/(.*)};
my $relative_name = $1;
my $re = $opt->include_re();
if ($relative_name =~ /$re/) {
say $relative_name;
# http://stackoverflow.com/questions/229357/what-is-the-best-way-in-perl-to-copy-files-into-a-yet-to-be-created-directory-tr/229382#229382
mkdir_and_copy(
$File::Find::name,
$opt->to_dir() . '/' . $relative_name,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DrivePlayer/Scanner.pm view on Meta::CPAN
use App::DrivePlayer::Scanner;
my $scanner = App::DrivePlayer::Scanner->new(
drive => $drive_api, # Google::RestApi::DriveApi3
db => $db, # App::DrivePlayer::DB
on_progress => sub { say $_[0] },
on_track_found => sub { my $track = shift; ... },
);
$scanner->scan_folder($root_folder_id, 'My Music');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/EPAN.pm view on Meta::CPAN
return sort {$a cmp $b} keys %{$data_for->{obsolete}};
}
sub action_list_obsoletes {
my ($self) = @_;
say for $self->_list_obsoletes;
return;
}
sub action_purge_obsoletes {
my ($self) = @_;
lib/App/EPAN.pm view on Meta::CPAN
}
sub action_list_actions {
my $self = shift;
no strict 'refs';
say 'Available actions:';
say for
sort {$a cmp $b}
map {s/^action_/- /; s/_/-/g; $_ }
grep {/^action_/ && $self->can($_)}
keys %{ref($self)."::"};
return;
view all matches for this distribution
view release on metacpan or search on metacpan
docs/templates/getting-started.pl view on Meta::CPAN
sub foo ($general, $config, $args) {
# $general is a hash reference to the overall application
# $config is a hash reference with options
# $args is an array reference with "residual" cmd line arguments
for my $key (sort { $a cmp $b } keys $config->%*) {
say "$key: $config->{$key}";
}
say "($args->@*)";
return;
}
# implementation of sub-command bar
sub bar ($general, $config, $args) {
say defined($config->{galook}) ? $config->{galook} : '*undef*';
return;
}
view all matches for this distribution
view release on metacpan or search on metacpan
samples/renamevar.pm view on Meta::CPAN
has b_var => ( is => 'rw', isa => 'Str' );
method some_method {
my $x_var = 1;
say "Do stuff with ${x_var}";
$x_var += 2;
my %hash;
for my $i (1..5) {
$hash{$i} = $x_var;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Eduard.pm view on Meta::CPAN
use Mail::GnuPG;
use PerlX::Maybe;
use Template;
use Try::Tiny;
sub debug { say STDERR @_ if $ENV{EDUARD_DEBUG} }
sub stringify ($) { join '', map {; '>', $_ } @{$_[0]} }
sub mg {
Mail::GnuPG->new(
key => $ENV{EDUARD_KEY},
maybe always_trust => $ENV{EDUARD_ALWAYS_TRUST},
lib/App/Eduard.pm view on Meta::CPAN
open STDERR, '>>', $ENV{EDUARD_LOGFILE} if $ENV{EDUARD_LOGFILE};
my $in = mp->parse(\*STDIN);
debug 'Received mail from ', $in->get('From');
my @keys = import_pubkeys $in, mg;
say 'Found keys: ', join ' ', @keys if @keys;
my ($tmpl, %params);
try {
($tmpl, %params) = process_message $in
} catch {
lib/App/Eduard.pm view on Meta::CPAN
=head1 SYNOPSIS
use App::Eduard;
my ($status, %params) = process_message '/path/to/message';
if ($status eq 'signencrypt') {
say 'This message is encrypted and signed with key ', $params{keyid}, ' from ', $params{email};
say 'Its contents are: ', $params{plaintext};
} elsif ($status eq 'encrypt') {
say 'This message is encrypted but not signed';
say 'Its contents are: ', $params{plaintext};
} elsif ($status eq 'encrypt_error') {
say 'This message is encrypted but I was unable to decrypt it. GnuPG output: ', $params{message};
} elsif ($status eq 'sign') {
say 'This message is signed with key ', $params{keyid}, ' from ', $params{email};
} elsif ($status eq 'sign_error') {
say 'This message is signed but I was unable to verify the signature. GnuPG output: ', $params{message};
} elsif ($status eq 'plain') {
say 'This message is neither signed nor encrypted';
} elsif ($status eq 'error') {
say 'There was an error processing the message: ', $params{message};
}
=head1 DESCRIPTION
Eduard is Ceata's reimplementation of the Edward reply bot referenced in L<https://emailselfdefense.fsf.org/>.
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/es-copy-index.pl view on Meta::CPAN
--settings new_settings.json \
--mappings new_mappings.json
=head2 Building an Incident Index using append
Let's say we were investigating an incident and wanted to have
an index that contained the data we were interested in. We could use different
retention rules for incident indexes and we could arbitrarily add data to them based
on searches being performed on the source index.
Here's our initial query, a bad actor on our admin login page.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Env/Example.pm view on Meta::CPAN
I<current> environment. For example, if the environment is derived
from running a shell script, make sure either that the shell script is
run without running the user's startup file, or that any differences
between the current environment and that constructed by the script
which are not due to the application are resolved in the current
environment's favor. For example, say that B<LD_LIBRARY_PATH> is set
in the user's F<.cshrc> file:
setenv LD_LIBRARY_PATH /my/path1
and that before invoking B<App::Env> the user has modified it to
view all matches for this distribution
view release on metacpan or search on metacpan
example/example.pl view on Meta::CPAN
App::Environ->send_event('initialize');
my $CH = App::Environ::ClickHouse->instance;
my $data = $CH->selectall_hash('SELECT * FROM default.test');
say Dumper $data;
App::Environ->send_event('finalize:r');
view all matches for this distribution
view release on metacpan or search on metacpan
example/example.pl view on Meta::CPAN
App::Environ->send_event('initialize');
my $pid = fork();
if ($pid) {
say 'Parent';
}
else {
say 'Worker';
App::Environ->send_event('postfork');
## Now we have correct AnyEvent::DNS and AnyEvent::DNS::Resolver
}
App::Environ->send_event('finalize:r');
view all matches for this distribution
view release on metacpan or search on metacpan
example/example.pl view on Meta::CPAN
App::Environ->send_event('initialize');
my $pg = App::Environ::Mojo::Pg->pg('main');
say $pg->db->query('SELECT 1')->array->[0];
App::Environ->send_event('finalize:r');
view all matches for this distribution
view release on metacpan or search on metacpan
bin/station-mgr.pl view on Meta::CPAN
$logger->debug("Restart Manger: $Bin/$script $options") if ($logger->is_debug());
exec("$Bin/$script $options") or $logger->logdie("Couldn't restart: $!");
}
sub print_usage {
say "
Usage: station-mgr.pl [OPTIONS]
Options:
--no-deaemon disable daemon
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Exifpic.pm view on Meta::CPAN
my ($new) = $raw =~ m{(.*).CR2$}i;
next if not $new; # Skip non-CR2 files
$new .= ".jpg";
say "$raw -> $new...";
my $exiftool = Image::ExifTool->new;
my $exif = $exiftool->ImageInfo($raw, [qw(PreviewImage)], { Binary => 1 });
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FTPThis.pm view on Meta::CPAN
require Net::FTPServer::RO_FTPThis::Server;
my ($self) = @_;
my $dir = File::Temp::tempdir(CLEANUP => !$ENV{DEBUG});
say "D: temporary dir = $dir" if $ENV{DEBUG};
File::Slurper::write_text(
"$dir/conf",
join(
"",
lib/App/FTPThis.pm view on Meta::CPAN
"limit nr processes: -1\n",
"limit nr files: -1\n",
),
);
say "Starting FTP server on port $self->{port} ...";
chdir $self->{root} or die "Can't chdir to $self->{root}: $!";
local @ARGV = (
"-C=$dir/conf",
"-p", $self->{port},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FatPacker/Simple/Tutorial.pm view on Meta::CPAN
C<lib,fatlib,local,extlib> directories.
Also note that the all modules are automatically perl-stripped.
=head1 TUTORIAL
Let's say you have C<hello.pl> and want to fatpack it.
And assume
=over 4
=item * C<hello.pl> uses your modules in C<lib> directory: C<lib/Hello.pm>, C<lib/Hello/CLI.pm>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FeedDeduplicator/Publisher.pm view on Meta::CPAN
if (@sorted > $max_entries) {
$#sorted = $max_entries - 1;
}
if ($format eq 'json') {
say encode_json([ map { {
title => $_->{entry}->title,
link => $_->{entry}->link,
summary => $_->{entry}->summary->body,
issued => $_->{entry}->issued && $_->{entry}->issued->iso8601,
source_name => $_->{feed}{name},
lib/App/FeedDeduplicator/Publisher.pm view on Meta::CPAN
} } @sorted ]);
} else {
my $feed = XML::Feed->new($format);
$feed->title("Deduplicated Feed");
$feed->add_entry($_) for @sorted;
say $feed->as_xml;
}
}
}
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Fetchware.pm view on Meta::CPAN
determine based on the lookup_url you provide if it can autogenerate a
Fetchwarefile for you. If Fetchware cannot, then it will ask you more
questions regarding the information it requires to be able to build a
installable fetchware package for you. After that, fetchware will ask you if
you would like to edit the Fetchwarefile, fetchware has created for you in an
editor. If you say yes, fetchware will open a editor for you, but if you say
no, fetchware will skip the custom editing. Next, fetchware will create a test
Fetchwarefile for you, and ask you if you would like to test it by trying to
install it now. If you say yes, fetchware will install it, and if you say no,
then fetchware will print the location of the Fetchwarefile it created for
you to later use to install your application.
EOM
opening_message($opening_message);
lib/App/Fetchware.pm view on Meta::CPAN
App-Fetchware: fetchware failed to create a new Archive::Tar iterator. The
Archive::Tar error message was [@{[Archive::Tar->error()]}].
EOD
# Iterate over the the archive one file at a time to save memory on big
# archives suchs a say MariaDB or the Linux kernel.
my @files;
while (my $file = $tar_iter->() ) {
push @files, $file->full_path();
}
lib/App/Fetchware.pm view on Meta::CPAN
all installed packages that fetchware is tracking in its internal fetchware
database. This command can be used to have fetchware upgrade all currently
installed programs that fetchware installed.
If you would like C<fetchware upgrade-all> to be run every night automatically
by cron, then just create a file say fetchware with the contents below in it,
and add it to /etc/cron.daily.
#!/bin/sh
# Update all already installed fetchware packages.
fetchware upgrade-all
lib/App/Fetchware.pm view on Meta::CPAN
my $fetchware_package_path = ask_to_install_now_to_test_fetchwarefile($term, \$fetchwarefile, $program_name);
my $fetchwarefile_filename = ask_to_install_now_to_test_fetchwarefile($term, \$fetchwarefile, $program_name);
This subroutine asks the user if they want to install the Fetchwarefile that
this subroutine has been called with. If they say yes, then the Fetchwarefile is
passed on to cmd_install() to do all of the installation stuff. If they say no,
then fetchware saves the file to C<"$program_name.Fetchwarefile"> or
ask_to_install_now_to_test_fetchwarefile() will ask the user where to save the
file until the user picks a filename that does not exist.
=over
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FileCleanerByDiskUage.pm view on Meta::CPAN
Default :: undef
- min_files :: Minimum number of files to keep, regardless of disk usage.
Default :: undef
- ignore :: A regexp to use for ignoring files. So lets say you want to ignore,
files matching /\.pcap$/, it would be '\.pcap$'.
Default :: undef
- dry_run :: Do not actually remove anything. Just check to see if the file writable by the
current user.
view all matches for this distribution
view release on metacpan or search on metacpan
bin/mkscript view on Meta::CPAN
=cut
# -------------------------- CLI Arguments ----------------------------
sub version {
say "Fc engine $App::FileComposer::VERSION";
}
sub reconf {
my $home = "$ENV{\"HOME\"}/.app-filecomposer";
mkdir $home
or die BRIGHT_YELLOW ,"direcotry already exists \n", RESET,"system: $!\n";
say BRIGHT_YELLOW, "Default directory created in: ", RESET, $home;
}
#-------------------------- Create Template -----------------------------
sub withparameters {
bin/mkscript view on Meta::CPAN
sub postmsg {
my ($path, $file) = @_;
my $file_comand = qx/file $path\/$file/;
say "source sample file: ", CYAN, "$file \n", RESET,
"Type: ", GREEN, $file_comand, RESET;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FindCallers.pm view on Meta::CPAN
sub find_in_file {
my ($function, $filename, $cb) = @_;
$cb ||= \&report;
my $document = PPI::Document->new($filename);
unless ($document) {
say "Failed to parse $filename " . PPI::Document->errstr;
return;
}
$document->index_locations;
my $references = $document->find(sub {
$_[1]->isa('PPI::Token::Word') and $_[1]->content eq $function
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FirefoxUtils.pm view on Meta::CPAN
summary => "Check whether Firefox is running",
description => <<'_',
Firefox is defined as running if there are some Firefox processes that are *not*
in 'stop' state. In other words, if Firefox has been started but is currently
paused, we do not say that it's running. If you want to check if Firefox process
exists, you can use `ps_firefox`.
_
args => {
%App::BrowserUtils::args_common,
lib/App/FirefoxUtils.pm view on Meta::CPAN
Check whether Firefox is running.
Firefox is defined as running if there are some Firefox processes that are I<not>
in 'stop' state. In other words, if Firefox has been started but is currently
paused, we do not say that it's running. If you want to check if Firefox process
exists, you can use C<ps_firefox>.
This function is not exported by default, but exportable.
Arguments ('*' denotes required arguments):
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FonBot/Plugin/Config.pm view on Meta::CPAN
use App::FonBot::Plugin::Config qw/$oftc_enabled $oftc_nick @oftc_channels $oftc_nickserv_password $bitlbee_enabled $bitlbee_nick $bitlbee_server $bitlbee_port $bitlbee_password $user $group @supplementary_groups $httpd_port/;
App::FonBot::Plugin::Config->init;
# Variables used in App::FonBot:Plugin::OFTC
say "The OFTC plugin is ".($oftc_enabled ? 'enabled' : 'disabled');
say "The OFTC NickServ password is $oftc_nickserv_password";
say "The OFTC nickname is $oftc_nick";
say "The OFTC channels are @oftc_channels";
# Variables used in App::FonBot::Plugin::BitlBee
say "The BitlBee plugin is ".($bitlbee_enabled ? 'enabled' : 'disabled');
say "The BitlBee server runs on port $bitlbee_port of host $bitlbee_server"
say "The BitlBee nickname is $bitlbee_nick";
say "The BitlBee password is $bitlbee_password";
# Variables used in App::FonBot::Plugin::Common
say "The storage directory is $dir";
say "The user is $user";
say "The primary group is $group";
say "The supplementary groups are @supplementary_groups";
# Variables used in App::FonBot::Plugin::HTTPD
say "The HTTPD listens on port $httpd_port"
# Variables used in App::FonBot::Plugin::Email
say "The email batch delay is $email_batch_seconds";
say "The email plugin sends emails from $email_from";
say "The email plugin sends emails with subject $email_subject";
=head1 DESCRIPTION
This FonBot plugin reads a configuration file (hardcoded to F</etc/fonbot/config.pl>) and provides configuration variables to the other plugins. It is a required plugin, since all other plugins depend on it.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Fotagger/Deleter.pm view on Meta::CPAN
my $answer = <STDIN>;
chomp $answer;
next unless $answer ~~ /y/i;
}
unless ($self->dry_run) {
unlink($file) || say "Couldn't unlink $file";
$count++;
}
say "deleted $file" if $self->verbose;
}
}
say "deleted $count file".($count>1?'s':'');
}
q{ listening to:
Soap & Skin - Lovetune For Vacuum
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Framework/Feature/Config.pm view on Meta::CPAN
#============================================================================================
# # TAG: authenticate_cache_garbage_interval
# # The time period between garbage collection across the username cache.
# # This is a tradeoff between memory utilization (long intervals - say
# # 2 days) and CPU (short intervals - say 1 minute). Only change if you
# # have good reason to.
# #
# #Default:
# # authenticate_cache_garbage_interval 1 hour
# authenticate_cache_garbage_interval 1 hour
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GHGen/Interactive.pm view on Meta::CPAN
Prompt user to select one option from a list.
=cut
sub prompt_choice($question, $choices, $default = 0) {
say $question;
for my $i (0 .. $#$choices) {
my $marker = $i == $default ? colored(['green'], 'â') : ' ';
say " $marker " . ($i + 1) . ". $choices->[$i]";
}
print "\nEnter number [" . ($default + 1) . "]: ";
chomp(my $answer = <STDIN>);
lib/App/GHGen/Interactive.pm view on Meta::CPAN
Prompt user to select multiple options. Returns array ref of selected items.
=cut
sub prompt_multiselect($question, $options, $defaults = []) {
say $question;
say colored(['cyan'], "(Enter numbers separated by commas, or 'all')");
my %is_default = map { $_ => 1 } @$defaults;
for my $i (0 .. $#$options) {
my $marker = $is_default{$options->[$i]} ? colored(['green'], 'â') : ' ';
say " $marker " . ($i + 1) . ". $options->[$i]";
}
print "\nEnter choices [" . join(',', map { $_+1 } 0..$#$defaults) . "]: ";
chomp(my $answer = <STDIN>);
lib/App/GHGen/Interactive.pm view on Meta::CPAN
Returns hash of configuration options.
=cut
sub customize_workflow($type) {
say '';
say colored(['bold cyan'], "=== Workflow Customization: " . uc($type) . " ===");
say '';
my %dispatch = (
perl => \&_customize_perl,
node => \&_customize_node,
python => \&_customize_python,
lib/App/GHGen/Interactive.pm view on Meta::CPAN
sub _customize_perl() {
my %config;
# Perl versions
say colored(['bold'], "Perl Versions to Test:");
my @all_versions = qw(5.40 5.38 5.36 5.34 5.32 5.30 5.28 5.26 5.24 5.22);
my @default_versions = qw(5.40 5.38 5.36);
$config{perl_versions} = prompt_multiselect(
"Which Perl versions?",
\@all_versions,
\@default_versions
);
say '';
# Operating systems
say colored(['bold'], "Operating Systems:");
my @all_os = ('ubuntu-latest', 'macos-latest', 'windows-latest');
my @default_os = @all_os;
$config{os} = prompt_multiselect(
"Which operating systems?",
\@all_os,
\@default_os
);
say '';
# Code quality
say colored(['bold'], "Code Quality Tools:");
$config{enable_critic} = prompt_yes_no(
"Enable Perl::Critic?",
'y'
);
say '';
# Coverage
$config{enable_coverage} = prompt_yes_no(
"Enable test coverage (Devel::Cover)?",
'y'
);
say '';
# Branches
say colored(['bold'], "Branch Configuration:");
my $branches = prompt_text(
"Branches to run on (comma-separated)",
'main,master'
);
$config{branches} = [split /,\s*/, $branches];
say '';
return \%config;
}
sub _customize_node() {
my %config;
# Node versions
say colored(['bold'], "Node.js Versions to Test:");
my @all_versions = qw(18.x 20.x 22.x 23.x);
my @default_versions = qw(20.x 22.x);
$config{node_versions} = prompt_multiselect(
"Which Node.js versions?",
\@all_versions,
\@default_versions
);
say '';
# Package manager
say colored(['bold'], "Package Manager:");
my $pm_choice = prompt_choice(
"Which package manager?",
['npm', 'yarn', 'pnpm'],
0
);
$config{package_manager} = ['npm', 'yarn', 'pnpm']->[$pm_choice];
say '';
# Linting
$config{enable_lint} = prompt_yes_no(
"Enable linting?",
'y'
);
say '';
# Build step
$config{enable_build} = prompt_yes_no(
"Enable build step?",
'y'
);
say '';
# Branches
my $branches = prompt_text(
"Branches to run on (comma-separated)",
'main,develop'
);
$config{branches} = [split /,\s*/, $branches];
say '';
return \%config;
}
sub _customize_python() {
my %config;
# Python versions
say colored(['bold'], "Python Versions to Test:");
my @all_versions = qw(3.9 3.10 3.11 3.12 3.13);
my @default_versions = qw(3.11 3.12);
$config{python_versions} = prompt_multiselect(
"Which Python versions?",
\@all_versions,
\@default_versions
);
say '';
# Linting
say colored(['bold'], "Code Quality:");
$config{enable_flake8} = prompt_yes_no(
"Enable flake8 linting?",
'y'
);
say '';
$config{enable_black} = prompt_yes_no(
"Enable black formatter check?",
'n'
);
say '';
# Coverage
$config{enable_coverage} = prompt_yes_no(
"Enable test coverage?",
'y'
);
say '';
# Branches
my $branches = prompt_text(
"Branches to run on (comma-separated)",
'main,develop'
);
$config{branches} = [split /,\s*/, $branches];
say '';
return \%config;
}
sub _customize_rust() {
my %config;
say colored(['bold'], "Rust Workflow Options:");
$config{enable_fmt} = prompt_yes_no(
"Enable formatting check (cargo fmt)?",
'y'
);
say '';
$config{enable_clippy} = prompt_yes_no(
"Enable clippy linting?",
'y'
);
say '';
$config{enable_release} = prompt_yes_no(
"Build release binary?",
'y'
);
say '';
my $branches = prompt_text(
"Branches to run on (comma-separated)",
'main'
);
$config{branches} = [split /,\s*/, $branches];
say '';
return \%config;
}
sub _customize_go() {
my %config;
say colored(['bold'], "Go Workflow Options:");
my $go_version = prompt_text(
"Go version",
'1.22'
);
$config{go_version} = $go_version;
say '';
$config{enable_vet} = prompt_yes_no(
"Enable go vet?",
'y'
);
say '';
$config{enable_race} = prompt_yes_no(
"Enable race detector?",
'y'
);
say '';
$config{enable_coverage} = prompt_yes_no(
"Enable test coverage?",
'y'
);
say '';
my $branches = prompt_text(
"Branches to run on (comma-separated)",
'main'
);
$config{branches} = [split /,\s*/, $branches];
say '';
return \%config;
}
sub _customize_ruby() {
my %config;
say colored(['bold'], "Ruby Versions to Test:");
my @all_versions = qw(3.1 3.2 3.3);
my @default_versions = qw(3.2 3.3);
$config{ruby_versions} = prompt_multiselect(
"Which Ruby versions?",
\@all_versions,
\@default_versions
);
say '';
my $branches = prompt_text(
"Branches to run on (comma-separated)",
'main'
);
$config{branches} = [split /,\s*/, $branches];
say '';
return \%config;
}
sub _customize_docker() {
my %config;
say colored(['bold'], "Docker Workflow Options:");
my $image_name = prompt_text(
"Docker image name (user/image)",
'your-username/your-image'
);
$config{image_name} = $image_name;
say '';
$config{push_on_pr} = prompt_yes_no(
'Push images on pull requests?',
'n'
);
say '';
my $branches = prompt_text(
"Branches to run on (comma-separated)",
'main'
);
$config{branches} = [split /,\s*/, $branches];
say '';
return \%config;
}
sub _customize_static() {
my %config;
say colored(['bold'], "Static Site Deployment:");
my $build_dir = prompt_text("Build output directory", './public');
$config{build_dir} = $build_dir;
say '';
my $build_command = prompt_text("Build command", 'npm run build');
$config{build_command} = $build_command;
say '';
return \%config;
}
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GHPT/WorkSubmitter.pm view on Meta::CPAN
my $name = $self->_choose( [ sort keys %membership_by_person_name ] );
return $membership_by_person_name{$name}->person;
}
before print_usage_text => sub {
say <<'EOF';
Please see POD in App::GHPT for installation and troubleshooting directions.
EOF
};
sub run ($self) {
lib/App/GHPT/WorkSubmitter.pm view on Meta::CPAN
$self->_text_for_story( $chosen_story, $requester ),
),
),
);
$self->_update_pt_story( $chosen_story, $pull_request_url );
say $chosen_story->url;
say $pull_request_url;
return 0;
}
sub _append_question_answers ( $self, $text ) {
lib/App/GHPT/WorkSubmitter.pm view on Meta::CPAN
my $project = $self->_find_project;
my $requester = $self->_find_requester($project);
my $name = $self->_get_story_name;
if ( $self->dry_run ) {
say "Would create story $name in "
. $project->name
. ' with requester '
. $requester->name
. ' but this is a dry-run.';
exit;
lib/App/GHPT/WorkSubmitter.pm view on Meta::CPAN
}
sub _get_story_name ($self) {
my $story_name = $self->story_name;
if ( !$story_name ) {
say q{Please enter the new story's name:};
$story_name = $self->_read_line;
}
return $story_name;
}
lib/App/GHPT/WorkSubmitter.pm view on Meta::CPAN
sub _filter_chores_and_maybe_warn_user ( $self, $stories ) {
my ( $chore_stories, $non_chore_stories )
= part { $_->story_type eq 'chore' ? 0 : 1 } $stories->@*;
say 'Note: '
. ( scalar $chore_stories->@* )
. PL( ' chore', scalar $chore_stories->@* )
. PL_V( ' is', scalar $chore_stories->@* )
. ' not shown here (chores by definition do not require review).'
if $chore_stories;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GUI/Cellgraph/Compute/Grid.pm view on Meta::CPAN
. ' '.move_pattern_string('$right_pattern', ($grid_circular ? '$x_pos+'.($input_overhang - $grid_size) : undef) )
. ' $subrule_nr[$x_pos] = '.$eval_pattern.";\n }\n\n";
}
my $result = eval( $code . $code_end); # say $code . $code_end;
say "compile in code:\n$code\n\n error: $@" if $@;
# say "got grid in:",timestr( timediff(Benchmark->new, $t0) );
$rules_tab->update_subrule_occurance( @subrule_occur );
if ($sketch_length){
$state_grid->[$_] = [@empty_row] for $compute_rows .. $grid_size - 1;
return $state_grid;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GUI/Harmonograph.pm view on Meta::CPAN
by clicking on in and typing. The third text field is the file number and
is readonly. That counter increments automatically when a file is generated.
The complete file path is <dir>+<base name>+'_'+<counter>+<file ending>.
The file ending is I<.ini> for setting files and I<.jpg> or I<.png> or I<.svg>
for image files. The exact ending depends on what is the current configuration
set in the image > format menu. Lets say your directory is
"/home/user/images/h" and the base file name is beauty. If there is already
a file "/home/user/images/h/beauty_4.png" - the program will detect that
and set the counter to 5. You can play with the settings and than (no matter
if there is currently a complete drawing or not) push the I<Save> button
to produce a complete drawing into "/home/user/images/h/beauty_5.png".
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GUI/Juliagraph.pm view on Meta::CPAN
The second section is for people who want only a few color regions.
Just activate the custom checkbox and select the C<Steps> count. If they
are at 20 only 20 differently colored reagions are drawn. The readonly
textbox below with the current iteration max is only for better orientation.
When it is at lets say 60 you know: this scale of one to 60 possible
iteratons will be divided into 20 parts. If the distribution is I<linear>
they all have the size of three. But you might want to skew the color
distribution. The mapping types are sorted by their skewness.
If the second section is deactivated you are able to activate the third.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Games/Keno.pm view on Meta::CPAN
use App::Games::Keno;
my $first_game = App::Games::Keno->new( num_spots => 5, draws => 1000 );
$first_game->PlayKeno;
say "You won \$"
. $first_game->winnings . " on "
. $first_game->draws
. " draws.";
This is how you choose your own spots.
lib/App/Games/Keno.pm view on Meta::CPAN
my $second_game = App::Games::Keno->new(
spots => [ 45, 33, 12, 20, 75 ],
draws => 1000
);
$second_game->PlayKeno;
say "You won \$"
. $second_game->winnings . " on "
. $second_game->draws
. " draws.";
Several verbosity levels exist, use theme like this:
view all matches for this distribution