/[Frey]/branches/no-pager/lib/Frey/Manual.pod
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/no-pager/lib/Frey/Manual.pod

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 737 by dpavlin, Wed Dec 3 21:12:43 2008 UTC revision 738 by dpavlin, Sat Dec 6 15:29:10 2008 UTC
# Line 2  Line 2 
2    
3  This page describes how to use and develop with L<Frey>  This page describes how to use and develop with L<Frey>
4    
5    =head1 Designing user interaction flows
6    
7    Frey is all about creating Moose classes as your interaction with pages.
8    Each page is instance of class with some parametars received with post or
9    get request.
10    
11    If you want to access those parameters in your object, you have to define
12    attributes for it using L<Moose/has>
13    
14    You can also generate result in three different forms:
15    
16    
17    =over 20
18    
19    =item as_markup
20    
21    HTML content
22    
23    =item as_sponge
24    
25    Tabular output
26    
27    FIXME link to description
28    
29    =item as_data
30    
31    Any perl hash structure
32    
33    =back
34    
35    
36    =head2 No html templates
37    
38    Frey doesn't have html templates. Since your methods are part of REST URIs,
39    it doesn't make sense to separate html from object itself, which represent
40    web page. L<Frey::Web> provides role which has a bunch of helpful things
41    when creating html.
42    
43    Basically, if html you are generating in readable code semantically correct
44    to you, it the right track.
45    
46    You don't even have to create initial entry form as L<Frey::Run>,
47    which will start your L<Moose> classes, will call L<Frey::Action>
48    for help and generate initial form for you.
49    
50    Creating files is mess, so L<Frey::ClassCreator/create_class_source> will
51    create class and test skeleton for you.
52    
53    If I did it right, it should read similar to human language, like SmallTalk.
54    
55    To make things simple, there are few convertions (with nod to Ruby on Rails)
56    which will help you get started:
57    
58    
59    =head2 default parametars
60    
61    Default values for
62    
63    
64    =head2 html markup
65    
66    HTML markup should be enclosed in C< qq| > and C< | > quotes. There is also
67    funny but very readable convention of multi line html when you have to
68    intermix confitions:
69    
70      my $html
71        = qq|<h1>First</h1>|
72        . ( $is_second ? qq|<h2>Second</h2>| : '' )
73        . qq|<h3>Third</h3>|
74        ;
75    
76    This will be checked and reported at some point. Ideally, I would like to
77    write just
78    
79      my $html
80        = qq|<h1>First</h1>|
81        . $is_second ? qq|<h2>Second</h2>| : ''
82        . qq|<h3>Third</h3>|
83        ;
84    
85    which is valid perl syntax but doesn't work as expected.
86    
87    
88    =head2 SmallTalk like refactoring
89    
90    Frey is heavily influcenced by SmallTalks, up to the point of syntax. Coding
91    Frey code should be like playing with L<Frey>. And you might end up with
92    result which might surprise you.
93    
94    Refactoring tools are not new in perl. However,
95    
96    
97    =head2 examples
98    
99    To help you get started, here are few implemented flows in Frey:
100    
101    =over 20
102    
103    =item L<Frey::Shell::Grep>
104    
105    Simple interaction with C<grep>
106    
107    =item L<Frey::SVK>
108    
109    Gather data, display selection form with checkboxes
110    
111    =item L<Frey::IconBrowser>
112    
113    Display a huge amount of icons with single HTTP request
114    
115    =back
116    
117    
118  =head1 Command-line integration  =head1 Command-line integration
119    
120  One of key points is that L<Frey> runs under your user. This means it has  One of key points is that L<Frey> runs under your user. This means it has
# Line 53  Check syntax of modified files. Line 166  Check syntax of modified files.
166    
167  Helper using C<iselect> to quickly grep, select result and jump to C<vim>  Helper using C<iselect> to quickly grep, select result and jump to C<vim>
168    
169    =head2 bin/log.sh
170    
171    Open last 3 logs in vim
172    
173  =head2 bin/checkout-js.sh  =head2 bin/checkout-js.sh
174    
175  Checkout bunch of JavaScript code from all over the net, some of which is  Checkout bunch of JavaScript code from all over the net, some of which is

Legend:
Removed from v.737  
changed lines
  Added in v.738

  ViewVC Help
Powered by ViewVC 1.1.26