PageTemplate 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes +24 -0
- data/MANIFEST +0 -1
- data/README.txt +10 -8
- data/Rakefile +30 -9
- data/lib/PageTemplate/case.rb +72 -0
- data/lib/PageTemplate/commands.rb +500 -0
- data/lib/PageTemplate/parser.rb +373 -0
- data/lib/PageTemplate.rb +47 -991
- data/setup-usage.txt +129 -0
- data/setup.rb +1360 -0
- data/tdata/dummy.txt +2 -0
- data/test.rb +616 -0
- metadata +13 -169
- data/CVS/Entries +0 -10
- data/CVS/Repository +0 -1
- data/CVS/Root +0 -1
- data/Changes~ +0 -7
- data/InstalledFiles +0 -7
- data/Rakefile~ +0 -54
- data/TC_PageTemplate.rb +0 -974
- data/TC_PageTemplate.rb~ +0 -965
- data/config.save +0 -12
- data/doc/classes/BlockCommand.html +0 -229
- data/doc/classes/BlockCommand.src/M000004.html +0 -18
- data/doc/classes/BlockCommand.src/M000005.html +0 -25
- data/doc/classes/BlockCommand.src/M000006.html +0 -18
- data/doc/classes/BlockCommand.src/M000007.html +0 -23
- data/doc/classes/BlockCommand.src/M000008.html +0 -24
- data/doc/classes/Command.html +0 -167
- data/doc/classes/Command.src/M000032.html +0 -19
- data/doc/classes/Command.src/M000033.html +0 -18
- data/doc/classes/CommentCommand.html +0 -146
- data/doc/classes/CommentCommand.src/M000009.html +0 -18
- data/doc/classes/IfCommand.html +0 -193
- data/doc/classes/IfCommand.src/M000042.html +0 -19
- data/doc/classes/IfCommand.src/M000043.html +0 -20
- data/doc/classes/IfCommand.src/M000044.html +0 -20
- data/doc/classes/IfElseCommand.html +0 -189
- data/doc/classes/IfElseCommand.src/M000025.html +0 -19
- data/doc/classes/IfElseCommand.src/M000026.html +0 -23
- data/doc/classes/IfElseCommand.src/M000027.html +0 -20
- data/doc/classes/IncludeCommand.html +0 -171
- data/doc/classes/IncludeCommand.src/M000019.html +0 -26
- data/doc/classes/IncludeCommand.src/M000020.html +0 -28
- data/doc/classes/IncludeCommand.src/M000021.html +0 -18
- data/doc/classes/IncludeCommandError.html +0 -118
- data/doc/classes/LoopCommand.html +0 -197
- data/doc/classes/LoopCommand.src/M000001.html +0 -19
- data/doc/classes/LoopCommand.src/M000002.html +0 -42
- data/doc/classes/LoopCommand.src/M000003.html +0 -20
- data/doc/classes/LoopElseCommand.html +0 -190
- data/doc/classes/LoopElseCommand.src/M000022.html +0 -19
- data/doc/classes/LoopElseCommand.src/M000023.html +0 -23
- data/doc/classes/LoopElseCommand.src/M000024.html +0 -20
- data/doc/classes/Namespace.html +0 -297
- data/doc/classes/Namespace.src/M000034.html +0 -19
- data/doc/classes/Namespace.src/M000035.html +0 -18
- data/doc/classes/Namespace.src/M000036.html +0 -18
- data/doc/classes/Namespace.src/M000037.html +0 -19
- data/doc/classes/Namespace.src/M000038.html +0 -36
- data/doc/classes/Namespace.src/M000039.html +0 -21
- data/doc/classes/Namespace.src/M000040.html +0 -18
- data/doc/classes/Namespace.src/M000041.html +0 -18
- data/doc/classes/PageTemplate.html +0 -380
- data/doc/classes/PageTemplate.src/M000010.html +0 -49
- data/doc/classes/PageTemplate.src/M000011.html +0 -18
- data/doc/classes/PageTemplate.src/M000012.html +0 -29
- data/doc/classes/PageTemplate.src/M000013.html +0 -18
- data/doc/classes/PageTemplate.src/M000014.html +0 -18
- data/doc/classes/PageTemplate.src/M000015.html +0 -18
- data/doc/classes/PageTemplate.src/M000016.html +0 -18
- data/doc/classes/PageTemplate.src/M000017.html +0 -18
- data/doc/classes/PageTemplate.src/M000018.html +0 -19
- data/doc/classes/Syntax/CachedParser.html +0 -163
- data/doc/classes/Syntax/CachedParser.src/M000048.html +0 -19
- data/doc/classes/Syntax/CachedParser.src/M000049.html +0 -53
- data/doc/classes/Syntax/Glossary.html +0 -251
- data/doc/classes/Syntax/Glossary.src/M000050.html +0 -20
- data/doc/classes/Syntax/Glossary.src/M000051.html +0 -29
- data/doc/classes/Syntax/Parser.html +0 -261
- data/doc/classes/Syntax/Parser.src/M000052.html +0 -22
- data/doc/classes/Syntax/Parser.src/M000053.html +0 -36
- data/doc/classes/Syntax/Parser.src/M000054.html +0 -18
- data/doc/classes/Syntax/Parser.src/M000055.html +0 -21
- data/doc/classes/Syntax/Parser.src/M000056.html +0 -53
- data/doc/classes/Syntax/Parser.src/M000057.html +0 -111
- data/doc/classes/Syntax.html +0 -139
- data/doc/classes/TextCommand.html +0 -185
- data/doc/classes/TextCommand.src/M000045.html +0 -18
- data/doc/classes/TextCommand.src/M000046.html +0 -18
- data/doc/classes/TextCommand.src/M000047.html +0 -18
- data/doc/classes/UnlessCommand.html +0 -151
- data/doc/classes/UnlessCommand.src/M000028.html +0 -20
- data/doc/classes/ValueCommand.html +0 -186
- data/doc/classes/ValueCommand.src/M000029.html +0 -18
- data/doc/classes/ValueCommand.src/M000030.html +0 -18
- data/doc/classes/ValueCommand.src/M000031.html +0 -20
- data/doc/created.rid +0 -1
- data/doc/files/README_txt.html +0 -224
- data/doc/files/lib/PageTemplate_rb.html +0 -119
- data/doc/fr_class_index.html +0 -44
- data/doc/fr_file_index.html +0 -28
- data/doc/fr_method_index.html +0 -83
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/install.rb +0 -1015
- data/lib/CVS/Entries +0 -2
- data/lib/CVS/Repository +0 -1
- data/lib/CVS/Root +0 -1
- data/lib/PageTemplate.rb~ +0 -1004
- data/pkg/PageTemplate-1.2.0.gem +0 -0
- data/tdata/CVS/Entries +0 -28
- data/tdata/CVS/Repository +0 -1
- data/tdata/CVS/Root +0 -1
- data/tdata/cm.txt +0 -3
- data/tdata/complex.txt +0 -116
- data/tdata/i1.txt +0 -1
- data/tdata/i2.txt +0 -7
- data/tdata/ib1.txt +0 -7
- data/tdata/ib2.txt +0 -13
- data/tdata/ie1.txt +0 -4
- data/tdata/ie2.txt +0 -15
- data/tdata/include.1.txt +0 -1
- data/tdata/include.2.txt +0 -1
- data/tdata/include.3.txt +0 -1
- data/tdata/include.4.nf.out.txt +0 -2
- data/tdata/include.4.out.txt +0 -3
- data/tdata/include.4.txt +0 -2
- data/tdata/include.4a.txt +0 -1
- data/tdata/include.4b.txt +0 -2
- data/tdata/include.5.txt +0 -2
- data/tdata/l1.txt +0 -5
- data/tdata/l2.txt +0 -7
- data/tdata/metadata.1.txt +0 -5
- data/tdata/metadata.2.txt +0 -5
- data/tdata/metadata.3.txt +0 -5
- data/tdata/metadata.4.txt +0 -5
- data/tdata/nm.txt +0 -4
- data/tdata/p/CVS/Entries +0 -5
- data/tdata/p/CVS/Repository +0 -1
- data/tdata/p/CVS/Root +0 -1
- data/tdata/p/CVS/b2.txt,t +0 -0
- data/tdata/p/_b1.txt +0 -0
- data/tdata/p/b1.txt +0 -4
- data/tdata/p/b2.txt +0 -4
- data/tdata/p/b2.txt~ +0 -4
- data/tdata/p/cb1.txt +0 -4
- data/tdata/t.txt +0 -2
- data/tdata/v1.txt +0 -11
- data/tdata/v2.txt +0 -11
@@ -1,18 +0,0 @@
|
|
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>[] (PageTemplate)</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 914</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-identifier">getParameter</span>(<span class="ruby-identifier">key</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
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>output (PageTemplate)</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 925</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output</span>
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">commands</span>.<span class="ruby-identifier">output</span>(<span class="ruby-ivar">@params</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
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>clearFile (PageTemplate)</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 931</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clearFile</span>
|
15
|
-
<span class="ruby-ivar">@file</span> = <span class="ruby-keyword kw">nil</span>
|
16
|
-
<span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">reset</span>()
|
17
|
-
<span class="ruby-keyword kw">end</span></pre>
|
18
|
-
</body>
|
19
|
-
</html>
|
@@ -1,163 +0,0 @@
|
|
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::CachedParser</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::CachedParser</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
|
-
<a href="Parser.html">
|
69
|
-
Parser
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
<div id="description">
|
84
|
-
<p>
|
85
|
-
A <a href="Parser.html">Syntax::Parser</a> that can save its compiled
|
86
|
-
CommandBlock for reuse later.
|
87
|
-
</p>
|
88
|
-
|
89
|
-
</div>
|
90
|
-
|
91
|
-
|
92
|
-
</div>
|
93
|
-
|
94
|
-
<div id="method-list">
|
95
|
-
<h3 class="section-bar">Methods</h3>
|
96
|
-
|
97
|
-
<div class="name-list">
|
98
|
-
<a href="#M000049">build</a>
|
99
|
-
<a href="#M000048">new</a>
|
100
|
-
</div>
|
101
|
-
</div>
|
102
|
-
|
103
|
-
</div>
|
104
|
-
|
105
|
-
|
106
|
-
<!-- if includes -->
|
107
|
-
|
108
|
-
<div id="section">
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
<!-- if method_list -->
|
118
|
-
<div id="methods">
|
119
|
-
<h3 class="section-bar">Public Class methods</h3>
|
120
|
-
|
121
|
-
<div id="method-M000048" class="method-detail">
|
122
|
-
<a name="M000048"></a>
|
123
|
-
|
124
|
-
<div class="method-heading">
|
125
|
-
<a href="CachedParser.src/M000048.html" target="Code" class="method-signature"
|
126
|
-
onclick="popupCode('CachedParser.src/M000048.html');return false;">
|
127
|
-
<span class="method-name">new</span><span class="method-args">(glossary, path=Dir.getwd)</span>
|
128
|
-
</a>
|
129
|
-
</div>
|
130
|
-
|
131
|
-
<div class="method-description">
|
132
|
-
</div>
|
133
|
-
</div>
|
134
|
-
|
135
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
136
|
-
|
137
|
-
<div id="method-M000049" class="method-detail">
|
138
|
-
<a name="M000049"></a>
|
139
|
-
|
140
|
-
<div class="method-heading">
|
141
|
-
<a href="CachedParser.src/M000049.html" target="Code" class="method-signature"
|
142
|
-
onclick="popupCode('CachedParser.src/M000049.html');return false;">
|
143
|
-
<span class="method-name">build</span><span class="method-args">(filename)</span>
|
144
|
-
</a>
|
145
|
-
</div>
|
146
|
-
|
147
|
-
<div class="method-description">
|
148
|
-
</div>
|
149
|
-
</div>
|
150
|
-
|
151
|
-
|
152
|
-
</div>
|
153
|
-
|
154
|
-
|
155
|
-
</div>
|
156
|
-
|
157
|
-
|
158
|
-
<div id="validator-badges">
|
159
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
160
|
-
</div>
|
161
|
-
|
162
|
-
</body>
|
163
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
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 756</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>
|
@@ -1,53 +0,0 @@
|
|
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 761</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">"/_"</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-identifier">cacheFile</span>.<span class="ruby-identifier">untaint</span>
|
21
|
-
<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>)
|
22
|
-
<span class="ruby-identifier">cacheStat</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>(<span class="ruby-identifier">cacheFile</span>)
|
23
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cacheStat</span>.<span class="ruby-identifier">mtime</span> <span class="ruby-operator">></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>
|
24
|
-
<span class="ruby-comment cmt"># See if cache is newer than internal CommandBlock.</span>
|
25
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cacheStat</span>.<span class="ruby-identifier">mtime</span> <span class="ruby-operator">></span> <span class="ruby-ivar">@mTime</span>
|
26
|
-
<span class="ruby-comment cmt"># Load the cache into memory</span>
|
27
|
-
<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>)
|
28
|
-
<span class="ruby-ivar">@mTime</span> = <span class="ruby-identifier">cacheStat</span>.<span class="ruby-identifier">mtime</span>
|
29
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">cacheStat</span>.<span class="ruby-identifier">mtime</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@mTime</span>
|
30
|
-
<span class="ruby-identifier">saveCache</span> = <span class="ruby-keyword kw">true</span>
|
31
|
-
<span class="ruby-keyword kw">end</span>
|
32
|
-
<span class="ruby-keyword kw">else</span>
|
33
|
-
<span class="ruby-comment cmt"># Build the CommandBlock</span>
|
34
|
-
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">filename</span>)
|
35
|
-
<span class="ruby-identifier">saveCache</span> = <span class="ruby-keyword kw">true</span>
|
36
|
-
<span class="ruby-keyword kw">end</span>
|
37
|
-
<span class="ruby-keyword kw">else</span>
|
38
|
-
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">filename</span>)
|
39
|
-
<span class="ruby-identifier">saveCache</span> = <span class="ruby-keyword kw">true</span>
|
40
|
-
<span class="ruby-keyword kw">end</span>
|
41
|
-
|
42
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">saveCache</span>
|
43
|
-
<span class="ruby-comment cmt"># Write the cache to disk.</span>
|
44
|
-
<span class="ruby-identifier">data</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-ivar">@commands</span>)
|
45
|
-
<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">"w"</span>)
|
46
|
-
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
|
47
|
-
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">close</span>
|
48
|
-
<span class="ruby-keyword kw">end</span>
|
49
|
-
|
50
|
-
<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>
|
51
|
-
<span class="ruby-keyword kw">end</span></pre>
|
52
|
-
</body>
|
53
|
-
</html>
|
@@ -1,251 +0,0 @@
|
|
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="#M000051">lookup</a>
|
109
|
-
<a href="#M000050">new</a>
|
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"> [R] </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"> [R] </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-M000050" class="method-detail">
|
150
|
-
<a name="M000050"></a>
|
151
|
-
|
152
|
-
<div class="method-heading">
|
153
|
-
<a href="Glossary.src/M000050.html" target="Code" class="method-signature"
|
154
|
-
onclick="popupCode('Glossary.src/M000050.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
|
-
"wrap" 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>unlessopen
|
188
|
-
|
189
|
-
</li>
|
190
|
-
<li>unlessclose
|
191
|
-
|
192
|
-
</li>
|
193
|
-
<li>loopopen
|
194
|
-
|
195
|
-
</li>
|
196
|
-
<li>loopclose
|
197
|
-
|
198
|
-
</li>
|
199
|
-
<li>loopbranch
|
200
|
-
|
201
|
-
</li>
|
202
|
-
</ul>
|
203
|
-
<p>
|
204
|
-
An ArgumentError is raised if glossary is missing any of these keys.
|
205
|
-
</p>
|
206
|
-
<p>
|
207
|
-
You may add keys, but it is up to you to make the <a
|
208
|
-
href="../PageTemplate.html">PageTemplate</a> parse method understand their
|
209
|
-
meaning.
|
210
|
-
</p>
|
211
|
-
</div>
|
212
|
-
</div>
|
213
|
-
|
214
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
215
|
-
|
216
|
-
<div id="method-M000051" class="method-detail">
|
217
|
-
<a name="M000051"></a>
|
218
|
-
|
219
|
-
<div class="method-heading">
|
220
|
-
<a href="Glossary.src/M000051.html" target="Code" class="method-signature"
|
221
|
-
onclick="popupCode('Glossary.src/M000051.html');return false;">
|
222
|
-
<span class="method-name">lookup</span><span class="method-args">(text)</span>
|
223
|
-
</a>
|
224
|
-
</div>
|
225
|
-
|
226
|
-
<div class="method-description">
|
227
|
-
<p>
|
228
|
-
Find out which parser directive corresponds to <tt>text</tt>. <tt>text</tt>
|
229
|
-
is the grouping found by a directive match.
|
230
|
-
</p>
|
231
|
-
<p>
|
232
|
-
If no match is found, returns nil. If a match is found, returns an array of
|
233
|
-
the parse command and variable associated with it (or the parse command and
|
234
|
-
nil for the variable if there is no variable match).
|
235
|
-
</p>
|
236
|
-
</div>
|
237
|
-
</div>
|
238
|
-
|
239
|
-
|
240
|
-
</div>
|
241
|
-
|
242
|
-
|
243
|
-
</div>
|
244
|
-
|
245
|
-
|
246
|
-
<div id="validator-badges">
|
247
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
248
|
-
</div>
|
249
|
-
|
250
|
-
</body>
|
251
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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 422</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>
|
@@ -1,29 +0,0 @@
|
|
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 435</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>
|