Permalink
Browse files

more stuff to do

  • Loading branch information...
1 parent 0e06303 commit 1449a3a4fcc7b686bee783177640d8084556243e Alexis Sukrieh committed Aug 3, 2009
Showing with 105 additions and 17 deletions.
  1. +105 −17 TODO
View
122 TODO
@@ -1,3 +1,9 @@
+ TODO
+
+
+ This is the roadmap of upcoming developments
+
+
* Route caching support
When a path is firstly resolved through the route tree, we should
@@ -14,37 +20,119 @@
...
};
-* Helper support
+* Helper script
+
+ We need an helper script for providing a bootstraping method for
+ creating new applications.
+
+ The helper script should be named dancer, and would be usable
+ like the following:
+
+ $ dancer --help
+ dancer - helper script for bootstraping Dancer web applications
+
+ Usage: dancer [options] <appname>
+ Create the directory `appname' according to the given options.
- We should provide a way to define helpers, that are basically, methods
- accessible from the action code blocks.
+ Options:
- Well, this is certainly useless in Perl (whereas it's not in Ruby) because
- any sub defined would be accessible....
+ --template create a views directory and make sure
+ Template is installed.
+ --logger make sure Logger::Syslog is installed and
+ enable the logger in the app.
+
+ Here is the output of the command:
+
+ $ dancer --template /srv/webapps/myblog
+ + creating /srv/webapps/myblog
+ + creating /srv/webapps/myblog/public
+ + creating /srv/webapps/myblog/public/errors
+ + creating /srv/webapps/myblog/public/errors/500.html
+ + creating /srv/webapps/myblog/public/errors/404.html
+ + creating /srv/webapps/myblog/public/errors/503.html
+ + creating /srv/webapps/myblog/public/css
+ + creating /srv/webapps/myblog/public/css/style.css
+ + creating /srv/webapps/myblog/views
+ + creating /srv/webapps/myblog/views/layouts
+ + creating /srv/webapps/myblog/views/layouts/main.tt
+ + creating /srv/webapps/myblog/myblog-server.pl
+ + creating /srv/webapps/myblog/environment.pl
+ + creating /srv/webapps/myblog/environments/
+ + creating /srv/webapps/myblog/environments/production.pl
+ + creating /srv/webapps/myblog/environments/development.pl
* Error handler support
- Could be interesting to have a real error handler mechanism instead of the
- single `Dancer::Renderer->render_error' method.
+ It should be possible to handle errors in two different ways.
+ - detailed: when an error occurs, Dancer renders a page with as
+ many details as it can concerning the error
+ - hidden: when an error occurs, a generic page is sent to the
+ user describing the kind of error. This is done with a
+ send_file statement, using views/error/ERRCODE.html
+
+ These error rendering modes should be set through the
+ 'errors' setting :
+
+ set errors => detailed;
+
+ or
+
+ set errors => hidden;
+
* Environment support
- It should be possible to run a Dancer server with a specific environment,
- like development or production.
+ It should be possible to run a Dancer server with a specific
+ environment, like development or production.
This could be done like the following:
- $ ./my-dancer-app.pl --environment=development (which would be the default)
+ $ ./my-dancer-app.pl --environment production
+
+ Then the script appdir/environments/development.pl would be
+ loaded.
+
+ Content for environments/development.pl
+
+ set access_log => true;
+ set verbosity => true;
+ set errors => detailed;
+ set port => 3000;
+
+ end;
+
+ Content for environments/production.pl
+
+ set access_log => true;
+ set verbosity => false;
+ set errors => hidden;
+ set port => 3000;
+
+ end;
+
+ The environments files are pure Perl files, they are loaded with
+ the require mechanism, so the can be written with the Dancer
+ syntax.
+
+ The `end' keyword just returns true, it's sugar for configuration
+ files.
+
+* Logger
+
+ we should provide the option to use a logger, like
+ Logger::Syslog. Can be defined with a setting:
+
+ set log => debug;
+
+ or
- Then the script appdir/environments/development.pl would be loaded.
+ set log => warning;
- It could contain the following information:
+ A wrapper, Dancer::Logger would then provide the following
+ methods: debug, warning and error.
- # a bunch of settings
- setting access_log => 1;
- setting verbosity => 1;
+ If the log setting is at least the level requested, it logs the
+ message, otherwise, it drops it out.
-* Templates
- - support for changing views extensions

0 comments on commit 1449a3a

Please sign in to comment.