Acme-Perl-Consensual

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

	$class =~ s/^\Q$args{prefix}\E:://;
	$args{name}     ||= $class;
	$args{version}  ||= $class->VERSION;
	unless ( $args{path} ) {
		$args{path}  = $args{name};
		$args{path}  =~ s!::!/!g;
	}
	$args{file}     ||= "$args{base}/$args{prefix}/$args{path}.pm";
	$args{wrote}      = 0;

	bless( \%args, $class );
}

sub call {
	my ($self, $method) = @_;
	my $obj = $self->load($method) or return;
        splice(@_, 0, 2, $obj);
	goto &{$obj->can($method)};
}

sub load {

inc/Module/Install/Base.pm  view on Meta::CPAN

#line 42

sub new {
	my $class = shift;
	unless ( defined &{"${class}::call"} ) {
		*{"${class}::call"} = sub { shift->_top->call(@_) };
	}
	unless ( defined &{"${class}::load"} ) {
		*{"${class}::load"} = sub { shift->_top->load(@_) };
	}
	bless { @_ }, $class;
}

#line 61

sub AUTOLOAD {
	local $@;
	my $func = eval { shift->_top->autoload } or return;
	goto &$func;
}

inc/Module/Install/Base.pm  view on Meta::CPAN

package Module::Install::Base::FakeAdmin;

use vars qw{$VERSION};
BEGIN {
	$VERSION = $Module::Install::Base::VERSION;
}

my $fake;

sub new {
	$fake ||= bless(\@_, $_[0]);
}

sub AUTOLOAD {}

sub DESTROY {}

# Restore warning handler
BEGIN {
	$SIG{__WARN__} = $SIG{__WARN__}->();
}

inc/Module/Install/Metadata.pm  view on Meta::CPAN

	$self->version( ExtUtils::MM_Unix->parse_version($file) );

	# for version integrity check
	$self->makemaker_args( VERSION_FROM => $file );
}

sub abstract_from {
	require ExtUtils::MM_Unix;
	my ( $self, $file ) = @_;
	$self->abstract(
		bless(
			{ DISTNAME => $self->name },
			'ExtUtils::MM_Unix'
		)->parse_abstract($file)
	);
}

# Add both distribution and module name
sub name_from {
	my ($self, $file) = @_;
	if (

inc/Module/Install/Package.pm  view on Meta::CPAN

    my $self = shift;
    return if $WriteAll++;
    $self->WriteAll(@_);
}

# Base package for Module::Package plugin distributed components.
package Module::Package::Dist;

sub new {
    my ($class, %args) = @_;
    bless \%args, $class;
}

sub mi {
    @_ > 1 ? ($_[0]->{mi}=$_[1]) : $_[0]->{mi};
}

sub _initial {
    my ($self) = @_;
}

inc/Module/Install/Package.pm  view on Meta::CPAN

        }, 'lib');
        shift @array while @array and not defined $array[0];
        die "Can't guess main module" unless @array;
        (($pm) = sort @{$array[0]}) or
            die "Can't guess main module";
    }
    my $pmc = $pm . 'c';
    $pm = $pmc if -e $pmc;
    $self->set($pm);
}
$main::PM = bless [$main::PM ? ($main::PM) : ()], __PACKAGE__;

package Module::Package::POD;
use overload '""' => sub {
    return $_[0]->[0] if @{$_[0]};
    (my $pod = "$main::PM") =~ s/\.pm/.pod/
        or die "Module::Package's \$main::PM value should end in '.pm'";
    return -e $pod ? $pod : '';
};
sub set { $_[0][0] = $_[1] }
$main::POD = bless [$main::POD ? ($main::POD) : ()], __PACKAGE__;

1;

inc/YAML/Tiny.pm  view on Meta::CPAN





#####################################################################
# Implementation

# Create an empty YAML::Tiny object
sub new {
	my $class = shift;
	bless [ @_ ], $class;
}

# Create an object from a file
sub read {
	my $class = ref $_[0] ? ref shift : shift;

	# Check the file
	my $file = shift or return $class->_error( 'You did not specify a file name' );
	return $class->_error( "File '$file' does not exist" )              unless -e $file;
	return $class->_error( "'$file' is a directory, not a file" )       unless -f _;

inc/YAML/Tiny.pm  view on Meta::CPAN

	unless ( close(CFG) ) {
		return $class->_error("Failed to close file '$file': $!");
	}

	$class->read_string( $contents );
}

# Create an object from a string
sub read_string {
	my $class  = ref $_[0] ? ref shift : shift;
	my $self   = bless [], $class;
	my $string = $_[0];
	eval {
		unless ( defined $string ) {
			die \"Did not provide a string to load";
		}

		# Byte order marks
		# NOTE: Keeping this here to educate maintainers
		# my %BOM = (
		#     "\357\273\277" => 'UTF-8',

inc/YAML/Tiny.pm  view on Meta::CPAN

	eval {
		require Scalar::Util;
	};
	my $v = eval("$Scalar::Util::VERSION") || 0;
	if ( $@ or $v < 1.18 ) {
		eval <<'END_PERL';
# Scalar::Util failed to load or too old
sub refaddr {
	my $pkg = ref($_[0]) or return undef;
	if ( !! UNIVERSAL::can($_[0], 'can') ) {
		bless $_[0], 'Scalar::Util::Fake';
	} else {
		$pkg = undef;
	}
	"$_[0]" =~ /0x(\w+)/;
	my $i = do { local $^W; hex $1 };
	bless $_[0], $pkg if defined $pkg;
	$i;
}
END_PERL
	} else {
		*refaddr = *Scalar::Util::refaddr;
	}
}

1;

lib/Acme/Perl/Consensual.pm  view on Meta::CPAN


my %perlhist;

sub new
{
	my ($class, %args) = @_;
	$args{locale} = $ENV{LC_ALL} || $ENV{LC_LEGAL} || 'en_XX.UTF-8'
		unless exists $args{locale};
	$args{locale} = $1
		if $args{locale} =~ /^.._(.+?)(\.|$)/;
	bless \%args => $class;
}

sub locale
{
	lc shift->{locale};
}

sub can
{
	if (@_ == 2 and not ref $_[1])



( run in 0.388 second using v1.01-cache-2.11-cpan-de7293f3b23 )