kwartz 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. data/COPYING +340 -0
  2. data/ChangeLog +103 -0
  3. data/README.txt +37 -0
  4. data/bin/kwartz +12 -0
  5. data/doc-api/classes/Kwartz.html +218 -0
  6. data/doc-api/classes/Kwartz/Assertion.html +140 -0
  7. data/doc-api/classes/Kwartz/AssertionError.html +148 -0
  8. data/doc-api/classes/Kwartz/AttrInfo.html +320 -0
  9. data/doc-api/classes/Kwartz/BaseError.html +206 -0
  10. data/doc-api/classes/Kwartz/BaseTranslator.html +331 -0
  11. data/doc-api/classes/Kwartz/CharacterType.html +212 -0
  12. data/doc-api/classes/Kwartz/CommandOptionError.html +154 -0
  13. data/doc-api/classes/Kwartz/CommandOptions.html +374 -0
  14. data/doc-api/classes/Kwartz/Config.html +150 -0
  15. data/doc-api/classes/Kwartz/ConvertError.html +191 -0
  16. data/doc-api/classes/Kwartz/Converter.html +252 -0
  17. data/doc-api/classes/Kwartz/CssStyleParser.html +483 -0
  18. data/doc-api/classes/Kwartz/DocumentRuleset.html +369 -0
  19. data/doc-api/classes/Kwartz/ElementExpander.html +325 -0
  20. data/doc-api/classes/Kwartz/ElementInfo.html +312 -0
  21. data/doc-api/classes/Kwartz/ElementRuleset.html +582 -0
  22. data/doc-api/classes/Kwartz/EperlHandler.html +338 -0
  23. data/doc-api/classes/Kwartz/EperlTranslator.html +167 -0
  24. data/doc-api/classes/Kwartz/ErubisHandler.html +113 -0
  25. data/doc-api/classes/Kwartz/ErubisTranslator.html +168 -0
  26. data/doc-api/classes/Kwartz/ErubyHandler.html +337 -0
  27. data/doc-api/classes/Kwartz/ErubyTranslator.html +167 -0
  28. data/doc-api/classes/Kwartz/ExpandStatement.html +227 -0
  29. data/doc-api/classes/Kwartz/Expression.html +119 -0
  30. data/doc-api/classes/Kwartz/Handler.html +558 -0
  31. data/doc-api/classes/Kwartz/JstlHandler.html +657 -0
  32. data/doc-api/classes/Kwartz/JstlTranslator.html +226 -0
  33. data/doc-api/classes/Kwartz/KwartzError.html +146 -0
  34. data/doc-api/classes/Kwartz/Main.html +384 -0
  35. data/doc-api/classes/Kwartz/NativeExpression.html +236 -0
  36. data/doc-api/classes/Kwartz/NativeStatement.html +254 -0
  37. data/doc-api/classes/Kwartz/Node.html +156 -0
  38. data/doc-api/classes/Kwartz/ParseError.html +148 -0
  39. data/doc-api/classes/Kwartz/PhpHandler.html +333 -0
  40. data/doc-api/classes/Kwartz/PhpTranslator.html +194 -0
  41. data/doc-api/classes/Kwartz/PresentationLogicParser.html +830 -0
  42. data/doc-api/classes/Kwartz/PrintStatement.html +221 -0
  43. data/doc-api/classes/Kwartz/RailsHandler.html +587 -0
  44. data/doc-api/classes/Kwartz/RailsTranslator.html +167 -0
  45. data/doc-api/classes/Kwartz/RubyStyleParser.html +558 -0
  46. data/doc-api/classes/Kwartz/Ruleset.html +117 -0
  47. data/doc-api/classes/Kwartz/Statement.html +119 -0
  48. data/doc-api/classes/Kwartz/StrutsTranslator.html +190 -0
  49. data/doc-api/classes/Kwartz/TagInfo.html +314 -0
  50. data/doc-api/classes/Kwartz/TextConverter.html +270 -0
  51. data/doc-api/classes/Kwartz/Translator.html +318 -0
  52. data/doc-api/classes/Test.html +107 -0
  53. data/doc-api/classes/Test/Unit.html +101 -0
  54. data/doc-api/created.rid +1 -0
  55. data/doc-api/files/__/README_txt.html +150 -0
  56. data/doc-api/files/kwartz/assert_rb.html +114 -0
  57. data/doc-api/files/kwartz/binding/eperl_rb.html +116 -0
  58. data/doc-api/files/kwartz/binding/erubis_rb.html +116 -0
  59. data/doc-api/files/kwartz/binding/eruby_rb.html +115 -0
  60. data/doc-api/files/kwartz/binding/jstl_rb.html +116 -0
  61. data/doc-api/files/kwartz/binding/php_rb.html +116 -0
  62. data/doc-api/files/kwartz/binding/rails_rb.html +115 -0
  63. data/doc-api/files/kwartz/binding/struts_rb.html +117 -0
  64. data/doc-api/files/kwartz/config_rb.html +107 -0
  65. data/doc-api/files/kwartz/converter_rb.html +119 -0
  66. data/doc-api/files/kwartz/error_rb.html +107 -0
  67. data/doc-api/files/kwartz/main_rb.html +124 -0
  68. data/doc-api/files/kwartz/node_rb.html +114 -0
  69. data/doc-api/files/kwartz/parser_rb.html +117 -0
  70. data/doc-api/files/kwartz/translator_rb.html +115 -0
  71. data/doc-api/files/kwartz/util/assert-text-equal_rb.html +115 -0
  72. data/doc-api/files/kwartz/util/testcase-helper_rb.html +115 -0
  73. data/doc-api/files/kwartz_rb.html +120 -0
  74. data/doc-api/fr_class_index.html +75 -0
  75. data/doc-api/fr_file_index.html +45 -0
  76. data/doc-api/fr_method_index.html +216 -0
  77. data/doc-api/index.html +24 -0
  78. data/doc-api/rdoc-style.css +208 -0
  79. data/doc/docstyle.css +188 -0
  80. data/doc/p-pattern.html +1207 -0
  81. data/doc/reference.html +3396 -0
  82. data/doc/users-guide.html +1670 -0
  83. data/examples/breadcrumbs1/Makefile +15 -0
  84. data/examples/breadcrumbs1/breadcrumbs.eruby.plogic +27 -0
  85. data/examples/breadcrumbs1/breadcrumbs.html +12 -0
  86. data/examples/breadcrumbs1/breadcrumbs.jstl.plogic +28 -0
  87. data/examples/breadcrumbs1/breadcrumbs.php.plogic +26 -0
  88. data/examples/breadcrumbs1/main.php +12 -0
  89. data/examples/breadcrumbs1/main.rb +12 -0
  90. data/examples/breadcrumbs2/Makefile +15 -0
  91. data/examples/breadcrumbs2/breadcrumbs.eruby.plogic +22 -0
  92. data/examples/breadcrumbs2/breadcrumbs.html +14 -0
  93. data/examples/breadcrumbs2/breadcrumbs.jstl.plogic +24 -0
  94. data/examples/breadcrumbs2/breadcrumbs.php.plogic +23 -0
  95. data/examples/breadcrumbs2/main.php +12 -0
  96. data/examples/breadcrumbs2/main.rb +12 -0
  97. data/examples/pagelayout/Makefile +47 -0
  98. data/examples/pagelayout/content.eruby.plogic +44 -0
  99. data/examples/pagelayout/content.jstl.plogic +36 -0
  100. data/examples/pagelayout/content.php.plogic +37 -0
  101. data/examples/pagelayout/content1.html +36 -0
  102. data/examples/pagelayout/content2.html +29 -0
  103. data/examples/pagelayout/design.css +40 -0
  104. data/examples/pagelayout/layout.html +50 -0
  105. data/examples/pagelayout/main.php +55 -0
  106. data/examples/pagelayout/main.rb +77 -0
  107. data/examples/pagelayout/menu.eruby.plogic +14 -0
  108. data/examples/pagelayout/menu.html +13 -0
  109. data/examples/pagelayout/menu.jstl.plogic +14 -0
  110. data/examples/pagelayout/menu.php.plogic +14 -0
  111. data/examples/rails1/Makefile +36 -0
  112. data/examples/rails1/README +19 -0
  113. data/examples/rails1/application_helper.rb +31 -0
  114. data/examples/rails1/edit.html +28 -0
  115. data/examples/rails1/edit.plogic +10 -0
  116. data/examples/rails1/form.html +52 -0
  117. data/examples/rails1/form.plogic +33 -0
  118. data/examples/rails1/layout.plogic +15 -0
  119. data/examples/rails1/link_to.plogic +19 -0
  120. data/examples/rails1/list.html +48 -0
  121. data/examples/rails1/list.plogic +28 -0
  122. data/examples/rails1/new.html +27 -0
  123. data/examples/rails1/new.plogic +10 -0
  124. data/examples/rails1/reader.plogic +29 -0
  125. data/examples/rails1/show.html +40 -0
  126. data/examples/rails1/show.plogic +4 -0
  127. data/examples/rails1/writer.plogic +8 -0
  128. data/examples/table1/Makefile +15 -0
  129. data/examples/table1/main.php +11 -0
  130. data/examples/table1/main.rb +11 -0
  131. data/examples/table1/table1.eruby.plogic +21 -0
  132. data/examples/table1/table1.html +16 -0
  133. data/examples/table1/table1.jstl.plogic +21 -0
  134. data/examples/table1/table1.php.plogic +22 -0
  135. data/kwartz.gemspec +55 -0
  136. data/lib/kwartz.rb +13 -0
  137. data/lib/kwartz/assert.rb +31 -0
  138. data/lib/kwartz/binding/eperl.rb +166 -0
  139. data/lib/kwartz/binding/erubis.rb +61 -0
  140. data/lib/kwartz/binding/eruby.rb +164 -0
  141. data/lib/kwartz/binding/jstl.rb +334 -0
  142. data/lib/kwartz/binding/php.rb +167 -0
  143. data/lib/kwartz/binding/rails.rb +295 -0
  144. data/lib/kwartz/binding/struts.rb +109 -0
  145. data/lib/kwartz/config.rb +28 -0
  146. data/lib/kwartz/converter.rb +920 -0
  147. data/lib/kwartz/error.rb +41 -0
  148. data/lib/kwartz/main.rb +464 -0
  149. data/lib/kwartz/node.rb +454 -0
  150. data/lib/kwartz/parser.rb +903 -0
  151. data/lib/kwartz/translator.rb +153 -0
  152. data/lib/kwartz/util/assert-text-equal.rb +44 -0
  153. data/lib/kwartz/util/testcase-helper.rb +112 -0
  154. data/setup.rb +1331 -0
  155. data/test/test-compile.rb +36 -0
  156. data/test/test-compile.yaml +178 -0
  157. data/test/test-converter.rb +34 -0
  158. data/test/test-converter.yaml +127 -0
  159. data/test/test-directives.rb +32 -0
  160. data/test/test-directives.yaml +1411 -0
  161. data/test/test-main.rb +464 -0
  162. data/test/test-parser.rb +54 -0
  163. data/test/test-parser.yaml +394 -0
  164. data/test/test-rails.rb +28 -0
  165. data/test/test-rails.yaml +301 -0
  166. data/test/test-ruleset.rb +36 -0
  167. data/test/test-ruleset.yaml +804 -0
  168. data/test/test.rb +44 -0
  169. metadata +236 -0
