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
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (Namespace)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/PageTemplate.rb, line 20</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>()
15
+ <span class="ruby-ivar">@global</span> = {}
16
+ <span class="ruby-ivar">@nSpaces</span> = []
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>[]= (Namespace)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/PageTemplate.rb, line 26</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
15
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>[] (Namespace)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/PageTemplate.rb, line 31</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
15
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>set (Namespace)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/PageTemplate.rb, line 37</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
15
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Namespace setting global #{key} to #{value}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
16
+ <span class="ruby-ivar">@global</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>get (Namespace)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/PageTemplate.rb, line 53</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
15
+ <span class="ruby-identifier">value</span> = <span class="ruby-keyword kw">nil</span>
16
+
17
+ <span class="ruby-ivar">@nSpaces</span>.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ns</span><span class="ruby-operator">|</span>
18
+
19
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">method_defined?</span>(<span class="ruby-node">&quot;:#{key}&quot;</span>)
20
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;:#{key}&quot;</span>)
21
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">method_defined?</span>(<span class="ruby-node">&quot;#{key}&quot;</span>)
22
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">key</span>)
23
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">method_defined?</span>(<span class="ruby-value str">&quot;[]&quot;</span>)
24
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">ns</span>[<span class="ruby-identifier">key</span>]
25
+ <span class="ruby-keyword kw">end</span>
26
+
27
+ <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>
28
+ <span class="ruby-keyword kw">end</span>
29
+
30
+ <span class="ruby-identifier">value</span> = <span class="ruby-ivar">@global</span>[<span class="ruby-identifier">key</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">value</span>
31
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Namespace #{key}: #{value}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
32
+
33
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">value</span>
34
+ <span class="ruby-keyword kw">end</span></pre>
35
+ </body>
36
+ </html>
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>true? (Namespace)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/PageTemplate.rb, line 78</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">true?</span>(<span class="ruby-identifier">flag</span>)
15
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">flag</span>)
16
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">value</span>
17
+
18
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">value</span>
19
+ <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>push (Namespace)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/PageTemplate.rb, line 87</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">push</span>(<span class="ruby-identifier">namespace</span>)
15
+ <span class="ruby-ivar">@nSpaces</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">namespace</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>pop (Namespace)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/PageTemplate.rb, line 94</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pop</span>
15
+ <span class="ruby-ivar">@nSpaces</span>.<span class="ruby-identifier">pop</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,352 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: PageTemplate</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">PageTemplate</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/PageTemplate_rb.html">
59
+ lib/PageTemplate.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ An object which parses text files littered with template directives and can
84
+ produce text based on set parameters and the instructions contained within
85
+ the text file. Each <a href="PageTemplate.html">PageTemplate</a> has its
86
+ own <a href="Namespace.html">Namespace</a>, so there shouldn&#8217;t be any
87
+ problems using it in a threaded environment.
88
+ </p>
89
+ <p>
90
+ <a href="PageTemplate.html">PageTemplate</a> is the primary user Class for
91
+ this package.
92
+ </p>
93
+
94
+ </div>
95
+
96
+
97
+ </div>
98
+
99
+ <div id="method-list">
100
+ <h3 class="section-bar">Methods</h3>
101
+
102
+ <div class="name-list">
103
+ <a href="#M000014">[]</a>&nbsp;&nbsp;
104
+ <a href="#M000013">[]=</a>&nbsp;&nbsp;
105
+ <a href="#M000016">clearFile</a>&nbsp;&nbsp;
106
+ <a href="#M000012">getParameter</a>&nbsp;&nbsp;
107
+ <a href="#M000010">load</a>&nbsp;&nbsp;
108
+ <a href="#M000009">new</a>&nbsp;&nbsp;
109
+ <a href="#M000015">output</a>&nbsp;&nbsp;
110
+ <a href="#M000011">setParameter</a>&nbsp;&nbsp;
111
+ </div>
112
+ </div>
113
+
114
+ </div>
115
+
116
+
117
+ <!-- if includes -->
118
+
119
+ <div id="section">
120
+
121
+
122
+
123
+
124
+
125
+ <div id="attribute-list">
126
+ <h3 class="section-bar">Attributes</h3>
127
+
128
+ <div class="name-list">
129
+ <table>
130
+ <tr class="top-aligned-row context-row">
131
+ <td class="context-item-name">file</td>
132
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
133
+ <td class="context-item-desc"></td>
134
+ </tr>
135
+ <tr class="top-aligned-row context-row">
136
+ <td class="context-item-name">parser</td>
137
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
138
+ <td class="context-item-desc"></td>
139
+ </tr>
140
+ <tr class="top-aligned-row context-row">
141
+ <td class="context-item-name">syntax</td>
142
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
143
+ <td class="context-item-desc"></td>
144
+ </tr>
145
+ </table>
146
+ </div>
147
+ </div>
148
+
149
+
150
+
151
+ <!-- if method_list -->
152
+ <div id="methods">
153
+ <h3 class="section-bar">Public Class methods</h3>
154
+
155
+ <div id="method-M000009" class="method-detail">
156
+ <a name="M000009"></a>
157
+
158
+ <div class="method-heading">
159
+ <a href="PageTemplate.src/M000009.html" target="Code" class="method-signature"
160
+ onclick="popupCode('PageTemplate.src/M000009.html');return false;">
161
+ <span class="method-name">new</span><span class="method-args">(args = {})</span>
162
+ </a>
163
+ </div>
164
+
165
+ <div class="method-description">
166
+ <p>
167
+ Creates a new <a href="PageTemplate.html">PageTemplate</a> object, using
168
+ <tt>args</tt> to provide optional initialization.
169
+ </p>
170
+ <h4>Possible Keys For Args</h4>
171
+ <dl>
172
+ <dt>:include_path</dt><dd>The directory that <a href="PageTemplate.html">PageTemplate</a> will look
173
+ for template files in.
174
+
175
+ </dd>
176
+ <dt>:filename</dt><dd>The name of a text file to use for a template.
177
+
178
+ </dd>
179
+ <dt>:syntax</dt><dd>A <a href="Syntax/Glossary.html">Syntax::Glossary</a> object, provided if
180
+ the user wants
181
+
182
+ </dd>
183
+ </dl>
184
+ <pre>
185
+ an alternate syntax for template parse directives. If not
186
+ provided, then Syntax::DEFAULT is used.
187
+ </pre>
188
+ <dl>
189
+ <dt>:use_cache</dt><dd>If <tt>true</tt>, the <a href="PageTemplate.html">PageTemplate</a> object
190
+ will use a <a href="Syntax/CachedParser.html">Syntax::CachedParser</a>
191
+ which stores compiled template data to disk in the same directory as the
192
+ template file itself. This cached template still needs you to provide a <a
193
+ href="Namespace.html">Namespace</a> during output, though.
194
+
195
+ </dd>
196
+ </dl>
197
+ </div>
198
+ </div>
199
+
200
+ <h3 class="section-bar">Public Instance methods</h3>
201
+
202
+ <div id="method-M000014" class="method-detail">
203
+ <a name="M000014"></a>
204
+
205
+ <div class="method-heading">
206
+ <a href="PageTemplate.src/M000014.html" target="Code" class="method-signature"
207
+ onclick="popupCode('PageTemplate.src/M000014.html');return false;">
208
+ <span class="method-name">[]</span><span class="method-args">(key)</span>
209
+ </a>
210
+ </div>
211
+
212
+ <div class="method-description">
213
+ <p>
214
+ An alias for <a
215
+ href="PageTemplate.html#M000012">PageTemplate.getParameter</a>(key)
216
+ </p>
217
+ </div>
218
+ </div>
219
+
220
+ <div id="method-M000013" class="method-detail">
221
+ <a name="M000013"></a>
222
+
223
+ <div class="method-heading">
224
+ <a href="PageTemplate.src/M000013.html" target="Code" class="method-signature"
225
+ onclick="popupCode('PageTemplate.src/M000013.html');return false;">
226
+ <span class="method-name">[]=</span><span class="method-args">(key, value)</span>
227
+ </a>
228
+ </div>
229
+
230
+ <div class="method-description">
231
+ <p>
232
+ An alias for <a
233
+ href="PageTemplate.html#M000011">PageTemplate.setParameter</a>(key, value)
234
+ </p>
235
+ </div>
236
+ </div>
237
+
238
+ <div id="method-M000016" class="method-detail">
239
+ <a name="M000016"></a>
240
+
241
+ <div class="method-heading">
242
+ <a href="PageTemplate.src/M000016.html" target="Code" class="method-signature"
243
+ onclick="popupCode('PageTemplate.src/M000016.html');return false;">
244
+ <span class="method-name">clearFile</span><span class="method-args">()</span>
245
+ </a>
246
+ </div>
247
+
248
+ <div class="method-description">
249
+ <p>
250
+ Remove all template data from the <a
251
+ href="PageTemplate.html">PageTemplate</a>, but leave the <a
252
+ href="Namespace.html">Namespace</a> intact.
253
+ </p>
254
+ </div>
255
+ </div>
256
+
257
+ <div id="method-M000012" class="method-detail">
258
+ <a name="M000012"></a>
259
+
260
+ <div class="method-heading">
261
+ <a href="PageTemplate.src/M000012.html" target="Code" class="method-signature"
262
+ onclick="popupCode('PageTemplate.src/M000012.html');return false;">
263
+ <span class="method-name">getParameter</span><span class="method-args">(name)</span>
264
+ </a>
265
+ </div>
266
+
267
+ <div class="method-description">
268
+ <p>
269
+ Get the value associated with <tt>name</tt> from the namespace. Returns nil
270
+ if the value is not set.
271
+ </p>
272
+ </div>
273
+ </div>
274
+
275
+ <div id="method-M000010" class="method-detail">
276
+ <a name="M000010"></a>
277
+
278
+ <div class="method-heading">
279
+ <a href="PageTemplate.src/M000010.html" target="Code" class="method-signature"
280
+ onclick="popupCode('PageTemplate.src/M000010.html');return false;">
281
+ <span class="method-name">load</span><span class="method-args">(file)</span>
282
+ </a>
283
+ </div>
284
+
285
+ <div class="method-description">
286
+ <p>
287
+ Open <tt>file</tt> and parse its contents so they will be ready for
288
+ template generation.
289
+ </p>
290
+ </div>
291
+ </div>
292
+
293
+ <div id="method-M000015" class="method-detail">
294
+ <a name="M000015"></a>
295
+
296
+ <div class="method-heading">
297
+ <a href="PageTemplate.src/M000015.html" target="Code" class="method-signature"
298
+ onclick="popupCode('PageTemplate.src/M000015.html');return false;">
299
+ <span class="method-name">output</span><span class="method-args">()</span>
300
+ </a>
301
+ </div>
302
+
303
+ <div class="method-description">
304
+ <p>
305
+ Returns the text result of stepping through the compiled template. Returns
306
+ nil if there is no compiled content (usually indicates that a file has not
307
+ been loaded yet).
308
+ </p>
309
+ <p>
310
+ *NOTE:* This checks the <a
311
+ href="PageTemplate.html">PageTemplate</a>&#8217;s namespace each time it is
312
+ called, so you can generate different custom pages without reloading the
313
+ template page.
314
+ </p>
315
+ </div>
316
+ </div>
317
+
318
+ <div id="method-M000011" class="method-detail">
319
+ <a name="M000011"></a>
320
+
321
+ <div class="method-heading">
322
+ <a href="PageTemplate.src/M000011.html" target="Code" class="method-signature"
323
+ onclick="popupCode('PageTemplate.src/M000011.html');return false;">
324
+ <span class="method-name">setParameter</span><span class="method-args">(name, value)</span>
325
+ </a>
326
+ </div>
327
+
328
+ <div class="method-description">
329
+ <p>
330
+ Set the namespace&#8217;s <tt>name</tt> to <tt>value</tt>.
331
+ </p>
332
+ <p>
333
+ If you need to reset a flag or loop variable to a false value, the easiest
334
+ way is to do just that: <tt>template.setParameter(&quot;myflag&quot;,
335
+ false)</tt>
336
+ </p>
337
+ </div>
338
+ </div>
339
+
340
+
341
+ </div>
342
+
343
+
344
+ </div>
345
+
346
+
347
+ <div id="validator-badges">
348
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
349
+ </div>
350
+
351
+ </body>
352
+ </html>