Skip to content

Commit

Permalink
renamed to App::Padadoy
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Apr 16, 2012
1 parent 580ab3a commit c7975b4
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ MYMETA.*
Makefile
Makefile.old

App-padadoy*
App-Padadoy*
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
{{$NEXT}}
Renamed to App::Padadoy

0.121 2012-04-16
Minor cleanup of dist.ini and typos
12 changes: 8 additions & 4 deletions bin/padadoy
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/perl
use strict;
use warnings;
#ABSTRACT: Simply deploy PSGI applications
#PODNAME: padadoy

use 5.010;
use App::padadoy;
use App::Padadoy;

use Getopt::Long;
use Pod::Usage;
Expand All @@ -19,7 +21,7 @@ GetOptions(
pod2usage(1) if $help;

if ($version) {
say 'This is padadoy version '.($App::padadoy::VERSION || '??').
say 'This is padadoy version '.($App::Padadoy::VERSION || '??').
'. Use -h for help.';
exit;
}
Expand All @@ -35,11 +37,13 @@ pod2usage(1) if $cmd eq 'help';
my $regexp = qr{^([a-z]+)=(.*)$};
my %values = map { $_ =~ $regexp; $1 => $2 }
grep { $_ =~ $regexp } @ARGV;
my $padadoy = App::padadoy->new($config,%values);
pod2usage("Unknown config value $_")
for grep { !$App::Padadoy::configs } keys %values;
my $padadoy = App::Padadoy->new($config,%values);
$padadoy->{quiet} = 1 if $quiet;

pod2usage("Unknown command '$cmd'!")
unless grep { $_ eq $cmd } @App::padadoy::commands;
unless grep { $_ eq $cmd } @App::Padadoy::commands;

$padadoy->$cmd( grep { $_ !~ $regexp } @ARGV);

Expand Down
3 changes: 2 additions & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = App-padadoy
name = App-Padadoy
license = Perl_5
copyright_year = 2012
author = Jakob Voß
Expand All @@ -14,6 +14,7 @@ dir=shares/app_padadoy
[NextRelease]
format=%-9v %{yyyy-MM-dd}d

[PodWeaver]
[@Basic]

[PkgVersion]
Expand Down
11 changes: 6 additions & 5 deletions lib/App/padadoy.pm → lib/App/Padadoy.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use strict;
use warnings;
package App::padadoy;
#ABSTRACT: Simply deploy PSGI web applications
package App::Padadoy;
#ABSTRACT: Simply deploy PSGI applications

use 5.010;
use autodie;
Expand All @@ -23,12 +23,13 @@ use Plack::Test qw();
use HTTP::Request::Common qw();

our @commands = qw(init start stop restart config status create deplist cartontest);
our @configs = qw(user base repository port pidfile logs errrorlog accesslog quiet);

# _msg( $fh, [\$caller], $msg [@args] )
sub _msg (@) {
my $fh = shift;
my $caller = ref($_[0]) ? ${(shift)} :
((caller(2))[3] =~ /^App::padadoy::(.+)/ ? $1 : '');
((caller(2))[3] =~ /^App::Padadoy::(.+)/ ? $1 : '');
my $text = shift;
say $fh (($caller ? "[$caller] " : "")
. (@_ ? sprintf($text, @_) : $text));
Expand Down Expand Up @@ -70,7 +71,7 @@ sub new {
close $fh;
}

foreach (qw(user base repository port pidfile logs errrorlog accesslog quiet)) {
foreach (@configs) {
$self->{$_} = $values{$_} if defined $values{$_};
}

Expand Down Expand Up @@ -515,7 +516,7 @@ The following should work at least with a fresh Ubuntu installation and Perl >=
Now you can install padadoy from CPAN:
$ sudo cpanm App::padadoy
$ sudo cpanm App::Padadoy
Depending on the Perl modules your application requires, you may need some
additional packages, such as C<libexpat1-dev> for XML. For instance for HTTPS
Expand Down
2 changes: 1 addition & 1 deletion t/compile.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use Test::More;

use_ok('App::padadoy');
use_ok('App::Padadoy');

done_testing;
5 changes: 2 additions & 3 deletions t/create.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ use File::Temp qw(tempdir);
use File::Spec::Functions;
use Cwd;

use App::padadoy;
use App::Padadoy;

my ($cwd) = (cwd =~ /^(.*)$/g); # untainted cwd

my $devdir = tempdir( CLEANUP => 1 );
chdir $devdir;

my $padadoy = App::padadoy->new;
$padadoy->{quiet} = 1;
my $padadoy = App::Padadoy->new('', quiet => 1);
$padadoy->create('Foo::Bar');

ok( -d catdir($devdir,$_), "$_/ created" )
Expand Down

0 comments on commit c7975b4

Please sign in to comment.