view release on metacpan or search on metacpan
lib/Benchmark/Featureset/ParamCheck.pm view on Meta::CPAN
L<Specio>,
L<Type::Tiny>,
L<Type::Nano>.
B<< Other tested libraries: >>
L<Ref::Util::XS>.
=head1 AUTHOR
Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
view all matches for this distribution
view release on metacpan or search on metacpan
t/00_use_ok.t view on Meta::CPAN
use Test::Most;
use strict;
use warnings;
use Ref::Util qw/is_coderef/;
# we could check that we actually add the callbacks ? that is what `use` is
# suposed to do, we opught to test that here!!
#
view all matches for this distribution
view release on metacpan or search on metacpan
},
"test" : {
"requires" : {
"CGI::Application" : "0",
"LWP::UserAgent" : "6.42",
"Ref::Util" : "0",
"Test::MockObject" : "0",
"Test::Most" : "0",
"Test::OpenTracing::Integration" : "v0.102.0",
"Test::WWW::Mechanize::CGIApp" : "0"
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CLI/Helpers.pm view on Meta::CPAN
use Capture::Tiny qw(capture);
use File::Basename;
use Getopt::Long qw(GetOptionsFromArray :config pass_through);
use IO::Interactive qw( is_interactive );
use Module::Load qw(load);
use Ref::Util qw(is_ref is_arrayref is_hashref);
use Sys::Syslog qw(:standard);
use Term::ANSIColor 2.01 qw(color colored colorstrip);
use Term::ReadKey;
use Term::ReadLine;
use YAML;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CSS/Simple.pm view on Meta::CPAN
use Carp;
use Tie::IxHash;
use Storable qw(dclone);
use Ref::Util qw(is_plain_arrayref is_plain_hashref);
=pod
=head1 NAME
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CXC/Astro/Regions/CFITSIO/Variant.pm view on Meta::CPAN
use experimental 'signatures', 'postderef';
our $VERSION = '0.03';
use Module::Runtime 'module_notional_filename';
use Ref::Util qw( is_arrayref );
use Package::Variant
importing => [ 'Moo', 'MooX::StrictConstructor' ],
subs => [qw( has extends around with )];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CXC/DB/DDL/Field/Pg.pm view on Meta::CPAN
use v5.26;
our $VERSION = '0.16';
use experimental 'signatures';
use Scalar::Util ();
use Ref::Util ();
package ## no critic (Modules::ProhibitMultiplePackages)
CXC::DB::DDL::Field::PgType {
use base 'CXC::DB::DDL::FieldType';
lib/CXC/DB/DDL/Field/Pg.pm view on Meta::CPAN
'SQL_TYPE_NAMES',
'SQL_TYPE_VALUES';
use Types::Standard 'ArrayRef', 'Enum', 'Int', 'InstanceOf';
use constant DataType => Enum->of( grep { !Ref::Util::is_ref $_ } SQL_TYPE_VALUES )
| InstanceOf ['CXC::DB::DDL::Field::PgType'];
use Moo;
use namespace::clean;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CXC/DB/DDL.pm view on Meta::CPAN
use Scalar::Util qw( blessed );
use Hash::Ordered;
use SQL::Translator::Schema;
use SQL::Translator::Schema::Table;
use Ref::Util qw( is_hashref is_arrayref );
use CXC::DB::DDL::Util 'sqlt_entity_map', 'db_version';
use CXC::DB::DDL::Failure;
use CXC::DB::DDL::Table;
use CXC::DB::DDL::Constants '-all';
use Type::Params qw( signature_for );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CXC/Data/Visitor.pm view on Meta::CPAN
use base 'Exporter::Tiny';
use Hash::Util 'lock_hash', 'unlock_hash', 'unlock_value';
use POSIX 'floor';
use Scalar::Util 'refaddr', 'looks_like_number';
use Ref::Util 'is_plain_arrayref', 'is_plain_hashref', 'is_coderef', 'is_plain_ref',
'is_plain_refref';
use Feature::Compat::Defer;
use constant {
CYCLE_DIE => 'die',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CXC/Form/Tiny/Plugin/OptArgs2/Meta.pm view on Meta::CPAN
our $VERSION = '0.12';
use Clone ();
use Scalar::Util qw( blessed );
use Ref::Util qw( is_plain_hashref is_arrayref is_regexpref is_ref );
use Form::Tiny::Utils 'get_package_form_meta';
use Types::Standard
qw( ArrayRef Bool CodeRef Dict Enum Int Optional RegexpRef Str Tuple Undef Value );
use Type::Params qw( signature_for );
use Types::Common::String qw ( NonEmptySimpleStr NonEmptyStr );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CXC/Number/Grid.pm view on Meta::CPAN
use POSIX ();
use Types::Standard qw( ArrayRef Bool Dict Enum HashRef InstanceOf Optional Slurpy );
use Type::Params qw( signature signature_for );
use Ref::Util qw( is_plain_hashref is_blessed_ref );
use List::Util qw( uniqnum );
use CXC::Number::Grid::Types -types;
use CXC::Number::Grid::Failure qw( parameter_interface parameter_constraint internal );
lib/CXC/Number/Grid.pm view on Meta::CPAN
require Carp;
goto \&Carp::croak;
}
sub _convert ( $self, $bignum ) {
require Ref::Util;
return Ref::Util::is_plain_arrayref( $bignum )
? [ map { $_->numify } $bignum->@* ]
: $bignum->numify;
}
view all matches for this distribution
view release on metacpan or search on metacpan
benchmark/simple.pl view on Meta::CPAN
use Benchmark qw(:all);
use Cache::FastMmap;
use Cache::LRU;
use Cache::Ref::LRU;
use Cache::Ref::Util::LRU::Array;
use Cache::Ref::Util::LRU::List;
use Tie::Cache::LRU;
my $size = 1024;
my $loop = 1000;
benchmark/simple.pl view on Meta::CPAN
},
'Cache::Ref::LRU (Array)' => sub {
cache_hit(
Cache::Ref::LRU->new(
size => $size,
lru_class => qw(Cache::Ref::Util::LRU::Array),
),
);
},
'Cache::Ref::LRU (List)' => sub {
cache_hit(
Cache::Ref::LRU->new(
size => $size,
lru_class => qw(Cache::Ref::Util::LRU::List),
),
);
},
'Tie::Cache::LRU' => sub {
tie my %cache, 'Tie::Cache::LRU', $size;
benchmark/simple.pl view on Meta::CPAN
# too slow
#'Cache::Ref::LRU (Array)' => sub {
# cache_set(
# Cache::Ref::LRU->new(
# size => $size,
# lru_class => qw(Cache::Ref::Util::LRU::Array),
# ),
# );
#},
'Cache::Ref::LRU (List)' => sub {
cache_set(
Cache::Ref::LRU->new(
size => $size,
lru_class => qw(Cache::Ref::Util::LRU::List),
),
);
},
'Tie::Cache::LRU' => sub {
tie my %cache, 'Tie::Cache::LRU', $size;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Ref.pm view on Meta::CPAN
provided for trading off memory for speed).
Long term utility of cache entries is not considered at all, so scans will
poison the cache.
=head3 Cache::Ref::Util::LRU::List
Uses a doubly linked list to perform MRU propagation.
Faster than Array.
Cache hits and LRU removal is O(1).
=head3 Cache::Ref::Util::LRU::Array
Generally slower for a cache size bigger than about 10 elements, but uses less memory due to the compact layout.
Cache hits are O(cache size). LRU removal is O(1).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cassandra/Client.pm view on Meta::CPAN
use Clone 0.36 qw/clone/;
use List::Util qw/shuffle/;
use AnyEvent::XSPromises qw/deferred/;
use Time::HiRes ();
use Ref::Util 0.008 qw/is_ref/;
use Devel::GlobalDestruction 0.11;
use XSLoader;
our $XS_VERSION = ($Cassandra::Client::VERSION || '');
$XS_VERSION =~ s/\A(\d+)\.(\d+)(\d{3})\z/$1.$2_$3/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Plugin/DetachIfNotModified.pm view on Meta::CPAN
use Moose::Role;
use HTTP::Headers 5.18;
use HTTP::Status qw/ HTTP_NOT_MODIFIED /;
use List::Util qw/ max /;
use Ref::Util qw/ is_blessed_ref /;
# RECOMMEND PREREQ: Plack::Middleware::ConditionalGET
# RECOMMEND PREREQ: Ref::Util::XS
use namespace::autoclean;
our $VERSION = 'v0.3.1';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Plugin/Statsd.pm view on Meta::CPAN
use v5.20;
use Moose::Role;
use POSIX qw/ ceil /;
use Ref::Util qw/ is_plain_arrayref /;
use experimental qw/ signatures /;
# RECOMMEND PREREQ: Ref::Util::XS
use namespace::autoclean;
requires qw/ log_stats /;
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
Module::Build 0.28
Module::Info 0
Moo 1.004006
Parser::MGC 0.15
Path::Tiny 0
Ref::Util 0.020
Sub::Exporter 0.982
Sub::Quote 0
Text::CSV 1.21
Text::Hogan::Compiler 1.02
Throwable 0.200004
cpanfile.snapshot view on Meta::CPAN
strict 0
warnings 0
Ref-Util-0.113
pathname: X/XS/XSAWYERX/Ref-Util-0.113.tar.gz
provides:
Ref::Util 0.113
requirements:
Exporter 5.57
ExtUtils::MakeMaker 0
Test::More 0
perl 5.006002
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
Module::Build 0.28
Module::Info 0
Moo 1.004006
MooX::Aliases 0.001006
MooX::Role::Logger 0.005
Ref::Util 0.020
Sub::Exporter 0.982
Sub::Quote 0
Text::CSV 1.21
Text::Hogan::Compiler 1.02
Throwable 0.200004
cpanfile.snapshot view on Meta::CPAN
Test::More 0
URI 1.64
Ref-Util-0.020
pathname: X/XS/XSAWYERX/Ref-Util-0.020.tar.gz
provides:
Ref::Util 0.020
requirements:
Exporter 5.57
ExtUtils::MakeMaker 0
Test::More 0
Role-Tiny-2.000003
view all matches for this distribution
view release on metacpan or search on metacpan
- fix type check bug
1.01 2016-05-10 13:03:58 CEST
- configurable prefixes for internal store data keys (_id, _version, ...)
- fix file or inline fix preprocessing with moustache templates
- faster type tests with Ref::Util
- is_true and is_false fix conditions have a new strict mode
- new is_array, is_object, is_string, is_number and is_null fix conditions
- new Importer http_timing and http_retry options
- better info command
- switch to Cpanel::JSON::XS
- more and better pod
- more tests
1.0002_03 2016-04-28 10:00:55 CEST
- fix file or inline fix preprocessing with moustache templates
- faster type tests with Ref::Util
- is_true and is_false fix conditions have a new strict mode
- new is_array, is_object, is_string, is_number and is_null fix conditions
- new Importer http_timing and http_retry options
- better info command
- switch to Cpanel::JSON::XS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chart/Bokeh.pm view on Meta::CPAN
use JSON;
use Params::Validate qw(:all);
use Text::Template;
use Module::Load;
use Ref::Util;
use HTML::Show;
our $VERSION = '0.001'; # VERSION
# ABSTRACT: Generate html/javascript charts from perl data using javascript library BokehJS
lib/Chart/Bokeh.pm view on Meta::CPAN
my %params = @_;
my $data = $params{'data'};
my $chart_id = 'bokeh_graph';
my $html;
if ( Ref::Util::is_blessed_ref($data) && $data->isa('Chart::Bokeh::Plot') ) {
$html = _render_html_wrap( $data->html( div_id => $chart_id ) );
} else {
$html = _render_html_wrap( _render_cell( _process_data($data), $chart_id ) );
}
return $html;
lib/Chart/Bokeh.pm view on Meta::CPAN
my $rendered_cells = "";
my $numeric_id = 0;
for my $data (@data_to_plot) {
my $id = 'chart_' . $numeric_id++;
if ( Ref::Util::is_blessed_ref($data) && $data->isa('Chart::Bokeh::Plot') ) {
$rendered_cells .= $data->html( div_id => $id );
} else {
$rendered_cells .= _render_cell( _process_data($data), $id );
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chart/Dygraphs.pm view on Meta::CPAN
use JSON;
use Params::Validate qw(:all);
use Text::Template;
use HTML::Show;
use Ref::Util;
our $VERSION = '0.007'; # VERSION
# ABSTRACT: Generate html/javascript charts from perl data using javascript library Dygraphs
lib/Chart/Dygraphs.pm view on Meta::CPAN
}
sub _transform_data {
my $data = shift;
my $string_data = "";
if ( Ref::Util::is_plain_arrayref($data) ) {
$string_data .= "[" . ( join( ',', map { _transform_data($_) } @$data ) ) . "]";
} elsif ( Ref::Util::is_plain_hashref($data) ) {
return "not supported";
} elsif ( Ref::Util::is_blessed_ref($data) && $data->isa('DateTime') ) {
return 'new Date("' . $data . '")';
} else {
return $data;
}
return $string_data;
lib/Chart/Dygraphs.pm view on Meta::CPAN
sub _process_data_and_options {
my $data = shift();
my $options = shift();
my $json_formatter = JSON->new->utf8;
local *PDL::TO_JSON = sub { $_[0]->unpdl };
if ( Ref::Util::is_blessed_ref($data) ) {
my $adapter_name = 'Chart::Dygraphs::Adapter::' . ref $data;
eval {
load $adapter_name;
my $adapter = $adapter_name->new( data => $data );
$data = $adapter->series();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chart/GGPlot/Geom/Boxplot.pm view on Meta::CPAN
:$notch=false, :$notchwidth=0.25,
:$varwidth=false, :$na_rm=false,
:$show_legend=undef, :$inherit_aes=true,
%rest )
{
if ( not Ref::Util::is_ref($position) ) {
if ($varwidth) {
$position = position_dodge2( preserve => 'single' );
}
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chart/Plotly.pm view on Meta::CPAN
use JSON;
use Params::Validate qw(:all);
use Text::Template;
use Module::Load;
use Ref::Util;
use HTML::Show;
use UUID::Tiny ':std';
use File::ShareDir;
use Path::Tiny;
lib/Chart/Plotly.pm view on Meta::CPAN
## use critic
my $data = $params{'data'};
my $chart_id = create_uuid_as_string(UUID_TIME);
my $html;
if ( Ref::Util::is_blessed_ref($data) && $data->isa('Chart::Plotly::Plot') ) {
$html = _render_html_wrap( $data->html( div_id => $chart_id ) );
} else {
$html = _render_html_wrap( _render_cell( _process_data($data), $chart_id ) );
}
return $html;
lib/Chart/Plotly.pm view on Meta::CPAN
sub _process_data {
my $data = shift;
my $json_formatter = JSON->new->allow_blessed(1)->convert_blessed(1);
local *PDL::TO_JSON = sub { $_[0]->unpdl };
if ( Ref::Util::is_blessed_ref($data) ) {
my $adapter_name = 'Chart::Plotly::Adapter::' . ref $data;
eval {
load $adapter_name;
my $adapter = $adapter_name->new( data => $data );
$data = $adapter->traces();
lib/Chart/Plotly.pm view on Meta::CPAN
my @data_to_plot = @_;
my $rendered_cells = "";
for my $data (@data_to_plot) {
my $id = create_uuid_as_string(UUID_TIME);
if ( Ref::Util::is_blessed_ref($data) && $data->isa('Chart::Plotly::Plot') ) {
$rendered_cells .= $data->html( div_id => $id );
} else {
$rendered_cells .= _render_cell( _process_data($data), $id );
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Clang/CastXML.pm view on Meta::CPAN
package Clang::CastXML;
use Moo;
use 5.022;
use experimental qw( signatures );
use Ref::Util qw( is_blessed_ref is_ref );
use Clang::CastXML::Container;
use Path::Tiny ();
use Clang::CastXML::Exception::UsageException;
use Clang::CastXML::Exception::ProcessException::IntrospectException;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Class/XSConstructor.pm view on Meta::CPAN
our $AUTHORITY = 'cpan:TOBYINK';
our $VERSION = '0.009';
use Exporter::Tiny 1.000000 qw( mkopt );
use Ref::Util 0.100 qw( is_plain_arrayref is_plain_hashref is_blessed_ref is_coderef );
use List::Util 1.45 qw( uniq );
sub import {
my $class = shift;
my $caller = our($SETUP_FOR) || caller;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/AWS.pm view on Meta::CPAN
use strict;
use warnings;
use Carp ();
use Ref::Util;
use Scalar::Util;
use Exporter::Shiny qw(
read
read_all
list_profiles
lib/Config/AWS.pm view on Meta::CPAN
my $input = shift // do {
my $cred_file = credentials_file();
-r $cred_file ? $cred_file : config_file();
};
unless ( Ref::Util::is_ref $input ) {
require Path::Tiny;
my @lines = eval { Path::Tiny::path( $input )->lines };
if ($@) {
Carp::croak "Cannot read from $input: $@->{err}"
if ref $@ && $@->isa('Path::Tiny::Error');
lib/Config/AWS.pm view on Meta::CPAN
return \@lines;
}
return [ $input->getlines ] if Scalar::Util::openhandle $input;
if ( Ref::Util::is_blessed_ref $input ) {
return [ $input->slurp ] if $input->isa('Path::Class::File');
return [ $input->lines ] if $input->isa('Path::Tiny');
Carp::croak 'Cannot read from objects of type ', ref $input;
}
return [ split /\R/, $$input ] if Ref::Util::is_scalarref $input;
return $input if Ref::Util::is_arrayref $input;
Carp::croak "Could not use $input as source for ", (caller 1)[3];
};
my $read = sub {
lib/Config/AWS.pm view on Meta::CPAN
# Methods for compatibility with Config::INI interface
sub read_file {
Carp::croak 'Filename is missing' unless @_;
Carp::croak 'Argument was not a string' if Ref::Util::is_ref $_[0];
$read->( $prepare->(shift), @_ );
}
sub read_string {
Carp::croak 'String is missing' unless @_;
Carp::croak 'Argument was not a string' if Ref::Util::is_ref $_[0];
$read->( [ split /\R/, shift // '' ], @_ );
}
sub read_handle {
Carp::croak 'Handle is missing' unless @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Files/Simple.pm view on Meta::CPAN
private hashref checking sub
=cut
sub _check_hashref {
require Ref::Util;
return $_[0] if ( Ref::Util::is_hashref( $_[0] ) );
require Carp;
Carp::cluck('config data must be a hashref');
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/XrmDatabase.pm view on Meta::CPAN
use Config::XrmDatabase::Failure ':all';
use Config::XrmDatabase::Util ':all';
use Config::XrmDatabase::Types -all;
use Types::Standard qw( Object Str Optional HashRef );
use Type::Params qw( compile_named );
use Ref::Util;
use Moo;
use namespace::clean;
lib/Config/XrmDatabase.pm view on Meta::CPAN
my @qargs = ( $class, $name, $return_all, $match );
my $retval = $self->_query( $self->_db, 0, \@qargs );
if ( ! defined $retval ) {
return $opt{on_failure}->( $name, $class )
if Ref::Util::is_coderef( $opt{on_failure} );
query_failure->throw(
"unable to match name: '@{[ name_arr_to_str($name) ]} '; class : '@{[ name_arr_to_str($class) ]}'" )
if $opt{on_failure} eq QUERY_ON_FAILURE_THROW;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Const/Exporter.pm view on Meta::CPAN
use Carp;
use Const::Fast;
use Exporter 5.57 ();
use List::Util 1.56 qw/ pairs mesh /;
use Package::Stash;
use Ref::Util qw/ is_blessed_ref is_arrayref is_coderef is_hashref is_ref /;
# RECOMMEND PREREQ: List::SomeUtils::XS
# RECOMMEND PREREQ: Package::Stash::XS
# RECOMMEND PREREQ: Ref::Util::XS
# RECOMMEND PREREQ: Storable 3.05
sub import {
my $pkg = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Const/Introspect/C.pm view on Meta::CPAN
package Const::Introspect::C;
use Moo;
use 5.020;
use experimental qw( signatures postderef );
use Ref::Util qw( is_plain_arrayref );
use Config;
use Text::ParseWords ();
use Path::Tiny ();
use Capture::Tiny qw( capture capture_merged );
use Const::Introspect::C::Constant;
view all matches for this distribution