r62079 - in /trunk/libdancer-perl: CHANGES META.yml debian/changelog lib/Dancer.pm lib/Dancer/Cookbook.pod lib/Dancer/Deployment.pod lib/Dancer/Route.pm script/dancer t/03_route_handler/24_named_captures.t t/17_apps/02_load_app.t t/17_apps/04_issue_91.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri Aug 27 23:10:32 UTC 2010


Author: gregoa
Date: Fri Aug 27 23:10:19 2010
New Revision: 62079

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62079
Log:
New upstream release

Modified:
    trunk/libdancer-perl/CHANGES
    trunk/libdancer-perl/META.yml
    trunk/libdancer-perl/debian/changelog
    trunk/libdancer-perl/lib/Dancer.pm
    trunk/libdancer-perl/lib/Dancer/Cookbook.pod
    trunk/libdancer-perl/lib/Dancer/Deployment.pod
    trunk/libdancer-perl/lib/Dancer/Route.pm
    trunk/libdancer-perl/script/dancer
    trunk/libdancer-perl/t/03_route_handler/24_named_captures.t
    trunk/libdancer-perl/t/17_apps/02_load_app.t
    trunk/libdancer-perl/t/17_apps/04_issue_91.t

Modified: trunk/libdancer-perl/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/CHANGES?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/CHANGES (original)
+++ trunk/libdancer-perl/CHANGES Fri Aug 27 23:10:19 2010
@@ -1,3 +1,13 @@
+Dancer 1.1809
+
+    [ Franck Cuny ]
+    * update Deployement.pod and Cookbook.pod
+    * fix bug in route building with prefix
+    * don't use app.psgi anymore in generated scripts
+
+    [ Alexis Sukrieh ]
+    * fix plan for t/03_route_handler/24_named_captures.t
+
 Dancer 1.1808
 
     [ Alexis Sukrieh ]

Modified: trunk/libdancer-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/META.yml?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/META.yml (original)
+++ trunk/libdancer-perl/META.yml Fri Aug 27 23:10:19 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Dancer
-version:            1.1808
+version:            1.1809
 abstract:           A minimal-effort oriented web application framework
 author:  []
 license:            perl

