Skip to content

Commit

Permalink
Import of JESSE/Prophet-0.742 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: Prophet
gitpan-cpan-version:      0.742
gitpan-cpan-path:         JESSE/Prophet-0.742.tar.gz
gitpan-cpan-author:       JESSE
gitpan-cpan-maturity:     released
  • Loading branch information
Jesse Vincent authored and Gitpan committed Oct 22, 2014
1 parent d126eff commit c3f13b6
Show file tree
Hide file tree
Showing 17 changed files with 483 additions and 203 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,3 +1,6 @@
0.742
* Deal with Path::Dispatcher::Declarative being split from P::D --jesse

0.741

* Actually ship all the javascript and css files for the web frontend.
Expand Down
5 changes: 3 additions & 2 deletions META.yml
Expand Up @@ -8,7 +8,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: 6.42
distribution_type: module
generated_by: 'Module::Install version 0.91'
generated_by: 'Module::Install version 0.95'
license: mit
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
Expand All @@ -34,11 +34,12 @@ requires:
Mouse: 0.21
Params::Validate: 0
Path::Dispatcher: 0.14
Path::Dispatcher::Declarative: 0
Proc::InvokeEditor: 0
Time::Progress: 0
URI: 0
UUID::Tiny: 1.02
XML::Atom::SimpleFeed: 0
resources:
license: http://opensource.org/licenses/mit-license.php
version: 0.741
version: 0.742
5 changes: 3 additions & 2 deletions Makefile.PL
Expand Up @@ -20,7 +20,8 @@ requires('Proc::InvokeEditor');
requires( 'Any::Moose' => '0.04' );
requires( 'Mouse' => '0.21' );
requires('XML::Atom::SimpleFeed');
requires( 'Path::Dispatcher' => '0.14' ); # Path::Dispatcher::Declarative
requires( 'Path::Dispatcher' => '0.14' );
requires( 'Path::Dispatcher::Declarative' );
requires('Time::Progress');
requires('Config::GitLike' => '1.02');
requires('MIME::Base64::URLSafe');
Expand Down Expand Up @@ -48,7 +49,7 @@ feature 'SQLite replica support' => -default => 1,
'DBI' => 1,
'DBD::SQLite' => 1;