@@ -0,0 +1,36 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <body>
4
+
5
+ <h1 id="mark:pagetitle">Stock Quoting</h1>
6
+
7
+ <table id="mark:content">
8
+ <thead>
9
+ <tr>
10
+ <th>Symbol</th><th>Company</th><th>Price</th><th>Change</th>
11
+ </tr>
12
+ </thead>
13
+ <tbody>
14
+ <tr id="mark:stocks">
15
+ <td><a href="#" id="mark:stock_symbol_link">AAAA</a></td>
16
+ <td id="mark:stock_company">AAAA Corp.</td>
17
+ <td id="mark:stock_price" align="right">11.11</td>
18
+ <td id="mark:stock_rate" align="right">1.11%</td>
19
+ </tr>
20
+ <tr id="dummy:s1">
21
+ <td>BBBB</td>
22
+ <td>BBBB Corp.</td>
23
+ <td align="right">22.22</td>
24
+ <td align="right">2.22%</td>
25
+ </tr>
26
+ <tr id="dummy:s2">
27
+ <td>CCCC</td>
28
+ <td>CCCC Corp.</td>
29
+ <td align="right">33.33</td>
30
+ <td align="right" class="minus">3.33%</td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+
35
+ </body>
36
+ </html>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <body>
4
+
5
+ <h1 id="mark:pagetitle">Quoting Detail</h1>
6
+
7
+ <table id="mark:content">
8
+ <tbody id="mark:stock">
9
+ <tr>
10
+ <th class="label">Symbol:</th>
11
+ <td id="mark:stock_symbol">AAAA</td>
12
+ </tr>
13
+ <tr>
14
+ <th class="label">Company:</th>
15
+ <td id="mark:stock_company">AAAA Corp.</td>
16
+ </tr>
17
+ <tr>
18
+ <th class="label">Price:</th>
19
+ <td id="mark:stock_price">11.11</td>
20
+ </tr>
21
+ <tr>
22
+ <th class="label">Change:</th>
23
+ <td id="mark:stock_rate">1.11%</td>
24
+ </tr>
25
+ </tbody>
26
+ </table>
27
+
28
+ </body>
29
+ </html>
@@ -0,0 +1,40 @@
1
+ body {
2
+ background-color: #FFFFFF;
3
+ }
4
+
5
+ ul {
6
+ margin: 0px;
7
+ padding-left: 15px;
8
+ }
9
+
10
+ #pain-table {
11
+ border-width: 0;
12
+ }
13
+
14
+ #menu-pain, #content-pain {
15
+ border-style: solid;
16
+ border-color: #006699;
17
+ border-width: 2px;
18
+ padding: 10px;
19
+ }
20
+
21
+ #footer-pain {
22
+ text-align: center;
23
+ color: #FFFFFF;
24
+ background-color: #006699;
25
+ }
26
+
27
+ .minus {
28
+ color: #FF0000;
29
+ }
30
+
31
+ th.label {
32
+ text-align: left;
33
+ }
34
+
35
+ .menulist {
36
+ }
37
+
38
+ .contents {
39
+ }
40
+
@@ -0,0 +1,50 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title id="replace_content_with_content:pagetitle">pagetitle</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
8
+ <link rel="stylesheet" type="text/css" href="design.css" />
9
+ </head>
10
+ <body>
11
+
12
+ <table summary="" id="pain-table">
13
+ <tr>
14
+
15
+ <td width="100" valign="top" id="menu-pain">
16
+ <b>Menu:</b>
17
+ <!-- menu -->
18
+ <div id="replace_element_with_element:menulist">
19
+ * menu1 <br />
20
+ * menu2 <br />
21
+ * menu3 <br />
22
+ * menu4 <br />
23
+ </div>
24
+ <!-- /menu -->
25
+ </td>
26
+
27
+ <td width="400" valign="top" id="content-pain">
28
+ <h3 id="replace_content_with_content:pagetitle">...title...</h3>
29
+ <!-- content -->
30
+ <div id="replace_element_with_element:content">
31
+ content<br />
32
+ content<br />
33
+ content<br />
34
+ content<br />
35
+ </div>
36
+ <!-- /content -->
37
+ </td>
38
+
39
+ </tr>
40
+
41
+ <tr>
42
+ <td colspan="2" id="footer-pain">
43
+ copyright&copy; 2004-2006 kuwata-lab.com all rights reserved
44
+ </td>
45
+ </tr>
46
+
47
+ </table>
48
+
49
+ </body>
50
+ </html>
@@ -0,0 +1,55 @@
1
+ <?php
2
+
3
+ // menu
4
+ $menulist = array(
5
+ array('label' => 'Mail', 'url' => '/cgi-bin/mail.cgi' ),
6
+ array('label' => 'Calnedar', 'url' => '/cgi-bin/calendar.cgi' ),
7
+ array('label' => 'Todo', 'url' => '/cgi-bin/todo.cgi' ),
8
+ array('label' => 'Stock', 'url' => '/cgi-bin/stock.cgi' ),
9
+ );
10
+
11
+
12
+ // contents data
13
+ $stocks = array(
14
+ array('symbol' => "AAPL", 'price' => 62.94, 'rate' => -0.23,
15
+ 'company' => "Apple Computer, Inc." ),
16
+ array('symbol' => "MSFT", 'price' => 22.53, 'rate' => 0.64,
17
+ 'company' => "Microsoft Corp." ),
18
+ array('symbol' => "ORCL", 'price' => 12.89, 'rate' => -2.02,
19
+ 'company' => "Oracle Corporation" ),
20
+ array('symbol' => "SUNW", 'price' => 4.12, 'rate' => 0.28,
21
+ 'company' => "Sun Microsystems, Inc." ),
22
+ array('symbol' => "INTC", 'price' => 18.61, 'rate' => 1.01,
23
+ 'company' => "Intel Corporation" ),
24
+ );
25
+
26
+
27
+ // stock symbol
28
+ $symbol = NULL;
29
+ if ($_REQUEST['symbol']) {
30
+ $symbol = $_REQUEST['symbol'];
31
+ } elseif ($argv[1]) {
32
+ $symbol = $argv[1];
33
+ } else {
34
+ $symbol = NULL;
35
+ }
36
+
37
+ // filename
38
+ if ($symbol) {
39
+ $stock = NULL;
40
+ foreach ($stocks as $arr) {
41
+ if ($arr['symbol'] == $symbol) {
42
+ $stock = $arr;
43
+ break;
44
+ }
45
+ }
46
+ $filename = 'content2.php';
47
+ } else {
48
+ $filename = 'content1.php';
49
+ }
50
+
51
+
52
+ // output
53
+ include($filename);
54
+
55
+ ?>
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ## menu
4
+ menulist = [
5
+ { :label => 'Mail', :url => '/cgi-bin/mail.cgi' },
6
+ { :label => 'Calnedar', :url => '/cgi-bin/calendar.cgi' },
7
+ { :label => 'Todo', :url => '/cgi-bin/todo.cgi' },
8
+ { :label => 'Stock', :url => '/cgi-bin/stock.cgi' },
9
+ ]
10
+ #table = [
11
+ # ["Mail" , "/cgi-bin/mail.cgi"],
12
+ # ["Calendar" , "/cgi-bin/calendar.cgi"],
13
+ # ["Todo" , "/cgi-bin/todo.cgi"],
14
+ # ["Stock" , "/cgi-bin/stock.cgi"],
15
+ #]
16
+ #@menulist = table.collect do |label, url|
17
+ # { :label=>label, :url=>url }
18
+ #end
19
+
20
+
21
+ ## contents data
22
+ stocks = [
23
+ { :symbol => "AAPL", :price => 62.94, :rate => -0.23,
24
+ :company => "Apple Computer, Inc." },
25
+ { :symbol => "MSFT", :price => 22.53, :rate => 0.64,
26
+ :company => "Microsoft Corp." },
27
+ { :symbol => "ORCL", :price => 12.89, :rate => -2.02,
28
+ :company => "Oracle Corporation" },
29
+ { :symbol => "SUNW", :price => 4.12, :rate => 0.28,
30
+ :company => "Sun Microsystems, Inc." },
31
+ { :symbol => "INTC", :price => 18.61, :rate => 1.01,
32
+ :company => "Intel Corporation" },
33
+ ]
34
+ #table = [
35
+ # ["AAPL", 62.94, 1.23, "Apple Computer, Inc." ],
36
+ # ["MSFT", 22.53, 0.44, "Microsoft Corp." ],
37
+ # ["ORCL", 12.89, -2.02, "Oracle Corporation" ],
38
+ # ["SUNW", 4.12, 0.28, "Sun Microsystems, Inc."],
39
+ #]
40
+ #@stocks = table.collect do |symbol, price, rate, company|
41
+ # { :symbol=>symbol, :price=>price, :rate=>rate, :company=>company }
42
+ #end
43
+
44
+
45
+ ## page filename
46
+ cgi = nil
47
+ symbol = nil
48
+ if ENV['SCRIPT_NAME']
49
+ require 'cgi'
50
+ cgi = CGI.new
51
+ symbol = cgi.params['symbol'].first
52
+ elsif ARGV[0]
53
+ symbol = ARGV[0]
54
+ end
55
+ if symbol
56
+ stock = stocks.find { |hash| hash[:symbol] == symbol }
57
+ filename = 'content2.rhtml'
58
+ else
59
+ filename = 'content1.rhtml'
60
+ end
61
+
62
+
63
+ ## context object
64
+ context = Object.new
65
+ context.instance_variable_set("@menulist", menulist)
66
+ context.instance_variable_set("@stocks", stocks)
67
+ context.instance_variable_set("@stock", stock) if stock
68
+ require 'erb'
69
+ context.extend ERB::Util
70
+
71
+
72
+ ## output
73
+ str = File.open(filename) { |f| f.read() }
74
+ trim_mode = 1
75
+ erb = ERB.new(str, $SAFE, trim_mode)
76
+ print cgi.header if cgi
77
+ print context.instance_eval(erb.src, filename)
@@ -0,0 +1,14 @@
1
+ #menulist {
2
+ logic: {
3
+ _stag
4
+ @menulist.each do |menu|
5
+ _cont
6
+ end
7
+ _etag
8
+ }
9
+ }
10
+
11
+ #menu {
12
+ value: menu[:label];
13
+ attrs: 'href' menu[:url];
14
+ }
@@ -0,0 +1,13 @@
1
+ <html>
2
+ <body>
3
+
4
+ <h1>Menu</h1>
5
+
6
+ <ul id="mark:menulist">
7
+ <li><a href="..." id="mark:menu">menu0</a></li>
8
+ <li id="dummy:m1"><a href="...">menu1</a></li>
9
+ <li id="dummy:m2"><a href="...">menu2</a></li>
10
+ </ul>
11
+
12
+ </body>
13
+ </html>
@@ -0,0 +1,14 @@
1
+ #menulist {
2
+ logic: {
3
+ _stag;
4
+ <c:forEach var="menu" items="${menulist}">
5
+ _cont;
6
+ </c:forEach>
7
+ _etag;
8
+ }
9
+ }
10
+
11
+ #menu {
12
+ value: menu.label;
13
+ attrs: 'href' menu.url;
14
+ }
@@ -0,0 +1,14 @@
1
+ #menulist {
2
+ logic: {
3
+ _stag();
4
+ foreach ($menulist as $menu) {
5
+ _cont();
6
+ }
7
+ _etag();
8
+ }
9
+ }
10
+
11
+ #menu {
12
+ value: $menu['label'];
13
+ attrs: 'href' $menu['url'];
14
+ }
@@ -0,0 +1,36 @@
1
+
2
+ kwartz = kwartz -l rails
3
+
4
+ ALL = _form.rhtml layout.rhtml new.rhtml edit.rhtml show.rhtml list.rhtml
5
+
6
+ all: $(ALL)
7
+
8
+ clean:
9
+ rm -f $(ALL)
10
+
11
+ check:
12
+ for i in $(ALL) ; do \
13
+ cmd="erb -xT - $$i | ruby -ne 'print \$$line; \$$line=\$$_' | ruby -wc" ; \
14
+ echo -n $$i ' ... '; \
15
+ eval $$cmd; \
16
+ done
17
+ # echo $$cmd ; \
18
+
19
+ _form.rhtml: form.plogic form.html
20
+ $(kwartz) -x form_content -p form.plogic form.html > _form.rhtml
21
+
22
+ layout.rhtml: form.plogic form.html
23
+ $(kwartz) -p form.plogic form.html > layout.rhtml
24
+
25
+ new.rhtml: new.html new.plogic form.html
26
+ $(kwartz) -x page_content -p new.plogic -i form.html new.html > new.rhtml
27
+
28
+ edit.rhtml: edit.html edit.plogic form.html
29
+ $(kwartz) -x page_content -p edit.plogic -i form.html edit.html > edit.rhtml
30
+
31
+ show.rhtml: show.html show.plogic
32
+ $(kwartz) -x page_content -p show.plogic show.html > show.rhtml
33
+
34
+ list.rhtml: list.html list.plogic
35
+ $(kwartz) -x page_content -p list.plogic list.html > list.rhtml
36
+
@@ -0,0 +1,19 @@
1
+
2
+ Just type 'make' and you'll get *.rhtml files.
3
+
4
+
5
+ Manifest:
6
+
7
+ * form.html, form.plogic - form design file for new.rhtml and edit.rhtml,
8
+ and presentation data/logic file for layout.rhtml
9
+ * reader.plogic - common presentation logic for show.rhtml and list.rhtml
10
+ * writer.plogic - common presentation logic for new.rhtml and edit.rhtml
11
+ * layout.plogic - presentation logic for layout.rhtml
12
+ * link_to.plogic - presentation logic for 'start_link_to' helper
13
+ * application_helper.rb - helper module in which 'start_link_to' is defined
14
+
15
+ * edit.html, edit.plogic - presentation data/logic file for edit.rhtml
16
+ * new.html, new.plogic - presentation data/logic file for new.rhtml
17
+ * show.html, show.plogic - presentation data/logic file for show.rhtml
18
+ * list.html, list.plogic - presentation data/logic file for list.rhtml
19
+
@@ -0,0 +1,31 @@
1
+ # Methods added to this helper will be available to all templates in the application.
2
+
3
+
4
+ module ApplicationHelper
5
+
6
+
7
+ ##
8
+ ## print only start-tag
9
+ ##
10
+ ## ex.
11
+ ## <%= start_link_to :action=>'new' %>Create new member</a>
12
+ ## #=> <a href="/member/new">Create new member</a>
13
+ ##
14
+ def start_link_to(options = {}, html_options = nil, *parameters_for_method_reference)
15
+ s = link_to('', options, html_options, *parameters_for_method_reference)
16
+ s.sub!(/<\/a>\z/, '')
17
+ end
18
+ alias anchor start_link_to
19
+
20
+
21
+ ##
22
+ ## print only start tag
23
+ ##
24
+ def start_link_to_remote(options = {}, html_options = {})
25
+ s = link_to_remote(options, html_options)
26
+ s.sub!(/<\/a>\z/, '')
27
+ end
28
+ alias anchor_remote start_link_to_remote
29
+
30
+
31
+ end