PageTemplate 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/MANIFEST +4 -0
  2. data/Rakefile +54 -0
  3. data/config.save +12 -0
  4. data/doc/classes/BlockCommand.html +229 -0
  5. data/doc/classes/BlockCommand.src/M000004.html +18 -0
  6. data/doc/classes/BlockCommand.src/M000005.html +25 -0
  7. data/doc/classes/BlockCommand.src/M000006.html +18 -0
  8. data/doc/classes/BlockCommand.src/M000007.html +23 -0
  9. data/doc/classes/BlockCommand.src/M000008.html +24 -0
  10. data/doc/classes/Command.html +167 -0
  11. data/doc/classes/Command.src/M000029.html +19 -0
  12. data/doc/classes/Command.src/M000030.html +18 -0
  13. data/doc/classes/IfCommand.html +193 -0
  14. data/doc/classes/IfCommand.src/M000039.html +19 -0
  15. data/doc/classes/IfCommand.src/M000040.html +20 -0
  16. data/doc/classes/IfCommand.src/M000041.html +20 -0
  17. data/doc/classes/IfElseCommand.html +189 -0
  18. data/doc/classes/IfElseCommand.src/M000023.html +19 -0
  19. data/doc/classes/IfElseCommand.src/M000024.html +23 -0
  20. data/doc/classes/IfElseCommand.src/M000025.html +20 -0
  21. data/doc/classes/IncludeCommand.html +178 -0
  22. data/doc/classes/IncludeCommand.src/M000017.html +21 -0
  23. data/doc/classes/IncludeCommand.src/M000018.html +23 -0
  24. data/doc/classes/IncludeCommand.src/M000019.html +18 -0
  25. data/doc/classes/LoopCommand.html +197 -0
  26. data/doc/classes/LoopCommand.src/M000001.html +19 -0
  27. data/doc/classes/LoopCommand.src/M000002.html +33 -0
  28. data/doc/classes/LoopCommand.src/M000003.html +20 -0
  29. data/doc/classes/LoopElseCommand.html +190 -0
  30. data/doc/classes/LoopElseCommand.src/M000020.html +19 -0
  31. data/doc/classes/LoopElseCommand.src/M000021.html +23 -0
  32. data/doc/classes/LoopElseCommand.src/M000022.html +20 -0
  33. data/doc/classes/Namespace.html +297 -0
  34. data/doc/classes/Namespace.src/M000031.html +19 -0
  35. data/doc/classes/Namespace.src/M000032.html +18 -0
  36. data/doc/classes/Namespace.src/M000033.html +18 -0
  37. data/doc/classes/Namespace.src/M000034.html +19 -0
  38. data/doc/classes/Namespace.src/M000035.html +36 -0
  39. data/doc/classes/Namespace.src/M000036.html +21 -0
  40. data/doc/classes/Namespace.src/M000037.html +18 -0
  41. data/doc/classes/Namespace.src/M000038.html +18 -0
  42. data/doc/classes/PageTemplate.html +352 -0
  43. data/doc/classes/PageTemplate.src/M000009.html +46 -0
  44. data/doc/classes/PageTemplate.src/M000010.html +29 -0
  45. data/doc/classes/PageTemplate.src/M000011.html +18 -0
  46. data/doc/classes/PageTemplate.src/M000012.html +18 -0
  47. data/doc/classes/PageTemplate.src/M000013.html +18 -0
  48. data/doc/classes/PageTemplate.src/M000014.html +18 -0
  49. data/doc/classes/PageTemplate.src/M000015.html +18 -0
  50. data/doc/classes/PageTemplate.src/M000016.html +19 -0
  51. data/doc/classes/Syntax.html +139 -0
  52. data/doc/classes/Syntax/CachedParser.html +163 -0
  53. data/doc/classes/Syntax/CachedParser.src/M000045.html +19 -0
  54. data/doc/classes/Syntax/CachedParser.src/M000046.html +52 -0
  55. data/doc/classes/Syntax/Glossary.html +245 -0
  56. data/doc/classes/Syntax/Glossary.src/M000047.html +20 -0
  57. data/doc/classes/Syntax/Glossary.src/M000048.html +29 -0
  58. data/doc/classes/Syntax/Parser.html +261 -0
  59. data/doc/classes/Syntax/Parser.src/M000049.html +22 -0
  60. data/doc/classes/Syntax/Parser.src/M000050.html +35 -0
  61. data/doc/classes/Syntax/Parser.src/M000051.html +18 -0
  62. data/doc/classes/Syntax/Parser.src/M000052.html +21 -0
  63. data/doc/classes/Syntax/Parser.src/M000053.html +53 -0
  64. data/doc/classes/Syntax/Parser.src/M000054.html +107 -0
  65. data/doc/classes/TextCommand.html +185 -0
  66. data/doc/classes/TextCommand.src/M000042.html +18 -0
  67. data/doc/classes/TextCommand.src/M000043.html +18 -0
  68. data/doc/classes/TextCommand.src/M000044.html +18 -0
  69. data/doc/classes/ValueCommand.html +186 -0
  70. data/doc/classes/ValueCommand.src/M000026.html +18 -0
  71. data/doc/classes/ValueCommand.src/M000027.html +18 -0
  72. data/doc/classes/ValueCommand.src/M000028.html +20 -0
  73. data/doc/created.rid +1 -0
  74. data/doc/files/README_txt.html +224 -0
  75. data/doc/files/lib/PageTemplate_rb.html +119 -0
  76. data/doc/fr_class_index.html +41 -0
  77. data/doc/fr_file_index.html +28 -0
  78. data/doc/fr_method_index.html +80 -0
  79. data/doc/index.html +24 -0
  80. data/doc/rdoc-style.css +208 -0
  81. data/install.rb +1015 -0
  82. data/lib/MANIFEST +2 -0
  83. data/lib/PageTemplate.rb +936 -0
  84. data/pkg/PageTemplate-1.1.2.gem +0 -0
  85. data/tdata/complex.txt +116 -0
  86. data/tdata/i1.txt +1 -0
  87. data/tdata/i2.txt +7 -0
  88. data/tdata/ib1.txt +7 -0
  89. data/tdata/ib2.txt +13 -0
  90. data/tdata/ie1.txt +4 -0
  91. data/tdata/ie2.txt +15 -0
  92. data/tdata/include.1.txt +1 -0
  93. data/tdata/include.2.txt +1 -0
  94. data/tdata/include.3.txt +1 -0
  95. data/tdata/include.4.out.txt +3 -0
  96. data/tdata/include.4.txt +2 -0
  97. data/tdata/include.4a.txt +1 -0
  98. data/tdata/include.4b.txt +2 -0
  99. data/tdata/include.5.txt +2 -0
  100. data/tdata/l1.txt +5 -0
  101. data/tdata/l2.txt +7 -0
  102. data/tdata/nm.txt +4 -0
  103. data/tdata/p/_b1.txt +0 -0
  104. data/tdata/p/b1.txt +4 -0
  105. data/tdata/p/cb1.txt +4 -0
  106. data/tdata/t.txt +2 -0
  107. data/tdata/v1.txt +11 -0
  108. data/tdata/v2.txt +11 -0
  109. data/test-install.rb +2 -0
  110. metadata +137 -4
