r64807 - in /trunk/libdancer-perl: ./ debian/ lib/ lib/Dancer/ lib/Dancer/Serializer/ lib/Dancer/Template/ script/ t/10_template/ t/14_serializer/

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri Nov 12 21:07:35 UTC 2010


Author: gregoa
Date: Fri Nov 12 21:07:25 2010
New Revision: 64807

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=64807
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/Deployment.pod
    trunk/libdancer-perl/lib/Dancer/Helpers.pm
    trunk/libdancer-perl/lib/Dancer/Renderer.pm
    trunk/libdancer-perl/lib/Dancer/Serializer/XML.pm
    trunk/libdancer-perl/lib/Dancer/Template/Abstract.pm
    trunk/libdancer-perl/script/dancer
    trunk/libdancer-perl/t/10_template/02_abstract_class.t
    trunk/libdancer-perl/t/14_serializer/13_xml.t

Modified: trunk/libdancer-perl/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/CHANGES?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/CHANGES (original)
+++ trunk/libdancer-perl/CHANGES Fri Nov 12 21:07:25 2010
@@ -1,3 +1,18 @@
+Dancer 1.1904
+    [ Sawyer X, Franck Cuny ]
+    * SAX, not Sax.
+    * Check for XML::Parser or XML::SAX in test as well.
+
+Dancer 1.1903
+    [ Sawyer X, Franck Cuny ]
+    * XML::Simple needs either XML::SAX or XML::Parser.
+      (fixed test fails from Dancer::Serializer::XML)
+
+Dancer 1.1902
+
+    [ Adam J. Foxson ]
+    * Addresses issue #136: "readline() on closed filehandle DATA"
+
 Dancer 1.1901 (1.2RC1)
 
     [ Franck Cuny ]
@@ -21,10 +36,6 @@
       flagged "experimental").  
     * Default log level in development environment is now 'core' in order to
       provide more information.
