WebLog-0.01/0000755000101400010140000000000010542521347011206 5ustar edenedenWebLog-0.01/t/0000755000101400010140000000000010542521347011451 5ustar edenedenWebLog-0.01/t/controller_Post.t0000644000101400010140000000031710542305104015016 0ustar edenedenuse strict; use warnings; use Test::More tests => 3; BEGIN { use_ok 'Catalyst::Test', 'WebLog' } BEGIN { use_ok 'WebLog::Controller::Post' } ok( request('/post')->is_success, 'Request should succeed' ); WebLog-0.01/t/view_TT.t0000644000101400010140000000013310542310011013174 0ustar edenedenuse strict; use warnings; use Test::More tests => 1; BEGIN { use_ok 'WebLog::View::TT' } WebLog-0.01/t/03podcoverage.t0000644000101400010140000000035710542302653014301 0ustar edenedenuse strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; all_pod_coverage_ok(); WebLog-0.01/t/01app.t0000644000101400010140000000023510542302653012554 0ustar edenedenuse strict; use warnings; use Test::More tests => 2; BEGIN { use_ok 'Catalyst::Test', 'WebLog' } ok( request('/')->is_success, 'Request should succeed' ); WebLog-0.01/t/02pod.t0000644000101400010140000000033010542302653012553 0ustar edenedenuse strict; use warnings; use Test::More; eval "use Test::Pod 1.14"; plan skip_all => 'Test::Pod 1.14 required' if $@; plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; all_pod_files_ok(); WebLog-0.01/t/model_DB.t0000644000101400010140000000013410542304407013275 0ustar edenedenuse strict; use warnings; use Test::More tests => 1; BEGIN { use_ok 'WebLog::Model::DB' } WebLog-0.01/inc/0000755000101400010140000000000010542521347011757 5ustar edenedenWebLog-0.01/inc/Module/0000755000101400010140000000000010542521347013204 5ustar edenedenWebLog-0.01/inc/Module/Install/0000755000101400010140000000000010542521347014612 5ustar edenedenWebLog-0.01/inc/Module/Install/Can.pm0000644000101400010140000000337410542521333015653 0ustar edeneden#line 1 package Module::Install::Can; use strict; use Module::Install::Base; use Config (); ### This adds a 5.005 Perl version dependency. ### This is a bug and will be fixed. use File::Spec (); use ExtUtils::MakeMaker (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.64'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { my $abs = File::Spec->catfile($dir, $_[1]); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # can we locate a (the) C compiler sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 157 WebLog-0.01/inc/Module/Install/Catalyst.pm0000644000101400010140000001472410542521333016737 0ustar edeneden#line 1 package Module::Install::Catalyst; use strict; our @ISA; require Module::Install::Base; @ISA = qw/Module::Install::Base/; use File::Find; use FindBin; use File::Copy::Recursive 'rcopy'; use File::Spec (); my $SAFETY = 0; our @IGNORE = qw/Build Build.PL Changes MANIFEST META.yml Makefile.PL Makefile README _build blib lib script t inc/; our @CLASSES = (); our $ENGINE = 'CGI'; our $CORE = 0; our $MULTIARCH = 0; our $SCRIPT; our $USAGE; #line 42 sub catalyst { my $self = shift; print <catalyst_files; $self->catalyst_par; print <name; for my $orig (@files) { my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig ); rcopy( $orig, $path ); } } #line 84 sub catalyst_ignore_all { my ( $self, $ignore ) = @_; @IGNORE = @$ignore; } #line 93 sub catalyst_ignore { my ( $self, @ignore ) = @_; push @IGNORE, @ignore; } #line 102 # Workaround for a namespace conflict sub catalyst_par { my ( $self, $par ) = @_; return if $SAFETY; $SAFETY++; my $name = $self->name; my $usage = $USAGE; $usage =~ s/"/\\"/g; my $class_string = join "', '", @CLASSES; $class_string = "'$class_string'" if $class_string; $self->postamble(< [$class_string], CORE => $CORE, ENGINE => '$ENGINE', MULTIARCH => $MULTIARCH, SCRIPT => '$SCRIPT', USAGE => q#$usage# } )" EOF print <{ENGINE}; my $CLASSES = $opts->{CLASSES} || []; my $USAGE = $opts->{USAGE}; my $SCRIPT = $opts->{SCRIPT}; my $MULTIARCH = $opts->{MULTIARCH}; my $CORE = $opts->{CORE}; my $name = $class_name; $name =~ s/::/_/g; $name = lc $name; $par ||= "$name.par"; my $engine = $ENGINE || 'CGI'; # Check for PAR eval "use PAR ()"; die "Please install PAR\n" if $@; eval "use PAR::Packer ()"; die "Please install PAR::Packer\n" if $@; eval "use App::Packer::PAR ()"; die "Please install App::Packer::PAR\n" if $@; eval "use Module::ScanDeps ()"; die "Please install Module::ScanDeps\n" if $@; my $root = $FindBin::Bin; $class_name =~ s/-/::/g; my $path = File::Spec->catfile( 'blib', 'lib', split( '::', $class_name ) ); $path .= '.pm'; unless ( -f $path ) { print qq/Not writing PAR, "$path" doesn't exist\n/; return 0; } print qq/Writing PAR "$par"\n/; chdir File::Spec->catdir( $root, 'blib' ); my $par_pl = 'par.pl'; unlink $par_pl; my $version = $Catalyst::VERSION; my $class = $class_name; my $classes = ''; $classes .= " require $_;\n" for @$CLASSES; unlink $par_pl; my $usage = $USAGE || <<"EOF"; Usage: [parl] $name\[.par] [script] [arguments] Examples: parl $name.par $name\_server.pl -r myapp $name\_cgi.pl EOF my $script = $SCRIPT; my $tmp_file = IO::File->new("> $par_pl "); print $tmp_file <<"EOF"; if ( \$ENV{PAR_PROGNAME} ) { my \$zip = \$PAR::LibCache{\$ENV{PAR_PROGNAME}} || Archive::Zip->new(__FILE__); my \$script = '$script'; \$ARGV[0] ||= \$script if \$script; if ( ( \@ARGV == 0 ) || ( \$ARGV[0] eq '-h' ) || ( \$ARGV[0] eq '-help' )) { my \@members = \$zip->membersMatching('.*script/.*\.pl'); my \$list = " Available scripts:\\n"; for my \$member ( \@members ) { my \$name = \$member->fileName; \$name =~ /(\\w+\\.pl)\$/; \$name = \$1; next if \$name =~ /^main\.pl\$/; next if \$name =~ /^par\.pl\$/; \$list .= " \$name\\n"; } die <<"END"; $usage \$list END } my \$file = shift \@ARGV; \$file =~ s/^.*[\\/\\\\]//; \$file =~ s/\\.[^.]*\$//i; my \$member = eval { \$zip->memberNamed("./script/\$file.pl") }; die qq/Can't open perl script "\$file"\n/ unless \$member; PAR::_run_member( \$member, 1 ); } else { require lib; import lib 'lib'; \$ENV{CATALYST_ENGINE} = '$engine'; require $class; import $class; require Catalyst::Helper; require Catalyst::Test; require Catalyst::Engine::HTTP; require Catalyst::Engine::CGI; require Catalyst::Controller; require Catalyst::Model; require Catalyst::View; require Getopt::Long; require Pod::Usage; require Pod::Text; $classes } EOF $tmp_file->close; # Create package local $SIG{__WARN__} = sub { }; open my $olderr, '>&STDERR'; open STDERR, '>', File::Spec->devnull; my %opt = ( 'x' => 1, 'n' => 0, 'o' => $par, 'a' => [ grep( !/par.pl/, glob '.' ) ], 'p' => 1, 'B' => $CORE, 'm' => $MULTIARCH ); App::Packer::PAR->new( frontend => 'Module::ScanDeps', backend => 'PAR::Packer', frontopts => \%opt, backopts => \%opt, args => ['par.pl'], )->go; open STDERR, '>&', $olderr; unlink $par_pl; chdir $root; rmove( File::Spec->catfile( 'blib', $par ), $par ); return 1; } #line 331 1; WebLog-0.01/inc/Module/Install/Base.pm0000644000101400010140000000203510542521333016015 0ustar edeneden#line 1 package Module::Install::Base; $VERSION = '0.64'; # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } ### This is the ONLY module that shouldn't have strict on # use strict; #line 41 sub new { my ($class, %args) = @_; foreach my $method ( qw(call load) ) { *{"$class\::$method"} = sub { shift()->_top->$method(@_); } unless defined &{"$class\::$method"}; } bless( \%args, $class ); } #line 61 sub AUTOLOAD { my $self = shift; local $@; my $autoload = eval { $self->_top->autoload } or return; goto &$autoload; } #line 76 sub _top { $_[0]->{_top} } #line 89 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } sub is_admin { $_[0]->admin->VERSION; } sub DESTROY {} package Module::Install::Base::FakeAdmin; my $Fake; sub new { $Fake ||= bless(\@_, $_[0]) } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 138 WebLog-0.01/inc/Module/Install/Win32.pm0000644000101400010140000000341610542521333016051 0ustar edeneden#line 1 package Module::Install::Win32; use strict; use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.64'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); if (!$rv) { die <<'END_MESSAGE'; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } } 1; WebLog-0.01/inc/Module/Install/WriteAll.pm0000644000101400010140000000162410542521333016671 0ustar edeneden#line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.64'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_ ); $self->sign(1) if $args{sign}; $self->Meta->write if $args{meta}; $self->admin->WriteAll(%args) if $self->is_admin; if ( $0 =~ /Build.PL$/i ) { $self->Build->write; } else { $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{'PL_FILES'} ) { $self->makemaker_args( PL_FILES => {} ); } if ($args{inline}) { $self->Inline->write; } else { $self->Makefile->write; } } } 1; WebLog-0.01/inc/Module/Install/AutoInstall.pm0000644000101400010140000000227210542521333017405 0ustar edeneden#line 1 package Module::Install::AutoInstall; use strict; use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.64'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } sub AutoInstall { $_[0] } sub run { my $self = shift; $self->auto_install_now(@_); } sub write { my $self = shift; $self->auto_install(@_); } sub auto_install { my $self = shift; return if $self->{done}++; # Flatten array of arrays into a single array my @core = map @$_, map @$_, grep ref, $self->build_requires, $self->requires; my @config = @_; # We'll need Module::AutoInstall $self->include('Module::AutoInstall'); require Module::AutoInstall; Module::AutoInstall->import( (@config ? (-config => \@config) : ()), (@core ? (-core => \@core) : ()), $self->features, ); $self->makemaker_args( Module::AutoInstall::_make_args() ); my $class = ref($self); $self->postamble( "# --- $class section:\n" . Module::AutoInstall::postamble() ); } sub auto_install_now { my $self = shift; $self->auto_install(@_); Module::AutoInstall::do_install(); } 1; WebLog-0.01/inc/Module/Install/Makefile.pm0000644000101400010140000001337310542521333016667 0ustar edeneden#line 1 package Module::Install::Makefile; use strict 'vars'; use Module::Install::Base; use ExtUtils::MakeMaker (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.64'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing, always use defaults if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } sub makemaker_args { my $self = shift; my $args = ($self->{makemaker_args} ||= {}); %$args = ( %$args, @_ ) if @_; $args; } # For mm args that take multiple space-seperated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{name} = defined $args->{$name} ? join( ' ', $args->{name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join(' ', grep length, $clean->{FILES}, @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join(' ', grep length, $realclean->{FILES}, @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args); $args->{VERSION} = $self->version || $self->determine_VERSION($args); $args->{NAME} =~ s/-/::/g; if ( $self->tests ) { $args->{test} = { TESTS => $self->tests }; } if ($] >= 5.005) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = $self->author; } if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) { $args->{NO_META} = 1; } if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } # merge both kinds of requires into prereq_pm my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_, ($self->build_requires, $self->requires) ); # merge both kinds of requires into prereq_pm my $subdirs = ($args->{DIR} ||= []); if ($self->bundles) { foreach my $bundle (@{ $self->bundles }) { my ($file, $dir) = @$bundle; push @$subdirs, $dir if -d $dir; delete $prereq->{$file}; } } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args; if ($self->admin->preop) { $args{dist} = $self->admin->preop; } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; my $makefile = do { local $/; }; close MAKEFILE or die $!; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 334 WebLog-0.01/inc/Module/Install/Scripts.pm0000644000101400010140000000243010542521333016571 0ustar edeneden#line 1 package Module::Install::Scripts; use strict; use Module::Install::Base; use File::Basename (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.64'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } sub prompt_script { my ($self, $script_file) = @_; my ($prompt, $abstract, $default); foreach my $line ( $self->_read_script($script_file) ) { last unless $line =~ /^#/; $prompt = $1 if $line =~ /^#\s*prompt:\s+(.*)/; $default = $1 if $line =~ /^#\s*default:\s+(.*)/; $abstract = $1 if $line =~ /^#\s*abstract:\s+(.*)/; } unless (defined $prompt) { my $script_name = File::Basename::basename($script_file); $prompt = "Do you want to install '$script_name'"; $prompt .= " ($abstract)" if defined $abstract; $prompt .= '?'; } return unless $self->prompt($prompt, ($default || 'n')) =~ /^[Yy]/; $self->install_script($script_file); } sub install_script { my $self = shift; my $args = $self->makemaker_args; my $exe_files = $args->{EXE_FILES} ||= []; push @$exe_files, @_; } sub _read_script { my ($self, $script_file) = @_; local *SCRIPT; open SCRIPT, $script_file or die "Can't open '$script_file' for input: $!\n"; return