Modified: trunk/libdancer-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/debian/changelog?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/debian/changelog (original)
+++ trunk/libdancer-perl/debian/changelog Fri Aug 27 23:10:19 2010
@@ -1,4 +1,4 @@
-libdancer-perl (1.1808-1) UNRELEASED; urgency=low
+libdancer-perl (1.1809-1) UNRELEASED; urgency=low
 
   [ Jonathan Yu ]
   * Initial Release (Closes: #569974)
@@ -7,4 +7,7 @@
   * New upstream release
   * Added myself to Uploaders
 
- -- Iñigo Tejedor Arrondo <poisonbit at gmal.com>  Tue, 24 Aug 2010 11:46:27 +0200
+  [ gregor herrmann ]
+  * New upstream release
+
+ -- gregor herrmann <gregoa at debian.org>  Sat, 28 Aug 2010 01:06:22 +0200

Modified: trunk/libdancer-perl/lib/Dancer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer.pm?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer.pm (original)
+++ trunk/libdancer-perl/lib/Dancer.pm Fri Aug 27 23:10:19 2010
@@ -30,7 +30,7 @@
 use base 'Exporter';
 
 $AUTHORITY = 'SUKRIA';
-$VERSION   = '1.1808';
+$VERSION   = '1.1809';
 @EXPORT    = qw(
   after
   any

Modified: trunk/libdancer-perl/lib/Dancer/Cookbook.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer/Cookbook.pod?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer/Cookbook.pod (original)
+++ trunk/libdancer-perl/lib/Dancer/Cookbook.pod Fri Aug 27 23:10:19 2010
@@ -451,6 +451,21 @@
 
     template 'index.tt', {}, { layout => undef };
 
+If your application is not mounted under root (B</>), instead to
+hardocre the full path to your application path for the CSS, images,
+javascript, ...  you can do this in your application:
+
+    before_template sub {
+        my $tokens = shift; $tokens->{uri_base} =
+        request->base;
+    };
+
+THen in your layout, modify your css inclusion as follows:
+
+    <link rel="stylesheet" href="<% uri_base %>/css/style.css" />
+
+From now on, you can mount your application wherever you want, without
+any further modification of the css inclusion
 
 =head3 template and unicode
 

Modified: trunk/libdancer-perl/lib/Dancer/Deployment.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer/Deployment.pod?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer/Deployment.pod (original)
+++ trunk/libdancer-perl/lib/Dancer/Deployment.pod Fri Aug 27 23:10:19 2010
@@ -20,6 +20,12 @@
     
     http://localhost/myapp/dispatch.cgi/
     200 OK - Right
+
+Start by adding the following to your apache configuration:
+
+    <VirtualHost *:80>
+        ScriptAlias /myapp /path/to/app/public/dispatch.cgi/
+    </VirtualHost>
     
 Enable Pretty-URLs if your web server supports .htaccess files and mod_rewrite.
 Place this code in a file called .htaccess in your application's root folder:
@@ -384,9 +390,15 @@
 =head3 Running on lighttpd (FastCGI)
 
 Make sure mod_fcgi is enabled. You also must install the FCGI module from
-CPAN. This example uses a port based virtual host.
-
-    $SERVER["socket"] == ":5000" {
+CPAN.
+
+=head4 Script
+
+This example uses a script based virtual host.
+
+Your lighttpd configuration:
+
+    $HTTP["url"] == "^/app" {
         fastcgi.server += (
             ".fcgi" => ((
                 "bin-path" => "/path/to/myapp/public/dispatch.fcgi",
@@ -396,4 +408,45 @@
         alias.url += ("" => "/path/to/myapp/public/dispatch.fcgi")
     }
 
-
+=head4 TCP/IP
+
+This example uses TCP/IP.
+
+Your lighttpd configuration:
+
+    $HTTP["url"] == "^/app" {
+        fastcgi.server += (
+            "/app" => (
+                "" => (
+                    "host" => "127.0.0.1",
+                    "port" => "5000",
+                    "check-local" => "disable",
+                )
+           )
+       )
+   }
+
+Launch your application
+
+    plackup -s FCGI --port 8080 app.pl
+
+=head4 Unix socket
+
+This example uses a socket.
+
+Your lighttpd configuration:
+
+    $HTTP["url"] =~ "^/app" {
+        fastcgi.server += (
+            "/app" => (
+                "" => ( 
+                    "socket" => "/tmp/fcgi.sock",  
+                    "check-local" => "disable", 
+                )
+            )
+        )
+    } 
+
+Launch your application:
+
+    plackup -s FCGI --listen /tmp/fcgi.sock app.pl

Modified: trunk/libdancer-perl/lib/Dancer/Route.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer/Route.pm?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer/Route.pm (original)
+++ trunk/libdancer-perl/lib/Dancer/Route.pm Fri Aug 27 23:10:19 2010
@@ -70,7 +70,7 @@
     my $path   = $request->path_info;
     my %params;
 
-    Dancer::Logger::core("trying to match `$path' "
+    Dancer::Logger::debug("trying to match `$path' "
           . "against /"
           . $self->{_compiled_regexp}
           . "/");
@@ -216,8 +216,11 @@
         }
     }
     else {
+        my $original_pattern = $self->pattern;
         $self->{pattern} = $prefix . $self->pattern;
-        $self->{pattern} =~ s/\/$//;    # remove trailing slash
+        $self->{pattern} =~ s/\/$//
+          unless $original_pattern eq
+              '/';    # remove trailing slash unless the path is /
     }
 
     return $prefix;

Modified: trunk/libdancer-perl/script/dancer
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/script/dancer?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/script/dancer (original)
+++ trunk/libdancer-perl/script/dancer Fri Aug 27 23:10:19 2010
@@ -257,14 +257,14 @@
 "dispatch.cgi" =>
 "$PERL_INTERPRETER
 use Plack::Runner;
-Plack::Runner->run('[% appdir %]/app.psgi');
+Plack::Runner->run('[% appdir %]/$DANCER_SCRIPT.pl');
 ",
 
 "dispatch.fcgi" =>
 "$PERL_INTERPRETER
 use Plack::Handler::FCGI;
 
-my \$app = do('[% appdir %]/app.psgi');
+my \$app = do('[% appdir %]/$DANCER_SCRIPT.pl');
 my \$server = Plack::Handler::FCGI->new(nproc  => 5, detach => 1);
 \$server->run(\$app);
 ",
@@ -576,7 +576,6 @@
     + mywebapp/environments/development.yml
     + mywebapp/mywebapp.pm
     + mywebapp/mywebapp.pl
-    + mywebapp/app.psgi
     + mywebapp/favicon.ico
 
 The application is ready to serve:

Modified: trunk/libdancer-perl/t/03_route_handler/24_named_captures.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/t/03_route_handler/24_named_captures.t?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/t/03_route_handler/24_named_captures.t (original)
+++ trunk/libdancer-perl/t/03_route_handler/24_named_captures.t Fri Aug 27 23:10:19 2010
@@ -1,12 +1,13 @@
 use strict;
 use warnings;
-use Test::More import => ['!pass'], tests => 3;
+use Test::More import => ['!pass'];
 
 use Dancer ':syntax';
 use Dancer::Test;
 
 # perl <= 5.8.x doesn't support named captures
 plan skip_all => 'Need perl >= 5.10' if $] < 5.010;
+plan tests => 3;
 
 my $route_regex = "/(?<class> user | content | post )/(?<action> delete | find )/(?<id> \\d+ )";
 

Modified: trunk/libdancer-perl/t/17_apps/02_load_app.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/t/17_apps/02_load_app.t?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/t/17_apps/02_load_app.t (original)
+++ trunk/libdancer-perl/t/17_apps/02_load_app.t Fri Aug 27 23:10:19 2010
@@ -31,4 +31,4 @@
     "9 routes are defined in main app";
 
 response_content_is [GET => "/forum/index"], "forum index"; 
-response_content_is [GET => "/forum"], "root"; 
+response_content_is [GET => "/forum/"], "root"; 

Modified: trunk/libdancer-perl/t/17_apps/04_issue_91.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/t/17_apps/04_issue_91.t?rev=62079&op=diff
==============================================================================
--- trunk/libdancer-perl/t/17_apps/04_issue_91.t (original)
+++ trunk/libdancer-perl/t/17_apps/04_issue_91.t Fri Aug 27 23:10:19 2010
@@ -9,6 +9,6 @@
 use Dancer ':syntax';
 
 response_content_is [GET => "/"], "mainapp";
-response_content_is [GET => "/foo"], "before block in foo";
-response_content_is [GET => "/foo"], "before block in foo";
+response_content_is [GET => "/foo/"], "before block in foo";
+response_content_is [GET => "/foo/"], "before block in foo";
 response_content_is [GET => "/"], "mainapp";




More information about the Pkg-perl-cvs-commits mailing list