Showing 18 changed files with 47 additions and 19 deletions
+24 -2
README.md
... ...
@@ -11,14 +11,14 @@ See GitPrep example site. [GitPrep example site](http://perlcodesample.sakura.ne
11 11
 * Github clone: GitPrep has the same interface as GitHub.
12 12
 * Portable: You can install GitPrep on your own Unix/Linux server.
13 13
 * Supports Windows installation via cygwin for Windows (need gcc4 package).
14
-* Only needs Perl 5.8.7+.
14
+* Only needs Perl 5.10.1+.
15 15
 * Smart HTTP support: you can pull and push via HTTP
16 16
 * CGI support, built-in web server, and reverse proxy support.
17 17
 * SSL support.
18 18
 
19 19
 ## Check Perl Version
20 20
 
21
-Check Perl version. You can use GitPrep if the Perl version is 5.8.7+;
21
+Check Perl version. You can use GitPrep if the Perl version is 5.10.1+;
22 22
 
23 23
     perl -v
24 24
 
... ...
@@ -420,6 +420,26 @@ You can start and stop the application with the following command.
420 420
     # Stop
421 421
     /webapp/gitprep --stop
422 422
 
423
+### I want to use GitPrep on Perl 5.8.7 system
424
+
425
+GitPrep 2.0 drop support Perl 5.8.7 because latest Mojolicious don't support Perl 5.8.
426
+
427
+You can choice two selection.
428
+
429
+**1. use GitPrep 1.xx**
430
+
431
+GitPrep 1.xx support Perl 5.8.7+. You can use GitPrep v1.12.
432
+
433
+https://github.com/yuki-kimoto/gitprep/archive/v1.12.tar.gz
434
+
435
+**2. You can install your local perl by perlbrew.**
436
+
437
+http://perlbrew.pl/
438
+
439
+perlbrew is very useful perl installation tools without breaking your system perl.
440
+
441
+If you install perl 5.10.1+ by perlbrew, you can install latest GitPrep.
442
+
423 443
 ## For Developer
424 444
 
425 445
 If you are a developer, you can start the application in development mode.
... ...
@@ -449,6 +469,8 @@ It is useful to write configuration in ***gitprep.my.conf***, not gitprep.conf.
449 469
 * [DBIx::Custom](http://search.cpan.org/dist/DBIx-Custom/lib/DBIx/Custom.pm)
450 470
 * [Mojolicious](http://search.cpan.org/~kimoto/DBIx-Custom/lib/DBIx/Custom.pm)
451 471
 * [Mojolicious::Plugin::INIConfig](http://search.cpan.org/dist/Mojolicious-Plugin-INIConfig/lib/Mojolicious/Plugin/INIConfig.pm)
472
+* [Mojolicious::Plugin::AutoRoute](http://search.cpan.org/dist/Mojolicious-Plugin-AutoRoute/lib/Mojolicious/Plugin/AutoRoute.pm)
473
+* [Mojolicious::Plugin::BasicAuth](http://search.cpan.org/dist/Mojolicious-Plugin-BasicAuth/README.pod)
452 474
 * [mojo-legacy](https://github.com/jamadam/mojo-legacy)
453 475
 * [Object::Simple](http://search.cpan.org/dist/Object-Simple/lib/Object/Simple.pm)
454 476
 * [Text::Markdown::Hoedown](http://search.cpan.org/~tokuhirom/Text-Markdown-Hoedown-1.01/lib/Text/Markdown/Hoedown.pm)
+4
cpanfile
... ...
@@ -29,3 +29,7 @@ requires 'Class::Accessor', '== 0.34';
29 29
 requires 'Test::Exception', '== 0.32';
30 30
 requires 'Sub::Uplevel', '== 0.24';
31 31
 requires 'Data::Page::Navigation', '== 0.06';
32
+requires 'Data::Page::Navigation', '== 0.06';
33
+requires 'Mojolicious::Plugin::BasicAuth', '== 0.08';
34
+requires 'Mojolicious::Plugin::AutoRoute', '== 0.18';
35
+requires 'Mojolicious::Plugin::INIConfig', '== 0.03';
+2 -2
gitprep
... ...
@@ -1,7 +1,7 @@
1 1
 #!/bin/sh
2 2
 
3 3
 DIR=$(dirname $0)
4
-PERL5LIB="$DIR/mojo/lib:$DIR/extlib/lib/perl5"
4
+PERL5LIB="$DIR/extlib/lib/perl5"
5 5
 export PERL5LIB
6
-exec $DIR/mojo/script/hypnotoad $* $DIR/script/gitprep
6
+exec $DIR/extlib/bin/hypnotoad $* $DIR/script/gitprep
7 7
 
-1
gitprep.cgi
... ...
@@ -1,6 +1,5 @@
1 1
 #!/usr/bin/env perl
2 2
 use FindBin;
3
-use lib "$FindBin::Bin/mojo/lib";
4 3
 use lib "$FindBin::Bin/extlib/lib/perl5";
5 4
 
6 5
 $ENV{MOJO_MODE} = 'production';
+1 -1
lib/Gitprep.pm
... ...
@@ -216,7 +216,7 @@ sub startup {
216 216
       # Custom routes
217 217
       {
218 218
         # Show ssh keys
219
-        $r->get('/:user.keys' => template '/user-keys');
219
+        $r->get('/(:user).keys' => template '/user-keys');
220 220
         
221 221
         # User
222 222
         my $r = $r->route('/:user');
+2 -2
morbo
... ...
@@ -1,6 +1,6 @@
1 1
 #!/bin/sh
2 2
 
3 3
 DIR=$(dirname $0)
4
-PERL5LIB="$DIR/mojo/lib:$DIR/extlib/lib/perl5"
4
+PERL5LIB="$DIR/extlib/lib/perl5"
5 5
 export PERL5LIB
6
-$DIR/mojo/script/morbo $* $DIR/script/gitprep 
6
+$DIR/extlib/bin/morbo $* $DIR/script/gitprep
+1
setup.sh
... ...
@@ -2,4 +2,5 @@
2 2
 CUR_DIR_ABS=$(cd $(dirname $0); pwd)
3 3
 export PERL_CPANM_HOME=$CUR_DIR_ABS/setup
4 4
 perl cpanm -n -l extlib Module::CoreList
5
+perl -Iextlib/lib/perl5 cpanm -nf -L extlib Mojolicious@6.57
5 6
 perl -Iextlib/lib/perl5 cpanm -n -L extlib --installdeps .
+1 -1
templates/archive.html.ep
... ...
@@ -28,7 +28,7 @@
28 28
   # Object type
29 29
   my $type = $git->object_type($user, $project, "$rev^{}");
30 30
   if (!$type || $type eq 'blob') {
31
-    $self->render_not_found;
31
+    $self->reply->not_found;
32 32
     return;
33 33
   }
34 34
   
+1 -1
templates/auto/_new.html.ep
... ...
@@ -49,7 +49,7 @@
49 49
     if ($validation->is_valid) {
50 50
       # Not logined
51 51
       unless ($api->logined) {
52
-        return $self->render_exception;
52
+        return $self->reply->exception;
53 53
       }
54 54
       
55 55
       my $manager = app->manager;
+1 -1
templates/commit.html.ep
... ...
@@ -15,7 +15,7 @@
15 15
   my $commit = $git->get_commit($user, $project, $rev);
16 16
   
17 17
   unless ($commit) {
18
-    $self->render_not_found;
18
+    $self->reply->not_found;
19 19
     return;
20 20
   }
21 21
   my $author_date
+1 -1
templates/commits.html.ep
... ...
@@ -20,7 +20,7 @@
20 20
 
21 21
   # Not found
22 22
   unless ($commit) {
23
-    $self->render_not_found;
23
+    $self->reply->not_found;
24 24
     return;
25 25
   }
26 26
     
+1 -1
templates/compare.html.ep
... ...
@@ -32,7 +32,7 @@
32 32
   my $end_commit = $git->get_commit($user, $project, $rev);
33 33
   
34 34
   if (!$start_commit || !$end_commit) {
35
-    $self->render_not_found;
35
+    $self->reply->not_found;
36 36
     return;
37 37
   }
38 38
   
+1 -1
templates/fork.html.ep
... ...
@@ -22,7 +22,7 @@
22 22
   else {
23 23
     eval { app->manager->fork_project($current_user, $user, $project) };
24 24
     if (my $e = $@) {
25
-      $self->render_exception('Internal Error');
25
+      $self->reply->exception('Internal Error');
26 26
       app->log->error(url_for . ": $e");
27 27
     }
28 28
     else {
+1 -1
templates/smart-http/info-refs.html.ep
... ...
@@ -42,7 +42,7 @@
42 42
     
43 43
     if ($err) {
44 44
       app->log->error($err);
45
-      $self->render_exception($err);
45
+      $self->reply->exception($err);
46 46
       return;
47 47
     }
48 48
     
+1 -1
templates/smart-http/static.html.ep
... ...
@@ -5,7 +5,7 @@
5 5
 
6 6
   # Protect directory traversal
7 7
   if ($path =~ m#\.\.#) {
8
-    $self->render_exception('Invalid URL');
8
+    $self->reply->exception('Invalid URL');
9 9
     return;
10 10
   }
11 11
 
+1 -1
templates/tree.html.ep
... ...
@@ -24,7 +24,7 @@
24 24
   }
25 25
   
26 26
   unless (app->manager->exists_project($user, $project)) {
27
-    $self->render_not_found;
27
+    $self->reply->not_found;
28 28
     return;
29 29
   }
30 30
 
+3 -1
templates/user-keys.html.ep
... ...
@@ -1,7 +1,9 @@
1 1
 <%
2 2
   my $user = param('user');
3
+  
4
+  warn param('user.keys');
5
+  
3 6
   my $keys = app->dbi->model('ssh_public_key')->select(where => {user_id => $user})->all;
4
-  warn dumper $keys;
5 7
   my $keys_str = '';
6 8
   for my $key (@$keys) {
7 9
     $keys_str .= "$key->{key}\n";
+1 -1
templates/user.html.ep
... ...
@@ -13,7 +13,7 @@
13 13
   
14 14
   # Projects
15 15
   unless (app->manager->exists_user($user)) {
16
-    $self->render_not_found;
16
+    $self->reply->not_found;
17 17
     return;
18 18
   }
19 19
   my $projects = app->manager->projects($user);