-    * New scaffolded application design. More neutral and with lots of
-      information for a beginner, and links to useful material.
-      Based on the Ruby on Rails start page (kudos to the Rails team,
-      http://www.rubyonrails.org).
 
     [ Boris Shomodjvarac ] 
     * Support for a clean way for Template engines to define their template

Modified: trunk/libdancer-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/META.yml?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/META.yml (original)
+++ trunk/libdancer-perl/META.yml Fri Nov 12 21:07:25 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Dancer
-version:            1.1901
+version:            1.1904
 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=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/debian/changelog (original)
+++ trunk/libdancer-perl/debian/changelog Fri Nov 12 21:07:25 2010
@@ -1,3 +1,9 @@
+libdancer-perl (1.1904-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Fri, 12 Nov 2010 22:06:14 +0100
+
 libdancer-perl (1.1901-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libdancer-perl/lib/Dancer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer.pm?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer.pm (original)
+++ trunk/libdancer-perl/lib/Dancer.pm Fri Nov 12 21:07:25 2010
@@ -30,7 +30,7 @@
 use base 'Exporter';
 
 $AUTHORITY = 'SUKRIA';
-$VERSION   = '1.1901';
+$VERSION   = '1.1904';
 @EXPORT    = qw(
   after
   any

Modified: trunk/libdancer-perl/lib/Dancer/Deployment.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer/Deployment.pod?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer/Deployment.pod (original)
+++ trunk/libdancer-perl/lib/Dancer/Deployment.pod Fri Nov 12 21:07:25 2010
@@ -25,7 +25,9 @@
 
         <Directory "/path/to/dancer/public">
             AllowOverride None
-            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch -Indexes
+
+            # +Indexes is important, if you don't enable it, Apache will silently try to get /index.html
+            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch +Indexes
             
 			Order allow,deny
             Allow from all
@@ -39,6 +41,7 @@
 configuration) in your application's root folder:
 
     # BEGIN dancer application htaccess
+    DirectoryIndex dispatch.cgi/
     RewriteEngine On
     RewriteCond %{SCRIPT_FILENAME} !-d
     RewriteCond %{SCRIPT_FILENAME} !-f

Modified: trunk/libdancer-perl/lib/Dancer/Helpers.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer/Helpers.pm?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer/Helpers.pm (original)
+++ trunk/libdancer-perl/lib/Dancer/Helpers.pm Fri Nov 12 21:07:25 2010
@@ -39,7 +39,6 @@
     undef $layout unless $options->{layout};
 
     $tokens ||= {};
-    $tokens->{settings} = Dancer::Config->settings;
     $tokens->{request} = Dancer::SharedData->request;
     $tokens->{params}  = Dancer::SharedData->request->params;
     if (setting('session')) {

Modified: trunk/libdancer-perl/lib/Dancer/Renderer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer/Renderer.pm?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer/Renderer.pm (original)
+++ trunk/libdancer-perl/lib/Dancer/Renderer.pm Fri Nov 12 21:07:25 2010
@@ -15,6 +15,10 @@
 use Dancer::SharedData;
 use Dancer::Logger;
 use MIME::Types;
+
+BEGIN {
+	MIME::Types->new(only_complete => 1);
+};
 
 sub render_file {
     return get_file_response();
@@ -186,22 +190,21 @@
 # set of builtin templates needed by Dancer when rendering HTML pages
 sub templates {
     my $charset = setting('charset') || 'UTF-8';
-    {   default => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
+    {   default => '<!DOCTYPE html>
+<html lang="en-US">
 <head>
 <title><% title %></title>
 <link rel="stylesheet" href="/css/<% style %>.css" />
-<meta http-equiv="Content-type" content="text/html; charset='.$charset.'" />
+<meta charset=' . $charset . '" />
 </head>
 <body>
 <h1><% title %></h1>
 <div id="content">
 <% content %>
 </div>
-<div id="footer">
+<footer>
 Powered by <a href="http://perldancer.org/">Dancer</a> <% version %>
-</div>
+</footer>
 </body>
 </html>',
     };

Modified: trunk/libdancer-perl/lib/Dancer/Serializer/XML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer/Serializer/XML.pm?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer/Serializer/XML.pm (original)
+++ trunk/libdancer-perl/lib/Dancer/Serializer/XML.pm Fri Nov 12 21:07:25 2010
@@ -22,12 +22,22 @@
 
 # class definition
 
-sub loaded { Dancer::ModuleLoader->load('XML::Simple') }
+sub loaded_xmlsimple {
+    Dancer::ModuleLoader->load('XML::Simple');
+}
+
+sub loaded_xmlbackends {
+    # we need either XML::Parser or XML::SAX too
+    Dancer::ModuleLoader->load('XML::Parser') or
+    Dancer::ModuleLoader->load('XML::SAX');
+}
 
 sub init {
     my ($self) = @_;
     die 'XML::Simple is needed and is not installed'
-      unless $self->loaded;
+      unless $self->loaded_xmlsimple;
+    die 'XML::Simple needs XML::Parser or XML::SAX and neither is installed'
+      unless $self->loaded_xmlbackends;
     $_xs = XML::Simple->new();
 }
 

Modified: trunk/libdancer-perl/lib/Dancer/Template/Abstract.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/lib/Dancer/Template/Abstract.pm?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/lib/Dancer/Template/Abstract.pm (original)
+++ trunk/libdancer-perl/lib/Dancer/Template/Abstract.pm Fri Nov 12 21:07:25 2010
@@ -61,18 +61,6 @@
 
 The base class provides a plain init() method that only returns true.
 
-=item B<default_tmpl_ext()>
-
-Template class that inherits this class should override this method to return a default template
-extension, example: for Template::Toolkit it returns "tt" and for HTML::Mason it returns "mason". 
-So when you call C<template 'index';> in your dispatch code, Dancer will look for a file 'index.tt'
-or 'index.mason' based on the template you use.
-
-Note 1: when returning the extension string, please do not add a dot in front of the extension 
-as Dancer will do that. 
-Note 2: for backwords compatibility abstract class returns "tt" instead of throwing
-an exception 'method not implemented'.
-
 =item B<view($view)>
 
 The default behavior of this method is to return the path of the given view.

Modified: trunk/libdancer-perl/script/dancer
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/script/dancer?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/script/dancer (original)
+++ trunk/libdancer-perl/script/dancer Fri Nov 12 21:07:25 2010
@@ -245,134 +245,14 @@
     clean               => { FILES => '$appname-*' },
 );
 ",
-'index.tt'  => 
-'  
-<!-- 
-    Credit goes to the Ruby on Rails team for this page 
-    has been heavily based on the default Rails page that is 
-    built with a scaffolded application.
-
-    Thanks a lot to them for their work.
-
-    See Ruby on Rails if you want a kickass framework in Ruby:
-    http://www.rubyonrails.org/
--->
-
-<div id="page">
-      <div id="sidebar">
-        <ul id="sidebar-items">
-          <li>
-            <h3>Join the community</h3>
-            <ul class="links">
-
-              <li><a href="http://perldancer.org/">PerlDancer</a></li>
-              <li><a href="http://twitter.com/PerlDancer/">Official Twitter</a></li>
-              <li><a href="http://github.com/sukria/Dancer/">GitHub Community</a></li>
-            </ul>
-          </li>
-          
-          <li>
-            <h3>Browse the documentation</h3>
-
-            <ul class="links">
-              <li><a href="http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod">Introduction</a></li>
-              <li><a href="http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod">Cookbook</a></li>
-              <li><a href="http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod">Deployment Guide</a></li>
-            </ul>
-          </li>
-
-          <li>
-            <h3>Your application’s environment</h3>
-
-            <ul>
-                <li>Location: <code>[% appdir %]</code></li>
-                <li>Template engine: <code><% settings.template %></code></li>
-                <li>Logger: <code><% settings.logger %></code></li>
-                <li>Environment: <code><% settings.environment %></code></li>
-            </ul>
-
-          </li>
-        </ul>
-
-      </div>
-
-      <div id="content">
-        <div id="header">
-          <h1>Perl is dancing</h1>
-          <h2>You&rsquo;ve joined the dance floor!</h2>
-        </div>
-
-        <div id="getting-started">
-          <h1>Getting started</h1>
-          <h2>Here&rsquo;s how to get dancing:</h2>
-          
-          <ol>          
-            <li>
-              <h2>Tune your application</h2>
-
-              <p>
-              Your application is configured via a global configuration file,
-              <tt>config.yml</tt> and an "environment" configuration file,
-              <tt>environments/development.yml</tt>. Edit those files if you
-              want to change the settings of your application.
-              </p>
-            </li>
-
-            <li>
-              <h2>Add your own routes</h2>
-
-              <p>
-              The default route that displays this page can be removed,
-              it\'s just here to help you get started. The template used to
-              generate this content is located in 
-              <code>views/index.tt</code>.
-              
-              <p>
-              You can add some routes to <tt>lib/'.$appname.'.pm</tt>. 
-              You can see lots of examples in the 
-              <a href="http://search.cpan.org/dist/Dancer/lib/Dancer/Introduction.pod">Dancer::Introduction</a> guide</p>
-            </li>
-
-            <li>
-                <h2>Restart your application</h2>
-
-                <p>
-                If you\'re using the standalone server (this is the case if you
-                just laucnhed <code>'.$appname.'.pl</code>) you will need to
-                restart it whenever you change the files located in the lib
-                directory (that\'s where you should put your routes).
-                </p>
-
-                <p>
-                If you want to be able to to change your routes on-the-fly, 
-                you can enable the auto_reload feature in
-                <code>environments/development.yml</code>.
-                </p>
-            </li>
-
-          </ol>
-        </div>
-      </div>
-    </div>
+'index.tt'  => '<h2>It Works!</h2>
+
+<p>
+I\'m in <code>[%appdir%]/views/index.tt</code>
+</p>
 ',
-
 'main.tt'   =>
-'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<title>'.$appname.'</title>
-<link rel="stylesheet" href="/css/style.css" />
-<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
-</head>
-<body>
-<% content %>
-<div id="footer">
-Powered by <a href="http://perldancer.org/">Dancer</a> '.$DANCER_VERSION.'
-</div>
-</body>
-</html>
-',
+    Dancer::Renderer->html_page($appname, '<% content %>'),
 
 "dispatch.cgi" =>
 "$PERL_INTERPRETER
@@ -417,200 +297,43 @@
 ",
 
 'style.css' =>
-'
-body {
-font-family: \'Linux Libertine\', Palatino, \'Palatino Linotype\', \'Book Antiqua\', Georgia, \'Times New Roman\', serif;
-margin: 0;
-margin-bottom: 25px;
-padding: 0;
-background-color: #ddd;
-font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
-font-size: 13px;
-color: #333;
+
+'body {
+    font-family: Lucida,sans-serif;
+    color: #eee;
+    background-color: #1f1b1a;
+}
+
+#content {
+    color: #000;
+    background-color: #eee;
+    padding: 1em;
+    margin: 1em;
+    padding-top: 0.5em;
+}
+
+a {
+    color: #a5ec02;
 }
 
 h1 {
-font-size: 28px;
-color: #000;
-}
-
-a  {color: #03c}
-a:hover {
-background-color: #03c;
-color: white;
-text-decoration: none;
-}
-
-
-#page {
-background-color: #ddd;
-width: 750px;
-margin: 0;
-margin-left: auto;
-padding-left: 100px;
-margin-right: auto;
-}
-
-#content {
-background-color: white;
-border: 3px solid #aaa;
-border-top: none;
-padding: 25px;
-width: 500px;
-}
-
-#sidebar {
-float: right;
-width: 175px;
-}
-
-#header, #about, #getting-started {
-padding-left: 75px;
-padding-right: 30px;
-}
-
-
-#header {
-/* background-image: url("images/perldancer.png"); */
-background-repeat: no-repeat;
-background-position: top left;
-height: 64px;
-}
-#header h1, #header h2 {margin: 0}
-#header h2 {
-color: #888;
-font-weight: normal;
-font-size: 16px;
-}
-
-
-#about h3 {
-margin: 0;
-margin-bottom: 10px;
-font-size: 14px;
-}
-
-#about-content {
-background-color: #ffd;
-border: 1px solid #fc0;
-margin-left: -11px;
-}
-#about-content table {
-margin-top: 10px;
-margin-bottom: 10px;
-font-size: 11px;
-border-collapse: collapse;
-}
-#about-content td {
-padding: 10px;
-padding-top: 3px;
-padding-bottom: 3px;
-}
-#about-content td.name  {color: #555}
-#about-content td.value {color: #000}
-
-#about-content.failure {
-background-color: #fcc;
-border: 1px solid #f00;
-}
-#about-content.failure p {
-margin: 0;
-padding: 10px;
-}
-
-
-#getting-started {
-border-top: 1px solid #ccc;
-margin-top: 25px;
-padding-top: 15px;
-}
-#getting-started h1 {
-margin: 0;
-font-size: 20px;
-}
-#getting-started h2 {
-margin: 0;
-font-size: 14px;
-font-weight: normal;
-color: #333;
-margin-bottom: 25px;
-}
-#getting-started ol {
-margin-left: 0;
-padding-left: 0;
-}
-#getting-started li {
-font-size: 18px;
-color: #888;
-margin-bottom: 25px;
-}
-#getting-started li h2 {
-margin: 0;
-font-weight: normal;
-font-size: 18px;
-color: #333;
-}
-#getting-started li p {
-color: #555;
-font-size: 13px;
-}
-
-
-#search {
-margin: 0;
-padding-top: 10px;
-padding-bottom: 10px;
-font-size: 11px;
-}
-#search input {
-font-size: 11px;
-margin: 2px;
-}
-#search-text {width: 170px}
-
-
-#sidebar ul {
-margin-left: 0;
-padding-left: 0;
-}
-#sidebar ul h3 {
-margin-top: 25px;
-font-size: 16px;
-padding-bottom: 10px;
-border-bottom: 1px solid #ccc;
-}
-#sidebar li {
-list-style-type: none;
-}
-#sidebar ul.links li {
-margin-bottom: 5px;
-}
-
-
-h1, h2, h3, h4, h5 {
-font-family: sans-serif;
-margin: 1.2em 0 0.6em 0;
-}
-
-p {
-line-height: 1.5em;
-margin: 1.6em 0;
-}
-
-code {
-    font-family: \'Andale Mono\', Monaco, \'Liberation Mono\', \'Bitstream Vera Sans Mono\', \'DejaVu Sans Mono\', monospace;
-}
-
-#footer {
-clear: both;
-padding-top: 2em;
-text-align: center;
-font-family: sans-serif;
-font-size: 10px;
-}
+    color: #a5ec02;
+}
+
+footer {
+    border-top: 1px solid #aba29c;
+    margin-top: 2em;
+    padding-top: 1em;
+    font-size: 10px;
+    color: #ddd;
+}
+
+pre {
+    font-family: \"lucida console\",\"monaco\",\"andale mono\",\"bitstream vera sans mono\",\"consolas\",monospace;
+}
+
 ',
 
