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 (Syntax::CachedParser)</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 712</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">glossary</span>, <span class="ruby-identifier">path</span>=<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span>)
15
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">glossary</span>, <span class="ruby-identifier">path</span>)
16
+ <span class="ruby-comment cmt"># Create the cache directory if it does not exist.</span>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,52 @@
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>build (Syntax::CachedParser)</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 717</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build</span>(<span class="ruby-identifier">filename</span>)
15
+ <span class="ruby-comment cmt"># Determine the name of the cache file.</span>
16
+ <span class="ruby-identifier">cacheFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">filename</span>)
17
+ <span class="ruby-identifier">saveCache</span> = <span class="ruby-keyword kw">false</span>
18
+
19
+ <span class="ruby-comment cmt"># See if cache exists and is newer than source.</span>
20
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">cacheFile</span>)
21
+ <span class="ruby-identifier">cacheStat</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>(<span class="ruby-identifier">cacheFile</span>)
22
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cacheStat</span>.<span class="ruby-identifier">mtime</span> <span class="ruby-operator">&gt;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">mtime</span>
23
+ <span class="ruby-comment cmt"># See if cache is newer than internal CommandBlock.</span>
24
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cacheStat</span>.<span class="ruby-identifier">mtime</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@mTime</span>
25
+ <span class="ruby-comment cmt"># Load the cache into memory</span>
26
+ <span class="ruby-ivar">@commands</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">IO</span>.<span class="ruby-identifier">readlines</span>(<span class="ruby-identifier">cacheFile</span>).<span class="ruby-identifier">join</span>)
27
+ <span class="ruby-ivar">@mTime</span> = <span class="ruby-identifier">cacheStat</span>.<span class="ruby-identifier">mtime</span>
28
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">cacheStat</span>.<span class="ruby-identifier">mtime</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@mTime</span>
29
+ <span class="ruby-identifier">saveCache</span> = <span class="ruby-keyword kw">true</span>
30
+ <span class="ruby-keyword kw">end</span>
31
+ <span class="ruby-keyword kw">else</span>
32
+ <span class="ruby-comment cmt"># Build the CommandBlock</span>
33
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">filename</span>)
34
+ <span class="ruby-identifier">saveCache</span> = <span class="ruby-keyword kw">true</span>
35
+ <span class="ruby-keyword kw">end</span>
36
+ <span class="ruby-keyword kw">else</span>
37
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">filename</span>)
38
+ <span class="ruby-identifier">saveCache</span> = <span class="ruby-keyword kw">true</span>
39
+ <span class="ruby-keyword kw">end</span>
40
+
41
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">saveCache</span>
42
+ <span class="ruby-comment cmt"># Write the cache to disk.</span>
43
+ <span class="ruby-identifier">data</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-ivar">@commands</span>)
44
+ <span class="ruby-identifier">f</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cacheFile</span>, <span class="ruby-value str">&quot;w&quot;</span>)
45
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
46
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">close</span>
47
+ <span class="ruby-keyword kw">end</span>
48
+
49
+ <span class="ruby-keyword kw">return</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@commands</span>
50
+ <span class="ruby-keyword kw">end</span></pre>
51
+ </body>
52
+ </html>
@@ -0,0 +1,245 @@
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: Syntax::Glossary</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">Syntax::Glossary</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
+ <a href="Glossary.html">Glossary</a> holds regular expression patterns
84
+ associated with markup in a <a href="../PageTemplate.html">PageTemplate</a>
85
+ document. It enables the <a href="../PageTemplate.html">PageTemplate</a> to
86
+ tell the difference between regular document content and template markup.
87
+ It also defines the syntax for the available markup directives:
88
+ </p>
89
+ <h3><a href="Glossary.html">Syntax::Glossary</a> read accessors</h3>
90
+ <dl>
91
+ <dt>:directive</dt><dd>The regular expression object which describes a chunk of markup text.
92
+
93
+ </dd>
94
+ <dt>:glossary</dt><dd>A hash of regular expression objects, describing parser keys.
95
+
96
+ </dd>
97
+ </dl>
98
+
99
+ </div>
100
+
101
+
102
+ </div>
103
+
104
+ <div id="method-list">
105
+ <h3 class="section-bar">Methods</h3>
106
+
107
+ <div class="name-list">
108
+ <a href="#M000048">lookup</a>&nbsp;&nbsp;
109
+ <a href="#M000047">new</a>&nbsp;&nbsp;
110
+ </div>
111
+ </div>
112
+
113
+ </div>
114
+
115
+
116
+ <!-- if includes -->
117
+
118
+ <div id="section">
119
+
120
+
121
+
122
+
123
+
124
+ <div id="attribute-list">
125
+ <h3 class="section-bar">Attributes</h3>
126
+
127
+ <div class="name-list">
128
+ <table>
129
+ <tr class="top-aligned-row context-row">
130
+ <td class="context-item-name">directive</td>
131
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
132
+ <td class="context-item-desc"></td>
133
+ </tr>
134
+ <tr class="top-aligned-row context-row">
135
+ <td class="context-item-name">glossary</td>
136
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
137
+ <td class="context-item-desc"></td>
138
+ </tr>
139
+ </table>
140
+ </div>
141
+ </div>
142
+
143
+
144
+
145
+ <!-- if method_list -->
146
+ <div id="methods">
147
+ <h3 class="section-bar">Public Class methods</h3>
148
+
149
+ <div id="method-M000047" class="method-detail">
150
+ <a name="M000047"></a>
151
+
152
+ <div class="method-heading">
153
+ <a href="Glossary.src/M000047.html" target="Code" class="method-signature"
154
+ onclick="popupCode('Glossary.src/M000047.html');return false;">
155
+ <span class="method-name">new</span><span class="method-args">(directive, glossary)</span>
156
+ </a>
157
+ </div>
158
+
159
+ <div class="method-description">
160
+ <p>
161
+ Creates a new <a href="Glossary.html">Syntax::Glossary</a> with regular
162
+ expression <tt>directive</tt>, and hash of regular expressions glossary, as
163
+ defined above.
164
+ </p>
165
+ <p>
166
+ <tt>directive</tt> must have a single grouping, which holds the actual
167
+ directive that is supposed to be processed (as opposed to the markers that
168
+ &quot;wrap&quot; the directive)
169
+ </p>
170
+ <p>
171
+ The following keys are required in glossary by a <a
172
+ href="Glossary.html">Syntax::Glossary</a> object:
173
+ </p>
174
+ <ul>
175
+ <li>value
176
+
177
+ </li>
178
+ <li>ifopen
179
+
180
+ </li>
181
+ <li>ifclose
182
+
183
+ </li>
184
+ <li>ifbranch
185
+
186
+ </li>
187
+ <li>loopopen
188
+
189
+ </li>
190
+ <li>loopclose
191
+
192
+ </li>
193
+ <li>loopbranch
194
+
195
+ </li>
196
+ </ul>
197
+ <p>
198
+ An ArgumentError is raised if glossary is missing any of these keys.
199
+ </p>
200
+ <p>
201
+ You may add keys, but it is up to you to make the <a
202
+ href="../PageTemplate.html">PageTemplate</a> parse method understand their
203
+ meaning.
204
+ </p>
205
+ </div>
206
+ </div>
207
+
208
+ <h3 class="section-bar">Public Instance methods</h3>
209
+
210
+ <div id="method-M000048" class="method-detail">
211
+ <a name="M000048"></a>
212
+
213
+ <div class="method-heading">
214
+ <a href="Glossary.src/M000048.html" target="Code" class="method-signature"
215
+ onclick="popupCode('Glossary.src/M000048.html');return false;">
216
+ <span class="method-name">lookup</span><span class="method-args">(text)</span>
217
+ </a>
218
+ </div>
219
+
220
+ <div class="method-description">
221
+ <p>
222
+ Find out which parser directive corresponds to <tt>text</tt>. <tt>text</tt>
223
+ is the grouping found by a directive match.
224
+ </p>
225
+ <p>
226
+ If no match is found, returns nil. If a match is found, returns an array of
227
+ the parse command and variable associated with it (or the parse command and
228
+ nil for the variable if there is no variable match).
229
+ </p>
230
+ </div>
231
+ </div>
232
+
233
+
234
+ </div>
235
+
236
+
237
+ </div>
238
+
239
+
240
+ <div id="validator-badges">
241
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
242
+ </div>
243
+
244
+ </body>
245
+ </html>
@@ -0,0 +1,20 @@
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 (Syntax::Glossary)</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 390</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">directive</span>, <span class="ruby-identifier">glossary</span>)
15
+ <span class="ruby-ivar">@directive</span> = <span class="ruby-identifier">directive</span>
16
+ <span class="ruby-identifier">checkGlossary</span>(<span class="ruby-identifier">glossary</span>)
17
+ <span class="ruby-ivar">@glossary</span> = <span class="ruby-identifier">glossary</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,29 @@
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>lookup (Syntax::Glossary)</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 403</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">text</span>)
15
+ <span class="ruby-identifier">command</span> = <span class="ruby-keyword kw">nil</span>
16
+ <span class="ruby-identifier">variable</span> = <span class="ruby-keyword kw">nil</span>
17
+ <span class="ruby-ivar">@glossary</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">match</span> = <span class="ruby-ivar">@glossary</span>[<span class="ruby-identifier">key</span>].<span class="ruby-identifier">match</span>(<span class="ruby-identifier">text</span>)
19
+ <span class="ruby-identifier">command</span> = <span class="ruby-identifier">key</span>
20
+ <span class="ruby-identifier">variable</span> = <span class="ruby-identifier">match</span>[<span class="ruby-value">1</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">match</span>[<span class="ruby-value">1</span>]
21
+ <span class="ruby-keyword kw">break</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+
25
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">command</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
26
+ <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">command</span>, <span class="ruby-identifier">variable</span>]
27
+ <span class="ruby-keyword kw">end</span></pre>
28
+ </body>
29
+ </html>
@@ -0,0 +1,261 @@
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: Syntax::Parser</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">Syntax::Parser</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
+ Uses a <a href="Glossary.html">Syntax::Glossary</a> to translate a string
84
+ of text into a series of Commands.
85
+ </p>
86
+
87
+ </div>
88
+
89
+
90
+ </div>
91
+
92
+ <div id="method-list">
93
+ <h3 class="section-bar">Methods</h3>
94
+
95
+ <div class="name-list">
96
+ <a href="#M000050">build</a>&nbsp;&nbsp;
97
+ <a href="#M000054">compile</a>&nbsp;&nbsp;
98
+ <a href="#M000049">new</a>&nbsp;&nbsp;
99
+ <a href="#M000051">output</a>&nbsp;&nbsp;
100
+ <a href="#M000053">parse</a>&nbsp;&nbsp;
101
+ <a href="#M000052">reset</a>&nbsp;&nbsp;
102
+ </div>
103
+ </div>
104
+
105
+ </div>
106
+
107
+
108
+ <!-- if includes -->
109
+
110
+ <div id="section">
111
+
112
+
113
+
114
+
115
+
116
+ <div id="attribute-list">
117
+ <h3 class="section-bar">Attributes</h3>
118
+
119
+ <div class="name-list">
120
+ <table>
121
+ <tr class="top-aligned-row context-row">
122
+ <td class="context-item-name">commands</td>
123
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
124
+ <td class="context-item-desc"></td>
125
+ </tr>
126
+ </table>
127
+ </div>
128
+ </div>
129
+
130
+
131
+
132
+ <!-- if method_list -->
133
+ <div id="methods">
134
+ <h3 class="section-bar">Public Class methods</h3>
135
+
136
+ <div id="method-M000049" class="method-detail">
137
+ <a name="M000049"></a>
138
+
139
+ <div class="method-heading">
140
+ <a href="Parser.src/M000049.html" target="Code" class="method-signature"
141
+ onclick="popupCode('Parser.src/M000049.html');return false;">
142
+ <span class="method-name">new</span><span class="method-args">(glossary, path=Dir.getwd)</span>
143
+ </a>
144
+ </div>
145
+
146
+ <div class="method-description">
147
+ </div>
148
+ </div>
149
+
150
+ <h3 class="section-bar">Public Instance methods</h3>
151
+
152
+ <div id="method-M000050" class="method-detail">
153
+ <a name="M000050"></a>
154
+
155
+ <div class="method-heading">
156
+ <a href="Parser.src/M000050.html" target="Code" class="method-signature"
157
+ onclick="popupCode('Parser.src/M000050.html');return false;">
158
+ <span class="method-name">build</span><span class="method-args">(filename)</span>
159
+ </a>
160
+ </div>
161
+
162
+ <div class="method-description">
163
+ <p>
164
+ Parse and compile a file containing <a
165
+ href="../PageTemplate.html">PageTemplate</a> directives.
166
+ </p>
167
+ </div>
168
+ </div>
169
+
170
+ <div id="method-M000054" class="method-detail">
171
+ <a name="M000054"></a>
172
+
173
+ <div class="method-heading">
174
+ <a href="Parser.src/M000054.html" target="Code" class="method-signature"
175
+ onclick="popupCode('Parser.src/M000054.html');return false;">
176
+ <span class="method-name">compile</span><span class="method-args">(lines, filename = &quot;?&quot;)</span>
177
+ </a>
178
+ </div>
179
+
180
+ <div class="method-description">
181
+ <p>
182
+ Turn an array of parsed directives into a CommandBlock.
183
+ </p>
184
+ <p>
185
+ If provided, <tt>filename</tt> is assumed to be the name of the file which
186
+ contains the original <tt>source</tt>.
187
+ </p>
188
+ </div>
189
+ </div>
190
+
191
+ <div id="method-M000051" class="method-detail">
192
+ <a name="M000051"></a>
193
+
194
+ <div class="method-heading">
195
+ <a href="Parser.src/M000051.html" target="Code" class="method-signature"
196
+ onclick="popupCode('Parser.src/M000051.html');return false;">
197
+ <span class="method-name">output</span><span class="method-args">(namespace = nil)</span>
198
+ </a>
199
+ </div>
200
+
201
+ <div class="method-description">
202
+ <p>
203
+ Returns the result of executing the <a
204
+ href="Parser.html">Parser</a>&#8217;s internal compiled CommandBlock, using
205
+ ((|namespace||)).
206
+ </p>
207
+ </div>
208
+ </div>
209
+
210
+ <div id="method-M000053" class="method-detail">
211
+ <a name="M000053"></a>
212
+
213
+ <div class="method-heading">
214
+ <a href="Parser.src/M000053.html" target="Code" class="method-signature"
215
+ onclick="popupCode('Parser.src/M000053.html');return false;">
216
+ <span class="method-name">parse</span><span class="method-args">(source, filename = &quot;?&quot;)</span>
217
+ </a>
218
+ </div>
219
+
220
+ <div class="method-description">
221
+ <p>
222
+ Turn an array of strings <tt>source</tt> into a series of directives that
223
+ can be handled by <a href="Parser.html#M000054">Parser#compile</a>.
224
+ </p>
225
+ <p>
226
+ If provided, <tt>filename</tt> is assumed to be the name of the file which
227
+ contains the original <tt>source</tt>.
228
+ </p>
229
+ </div>
230
+ </div>
231
+
232
+ <div id="method-M000052" class="method-detail">
233
+ <a name="M000052"></a>
234
+
235
+ <div class="method-heading">
236
+ <a href="Parser.src/M000052.html" target="Code" class="method-signature"
237
+ onclick="popupCode('Parser.src/M000052.html');return false;">
238
+ <span class="method-name">reset</span><span class="method-args">()</span>
239
+ </a>
240
+ </div>
241
+
242
+ <div class="method-description">
243
+ <p>
244
+ Clear the <a href="Parser.html">Parser</a>&#8217;s CommandBlock.
245
+ </p>
246
+ </div>
247
+ </div>
248
+
249
+
250
+ </div>
251
+
252
+
253
+ </div>
254
+
255
+
256
+ <div id="validator-badges">
257
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
258
+ </div>
259
+
260
+ </body>
261
+ </html>