PageTemplate 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. data/Changes +24 -0
  2. data/MANIFEST +0 -1
  3. data/README.txt +10 -8
  4. data/Rakefile +30 -9
  5. data/lib/PageTemplate/case.rb +72 -0
  6. data/lib/PageTemplate/commands.rb +500 -0
  7. data/lib/PageTemplate/parser.rb +373 -0
  8. data/lib/PageTemplate.rb +47 -991
  9. data/setup-usage.txt +129 -0
  10. data/setup.rb +1360 -0
  11. data/tdata/dummy.txt +2 -0
  12. data/test.rb +616 -0
  13. metadata +13 -169
  14. data/CVS/Entries +0 -10
  15. data/CVS/Repository +0 -1
  16. data/CVS/Root +0 -1
  17. data/Changes~ +0 -7
  18. data/InstalledFiles +0 -7
  19. data/Rakefile~ +0 -54
  20. data/TC_PageTemplate.rb +0 -974
  21. data/TC_PageTemplate.rb~ +0 -965
  22. data/config.save +0 -12
  23. data/doc/classes/BlockCommand.html +0 -229
  24. data/doc/classes/BlockCommand.src/M000004.html +0 -18
  25. data/doc/classes/BlockCommand.src/M000005.html +0 -25
  26. data/doc/classes/BlockCommand.src/M000006.html +0 -18
  27. data/doc/classes/BlockCommand.src/M000007.html +0 -23
  28. data/doc/classes/BlockCommand.src/M000008.html +0 -24
  29. data/doc/classes/Command.html +0 -167
  30. data/doc/classes/Command.src/M000032.html +0 -19
  31. data/doc/classes/Command.src/M000033.html +0 -18
  32. data/doc/classes/CommentCommand.html +0 -146
  33. data/doc/classes/CommentCommand.src/M000009.html +0 -18
  34. data/doc/classes/IfCommand.html +0 -193
  35. data/doc/classes/IfCommand.src/M000042.html +0 -19
  36. data/doc/classes/IfCommand.src/M000043.html +0 -20
  37. data/doc/classes/IfCommand.src/M000044.html +0 -20
  38. data/doc/classes/IfElseCommand.html +0 -189
  39. data/doc/classes/IfElseCommand.src/M000025.html +0 -19
  40. data/doc/classes/IfElseCommand.src/M000026.html +0 -23
  41. data/doc/classes/IfElseCommand.src/M000027.html +0 -20
  42. data/doc/classes/IncludeCommand.html +0 -171
  43. data/doc/classes/IncludeCommand.src/M000019.html +0 -26
  44. data/doc/classes/IncludeCommand.src/M000020.html +0 -28
  45. data/doc/classes/IncludeCommand.src/M000021.html +0 -18
  46. data/doc/classes/IncludeCommandError.html +0 -118
  47. data/doc/classes/LoopCommand.html +0 -197
  48. data/doc/classes/LoopCommand.src/M000001.html +0 -19
  49. data/doc/classes/LoopCommand.src/M000002.html +0 -42
  50. data/doc/classes/LoopCommand.src/M000003.html +0 -20
  51. data/doc/classes/LoopElseCommand.html +0 -190
  52. data/doc/classes/LoopElseCommand.src/M000022.html +0 -19
  53. data/doc/classes/LoopElseCommand.src/M000023.html +0 -23
  54. data/doc/classes/LoopElseCommand.src/M000024.html +0 -20
  55. data/doc/classes/Namespace.html +0 -297
  56. data/doc/classes/Namespace.src/M000034.html +0 -19
  57. data/doc/classes/Namespace.src/M000035.html +0 -18
  58. data/doc/classes/Namespace.src/M000036.html +0 -18
  59. data/doc/classes/Namespace.src/M000037.html +0 -19
  60. data/doc/classes/Namespace.src/M000038.html +0 -36
  61. data/doc/classes/Namespace.src/M000039.html +0 -21
  62. data/doc/classes/Namespace.src/M000040.html +0 -18
  63. data/doc/classes/Namespace.src/M000041.html +0 -18
  64. data/doc/classes/PageTemplate.html +0 -380
  65. data/doc/classes/PageTemplate.src/M000010.html +0 -49
  66. data/doc/classes/PageTemplate.src/M000011.html +0 -18
  67. data/doc/classes/PageTemplate.src/M000012.html +0 -29
  68. data/doc/classes/PageTemplate.src/M000013.html +0 -18
  69. data/doc/classes/PageTemplate.src/M000014.html +0 -18
  70. data/doc/classes/PageTemplate.src/M000015.html +0 -18
  71. data/doc/classes/PageTemplate.src/M000016.html +0 -18
  72. data/doc/classes/PageTemplate.src/M000017.html +0 -18
  73. data/doc/classes/PageTemplate.src/M000018.html +0 -19
  74. data/doc/classes/Syntax/CachedParser.html +0 -163
  75. data/doc/classes/Syntax/CachedParser.src/M000048.html +0 -19
  76. data/doc/classes/Syntax/CachedParser.src/M000049.html +0 -53
  77. data/doc/classes/Syntax/Glossary.html +0 -251
  78. data/doc/classes/Syntax/Glossary.src/M000050.html +0 -20
  79. data/doc/classes/Syntax/Glossary.src/M000051.html +0 -29
  80. data/doc/classes/Syntax/Parser.html +0 -261
  81. data/doc/classes/Syntax/Parser.src/M000052.html +0 -22
  82. data/doc/classes/Syntax/Parser.src/M000053.html +0 -36
  83. data/doc/classes/Syntax/Parser.src/M000054.html +0 -18
  84. data/doc/classes/Syntax/Parser.src/M000055.html +0 -21
  85. data/doc/classes/Syntax/Parser.src/M000056.html +0 -53
  86. data/doc/classes/Syntax/Parser.src/M000057.html +0 -111
  87. data/doc/classes/Syntax.html +0 -139
  88. data/doc/classes/TextCommand.html +0 -185
  89. data/doc/classes/TextCommand.src/M000045.html +0 -18
  90. data/doc/classes/TextCommand.src/M000046.html +0 -18
  91. data/doc/classes/TextCommand.src/M000047.html +0 -18
  92. data/doc/classes/UnlessCommand.html +0 -151
  93. data/doc/classes/UnlessCommand.src/M000028.html +0 -20
  94. data/doc/classes/ValueCommand.html +0 -186
  95. data/doc/classes/ValueCommand.src/M000029.html +0 -18
  96. data/doc/classes/ValueCommand.src/M000030.html +0 -18
  97. data/doc/classes/ValueCommand.src/M000031.html +0 -20
  98. data/doc/created.rid +0 -1
  99. data/doc/files/README_txt.html +0 -224
  100. data/doc/files/lib/PageTemplate_rb.html +0 -119
  101. data/doc/fr_class_index.html +0 -44
  102. data/doc/fr_file_index.html +0 -28
  103. data/doc/fr_method_index.html +0 -83
  104. data/doc/index.html +0 -24
  105. data/doc/rdoc-style.css +0 -208
  106. data/install.rb +0 -1015
  107. data/lib/CVS/Entries +0 -2
  108. data/lib/CVS/Repository +0 -1
  109. data/lib/CVS/Root +0 -1
  110. data/lib/PageTemplate.rb~ +0 -1004
  111. data/pkg/PageTemplate-1.2.0.gem +0 -0
  112. data/tdata/CVS/Entries +0 -28
  113. data/tdata/CVS/Repository +0 -1
  114. data/tdata/CVS/Root +0 -1
  115. data/tdata/cm.txt +0 -3
  116. data/tdata/complex.txt +0 -116
  117. data/tdata/i1.txt +0 -1
  118. data/tdata/i2.txt +0 -7
  119. data/tdata/ib1.txt +0 -7
  120. data/tdata/ib2.txt +0 -13
  121. data/tdata/ie1.txt +0 -4
  122. data/tdata/ie2.txt +0 -15
  123. data/tdata/include.1.txt +0 -1
  124. data/tdata/include.2.txt +0 -1
  125. data/tdata/include.3.txt +0 -1
  126. data/tdata/include.4.nf.out.txt +0 -2
  127. data/tdata/include.4.out.txt +0 -3
  128. data/tdata/include.4.txt +0 -2
  129. data/tdata/include.4a.txt +0 -1
  130. data/tdata/include.4b.txt +0 -2
  131. data/tdata/include.5.txt +0 -2
  132. data/tdata/l1.txt +0 -5
  133. data/tdata/l2.txt +0 -7
  134. data/tdata/metadata.1.txt +0 -5
  135. data/tdata/metadata.2.txt +0 -5
  136. data/tdata/metadata.3.txt +0 -5
  137. data/tdata/metadata.4.txt +0 -5
  138. data/tdata/nm.txt +0 -4
  139. data/tdata/p/CVS/Entries +0 -5
  140. data/tdata/p/CVS/Repository +0 -1
  141. data/tdata/p/CVS/Root +0 -1
  142. data/tdata/p/CVS/b2.txt,t +0 -0
  143. data/tdata/p/_b1.txt +0 -0
  144. data/tdata/p/b1.txt +0 -4
  145. data/tdata/p/b2.txt +0 -4
  146. data/tdata/p/b2.txt~ +0 -4
  147. data/tdata/p/cb1.txt +0 -4
  148. data/tdata/t.txt +0 -2
  149. data/tdata/v1.txt +0 -11
  150. data/tdata/v2.txt +0 -11