-# error.css
 "error.css" =>
 
 "body {
@@ -736,7 +459,7 @@
 ",
 
 "002_index_route.t" =>
-"use Test::More tests => 2;
+"use Test::More tests => 3;
 use strict;
 use warnings;
 
@@ -746,6 +469,8 @@
 
 route_exists [GET => '/'], 'a route handler is defined for /';
 response_status_is ['GET' => '/'], 200, 'response status is 200 for /';
+response_content_like [GET => '/'], qr/It Works.*I'm in.*index.tt/s,
+    'content looks OK for /';
 ",
 
     };

Modified: trunk/libdancer-perl/t/10_template/02_abstract_class.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/t/10_template/02_abstract_class.t?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/t/10_template/02_abstract_class.t (original)
+++ trunk/libdancer-perl/t/10_template/02_abstract_class.t Fri Nov 12 21:07:25 2010
@@ -1,4 +1,4 @@
-use Test::More tests => 3;
+use Test::More tests => 2;
 use strict;
 use warnings;
 
@@ -8,5 +8,3 @@
 eval { $a->render };
 like $@, qr/render not implemented/, "cannot call abstract method render";
 is $a->init, 1, "default init returns 1";
-
-is $a->default_tmpl_ext, "tt";

Modified: trunk/libdancer-perl/t/14_serializer/13_xml.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdancer-perl/t/14_serializer/13_xml.t?rev=64807&op=diff
==============================================================================
--- trunk/libdancer-perl/t/14_serializer/13_xml.t (original)
+++ trunk/libdancer-perl/t/14_serializer/13_xml.t Fri Nov 12 21:07:25 2010
@@ -5,6 +5,10 @@
 
 plan skip_all => "XML::Simple is needed to run this tests"
     unless Dancer::ModuleLoader->load('XML::Simple');
+
+plan skip_all => "XML::Parser or XML::SAX are needed to run this tests"
+    unless Dancer::ModuleLoader->load('XML::Parser') or
+           Dancer::ModuleLoader->load('XML::SAX');
 
 plan tests => 13;
 




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