Reindent everything
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 12 Sep 2015 12:03:52 +0000 (15:03 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 12 Sep 2015 12:03:52 +0000 (15:03 +0300)
Makefile.PL
lib/Apache2/AuthzCaps.pm
t/Apache2-AuthzCaps.t

index d2cd36f2193a31b326be650de3e66f1a1e72fafa..8b2284d43eb30c10cbf4b15824d606ce7212258d 100644 (file)
@@ -1,22 +1,22 @@
 use ExtUtils::MakeMaker;
 
 WriteMakefile(
-  NAME             => 'Apache2::AuthzCaps',
-  VERSION_FROM     => 'lib/Apache2/AuthzCaps.pm',
-  ABSTRACT_FROM    => 'lib/Apache2/AuthzCaps.pm',
-  AUTHOR           => 'Marius Gavrilescu <marius@ieval.ro>',
-  MIN_PERL_VERSION => '5.14.0',
-  LICENSE          => 'perl',
-  SIGN             => 1,
-  PREREQ_PM        => {
-         qw/YAML::Any 0/,
-  },
-  META_MERGE       => {
-         dynamic_config => 0,
-         recommends   => {
-                 qw/Apache2::Access     0
-                        Apache2::Const      0
-                        Apache2::RequestRec 0/,
-         }
-  }
+       NAME             => 'Apache2::AuthzCaps',
+       VERSION_FROM     => 'lib/Apache2/AuthzCaps.pm',
+       ABSTRACT_FROM    => 'lib/Apache2/AuthzCaps.pm',
+       AUTHOR           => 'Marius Gavrilescu <marius@ieval.ro>',
+       MIN_PERL_VERSION => '5.14.0',
+       LICENSE          => 'perl',
+       SIGN             => 1,
+       PREREQ_PM        => {
+               qw/YAML::Any 0/,
+       },
+       META_MERGE       => {
+               dynamic_config => 0,
+               recommends   => {
+                       qw/Apache2::Access     0
+                          Apache2::Const      0
+                          Apache2::RequestRec 0/,
+               }
+       }
 );
index 426b6081278e5597c4b3ef0aa4edfca03a17d31a..281d3d6f6e3b63eaa9874172ea00f5030901bbc5 100644 (file)
@@ -21,45 +21,45 @@ our @EXPORT_OK = qw/setcap hascaps/;
 our $rootdir;
 
 sub setcap{
-  my ($user, $cap, $value) = @_;
-  my $config = eval { LoadFile "$rootdir/$user.yml" } // {};
-  $config->{caps}//={};
-  my $caps=$config->{caps};
-
-  delete $caps->{$cap} unless $value;
-  $caps->{$cap} = 1 if $value;
-  DumpFile "$rootdir/$user.yml", $config
+       my ($user, $cap, $value) = @_;
+       my $config = eval { LoadFile "$rootdir/$user.yml" } // {};
+       $config->{caps}//={};
+       my $caps=$config->{caps};
+
+       delete $caps->{$cap} unless $value;
+       $caps->{$cap} = 1 if $value;
+       DumpFile "$rootdir/$user.yml", $config
 }
 
 sub hascaps{
-  my ($user, @caps) = @_;
-  my $config = LoadFile "$rootdir/$user.yml";
-  my $caps = $config->{caps};
-  for (@caps) {
-       return 0 unless $caps->{$_}
-  }
-  1
+       my ($user, @caps) = @_;
+       my $config = LoadFile "$rootdir/$user.yml";
+       my $caps = $config->{caps};
+       for (@caps) {
+               return 0 unless $caps->{$_}
+       }
+       1
 }
 
 sub handler{
-  my $r=shift;
-  my $user = $r->user;
-  local $rootdir = $r->dir_config('AuthzCapsRootdir');
+       my $r=shift;
+       my $user = $r->user;
+       local $rootdir = $r->dir_config('AuthzCapsRootdir');
 
-  if ($user) {
-  LOOP: for my $requirement (map { $_->{requirement} } @{$r->requires}) {
-         my ($command, @args) = split ' ', $requirement;
+       if ($user) {
+         LOOP: for my $requirement (map { $_->{requirement} } @{$r->requires}) {
+                       my ($command, @args) = split ' ', $requirement;
 
-         given ($command){
-               when('cap'){
-                 return OK if hascaps $user, @args
-               }
+                       given ($command){
+                               when('cap'){
+                                       return OK if hascaps $user, @args
+                               }
 
-         }
+                       }
+               }
        }
-  }
 
-  DECLINED
+       DECLINED
 }
 
 1;
index b018dd5467828d14c908dbb523cc2cdf69701d76..905270356e0654e4f2983fc6b1eea909d141f95f 100644 (file)
@@ -9,13 +9,13 @@ BEGIN { use_ok('Apache2::AuthzCaps', qw/setcap hascaps/) };
 $Apache2::AuthzCaps::rootdir = tempdir CLEANUP => 1;
 
 sub checkcaps{
-  my ($user, $testname, @caps) = @_;
-  ok hascaps ($user, @caps), $testname
+       my ($user, $testname, @caps) = @_;
+       ok hascaps ($user, @caps), $testname
 }
 
 sub checknocaps{
-  my ($user, $testname, @caps) = @_;
-  ok !(hascaps $user, @caps), $testname
+       my ($user, $testname, @caps) = @_;
+       ok !(hascaps $user, @caps), $testname
 }
 
 setcap marius => dostuff => 1;
This page took 0.016536 seconds and 4 git commands to generate.