view release on metacpan or search on metacpan
lib/App/Gitc/Util.pm view on Meta::CPAN
my $staged = git "$arguments --cached";
my $changed = git $arguments;
return if not $staged and not $changed;
# the tree is dirty, verify whether to continue
warn "It looks like you have uncommitted changes. If this is expected,\n"
. "type 'y' to continue. If it's not expected, type 'n'.\n"
. ( $staged ? "staged:\n$staged\n" : '' )
. ( $changed ? "changed:\n$changed\n" : '' )
;
die "Aborting at the user's request.\n" if not confirm('Continue?');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GnuplotUtils.pm view on Meta::CPAN
my (@x, @y);
if ($args{dataset_datas}) {
my $dataset = [split $fieldsep_re, $args{dataset_datas}[$i]];
while (@$dataset) {
my $item = shift @$dataset;
warn "Not a number in --dataset-data: '$item'" unless Scalar::Util::looks_like_number($item);
push @x, $item;
warn "Odd number of numbers in --dataset-data" unless @$dataset;
$item = shift @$dataset;
warn "Not a number in --dataset-data: '$item'" unless Scalar::Util::looks_like_number($item);
push @y, $item;
}
} else {
my $filename = $args{dataset_files}[$i];
my $content = File::Slurper::Dash::read_text($filename);
lib/App/GnuplotUtils.pm view on Meta::CPAN
chomp $content;
my @numbers = split $fieldsep_re, $content;
warn "Odd number of numbers in dataset file '$filename'" unless @numbers % 2 == 0;
while (@numbers) {
my $item = shift @numbers;
warn "Not a number in dataset file '$filename': '$item'" unless Scalar::Util::looks_like_number($item);
push @x, $item;
$item = shift @numbers;
warn "Not a number in dataset file '$filename': '$item'" unless Scalar::Util::looks_like_number($item);
push @y, $item;
}
}
my $dataset = Chart::Gnuplot::DataSet->new(
view all matches for this distribution
view release on metacpan or search on metacpan
ok($goto->cmd() =~ m#log/FOO #, 'Got the right hostname-based command');
};
GET_EVERYTHING_RIGHT: {
my $goto = App::Goto->new({ config => $config, args => [qw/lo log/] });
is($goto->cmd(), "ssh 127.0.0.1 -t 'cd /var/log/ && bash'", 'Everything looks good');
};
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Gre.pm view on Meta::CPAN
You can specify the output style with the -y option:
-y1 groups output by filename, with each matching line prepended
with it's line number. This is the default.
-y2 looks like classic grep output. Each line looks like file:line:match.
-y3 just has the matching line. This is the default for piped input.
goes well with the -p option sometimes.
-k will disable color output.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Greple/stripe.pm view on Meta::CPAN
=cut
use List::Util qw(max pairmap first);
use Hash::Util qw(lock_keys);
use Scalar::Util;
*is_number = \&Scalar::Util::looks_like_number;
use Data::Dumper;
use Getopt::EX::Config qw(config set);
my $config = Getopt::EX::Config->new(
step => 2,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Greple/wordle/word_all.pm view on Meta::CPAN
looed
looey
loofa
loofs
looie
looks
looky
looms
loons
loony
loops
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Greple/select.pm view on Meta::CPAN
with extra conditional expression for B<find> command.
greple -Mdig foobar --dig . -name '*.p[lm]'
The problems is that the above command does not search perl command
script without suffixes. Next command looks for both files looking at
C<#!> (shebang) line.
greple -Mdig -Mselect --suffix=pl,pm --shebang perl foobar --dig .
Generic option B<--select-name>, B<--select-path> and B<--select-data>
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
bin/http_this view on Meta::CPAN
=back
=head2 CONFIGURATION FILE
The script can read configuration options from a file. By default, it
looks for a file named C<.http_thisrc> in the current directory or
your home directory. You can specify a different file with the C<--config>
option or by setting the C<HTTP_THIS_CONFIG> environment variable.
The config file consists of lines in the format C<key=value>. The valid
keys are:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/HTTP_Proxy_IMP/IMP.pm view on Meta::CPAN
# deflate
# according to RFC it should be zlib, but due to the encoding name
# often real deflate is used instead
# check magic bytes to decide
# lets see if it looks like a zlib header
# check for CM=8, CMID<=7 in first byte and valid FCHECK in
# seconds byte
return $more if length($buf)<2;
my $magic = unpack('C',substr($buf,0,1));
if (
( $magic & 0b1111 ) == 8 # CM = 8
and $magic >> 4 <= 7 # CMID <= 7
and unpack('n',substr($buf,0,2)) % 31 == 0 # valid FCHECK
) {
# looks like zlib header
$wb = +MAX_WBITS(); # see Compress::Raw::Zlib
} else {
# assume deflate
$wb = -MAX_WBITS(); # see Compress::Raw::Zlib
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/HomeBank2Ledger/Formatter/Beancount.pm view on Meta::CPAN
use v5.10.1; # defined-or
use warnings;
use strict;
use App::HomeBank2Ledger::Util qw(commify rtrim);
use Scalar::Util qw(looks_like_number);
use parent 'App::HomeBank2Ledger::Formatter';
our $VERSION = '0.010'; # VERSION
lib/App/HomeBank2Ledger/Formatter/Beancount.pm view on Meta::CPAN
$out[-1] .= ' '.join(' ', @tags);
}
my $metadata = $transaction->{metadata} || {};
for my $key (sort keys %$metadata) {
my $value = looks_like_number($metadata->{$key}) ? $metadata->{$key}
: $self->_format_string($metadata->{$key});
push @out, " ; ${key}: ${value}";
}
for my $posting (@postings) {
lib/App/HomeBank2Ledger/Formatter/Beancount.pm view on Meta::CPAN
push @out, join('', @line);
my $metadata = $posting->{metadata} || {};
for my $key (sort keys %$metadata) {
my $value = looks_like_number($metadata->{$key}) ? $metadata->{$key}
: $self->_format_string($metadata->{$key});
push @out, " ; ${key}: ${value}";
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ImageMagickUtils.pm view on Meta::CPAN
'summary.alt.bool.not' => 'Do not skip previously downsized images',
schema => 'bool*',
default => 1,
description => <<'_',
By default, when given a filename that looks like it's already downsized, e.g.
`foo.1024-q40.jpg` or `foo.q40.jpg`, will skip downsizing. The
`--no-skip-downsized` option will process such filenames nevertheless.
_
},
lib/App/ImageMagickUtils.pm view on Meta::CPAN
}
if ($skip_whatsapp) {
require Regexp::Pattern::Filename::Image::WhatsApp;
if ($file =~ $Regexp::Pattern::Filename::Image::WhatsApp::RE{filename_image_whatsapp}{pat}) {
log_info "Filename '%s' looks like a WhatsApp image, skip downsizing due to --skip-whatsapp option is in effect", $file;
next FILE;
}
}
if ($skip_downsized) {
if ($file =~ /\.(?:\d+p?-)?q(?:\d{1,3})\.\w+\z/) {
log_info "Filename '%s' looks like it's already downsized, skip downsizing due to --skip-downsized option is in effect", $file;
next FILE;
}
}
my $q = $args{quality} // 40;
lib/App/ImageMagickUtils.pm view on Meta::CPAN
=item * B<skip_downsized> => I<bool> (default: 1)
Skip previously downsized images.
By default, when given a filename that looks like it's already downsized, e.g.
C<foo.1024-q40.jpg> or C<foo.q40.jpg>, will skip downsizing. The
C<--no-skip-downsized> option will process such filenames nevertheless.
=item * B<skip_whatsapp> => I<bool> (default: 1)
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Info.pm view on Meta::CPAN
every time, as C<unknown()> will return the same value every time it is called
(as, indeed, should C<_find_version()>. But by checking for the C<version> key
in C<$self> ourselves, we save some of the overhead.
But as I said before, every meta data method should make use of the
C<unknown()> method. Thus, the C<major()> method might looks something like
this:
sub major {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
bin/iniedit view on Meta::CPAN
Whereas in other documentation of INI files the naming convention is:
[section] key=value
Your typical C<.ini> file looks like this:
; A comment
[firstkey]
field=value ; More comments
foo=bar
view all matches for this distribution
view release on metacpan or search on metacpan
cases.
In those configurations, where you would need the graph to comprehend
the rules, the resulting graph would be a mess.
When the graph looks neat and is legible on A4 paper, you would probably
understand the configuration without it. But it could be handy to
explain the rules to someone else, following them with a pencil or your
finger.
You would do this to get a detailed graph:
view all matches for this distribution
view release on metacpan or search on metacpan
This module installs a command-line tool called jyj.
It reads stdin.
If it looks like JSON, it prints the YAML dump of the JSON decoding.
If it looks like YAML, it prints the JSON encoding of the YAML load.
That's it.
Author
view all matches for this distribution
view release on metacpan or search on metacpan
=head1 CONFIGURATION
You can save your configuration into C<~/.jenkins-cli.yml> so that you don't
have to enter them each time. The following is an example of what the file
looks like:
---
base_url: http://localhost:8080/
username: admin
password: my-secrent-password
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/JobLog/Log.pm view on Meta::CPAN
the portion of all logged notes falling within this interval. These
portions are represented as L<App::JobLog::Log::Note> objects.
=head2 find_previous
C<find_previous> looks for the logged event previous to a given
moment, returning the L<App::JobLog::Log::Event> objects and the
appropriate log line number, or the empty list if no such
event exists. It expects a L<DateTime> object as its parameter.
=head2 find_previous
C<find_previous> looks for the logged event previous to a given
moment, returning the L<App::JobLog::Log::Event> objects and the
appropriate log line number, or the empty list if no such
event exists. It expects a L<DateTime> object as its parameter.
=head2 append_event
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/KGB/Client/Git.pm view on Meta::CPAN
}
sub _describe_ref {
my( $self, $new ) = @_;
# raw commit looks like this:
#commit cc746cf3f6b8937c059cf6311a8903dba9936749
#tree 76bcae9bdbcfab304c8265d2c2cc245048c9f0f3
#parent 7e99c8b051169e43189c822c8db77bcad5956734
#author Damyan Ivanov <dmn@debian.org> 1257538837 +0200
#committer Damyan Ivanov <dmn@debian.org> 1257538837 +0200
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
kritika.fatpack view on Meta::CPAN
As this callback gets called less often then the C<filter_json_object>
one, decoding speed will not usually suffer as much. Therefore, single-key
objects make excellent targets to serialise Perl objects into, especially
as single-key JSON objects are as close to the type-tagged value concept
as JSON gets (it's basically an ID/VALUE tuple). Of course, JSON does not
support this in any way, so you need to make sure your data never looks
like a serialised Perl hash.
Typical names for the single object key are C<__class_whatever__>, or
C<$__dollars_are_rarely_used__$> or C<}ugly_brace_placement>, or even
things like C<__class_md5sum(classname)__>, to reduce the risk of clashing
kritika.fatpack view on Meta::CPAN
}
sub get_$name {
\$_[0]->{PROPS}->[$property_id] ? 1 : '';
}
/}}my$JSON;sub encode_json ($) {($JSON ||= __PACKAGE__->new->utf8)->encode(@_)}sub decode_json {($JSON ||= __PACKAGE__->new->utf8)->decode(@_)}sub to_json($) {Carp::croak ("JSON::PP::to_json has been renamed to encode_json.")}sub from_json(...
[\x00-\x7F]
|[\xC2-\xDF][\x80-\xBF]
|[\xE0][\xA0-\xBF][\x80-\xBF]
|[\xE1-\xEC][\x80-\xBF][\x80-\xBF]
|[\xED][\x80-\x9F][\x80-\xBF]
view all matches for this distribution