Binary file
data/tdata/CVS/Entries DELETED
@@ -1,28 +0,0 @@
1
- /complex.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
2
- /i1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
3
- /i2.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
4
- /ib1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
5
- /ib2.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
6
- /ie1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
7
- /ie2.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
8
- /include.1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
9
- /include.2.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
10
- /include.3.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
11
- /include.4.out.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
12
- /include.4.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
13
- /include.4a.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
14
- /include.4b.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
15
- /include.5.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
16
- /l1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
17
- /l2.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
18
- /nm.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
19
- /t.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
20
- /v1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
21
- /v2.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
22
- D/p////
23
- /metadata.1.txt/1.1/Thu Mar 10 08:38:10 2005//
24
- /metadata.2.txt/1.1/Thu Mar 10 09:13:29 2005//
25
- /metadata.3.txt/1.1/Thu Mar 10 09:21:33 2005//
26
- /metadata.4.txt/1.1/Thu Mar 10 09:35:58 2005//
27
- /include.4.nf.out.txt/1.1/Thu Mar 10 07:10:26 2005//
28
- /cm.txt/1.1/Wed Mar 9 21:35:36 2005//
data/tdata/CVS/Repository DELETED
@@ -1 +0,0 @@
1
- PageTemplate/tdata
data/tdata/CVS/Root DELETED
@@ -1 +0,0 @@
1
- /home/wisti/CVS
data/tdata/cm.txt DELETED
@@ -1,3 +0,0 @@
1
- This is a line of text.
2
- [%-- This is a comment --%]
3
- This is more text.
data/tdata/complex.txt DELETED
@@ -1,116 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
- <html>
3
- <head>
4
- <title>[%var title %]</title>
5
- <META HTTP-EQUIV=Expires CONTENT="Sun, 22 Mar 1998 16:18:35 GMT">
6
- <link rel="STYLESHEET" href="/cnh.css" type="text/css" title="cnh.css">
7
- [%if reverse %]
8
- <style type="text/css">
9
- div#content {
10
- background-color: black;
11
- color: white;
12
- }
13
-
14
- div#content table {
15
- background-color: black;
16
- color: white;
17
- }
18
- </style>
19
- [%endif %]
20
-
21
- </head>
22
- <body>
23
- <div class="navbar">
24
- <a href="/SiteMap.html">Sitemap</a> |
25
- <span class="trail"><a href="/">Welcome!</a> &gt; [%var title %]</span>
26
- </div>
27
- <h1 id="title">[%var title %]</h1>
28
- <div id="content">
29
- <h2>PageTemplate In Action!</h2>
30
-
31
- <p><em>View the <a href="/test-template.txt">template</a> used for this test</em>.</p>
32
- <h3>Variable Substitution</h3>
33
- <p>Simple variable substitution seems to work just fine. For example, the name of this
34
- page is currently <em>"[%var title %]"</em>. Give this page a new
35
- title by using the form below!</p>
36
-
37
- <h3>If Structure</h3>
38
-
39
- <p><tt>if</tt> functionality is working fine. To see it in action, alternate the display of this
40
- page's content section using the form below! <em>(after you do, view the source and see the
41
- <tt>style</tt> information that was added to the page, and goes away when you select
42
- <tt>Normal</tt>.)</em></p>
43
- [%if ifTest %]
44
- <p><tt>ifTest</tt> is active, so why don't I show you the state of <tt>reverse</tt>?</p>
45
- [%if reverse %]
46
- <p><tt><strong>reverse</strong></tt> was set.</p>
47
- [%else %]
48
- <p><tt><strong>reverse</strong></tt> was not set.</p>
49
- [%endif %]
50
- [%endif %]
51
-
52
- <h3>Loop Structure</h3>
53
-
54
- <p>Loops allow you to repeat formatting for several items. It comes in very handy
55
- in many Web situations - shopping carts, BBSes, and other stuff.</p>
56
-
57
- <p>I have "in <em>loop</em>" and "no <em>loop</em>" (in case you want to define
58
- special behavior for situations where the loop has not been provided). Nested loops even work.
59
- Be careful, though - loop variable names mask outer names while looping!</p>
60
-
61
- <p>Here is a table of my favorite programming languages <em>(today)</em>.</p>
62
-
63
- <table border='1'>
64
- <tr>
65
- <th>Name</th>
66
- <th>Created By</th>
67
- <th>Guiding Principle</th>
68
- </tr>
69
- [%in languages %]
70
- <tr>
71
- <td>[%var name %]</td>
72
- <td>[%var author %]</td>
73
- <td>[%if guideline %][%var guideline %][%else %]<em>I dunno</em>[%endif %]</td>
74
- </tr>
75
- [%no %]
76
- <tr>
77
- <td colspan='3' align='center'>
78
- <p>Guess I don't have any today</p>
79
- </td>
80
- </tr>
81
- [%endin %]
82
- </table>
83
-
84
- <p>How about a (very simple) nested loop example before bed?</p>
85
-
86
- <ul>
87
- [%in favorites %]
88
- <li><strong>[%var topic %]</strong>
89
- <ul>[%in items %]
90
- <li>"[%var title %]" by [%var creator %]</li>
91
- [%no %]<li>Can't think of anything right now...</li>
92
- [%endin %]</ul>
93
- </li>
94
- [%no %]
95
- <li>No, not today.</li>
96
- [%endin %]
97
- </ul>
98
-
99
- <h2>Customize It!</h2>
100
- <form>
101
- <strong>Title:</strong>
102
- <input type="text" name="title" value="[%var title %]">
103
- <strong>Page Colors:</strong>
104
- <select name="reverse">
105
- <option value="0">Normal</option>
106
- <option value="1"[%if reverse %] selected[%endif %]>Reverse</option>
107
- </select>
108
- <input type="submit" value="update">
109
- </form>
110
-
111
- </div>
112
- <div class="legal">
113
- <p>Copyright 2000-2002 <a href="/brian/">Brian Wisti</a></p>
114
- </div>
115
- </body>
116
- </html>
data/tdata/i1.txt DELETED
@@ -1 +0,0 @@
1
- This is some text. [%if flag %]It's all true![%endif%]
data/tdata/i2.txt DELETED
@@ -1,7 +0,0 @@
1
- <h1>Hello, Nested If's</h1>
2
- [%if outer %]
3
- <p>This is outer text.</p>
4
- [%if inner%]
5
- <p>This is inner text.</p>
6
- [%endif%]
7
- [%endif%]
data/tdata/ib1.txt DELETED
@@ -1,7 +0,0 @@
1
- <ul>
2
- [%in loop%]
3
- <li>[%var value%]</li>
4
- [%no%]
5
- <li>No values</li>
6
- [%endin%]
7
- </ul>
data/tdata/ib2.txt DELETED
@@ -1,13 +0,0 @@
1
- <ul>
2
- [%in loop%]
3
- <li>[%var value%]
4
- <ul>
5
- [%in inner %]<li>[%var value%]</li>
6
- [%no%] <li>No inner values</li>
7
- [%endin%]
8
- </ul>
9
- </li>
10
- [%no%]
11
- <li>No values</li>
12
- [%endin%]
13
- </ul>
data/tdata/ie1.txt DELETED
@@ -1,4 +0,0 @@
1
- This is some text.
2
- [%if flag %] It's all true!
3
- [%else%] Nothing is true ...
4
- [%endif%]
data/tdata/ie2.txt DELETED
@@ -1,15 +0,0 @@
1
- [%if outer %]
2
- Outer is true
3
- [%if inner%]
4
- Inner is true
5
- [%else%]
6
- Inner is false
7
- [%endif%]
8
- [%else%]
9
- Outer is false
10
- [%if inner%]
11
- Inner is true
12
- [%else%]
13
- Inner is false
14
- [%endif%]
15
- [%endif%]
data/tdata/include.1.txt DELETED
@@ -1 +0,0 @@
1
- Dude! What's mine say?
data/tdata/include.2.txt DELETED
@@ -1 +0,0 @@
1
- Sweet! What's mine say?
data/tdata/include.3.txt DELETED
@@ -1 +0,0 @@
1
- [%var x], where's my car?
@@ -1,2 +0,0 @@
1
- alpha
2
- File secret-of-life.txt not found.gamma
@@ -1,3 +0,0 @@
1
- alpha
2
- beta
3
- gamma
data/tdata/include.4.txt DELETED
@@ -1,2 +0,0 @@
1
- alpha
2
- [%include include.4a.txt%]gamma
data/tdata/include.4a.txt DELETED
@@ -1 +0,0 @@
1
- beta
data/tdata/include.4b.txt DELETED
@@ -1,2 +0,0 @@
1
- alpha
2
- [%include file %]gamma
data/tdata/include.5.txt DELETED
@@ -1,2 +0,0 @@
1
- alpha
2
- [%include include.4a.txt %]gamma
data/tdata/l1.txt DELETED
@@ -1,5 +0,0 @@
1
- <ul>
2
- [%in loop%]
3
- <li>[%var value%]</li>
4
- [%endin%]
5
- </ul>
data/tdata/l2.txt DELETED
@@ -1,7 +0,0 @@
1
- <ul>
2
- [%in loop%]
3
- <li>[%var value%]
4
- <ul>[%in inner %]<li>[%var value %]</li>[%endin%]</ul>
5
- </li>
6
- [%endin%]
7
- </ul>
data/tdata/metadata.1.txt DELETED
@@ -1,5 +0,0 @@
1
- <ul>
2
- [%in loop%]
3
- [%if __FIRST__ %]<li>--[%var v %]--</li>[%else %]<li>[%var v %]</li>[%endif %]
4
- [%endin %]
5
- </ul>
data/tdata/metadata.2.txt DELETED
@@ -1,5 +0,0 @@
1
- <ul>
2
- [%in loop%]
3
- [%if __LAST__ %]<li>--[%var v %]--</li>[%else %]<li>[%var v %]</li>[%endif %]
4
- [%endin %]
5
- </ul>
data/tdata/metadata.3.txt DELETED
@@ -1,5 +0,0 @@
1
- <ul>
2
- [%in loop%]
3
- [%if __ODD__ %]<li>--[%var v %]--</li>[%else %]<li>[%var v %]</li>[%endif %]
4
- [%endin %]
5
- </ul>
data/tdata/metadata.4.txt DELETED
@@ -1,5 +0,0 @@
1
- <ul>
2
- [%in loop%]
3
- [%if __TOGGLE__ %]<li>--[%var v %]--</li>[%else %]<li>[%var v %]</li>[%endif %]
4
- [%endin %]
5
- </ul>
data/tdata/nm.txt DELETED
@@ -1,4 +0,0 @@
1
- <p>This page contains HTML, but not any PageTemplate markup.</p>
2
-
3
- <p>I expect that we should see it pretty much the same as I am
4
- typing it.
data/tdata/p/CVS/Entries DELETED
@@ -1,5 +0,0 @@
1
- /_b1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
2
- /b1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
3
- /cb1.txt/1.1.1.1/Wed Mar 9 01:30:10 2005//
4
- /b2.txt/0/Initial b2.txt//
5
- D
@@ -1 +0,0 @@
1
- PageTemplate/tdata/p
data/tdata/p/CVS/Root DELETED
@@ -1 +0,0 @@
1
- /home/wisti/CVS
data/tdata/p/CVS/b2.txt,t DELETED
File without changes
data/tdata/p/_b1.txt DELETED
Binary file
data/tdata/p/b1.txt DELETED
@@ -1,4 +0,0 @@
1
- Hello [%var world%]
2
- [%if return%]
3
- Welcome Back!
4
- [%endif%]
data/tdata/p/b2.txt DELETED
@@ -1,4 +0,0 @@
1
- Hello [%var world%]
2
- [%unless return%]
3
- Welcome!
4
- [%endunless%]
data/tdata/p/b2.txt~ DELETED
@@ -1,4 +0,0 @@
1
- Hello [%var world%]
2
- [%if return%]
3
- Welcome Back!
4
- [%endif%]
data/tdata/p/cb1.txt DELETED
@@ -1,4 +0,0 @@
1
- Hello [%var world%]
2
- [%if return%]
3
- Welcome Back!
4
- [%endif%]
data/tdata/t.txt DELETED
@@ -1,2 +0,0 @@
1
- This is a simple file to test how PageTemplate handles the simple
2
- act of loading a file.
data/tdata/v1.txt DELETED
@@ -1,11 +0,0 @@
1
- <html>
2
- <head>
3
- <title>[%var title %]</title>
4
- </head>
5
- <body>
6
- <h1>[%var title%]</h1>
7
-
8
- <p> This is the [%var title %]
9
- document.</p>
10
- </body>
11
- </html>
data/tdata/v2.txt DELETED
@@ -1,11 +0,0 @@
1
- <html>
2
- <head>
3
- <title>[%var title </title>
4
- </head>
5
- <body>
6
- <h1>title%]</h1>
7
-
8
- <p> This is the [%var %]
9
- document.</p>
10
- </body>
11
- </html>