feature 'Maintainer testing tools' => -default => 1,
feature 'Maintainer testing tools' => -default => 0,
'Test::HTTP::Server::Simple',
'YAML::Syck' => 0,
'Module::Refresh' => 0,
Expand Down
17 changes: 15 additions & 2 deletions inc/Module/AutoInstall.pm
Expand Up @@ -672,7 +672,20 @@ sub _load {
sub _load_cpan {
return if $CPAN::VERSION and $CPAN::Config and not @_;
require CPAN;
if ( $CPAN::HandleConfig::VERSION ) {

# CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to
# CPAN::HandleConfig->load. CPAN reports that the redirection
# is deprecated in a warning printed at the user.

# CPAN-1.81 expects CPAN::HandleConfig->load, does not have
# $CPAN::HandleConfig::VERSION but cannot handle
# CPAN::Config->load

# Which "versions expect CPAN::Config->load?

if ( $CPAN::HandleConfig::VERSION
|| CPAN::HandleConfig->can('load')
) {
# Newer versions of CPAN have a HandleConfig module
CPAN::HandleConfig->load;
} else {
Expand Down Expand Up @@ -802,4 +815,4 @@ END_MAKE

__END__
#line 1056
#line 1069
183 changes: 97 additions & 86 deletions inc/Module/Install.pm
Expand Up @@ -19,6 +19,10 @@ package Module::Install;

use 5.005;
use strict 'vars';
use Cwd ();
use File::Find ();
use File::Path ();
use FindBin;

use vars qw{$VERSION $MAIN};
BEGIN {
Expand All @@ -28,7 +32,7 @@ BEGIN {
# 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 = '0.91';
$VERSION = '0.95';

# Storage for the pseudo-singleton
$MAIN = undef;
Expand All @@ -38,18 +42,25 @@ BEGIN {

}

sub import {
my $class = shift;
my $self = $class->new(@_);
my $who = $self->_caller;




# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
#-------------------------------------------------------------
# all of the following checks should be included in import(),
# to allow "eval 'require Module::Install; 1' to test
# installation of Module::Install. (RT #51267)
#-------------------------------------------------------------

# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
Please invoke ${\__PACKAGE__} with:
Expand All @@ -61,26 +72,28 @@ not:
END_DIE





# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];

# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }

# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
# This reportedly fixes a rare Win32 UTC file time issue, but
# as this is a non-cross-platform XS module not in the core,
# we shouldn't really depend on it. See RT #24194 for detail.
# (Also, this module only supports Perl 5.6 and above).
eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006;

# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];

# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }

# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
Expand All @@ -89,15 +102,12 @@ This is known to create infinite loops in make.
Please correct this, then run $0 again.
END_DIE
}



}


# Build.PL was formerly supported, but no longer is due to excessive
# difficulty in implementing every single feature twice.
if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" }
# Build.PL was formerly supported, but no longer is due to excessive
# difficulty in implementing every single feature twice.
if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" }
Module::Install no longer supports Build.PL.
Expand All @@ -107,23 +117,36 @@ Please remove all Build.PL files and only use the Makefile.PL installer.
END_DIE

#-------------------------------------------------------------

# To save some more typing in Module::Install installers, every...
# use inc::Module::Install
# ...also acts as an implicit use strict.
$^H |= strict::bits(qw(refs subs vars));

#-------------------------------------------------------------

unless ( -f $self->{file} ) {
require "$self->{path}/$self->{dispatch}.pm";
File::Path::mkpath("$self->{prefix}/$self->{author}");
$self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}

# To save some more typing in Module::Install installers, every...
# use inc::Module::Install
# ...also acts as an implicit use strict.
$^H |= strict::bits(qw(refs subs vars));


*{"${who}::AUTOLOAD"} = $self->autoload;
$self->preload;

# Unregister loader and worker packages so subdirs can use them again
delete $INC{"$self->{file}"};
delete $INC{"$self->{path}.pm"};

# Save to the singleton
$MAIN = $self;

use Cwd ();
use File::Find ();
use File::Path ();
use FindBin;
return 1;
}

sub autoload {
my $self = shift;
Expand Down Expand Up @@ -152,33 +175,6 @@ sub autoload {
};
}

sub import {
my $class = shift;
my $self = $class->new(@_);
my $who = $self->_caller;

unless ( -f $self->{file} ) {
require "$self->{path}/$self->{dispatch}.pm";
File::Path::mkpath("$self->{prefix}/$self->{author}");
$self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}

*{"${who}::AUTOLOAD"} = $self->autoload;
$self->preload;

# Unregister loader and worker packages so subdirs can use them again
delete $INC{"$self->{file}"};
delete $INC{"$self->{path}.pm"};

# Save to the singleton
$MAIN = $self;

return 1;
}

sub preload {
my $self = shift;
unless ( $self->{extensions} ) {
Expand Down Expand Up @@ -348,17 +344,24 @@ sub _caller {
return $call;
}

# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
if ( $] >= 5.006 ) {
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
} else {
open( FH, "< $_[0]" ) or die "open($_[0]): $!";
}
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
}
END_NEW
sub _read {
local *FH;
open( FH, "< $_[0]" ) or die "open($_[0]): $!";
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
}
END_OLD

sub _readperl {
my $string = Module::Install::_read($_[0]);
Expand All @@ -379,18 +382,26 @@ sub _readpod {
return $string;
}

# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
if ( $] >= 5.006 ) {
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
} else {
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
END_NEW
sub _write {
local *FH;
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
END_OLD

# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
Expand Down Expand Up @@ -427,4 +438,4 @@ sub _CLASS ($) {

1;

# Copyright 2008 - 2009 Adam Kennedy.
# Copyright 2008 - 2010 Adam Kennedy.
2 changes: 1 addition & 1 deletion inc/Module/Install/AutoInstall.pm
Expand Up @@ -6,7 +6,7 @@ use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '0.91';
$VERSION = '0.95';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/Module/Install/Base.pm
Expand Up @@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
$VERSION = '0.91';
$VERSION = '0.95';
}

# Suspend handler for "redefined" warnings
Expand Down
2 changes: 1 addition & 1 deletion inc/Module/Install/Can.pm
Expand Up @@ -9,7 +9,7 @@ use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '0.91';
$VERSION = '0.95';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/Module/Install/Fetch.pm
Expand Up @@ -6,7 +6,7 @@ use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '0.91';
$VERSION = '0.95';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/Module/Install/Include.pm
Expand Up @@ -6,7 +6,7 @@ use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '0.91';
$VERSION = '0.95';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down

0 comments on commit c3f13b6

Please sign in to comment.