syc-spector 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +17 -0
- data/bin/sycspector +7 -0
- data/doc/Inspector/Console.html +256 -0
- data/doc/Inspector/Options.html +301 -0
- data/doc/Inspector/Runner.html +239 -0
- data/doc/Inspector/Separator.html +456 -0
- data/doc/Inspector.html +157 -0
- data/doc/Object.html +165 -0
- data/doc/README.html +119 -0
- data/doc/TestConsole.html +143 -0
- data/doc/TestOptions.html +246 -0
- data/doc/TestSeparator.html +270 -0
- data/doc/created.rid +11 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +94 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +109 -0
- data/lib/inspector/console.rb +60 -0
- data/lib/inspector/options.rb +212 -0
- data/lib/inspector/pattern.rb +11 -0
- data/lib/inspector/runner.rb +31 -0
- data/lib/inspector/separator.rb +182 -0
- data/sycspector.gemspec +18 -0
- data/test/test_console.rb +26 -0
- data/test/test_options.rb +115 -0
- data/test/test_separator.rb +118 -0
- metadata +140 -0
@@ -0,0 +1,270 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class TestSeparator - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>test/test_separator.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">Test::Unit::TestCase
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-i-initialize_infile">#initialize_infile</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-initialize_options">#initialize_options</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-setup">#setup</a>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
</nav>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<div id="project-metadata">
|
85
|
+
<nav id="fileindex-section" class="section project-section">
|
86
|
+
<h3 class="section-header">Pages</h3>
|
87
|
+
|
88
|
+
<ul>
|
89
|
+
|
90
|
+
<li class="file"><a href="./README.html">README</a>
|
91
|
+
|
92
|
+
</ul>
|
93
|
+
</nav>
|
94
|
+
|
95
|
+
<nav id="classindex-section" class="section project-section">
|
96
|
+
<h3 class="section-header">Class and Module Index</h3>
|
97
|
+
|
98
|
+
<ul class="link-list">
|
99
|
+
|
100
|
+
<li><a href="./Inspector.html">Inspector</a>
|
101
|
+
|
102
|
+
<li><a href="./Inspector/Console.html">Inspector::Console</a>
|
103
|
+
|
104
|
+
<li><a href="./Inspector/Options.html">Inspector::Options</a>
|
105
|
+
|
106
|
+
<li><a href="./Inspector/Runner.html">Inspector::Runner</a>
|
107
|
+
|
108
|
+
<li><a href="./Inspector/Separator.html">Inspector::Separator</a>
|
109
|
+
|
110
|
+
<li><a href="./Object.html">Object</a>
|
111
|
+
|
112
|
+
<li><a href="./TestConsole.html">TestConsole</a>
|
113
|
+
|
114
|
+
<li><a href="./TestOptions.html">TestOptions</a>
|
115
|
+
|
116
|
+
<li><a href="./TestSeparator.html">TestSeparator</a>
|
117
|
+
|
118
|
+
</ul>
|
119
|
+
</nav>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
</nav>
|
123
|
+
|
124
|
+
<div id="documentation">
|
125
|
+
<h1 class="class">class TestSeparator</h1>
|
126
|
+
|
127
|
+
<div id="description" class="description">
|
128
|
+
|
129
|
+
<p>Tests the Separator class</p>
|
130
|
+
|
131
|
+
</div><!-- description -->
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<!-- Methods -->
|
146
|
+
|
147
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
148
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
149
|
+
|
150
|
+
|
151
|
+
<div id="method-i-initialize_infile" class="method-detail ">
|
152
|
+
|
153
|
+
<div class="method-heading">
|
154
|
+
<span class="method-name">initialize_infile</span><span
|
155
|
+
class="method-args">(values = [], separator)</span>
|
156
|
+
<span class="method-click-advice">click to toggle source</span>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
<div class="method-description">
|
161
|
+
|
162
|
+
<p>Initilize the infile with provided values and separating the values with
|
163
|
+
the provided separator</p>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<div class="method-source-code" id="initialize_infile-source">
|
168
|
+
<pre><span class="ruby-comment"># File test/test_separator.rb, line 24</span>
|
169
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize_infile</span>(<span class="ruby-identifier">values</span> = [], <span class="ruby-identifier">separator</span>)
|
170
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:infile</span>], <span class="ruby-string">'w'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
171
|
+
<span class="ruby-identifier">first</span> = <span class="ruby-keyword">true</span>
|
172
|
+
<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
173
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">first</span>
|
174
|
+
<span class="ruby-identifier">first</span> = <span class="ruby-keyword">false</span>
|
175
|
+
<span class="ruby-keyword">else</span>
|
176
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">separator</span>
|
177
|
+
<span class="ruby-keyword">end</span>
|
178
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">value</span>
|
179
|
+
<span class="ruby-keyword">end</span>
|
180
|
+
<span class="ruby-keyword">end</span>
|
181
|
+
<span class="ruby-keyword">end</span></pre>
|
182
|
+
</div><!-- initialize_infile-source -->
|
183
|
+
|
184
|
+
</div>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
</div><!-- initialize_infile-method -->
|
190
|
+
|
191
|
+
|
192
|
+
<div id="method-i-initialize_options" class="method-detail ">
|
193
|
+
|
194
|
+
<div class="method-heading">
|
195
|
+
<span class="method-name">initialize_options</span><span
|
196
|
+
class="method-args">(opts={})</span>
|
197
|
+
<span class="method-click-advice">click to toggle source</span>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
|
203
|
+
<p>Overrides some of the standard @optinons initialized in setup</p>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<div class="method-source-code" id="initialize_options-source">
|
208
|
+
<pre><span class="ruby-comment"># File test/test_separator.rb, line 39</span>
|
209
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize_options</span>(<span class="ruby-identifier">opts</span>={})
|
210
|
+
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
211
|
+
<span class="ruby-ivar">@options</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
|
212
|
+
<span class="ruby-keyword">end</span>
|
213
|
+
<span class="ruby-keyword">end</span></pre>
|
214
|
+
</div><!-- initialize_options-source -->
|
215
|
+
|
216
|
+
</div>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
</div><!-- initialize_options-method -->
|
222
|
+
|
223
|
+
|
224
|
+
<div id="method-i-setup" class="method-detail ">
|
225
|
+
|
226
|
+
<div class="method-heading">
|
227
|
+
<span class="method-name">setup</span><span
|
228
|
+
class="method-args">()</span>
|
229
|
+
<span class="method-click-advice">click to toggle source</span>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
|
235
|
+
<p>Initialize the @options</p>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<div class="method-source-code" id="setup-source">
|
240
|
+
<pre><span class="ruby-comment"># File test/test_separator.rb, line 14</span>
|
241
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">setup</span>
|
242
|
+
<span class="ruby-ivar">@options</span> = {<span class="ruby-identifier">individualize</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>, <span class="ruby-identifier">sort</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>, <span class="ruby-identifier">fix</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>, <span class="ruby-identifier">mode</span><span class="ruby-operator">:</span> <span class="ruby-string">'w'</span>,
|
243
|
+
<span class="ruby-identifier">pattern</span><span class="ruby-operator">:</span> <span class="ruby-regexp">%r\A\w+@\w+\.de\Z/</span>, <span class="ruby-identifier">scan_pattern</span><span class="ruby-operator">:</span> <span class="ruby-regexp">%r\w+@\w+\.de/</span>,
|
244
|
+
<span class="ruby-identifier">delimiter</span><span class="ruby-operator">:</span> <span class="ruby-string">";"</span>, <span class="ruby-identifier">valid_file</span><span class="ruby-operator">:</span> <span class="ruby-string">"20130113_121212_valid_values"</span>,
|
245
|
+
<span class="ruby-identifier">infile</span><span class="ruby-operator">:</span> <span class="ruby-string">"inputfile"</span>,
|
246
|
+
<span class="ruby-identifier">invalid_file</span><span class="ruby-operator">:</span> <span class="ruby-string">"20130113_121212_invalid_values"</span>, <span class="ruby-identifier">show</span><span class="ruby-operator">:</span> <span class="ruby-value">:valid</span>}
|
247
|
+
<span class="ruby-keyword">end</span></pre>
|
248
|
+
</div><!-- setup-source -->
|
249
|
+
|
250
|
+
</div>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</div><!-- setup-method -->
|
256
|
+
|
257
|
+
|
258
|
+
</section><!-- public-instance-method-details -->
|
259
|
+
|
260
|
+
</section><!-- 5Buntitled-5D -->
|
261
|
+
|
262
|
+
</div><!-- documentation -->
|
263
|
+
|
264
|
+
|
265
|
+
<footer id="validator-badges">
|
266
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
267
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
268
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
269
|
+
</footer>
|
270
|
+
|
data/doc/created.rid
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Tue, 15 Jan 2013 23:07:10 +0100
|
2
|
+
./test/test_options.rb Tue, 15 Jan 2013 23:04:15 +0100
|
3
|
+
./test/test_separator.rb Tue, 15 Jan 2013 23:02:11 +0100
|
4
|
+
./test/test_console.rb Tue, 15 Jan 2013 22:59:35 +0100
|
5
|
+
./lib/inspector/separator.rb Tue, 15 Jan 2013 22:52:16 +0100
|
6
|
+
./lib/inspector/pattern.rb Tue, 15 Jan 2013 22:28:07 +0100
|
7
|
+
./lib/inspector/options.rb Tue, 15 Jan 2013 23:07:06 +0100
|
8
|
+
./lib/inspector/console.rb Tue, 15 Jan 2013 22:54:55 +0100
|
9
|
+
./lib/inspector/runner.rb Tue, 15 Jan 2013 22:56:24 +0100
|
10
|
+
./bin/sycspector Tue, 15 Jan 2013 22:57:52 +0100
|
11
|
+
./README Tue, 15 Jan 2013 22:46:24 +0100
|
data/doc/images/add.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/doc/images/bug.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/date.png
ADDED
Binary file
|
Binary file
|
data/doc/images/find.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/ruby.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/zoom.png
ADDED
Binary file
|
data/doc/index.html
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="project-metadata">
|
47
|
+
<nav id="fileindex-section" class="section project-section">
|
48
|
+
<h3 class="section-header">Pages</h3>
|
49
|
+
|
50
|
+
<ul>
|
51
|
+
|
52
|
+
<li class="file"><a href="./README.html">README</a>
|
53
|
+
|
54
|
+
</ul>
|
55
|
+
</nav>
|
56
|
+
|
57
|
+
<nav id="classindex-section" class="section project-section">
|
58
|
+
<h3 class="section-header">Class and Module Index</h3>
|
59
|
+
|
60
|
+
<ul class="link-list">
|
61
|
+
|
62
|
+
<li><a href="./Inspector.html">Inspector</a>
|
63
|
+
|
64
|
+
<li><a href="./Inspector/Console.html">Inspector::Console</a>
|
65
|
+
|
66
|
+
<li><a href="./Inspector/Options.html">Inspector::Options</a>
|
67
|
+
|
68
|
+
<li><a href="./Inspector/Runner.html">Inspector::Runner</a>
|
69
|
+
|
70
|
+
<li><a href="./Inspector/Separator.html">Inspector::Separator</a>
|
71
|
+
|
72
|
+
<li><a href="./Object.html">Object</a>
|
73
|
+
|
74
|
+
<li><a href="./TestConsole.html">TestConsole</a>
|
75
|
+
|
76
|
+
<li><a href="./TestOptions.html">TestOptions</a>
|
77
|
+
|
78
|
+
<li><a href="./TestSeparator.html">TestSeparator</a>
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
</nav>
|
85
|
+
|
86
|
+
<p>This is the API documentation for RDoc Documentation.
|
87
|
+
|
88
|
+
|
89
|
+
<footer id="validator-badges">
|
90
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
91
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
92
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
93
|
+
</footer>
|
94
|
+
|
data/doc/js/darkfish.js
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* Darkfish Page Functions
|
4
|
+
* $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $
|
5
|
+
*
|
6
|
+
* Author: Michael Granger <mgranger@laika.com>
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
/* Provide console simulation for firebug-less environments */
|
11
|
+
if (!("console" in window) || !("firebug" in console)) {
|
12
|
+
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
|
13
|
+
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
|
14
|
+
|
15
|
+
window.console = {};
|
16
|
+
for (var i = 0; i < names.length; ++i)
|
17
|
+
window.console[names[i]] = function() {};
|
18
|
+
};
|
19
|
+
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Unwrap the first element that matches the given @expr@ from the targets and return them.
|
23
|
+
*/
|
24
|
+
$.fn.unwrap = function( expr ) {
|
25
|
+
return this.each( function() {
|
26
|
+
$(this).parents( expr ).eq( 0 ).after( this ).remove();
|
27
|
+
});
|
28
|
+
};
|
29
|
+
|
30
|
+
|
31
|
+
function showSource( e ) {
|
32
|
+
var target = e.target;
|
33
|
+
var codeSections = $(target).
|
34
|
+
parents('.method-detail').
|
35
|
+
find('.method-source-code');
|
36
|
+
|
37
|
+
$(target).
|
38
|
+
parents('.method-detail').
|
39
|
+
find('.method-source-code').
|
40
|
+
slideToggle();
|
41
|
+
};
|
42
|
+
|
43
|
+
function hookSourceViews() {
|
44
|
+
$('.method-heading').click( showSource );
|
45
|
+
};
|
46
|
+
|
47
|
+
function toggleDebuggingSection() {
|
48
|
+
$('.debugging-section').slideToggle();
|
49
|
+
};
|
50
|
+
|
51
|
+
function hookDebuggingToggle() {
|
52
|
+
$('#debugging-toggle img').click( toggleDebuggingSection );
|
53
|
+
};
|
54
|
+
|
55
|
+
function hookTableOfContentsToggle() {
|
56
|
+
$('.indexpage li .toc-toggle').each( function() {
|
57
|
+
$(this).click( function() {
|
58
|
+
$(this).toggleClass('open');
|
59
|
+
});
|
60
|
+
|
61
|
+
var section = $(this).next();
|
62
|
+
|
63
|
+
$(this).click( function() {
|
64
|
+
section.slideToggle();
|
65
|
+
});
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
function hookSearch() {
|
70
|
+
var input = $('#search-field').eq(0);
|
71
|
+
var result = $('#search-results').eq(0);
|
72
|
+
$(result).show();
|
73
|
+
|
74
|
+
var search_section = $('#search-section').get(0);
|
75
|
+
$(search_section).show();
|
76
|
+
|
77
|
+
var search = new Search(search_data, input, result);
|
78
|
+
|
79
|
+
search.renderItem = function(result) {
|
80
|
+
var li = document.createElement('li');
|
81
|
+
var html = '';
|
82
|
+
|
83
|
+
// TODO add relative path to <script> per-page
|
84
|
+
html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
|
85
|
+
if (result.params)
|
86
|
+
html += '<span class="params">' + result.params + '</span>';
|
87
|
+
html += '</a>';
|
88
|
+
|
89
|
+
|
90
|
+
if (result.namespace)
|
91
|
+
html += '<p class="search-namespace">' + this.hlt(result.namespace);
|
92
|
+
|
93
|
+
if (result.snippet)
|
94
|
+
html += '<div class="search-snippet">' + result.snippet + '</div>';
|
95
|
+
|
96
|
+
li.innerHTML = html;
|
97
|
+
|
98
|
+
return li;
|
99
|
+
}
|
100
|
+
|
101
|
+
search.select = function(result) {
|
102
|
+
var result_element = result.get(0);
|
103
|
+
window.location.href = result_element.firstChild.firstChild.href;
|
104
|
+
}
|
105
|
+
|
106
|
+
search.scrollIntoView = search.scrollInWindow;
|
107
|
+
};
|
108
|
+
|
109
|
+
function highlightTarget( anchor ) {
|
110
|
+
console.debug( "Highlighting target '%s'.", anchor );
|
111
|
+
|
112
|
+
$("a[name=" + anchor + "]").each( function() {
|
113
|
+
if ( !$(this).parent().parent().hasClass('target-section') ) {
|
114
|
+
console.debug( "Wrapping the target-section" );
|
115
|
+
$('div.method-detail').unwrap( 'div.target-section' );
|
116
|
+
$(this).parent().wrap( '<div class="target-section"></div>' );
|
117
|
+
} else {
|
118
|
+
console.debug( "Already wrapped." );
|
119
|
+
}
|
120
|
+
});
|
121
|
+
};
|
122
|
+
|
123
|
+
function highlightLocationTarget() {
|
124
|
+
console.debug( "Location hash: %s", window.location.hash );
|
125
|
+
if ( ! window.location.hash || window.location.hash.length == 0 ) return;
|
126
|
+
|
127
|
+
var anchor = window.location.hash.substring(1);
|
128
|
+
console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
|
129
|
+
|
130
|
+
highlightTarget( anchor );
|
131
|
+
};
|
132
|
+
|
133
|
+
function highlightClickTarget( event ) {
|
134
|
+
console.debug( "Highlighting click target for event %o", event.target );
|
135
|
+
try {
|
136
|
+
var anchor = $(event.target).attr( 'href' ).substring(1);
|
137
|
+
console.debug( "Found target anchor: %s", anchor );
|
138
|
+
highlightTarget( anchor );
|
139
|
+
} catch ( err ) {
|
140
|
+
console.error( "Exception while highlighting: %o", err );
|
141
|
+
};
|
142
|
+
};
|
143
|
+
|
144
|
+
|
145
|
+
$(document).ready( function() {
|
146
|
+
hookSourceViews();
|
147
|
+
hookDebuggingToggle();
|
148
|
+
hookSearch();
|
149
|
+
highlightLocationTarget();
|
150
|
+
hookTableOfContentsToggle();
|
151
|
+
|
152
|
+
$('ul.link-list a').bind( "click", highlightClickTarget );
|
153
|
+
});
|