Acme-FizzBuzz
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
BEGIN {
# All Module::Install core packages now require synchronised versions.
# This will be used to ensure we don't accidentally load old or
# different versions of modules.
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
$VERSION = '1.00';
# Storage for the pseudo-singleton
$MAIN = undef;
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
}
sub import {
my $class = shift;
my $self = $class->new(@_);
my $who = $self->_caller;
inc/Module/Install.pm view on Meta::CPAN
}
# Cloned from Params::Util::_CLASS
sub _CLASS ($) {
(
defined $_[0]
and
! ref $_[0]
and
$_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s
) ? $_[0] : undef;
}
1;
# Copyright 2008 - 2010 Adam Kennedy.
inc/Module/Install/Makefile.pm view on Meta::CPAN
foreach my $bundle (@{ $self->bundles }) {
my ($mod_name, $dist_dir) = @$bundle;
delete $prereq->{$mod_name};
$dist_dir = File::Basename::basename($dist_dir); # dir for building this module
if (not exists $processed{$dist_dir}) {
if (-d $dist_dir) {
# List as sub-directory to be processed by make
push @$subdirs, $dist_dir;
}
# Else do nothing: the module is already present on the system
$processed{$dist_dir} = undef;
}
}
}
unless ( $self->makemaker('6.55_03') ) {
%$prereq = (%$prereq,%$build_prereq);
delete $args->{BUILD_REQUIRES};
}
if ( my $perl_version = $self->perl_version ) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
lgpl => 'http://opensource.org/licenses/lgpl-license.php',
lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
bsd => 'http://opensource.org/licenses/bsd-license.php',
gpl => 'http://opensource.org/licenses/gpl-license.php',
gpl2 => 'http://opensource.org/licenses/gpl-2.0.php',
gpl3 => 'http://opensource.org/licenses/gpl-3.0.html',
mit => 'http://opensource.org/licenses/mit-license.php',
mozilla => 'http://opensource.org/licenses/mozilla1.1.php',
open_source => undef,
unrestricted => undef,
restrictive => undef,
unknown => undef,
);
sub license {
my $self = shift;
return $self->{values}->{license} unless @_;
my $license = shift or die(
'Did not provide a value to license()'
);
$license = __extract_license($license) || lc $license;
$self->{values}->{license} = $license;
inc/Module/Install/Metadata.pm view on Meta::CPAN
Module::Install::_write(
'MYMETA.json',
JSON->new->pretty(1)->canonical->encode($meta),
);
}
sub _write_mymeta_data {
my $self = shift;
# If there's no existing META.yml there is nothing we can do
return undef unless -f 'META.yml';
# We need Parse::CPAN::Meta to load the file
unless ( eval { require Parse::CPAN::Meta; 1; } ) {
return undef;
}
# Merge the perl version into the dependencies
my $val = $self->Meta->{values};
my $perl = delete $val->{perl_version};
if ( $perl ) {
$val->{requires} ||= [];
my $requires = $val->{requires};
# Canonize to three-dot version after Perl 5.6
inc/Pod/Markdown.pm view on Meta::CPAN
$self->_private;
$self;
}
sub _private {
my $self = shift;
$self->{_MyParser} ||= {
Text => [], # final text
Indent => 0, # list indent levels counter
ListType => '-', # character on every item
searching => undef, # what are we searching for? (title, author etc.)
Title => undef, # page title
Author => undef, # page author
};
}
sub as_markdown {
my ($parser, %args) = @_;
my $data = $parser->_private;
my $lines = $data->{Text};
my @header;
if ($args{with_meta}) {
@header = $parser->_build_markdown_head;
inc/Pod/Markdown.pm view on Meta::CPAN
my $data = $parser->_private;
$text = $parser->_indent_text($text);
push @{ $data->{Text} }, $text;
return;
}
sub _indent_text {
my ($parser, $text) = @_;
my $data = $parser->_private;
my $level = $data->{Indent};
my $indent = undef;
if ($level > 0) {
$level--;
}
$indent = ' ' x ($level * 4);
my @lines = map { $indent . $_; } split(/\n/, $text);
return wantarray ? @lines : join("\n", @lines);
}
sub _clean_text {
my $text = $_[1];
inc/Pod/Markdown.pm view on Meta::CPAN
$paragraph = $parser->interpolate($paragraph, $line_num);
# the headers never are indented
$parser->_save($parser->format_header($level, $paragraph));
if ($level == 1) {
if ($paragraph =~ m{NAME}xmsi) {
$data->{searching} = 'title';
} elsif ($paragraph =~ m{AUTHOR}xmsi) {
$data->{searching} = 'author';
} else {
$data->{searching} = undef;
}
}
}
# opening a list ?
elsif ($command =~ m{over}xms) {
# update indent level
$data->{Indent}++;
inc/Pod/Markdown.pm view on Meta::CPAN
# interpolate the paragraph for embebed sequences
$paragraph = $parser->interpolate($paragraph, $line_num);
# clean the empty lines
$paragraph = $parser->_clean_text($paragraph);
# searching ?
if ($data->{searching}) {
if ($data->{searching} =~ m{title|author}xms) {
$data->{ ucfirst $data->{searching} } = $paragraph;
$data->{searching} = undef;
}
}
# save the text
$parser->_save($paragraph);
}
sub interior_sequence {
my ($seq_command, $seq_argument, $pod_seq) = @_[1..3];
my %interiors = (
( run in 1.123 second using v1.01-cache-2.11-cpan-d80b1682f3f )