--- trunk/lib/Frey/Manual.pod 2008/12/02 22:07:22 693 +++ trunk/lib/Frey/Manual.pod 2008/12/06 00:20:20 729 @@ -2,8 +2,128 @@ This page describes how to use and develop with L +=head1 Designing user interaction flows + +Frey is all about creating Moose classes as your interaction with pages. +Each page is instance of class with some parametars received with post or +get request. + +If you want to access those parameters in your object, you have to define +attributes for it using L + +You can also generate result in three different forms: + + +=over 20 + +=item as_markup + +HTML content + +=item as_sponge + +Tabular output + +FIXME link to description + +=item as_data + +Any perl hash structure + +=back + + +=head2 No html templates + +Frey doesn't have html templates. Since your methods are part of REST URIs, +it doesn't make sense to separate html from object itself, which represent +web page. L provides role which has a bunch of helpful things +when creating html. + +Basically, if html you are generating in readable code semantically correct +to you, it the right track. + +You don't even have to create initial entry form as L, +which will start your L classes, will call L +for help and generate initial form for you. + +Creating files is mess, so L will +create class and test skeleton for you. + +If I did it right, it should read similar to human language, like SmallTalk. + +To make things simple, there are few convertions (with nod to Ruby on Rails) +which will help you get started: + + +=head2 default parametars + +Default values for + + +=head2 html markup + +HTML markup should be enclosed in C< qq| > and C< | > quotes. There is also +funny but very readable convention of multi line html when you have to +intermix confitions: + + my $html + = qq|

First

| + . ( $is_second ? qq|

Second

| : '' ) + . qq|

Third

| + ; + +This will be checked and reported at some point. Ideally, I would like to +write just + + my $html + = qq|

First

| + . $is_second ? qq|

Second

| : '' + . qq|

Third

| + ; + +which is valid perl syntax but doesn't work as expected. + + +=head2 SmallTalk like refactoring + +Frey is heavily influcenced by SmallTalks, up to the point of syntax. Coding +Frey code should be like playing with L. And you might end up with +result which might surprise you. + +Refactoring tools are not new in perl. However, + + +=head2 examples + +To help you get started, here are few implemented flows in Frey: + +=over 20 + +=item L + +Simple interaction with C + +=item L + +Gather data, display selection form with checkboxes + +=item L + +Display a huge amount of icons with single HTTP request + +=back + + +=head1 Command-line integration + +One of key points is that L runs under your user. This means it has +access to your termnial, and ssh keys, so beware! + =head1 Install +=head2 Firefox + Frey is designed to provide close integration between your day-to-day data mungling work in console and Firefox. @@ -12,12 +132,11 @@ It's also useful to have Firebug extension installed in Firefox to provide quick introspection on html, network traffic and request parameters. -=head1 Command-line integration +If nothing else, L provides Firebug lite bookmarklet. -One of key points is that L runs under your user. This means it has -access to your termnial, and ssh keys, so beware! - -On the other hand, this allow nice integration with command-line utlities: +It's all Text! Firefox extension at +L provides integration +between form textarea and your editor, so it's also handy. =head2 vim @@ -34,8 +153,32 @@ =head1 Command-line helpers +=head2 bin/dev.sh + +Recommeded way to start development L server since it will restart it +automatically and kill running instance if existing. + =head2 bin/check-syntax.sh Check syntax of modified files. +=head2 bin/grep-iselect.sh + +Helper using C to quickly grep, select result and jump to C + +=head2 bin/log.sh + +Open last 3 logs in vim + +=head2 bin/checkout-js.sh + +Checkout bunch of JavaScript code from all over the net, some of which is +used in Frey and rest is kind of TODO list... + +=head2 bin/clean-var.sh + +Cleanup C directory which gets a lot of dumps. Most of useful data +is held forever because I belive that trends are most interesting way to +look at data. + =cut