Binary file
data/tdata/complex.txt ADDED
@@ -0,0 +1,116 @@
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 ADDED
@@ -0,0 +1 @@
1
+ This is some text. [%if flag %]It's all true![%endif%]
data/tdata/i2.txt ADDED
@@ -0,0 +1,7 @@
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 ADDED
@@ -0,0 +1,7 @@
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 ADDED
@@ -0,0 +1,13 @@
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 ADDED
@@ -0,0 +1,4 @@
1
+ This is some text.
2
+ [%if flag %] It's all true!
3
+ [%else%] Nothing is true ...
4
+ [%endif%]
data/tdata/ie2.txt ADDED
@@ -0,0 +1,15 @@
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%]
@@ -0,0 +1 @@
1
+ Dude! What's mine say?
@@ -0,0 +1 @@
1
+ Sweet! What's mine say?
@@ -0,0 +1 @@
1
+ [%var x], where's my car?
@@ -0,0 +1,3 @@
1
+ alpha
2
+ beta
3
+ gamma
@@ -0,0 +1,2 @@
1
+ alpha
2
+ [%include include.4a.txt%]gamma
@@ -0,0 +1 @@
1
+ beta
@@ -0,0 +1,2 @@
1
+ alpha
2
+ [%include file %]gamma
@@ -0,0 +1,2 @@
1
+ alpha
2
+ [%include include.4a.txt %]gamma
data/tdata/l1.txt ADDED
@@ -0,0 +1,5 @@
1
+ <ul>
2
+ [%in loop%]
3
+ <li>[%var value%]</li>
4
+ [%endin%]
5
+ </ul>
data/tdata/l2.txt ADDED
@@ -0,0 +1,7 @@
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/nm.txt ADDED
@@ -0,0 +1,4 @@
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/_b1.txt ADDED
Binary file
data/tdata/p/b1.txt ADDED
@@ -0,0 +1,4 @@
1
+ Hello [%var world%]
2
+ [%if return%]
3
+ Welcome Back!
4
+ [%endif%]
data/tdata/p/cb1.txt ADDED
@@ -0,0 +1,4 @@
1
+ Hello [%var world%]
2
+ [%if return%]
3
+ Welcome Back!
4
+ [%endif%]
data/tdata/t.txt ADDED
@@ -0,0 +1,2 @@
1
+ This is a simple file to test how PageTemplate handles the simple
2
+ act of loading a file.
data/tdata/v1.txt ADDED
@@ -0,0 +1,11 @@
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 ADDED
@@ -0,0 +1,11 @@
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>
data/test-install.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'rubygems'
2
+ require_gem 'PageTemplate'
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.4
2
+ rubygems_version: 0.8.6
3
3
  specification_version: 1
