view release on metacpan or search on metacpan
script/release-csjewell.pl view on Meta::CPAN
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# get the release object
my %params;
$params{local} = shift @ARGV if @ARGV;
if( @ARGV )
{
$params{remote} = shift @ARGV;
}
view all matches for this distribution
view release on metacpan or search on metacpan
script/release view on Meta::CPAN
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# get the release object
my %params;
$params{local} = shift @ARGV if @ARGV;
if( @ARGV ) {
$params{remote} = shift @ARGV;
}
elsif( $params{local} ) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/010_core/setup_options.t view on Meta::CPAN
filters { input => [qw/lines chomp/], argv => [qw/lines chomp array/], options => 'yaml' };
run {
my $block = shift;
local @ARGV = $block->input;
my $self = Module::Setup->new->setup_options;
my $options = {
target => undef,
plugins => undef,
direct => undef,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter/CSJEWELL.pm view on Meta::CPAN
File::Spec->catdir( $self->{basedir}, 'xt', 'author' ),
)
{
if ( not -d $tdir ) {
local @ARGV = $tdir;
mkpath();
$self->progress("Created $tdir");
}
} ## end foreach my $tdir ( File::Spec...)
lib/Module/Starter/CSJEWELL.pm view on Meta::CPAN
# Create the directories...
my $template_dir =
File::Spec->catdir( $ENV{HOME}, '.module-starter', 'CSJEWELL' );
if ( not -d $template_dir ) {
print {*STDERR} "Creating $template_dir...";
local @ARGV = $template_dir;
mkpath;
print {*STDERR} "done.\n";
}
my $template_test_dir =
File::Spec->catdir( $ENV{HOME}, '.module-starter', 'CSJEWELL', 't' );
if ( not -d $template_test_dir ) {
print {*STDERR} "Creating $template_test_dir...";
local @ARGV = $template_test_dir;
mkpath;
print {*STDERR} "done.\n";
}
my $template_xtest_dir =
File::Spec->catdir( $ENV{HOME}, '.module-starter', 'CSJEWELL', 'xt' );
if ( not -d $template_xtest_dir ) {
print {*STDERR} "Creating $template_xtest_dir...";
local @ARGV = $template_xtest_dir;
mkpath;
print {*STDERR} "done.\n";
}
my $template_authortest_dir =
File::Spec->catdir( $ENV{HOME}, '.module-starter', 'CSJEWELL', 'xt',
'author' );
if ( not -d $template_authortest_dir ) {
print {*STDERR} "Creating $template_authortest_dir...";
local @ARGV = $template_authortest_dir;
mkpath;
print {*STDERR} "done.\n";
}
my $template_authortest_settings =
File::Spec->catdir( $ENV{HOME}, '.module-starter', 'CSJEWELL', 'xt',
'settings' );
if ( not -d $template_authortest_settings ) {
print {*STDERR} "Creating $template_authortest_settings...";
local @ARGV = $template_authortest_settings;
mkpath;
print {*STDERR} "done.\n";
}
# Create or update the config file (making a backup, of course)...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter/PBP.pm view on Meta::CPAN
# Create the directories...
my $template_dir
= File::Spec->catdir( $ENV{HOME}, '.module-starter', 'PBP' );
if ( not -d $template_dir ) {
print {*STDERR} "Creating $template_dir...";
local @ARGV = $template_dir;
mkpath;
print {*STDERR} "done.\n";
}
my $template_test_dir
= File::Spec->catdir( $ENV{HOME}, '.module-starter', 'PBP', 't' );
if ( not -d $template_test_dir ) {
print {*STDERR} "Creating $template_test_dir...";
local @ARGV = $template_test_dir;
mkpath;
print {*STDERR} "done.\n";
}
# Create or update the config file (making a backup, of course)...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter/Smart.pm view on Meta::CPAN
my @dirparts = ( $self->{basedir}, 'lib', @parts );
my $manifest_file = join( "/", "lib", @parts, $filepart );
if ( @dirparts ) {
my $dir = File::Spec->catdir( @dirparts );
if ( not -d $dir ) {
local @ARGV = $dir;
mkpath @ARGV;
$self->progress( "Created $dir" );
}
}
lib/Module/Starter/Smart.pm view on Meta::CPAN
my $content = shift;
my @dirparts = ( $self->{basedir}, $testdir );
my $tdir = File::Spec->catdir( @dirparts );
if ( not -d $tdir ) {
local @ARGV = $tdir;
mkpath();
$self->progress( "Created $tdir" );
}
my $fname = File::Spec->catfile( @dirparts, $filename );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter/TOSHIOITO.pm view on Meta::CPAN
sub _ensure_dir {
my ($self, @dirpaths) = @_;
my $dir = File::Spec->catdir($self->{basedir}, @dirpaths);
if (not -d $dir) {
local @ARGV = $dir;
mkpath();
$self->progress("Created $dir");
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Modulino/Demo.pm view on Meta::CPAN
sub doc {
say "Running as docs";
my $data = do {
local( @ARGV, $/ ) = __FILE__;
<>;
};
my $package = __PACKAGE__;
$data =~ s/__PACKAGE__/$package/;
view all matches for this distribution
view release on metacpan or search on metacpan
use MogileFS::Server;
use MogileFS::Config;
{
local @ARGV = qw/--skipconfig --plugins MultiHook/;
eval {
MogileFS::Config->load_config;
};
ok(!$@);
view all matches for this distribution
view release on metacpan or search on metacpan
$rv;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojo/Webqq/Plugin/Perldoc.pm view on Meta::CPAN
$msg->allow_plugin(0);
return if $msg->class eq "send" and $msg->from ne "api" and $msg->from ne "irc";
my($p,$v) = ("-$1",$2);
$client->spawn(
cmd =>sub{
local @ARGV=($p,$v);
require 5;
exit(Pod::Perldoc->run());
},
exec_timeout => 5,
exit_cb => sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojo/Weixin/Plugin/Perldoc.pm view on Meta::CPAN
$msg->allow_plugin(0);
return if $msg->from eq "bot";
my($p,$v) = ("-$1",$2);
$client->spawn(
cmd =>sub{
local @ARGV=($p,$v);
require 5;
exit(Pod::Perldoc->run());
},
exec_timeout => 5,
exit_cb => sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Command/generate/lexicon.pm view on Meta::CPAN
$language ||= 'Skeleton';
my $behavior = '';
local @ARGV = @_ if @_;
my $result = GetOptions(
"behavior|b:s{1,1}" => \$behavior,
'verbose|v:1' => \$verbose,
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Command/nopaste/Service.pm view on Meta::CPAN
my ($self, @files) = @_;
@files = @{ $self->files } unless @files;
my $content = do {
local $/;
local @ARGV = @files;
decode 'UTF-8', <>;
};
# Remove trailing newline as some sites won't do it for us
chomp $content;
view all matches for this distribution
view release on metacpan or search on metacpan
ok eval "require Mojolicious::Command::static; 1", "load Mojolicious::Command::static";
# Make sure @ARGV is not changed
{
local $ENV{MOJO_MODE};
local @ARGV = qw(-m production -x whatever);
require Mojolicious::Commands;
}
my $t = Test::Mojo->new;
my $commands = Mojolicious::Commands->new;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/AssetPack/Pipe/ElmLang.pm view on Meta::CPAN
push @args , $file->path->to_string;
$self->run(\@args, undef, undef);
my $js = do { local(@ARGV, $/) = $tmp; <> };
$asset->content($store->save(\$js, $attrs))->FROM_JSON($attrs);
}
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/iniweb.pm view on Meta::CPAN
sub import {
$ENV{PERL_MINIWEB_ROOT} //= '.';
$ENV{PERL_MINIWEB_DIR_INDEX} //= 'index.html:index.htm';
local @ARGV = 'daemon';
my %opts = (
root => $ENV{PERL_MINIWEB_ROOT},
dir_index => [ split ':', $ENV{PERL_MINIWEB_DIR_INDEX} ],
);
a->plugin( DirectoryServer => %opts )->start;
view all matches for this distribution
view release on metacpan or search on metacpan
xt/compat/commands.t view on Meta::CPAN
use File::Temp 'tempdir';
# Make sure @ARGV is not changed
{
local $ENV{MOJO_MODE};
local @ARGV = qw(-m production -x whatever);
require Mojolicious::Commands;
is $ENV{MOJO_MODE}, 'production', 'right mode';
is_deeply \@ARGV, [qw(-m production -x whatever)], 'unchanged';
}
xt/compat/commands.t view on Meta::CPAN
# Do not pick up options for detected environments
{
local $ENV{MOJO_MODE};
local $ENV{PLACK_ENV} = 'testing';
local @ARGV = qw(psgi -m production);
is ref Mojolicious::Commands->start_app('MojoliciousTest'), 'CODE',
'right reference';
is $ENV{MOJO_MODE}, undef, 'no mode';
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Util/Endpoint/endpoints.pm view on Meta::CPAN
# Run endpoints
sub run {
my $self = shift;
# Options
local @ARGV = @_;
my $c = $self->app->build_controller;
$c->app($self->app);
# Get endpoints
view all matches for this distribution
view release on metacpan or search on metacpan
t/mojo/util.t view on Meta::CPAN
getopt $array, 'h' => \my $flag, 'w|whatever=s' => \my $whatever;
ok $flag, 'flag has been set';
is $whatever, 'Whatever!', 'right string';
is_deeply $array, ['stuff'], 'right structure';
{
local @ARGV = ('--charset', 'UTF-16', 'test');
getopt 'c|charset=s' => \my @charset;
is_deeply \@charset, ['UTF-16'], 'right structure';
is_deeply \@ARGV, ['test'], 'right structure';
}
};
view all matches for this distribution
view release on metacpan or search on metacpan
$rv;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Monitoring/GLPlugin.pm view on Meta::CPAN
sub init {
my ($self) = @_;
if ($self->opts->can("blacklist") && $self->opts->blacklist &&
-f $self->opts->blacklist) {
$self->opts->blacklist = do {
local (@ARGV, $/) = $self->opts->blacklist; <> };
}
}
sub dumper {
my ($self, $object) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MooX/Cmd/Tester.pm view on Meta::CPAN
my ($stdout, $stderr, $merged, $ok) = _capture_merged
{
eval {
local $TEST_IN_PROGRESS = 1;
local @ARGV = @$argv;
my $tb = $CLASS->builder();
$cmd = ref $app ? $app : $app->new_with_cmd;
ref $app and $app = ref $app;
view all matches for this distribution
view release on metacpan or search on metacpan
t/testmxopt.pm view on Meta::CPAN
my @cfg_files = map { ("--config-files", File::Spec->catfile($cwd, qw(calc etc), $_)) }
qw(operands.json small-operands.json large-operands.json);
SCOPE:
{
local @ARGV = qw(--config-prefix calc-operands);
my $adder = oCalc::add->new_with_options;
ok(defined($adder->a), "read \"a\" from add config");
ok(defined($adder->b), "read \"b\" from add config");
cmp_ok($adder->execute, "==", 5, "read right adder config");
ok(Moo::Role::does_role($adder, "MooX::ConfigFromFile::Role"), "Applying MooX::ConfigFromFile::Role to oCalc::add");
}
SCOPE:
{
local @ARGV = qw(--config-prefix operands);
my $subber = oCalc::sub->new_with_options;
ok(defined($subber->a), "read \"a\" from sub config");
ok(defined($subber->b), "read \"b\" from sub config");
cmp_ok($subber->execute, "==", 17, "read right subber config");
ok(Moo::Role::does_role($subber, "MooX::ConfigFromFile::Role"), "Applying MooX::ConfigFromFile::Role to oCalc::sub");
}
SCOPE:
{
local @ARGV = @cfg_files[0 .. 1];
my $mul = oCalc::mul->new_with_options;
is($mul->a, 21,, "read \"a\" from mul config");
is($mul->b, 4, "read \"b\" from mul config");
cmp_ok($mul->execute, "==", 84, "read right mul config");
}
SCOPE:
{
local @ARGV = @cfg_files[2 .. 3];
my $mul = oCalc::mul->new_with_options;
is($mul->a, 21,, "keep \"a\" from first mul config");
is($mul->b, 4, "keep \"b\" from first mul config");
cmp_ok($mul->execute, "==", 84, "read right mul config");
}
SCOPE:
{
local @ARGV = @cfg_files[2 .. 3];
my $div = oCalc::div->new_with_options;
is($div->a, 30,, "read \"a\" from small div config");
is($div->b, 6, "read \"b\" from small div config");
cmp_ok($div->execute, "==", 5, "read right div config");
}
SCOPE:
{
local @ARGV = @cfg_files[4 .. 5];
my $div = oCalc::div->new_with_options;
is($div->a, 666,, "read \"a\" from large div config");
is($div->b, 222, "read \"b\" from large div config");
cmp_ok($div->execute, "==", 3, "read right div config");
}
view all matches for this distribution
view release on metacpan or search on metacpan
}
my $options_argv;
{
local @ARGV;
@ARGV = ( qw/
--opt
test_string
/ );
$options_argv = My::Test::Class->new_with_options;
is $options_argv->success, 1, 'Command works';
my $actions_argv;
dies_ok {
local @ARGV;
@ARGV = ( qw/
--opt
test_string
/ );
My::Test::Class->new_with_actions;
} 'Dies with no command';
{
local @ARGV;
@ARGV = ( qw/
test
--opt
test_string
/ );
is $actions_argv->success, 1, 'Command works';
my $new_with_argv;
{
local @ARGV;
@ARGV = ( qw/
test
/ );
$new_with_argv = My::Test::Class->new_with_actions( opt => 'test_string' );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MooX/Options/Role.pm view on Meta::CPAN
}
my ( $options, $has_to_split, $all_options )
= _options_prepare_descriptive( \%options_data );
local @ARGV = @ARGV if $options_config{protect_argv};
@ARGV = _options_fix_argv( \%options_data, $has_to_split, $all_options );
my @flavour;
if ( defined $options_config{flavour} ) {
push @flavour, { getopt_conf => $options_config{flavour} };
lib/MooX/Options/Role.pm view on Meta::CPAN
{
$usage = shift @messages;
}
$code = 0 if !defined $code;
if ( !$usage ) {
local @ARGV = ();
my %cmdline_params = $class->parse_options( help => $code );
$usage = $cmdline_params{help};
}
my $message = "";
$message .= join( "\n", @messages, '' ) if @messages;
lib/MooX/Options/Role.pm view on Meta::CPAN
sub options_help {
my ( $class, $code, $usage ) = @_;
$code = 0 if !defined $code;
if ( !defined $usage || !ref $usage ) {
local @ARGV = ();
my %cmdline_params = $class->parse_options( help => $code );
$usage = $cmdline_params{help};
}
my $message = $usage->option_help . "\n";
if ( $code > 0 ) {
lib/MooX/Options/Role.pm view on Meta::CPAN
sub options_short_usage {
my ( $class, $code, $usage ) = @_;
$code = 0 if !defined $code;
if ( !defined $usage || !ref $usage ) {
local @ARGV = ();
my %cmdline_params = $class->parse_options( help => $code );
$usage = $cmdline_params{help};
}
my $message = "USAGE: " . $usage->option_short_usage . "\n";
if ( $code > 0 ) {
lib/MooX/Options/Role.pm view on Meta::CPAN
=cut
sub options_man {
my ( $class, $usage, $output ) = @_;
local @ARGV = ();
if ( !$usage ) {
local @ARGV = ();
my %cmdline_params = $class->parse_options( man => 1 );
$usage = $cmdline_params{man};
}
use_module( "Path::Class", "0.32" );
view all matches for this distribution
view release on metacpan or search on metacpan
t/30-create_crypted_password.t view on Meta::CPAN
my $secret_file = catfile($tmp_dir, 'password.private');
note('Create crypted file');
{
local $ENV{PERL5LIB} = 'lib';
local @ARGV = (
'--file-name' => $secret_file,
'--cipher-key' => $cipher_key,
'--password' => $secret,
);
do "bin/create_crypted_password";
view all matches for this distribution
view release on metacpan or search on metacpan
$rv || 0;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MooseX/App/Cmd/Command.pm view on Meta::CPAN
isa => 'MooseX::App::Cmd',
);
override _process_args => sub {
my ($class, $args) = @_;
local @ARGV = @{$args};
my $config_from_file;
if ($class->meta->does_role('MooseX::ConfigFromFile')) {
local @ARGV = @ARGV;
my $configfile;
my $opt_parser;
{
## no critic (Modules::RequireExplicitInclusion)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MooseX/App/ParsedArgv.pm view on Meta::CPAN
my $option = $self->consume($type);
OR
my $option = $self->consume();
Returns the first option/parameter of the local @ARGV that has not yet been
consumed as a L<MooseX::App::ParsedArgv::Element> object.
=head2 elements
Returns all parsed options and parameters.
view all matches for this distribution