4
4
  name: PageTemplate
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.1
7
- date: 2005-02-16
6
+ version: 1.1.2
7
+ date: 2005-03-06
8
8
  summary: A simple templating system for Web sites.
9
9
  require_paths:
10
10
  - lib
@@ -12,7 +12,7 @@ email: brian@coolnamehere.com
12
12
  homepage: http://coolnamehere.com/products/pagetemplate
13
13
  rubyforge_project:
14
14
  description:
15
- autorequire: PageTemplate
15
+ autorequire: PageTemplate.rb
16
16
  default_executable:
17
17
  bindir: bin
18
18
  has_rdoc: true
@@ -28,6 +28,139 @@ authors:
28
28
  - Brian Wisti
29
29
  files:
30
30
  - README.txt
31
+ - MANIFEST
32
+ - install.rb
33
+ - lib
34
+ - doc
35
+ - config.save
36
+ - test-install.rb
37
+ - Rakefile
38
+ - tdata
39
+ - TC_PageTemplate.rb
40
+ - pkg
41
+ - lib/PageTemplate.rb
42
+ - lib/MANIFEST
43
+ - doc/fr_class_index.html
44
+ - doc/index.html
45
+ - doc/fr_file_index.html
46
+ - doc/rdoc-style.css
47
+ - doc/created.rid
48
+ - doc/classes
49
+ - doc/files
50
+ - doc/fr_method_index.html
51
+ - doc/classes/LoopCommand.html
52
+ - doc/classes/LoopCommand.src
53
+ - doc/classes/Syntax
54
+ - doc/classes/LoopElseCommand.src
55
+ - doc/classes/LoopElseCommand.html
56
+ - doc/classes/IfCommand.src
57
+ - doc/classes/ValueCommand.src
58
+ - doc/classes/IfElseCommand.html
59
+ - doc/classes/ValueCommand.html
60
+ - doc/classes/IncludeCommand.html
61
+ - doc/classes/Namespace.html
62
+ - doc/classes/Command.html
63
+ - doc/classes/BlockCommand.html
64
+ - doc/classes/Command.src
65
+ - doc/classes/PageTemplate.src
66
+ - doc/classes/BlockCommand.src
67
+ - doc/classes/TextCommand.html
68
+ - doc/classes/TextCommand.src
69
+ - doc/classes/Syntax.html
70
+ - doc/classes/IfCommand.html
71
+ - doc/classes/IfElseCommand.src
72
+ - doc/classes/IncludeCommand.src
73
+ - doc/classes/Namespace.src
74
+ - doc/classes/PageTemplate.html
75
+ - doc/classes/LoopCommand.src/M000002.html
76
+ - doc/classes/LoopCommand.src/M000003.html
77
+ - doc/classes/LoopCommand.src/M000001.html
78
+ - doc/classes/Syntax/CachedParser.src
79
+ - doc/classes/Syntax/Parser.html
80
+ - doc/classes/Syntax/Glossary.html
81
+ - doc/classes/Syntax/CachedParser.html
82
+ - doc/classes/Syntax/Parser.src
83
+ - doc/classes/Syntax/Glossary.src
84
+ - doc/classes/Syntax/CachedParser.src/M000046.html
85
+ - doc/classes/Syntax/CachedParser.src/M000045.html
86
+ - doc/classes/Syntax/Parser.src/M000052.html
87
+ - doc/classes/Syntax/Parser.src/M000054.html
88
+ - doc/classes/Syntax/Parser.src/M000050.html
89
+ - doc/classes/Syntax/Parser.src/M000049.html
90
+ - doc/classes/Syntax/Parser.src/M000053.html
91
+ - doc/classes/Syntax/Parser.src/M000051.html
92
+ - doc/classes/Syntax/Glossary.src/M000047.html
93
+ - doc/classes/Syntax/Glossary.src/M000048.html
94
+ - doc/classes/LoopElseCommand.src/M000022.html
95
+ - doc/classes/LoopElseCommand.src/M000021.html
96
+ - doc/classes/LoopElseCommand.src/M000020.html
97
+ - doc/classes/IfCommand.src/M000041.html
98
+ - doc/classes/IfCommand.src/M000039.html
99
+ - doc/classes/IfCommand.src/M000040.html
100
+ - doc/classes/ValueCommand.src/M000026.html
101
+ - doc/classes/ValueCommand.src/M000027.html
102
+ - doc/classes/ValueCommand.src/M000028.html
103
+ - doc/classes/Command.src/M000029.html
104
+ - doc/classes/Command.src/M000030.html
105
+ - doc/classes/PageTemplate.src/M000013.html
106
+ - doc/classes/PageTemplate.src/M000014.html
107
+ - doc/classes/PageTemplate.src/M000010.html
108
+ - doc/classes/PageTemplate.src/M000015.html
109
+ - doc/classes/PageTemplate.src/M000012.html
110
+ - doc/classes/PageTemplate.src/M000016.html
111
+ - doc/classes/PageTemplate.src/M000009.html
112
+ - doc/classes/PageTemplate.src/M000011.html
113
+ - doc/classes/BlockCommand.src/M000007.html
114
+ - doc/classes/BlockCommand.src/M000005.html
115
+ - doc/classes/BlockCommand.src/M000006.html
116
+ - doc/classes/BlockCommand.src/M000004.html
117
+ - doc/classes/BlockCommand.src/M000008.html
118
+ - doc/classes/TextCommand.src/M000042.html
119
+ - doc/classes/TextCommand.src/M000044.html
120
+ - doc/classes/TextCommand.src/M000043.html
121
+ - doc/classes/IfElseCommand.src/M000023.html
122
+ - doc/classes/IfElseCommand.src/M000024.html
123
+ - doc/classes/IfElseCommand.src/M000025.html
124
+ - doc/classes/IncludeCommand.src/M000018.html
125
+ - doc/classes/IncludeCommand.src/M000019.html
126
+ - doc/classes/IncludeCommand.src/M000017.html
127
+ - doc/classes/Namespace.src/M000036.html
128
+ - doc/classes/Namespace.src/M000031.html
129
+ - doc/classes/Namespace.src/M000035.html
130
+ - doc/classes/Namespace.src/M000037.html
131
+ - doc/classes/Namespace.src/M000033.html
132
+ - doc/classes/Namespace.src/M000034.html
133
+ - doc/classes/Namespace.src/M000032.html
134
+ - doc/classes/Namespace.src/M000038.html
135
+ - doc/files/lib
136
+ - doc/files/README_txt.html
137
+ - doc/files/lib/PageTemplate_rb.html
138
+ - tdata/include.3.txt
139
+ - tdata/include.2.txt
140
+ - tdata/ib2.txt
141
+ - tdata/include.4b.txt
142
+ - tdata/t.txt
143
+ - tdata/p
144
+ - tdata/v2.txt
145
+ - tdata/l2.txt
146
+ - tdata/ib1.txt
147
+ - tdata/v1.txt
148
+ - tdata/complex.txt
149
+ - tdata/i2.txt
150
+ - tdata/include.4.out.txt
151
+ - tdata/nm.txt
152
+ - tdata/include.4a.txt
153
+ - tdata/ie1.txt
154
+ - tdata/include.4.txt
155
+ - tdata/l1.txt
156
+ - tdata/include.5.txt
157
+ - tdata/i1.txt
158
+ - tdata/ie2.txt
159
+ - tdata/include.1.txt
160
+ - tdata/p/b1.txt
161
+ - tdata/p/cb1.txt
162
+ - tdata/p/_b1.txt
163
+ - pkg/PageTemplate-1.1.2.gem
31
164
  test_files:
32
165
  - TC_PageTemplate.rb
33
166
  rdoc_options: []