EasyLogger 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/EasyLogger.gemspec +28 -0
- data/EasyLogger.rdoc +62 -0
- data/Gemfile +21 -0
- data/README.rdoc +64 -0
- data/Rakefile +71 -0
- data/bin/EasyLogger +104 -0
- data/doc/ArubaOverrides.html +204 -0
- data/doc/EasyLogger.html +130 -0
- data/doc/EasyLogger/EasyLogger.html +188 -0
- data/doc/EasyLogger_rdoc.html +207 -0
- data/doc/File.html +208 -0
- data/doc/Gemfile.html +123 -0
- data/doc/README_rdoc.html +211 -0
- data/doc/Rakefile.html +136 -0
- data/doc/_index.html +101 -0
- data/doc/bin/EasyLogger.html +62 -0
- data/doc/class_list.html +36 -0
- data/doc/created.rid +11 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +53 -0
- data/doc/css/style.css +310 -0
- data/doc/features/support/env_rb.html +56 -0
- data/doc/file.README.html +60 -0
- data/doc/file_list.html +38 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +60 -0
- data/doc/js/app.js +202 -0
- data/doc/js/full_list.js +149 -0
- data/doc/js/jquery.js +154 -0
- data/doc/lib/EasyLogger_version_rb.html +52 -0
- data/doc/lib/easy_logger/easy_logger_rb.html +52 -0
- data/doc/lib/easy_logger_rb.html +54 -0
- data/doc/method_list.html +43 -0
- data/doc/rdoc.css +706 -0
- data/doc/top-level-namespace.html +88 -0
- data/features/class_filtering.feature +79 -0
- data/features/class_method_filtering.feature +29 -0
- data/features/command_line.feature +25 -0
- data/features/method_filtering.feature +72 -0
- data/features/step_definitions/command_line_steps.rb +1 -0
- data/features/support/env.rb +14 -0
- data/html/EasyLogger.html +170 -0
- data/html/EasyLogger/EasyLogger.html +379 -0
- data/html/File.html +200 -0
- data/html/Logging.html +280 -0
- data/html/README_rdoc.html +212 -0
- data/html/bin/EasyLogger.html +64 -0
- data/html/created.rid +7 -0
- data/html/index.html +198 -0
- data/html/lib/EasyLogger_version_rb.html +52 -0
- data/html/lib/easy_logger/easy_logger_rb.html +54 -0
- data/html/lib/easy_logger/logging_example_rb.html +54 -0
- data/html/lib/easy_logger_rb.html +54 -0
- data/html/rdoc.css +706 -0
- data/lib/EasyLogger_version.rb +3 -0
- data/lib/easy_logger.rb +1 -0
- data/lib/easy_logger/easy_logger.rb +116 -0
- data/lib/easy_logger/logging_example.rb +46 -0
- data/spec/EasyLogger/easy_logger_spec.rb +63 -0
- data/spec/spec_helper.rb +22 -0
- metadata +132 -0
@@ -0,0 +1,379 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: EasyLogger::EasyLogger</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="../js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="../js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="../index.html">Home</a>
|
29
|
+
<a href="../index.html#classes">Classes</a>
|
30
|
+
<a href="../index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="../lib/easy_logger/easy_logger_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/easy_logger/easy_logger.rb">lib/easy_logger/easy_logger.rb</a></li>
|
43
|
+
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="class-metadata">
|
52
|
+
|
53
|
+
<!-- Parent Class -->
|
54
|
+
|
55
|
+
<div id="parent-class-section" class="section">
|
56
|
+
<h3 class="section-header">Parent</h3>
|
57
|
+
|
58
|
+
<p class="link">Object</p>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Namespace Contents -->
|
64
|
+
|
65
|
+
|
66
|
+
<!-- Method Quickref -->
|
67
|
+
|
68
|
+
<div id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
<li><a href="#method-i-file">#file</a></li>
|
73
|
+
|
74
|
+
<li><a href="#method-i-match">#match</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-tail">#tail</a></li>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
|
82
|
+
<!-- Included Modules -->
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<div id="project-metadata">
|
87
|
+
|
88
|
+
|
89
|
+
<div id="fileindex-section" class="section project-section">
|
90
|
+
<h3 class="section-header">Files</h3>
|
91
|
+
<ul>
|
92
|
+
|
93
|
+
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
94
|
+
|
95
|
+
</ul>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
|
99
|
+
<div id="classindex-section" class="section project-section">
|
100
|
+
<h3 class="section-header">Class Index
|
101
|
+
<span class="search-toggle"><img src="../images/find.png"
|
102
|
+
height="16" width="16" alt="[+]"
|
103
|
+
title="show/hide quicksearch" /></span></h3>
|
104
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
105
|
+
<fieldset>
|
106
|
+
<legend>Quicksearch</legend>
|
107
|
+
<input type="text" name="quicksearch" value=""
|
108
|
+
class="quicksearch-field" />
|
109
|
+
</fieldset>
|
110
|
+
</form>
|
111
|
+
|
112
|
+
<ul class="link-list">
|
113
|
+
|
114
|
+
<li><a href="../EasyLogger.html">EasyLogger</a></li>
|
115
|
+
|
116
|
+
<li><a href="../EasyLogger/EasyLogger.html">EasyLogger::EasyLogger</a></li>
|
117
|
+
|
118
|
+
<li><a href="../File.html">File</a></li>
|
119
|
+
|
120
|
+
<li><a href="../Logging.html">Logging</a></li>
|
121
|
+
|
122
|
+
</ul>
|
123
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div id="documentation">
|
131
|
+
<h1 class="class">EasyLogger::EasyLogger</h1>
|
132
|
+
|
133
|
+
<div id="description">
|
134
|
+
<h1>Class <a href="EasyLogger.html">EasyLogger</a> which will do all the job of matching the lines and showing it</h1>
|
135
|
+
<p>
|
136
|
+
@author Sylvain Desbureaux
|
137
|
+
</p>
|
138
|
+
<h2>Attributes</h2>
|
139
|
+
<p>
|
140
|
+
@attr_reader [String] log the log file/stream that we’ll look
|
141
|
+
into @attr_reader [Array] classes the classes to match in the log
|
142
|
+
@attr_reader [Array] methods the methods to match in the log
|
143
|
+
@attr_reader [Boolean] verbose the verbosity of the output @attr_reader
|
144
|
+
[String] separator the separator of the values in the log. it’s
|
145
|
+
“|” per default
|
146
|
+
</p>
|
147
|
+
<h2>Use</h2>
|
148
|
+
<p>
|
149
|
+
There’s two methods to use the class: file() and tail(). Both of them
|
150
|
+
use the same parameters (the attributes of the class). The log file need to
|
151
|
+
be correctly formatted. the parser assumes that the log file has this
|
152
|
+
format (with ’|’ as separator in the example):
|
153
|
+
</p>
|
154
|
+
<pre>
|
155
|
+
|some tag (example: the date and time)|some tag|...|class|method| free text
|
156
|
+
</pre>
|
157
|
+
<p>
|
158
|
+
The Separator could be at the end of the free text but never in the middle
|
159
|
+
so choose it carefully! @see <a href="../Logging.html">Logging</a> a
|
160
|
+
working logger example
|
161
|
+
</p>
|
162
|
+
<h3><a href="../File.html">File</a></h3>
|
163
|
+
<p>
|
164
|
+
<a href="../File.html">File</a> will open the stream, parse and output the
|
165
|
+
matching line and exit
|
166
|
+
</p>
|
167
|
+
<h3>Tail</h3>
|
168
|
+
<p>
|
169
|
+
Tail will open the end of the stream and parse and output the matching line
|
170
|
+
and exit
|
171
|
+
</p>
|
172
|
+
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<!-- Constants -->
|
176
|
+
|
177
|
+
|
178
|
+
<!-- Attributes -->
|
179
|
+
|
180
|
+
|
181
|
+
<!-- Methods -->
|
182
|
+
|
183
|
+
<div id="public-instance-method-details" class="method-section section">
|
184
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
185
|
+
|
186
|
+
|
187
|
+
<div id="file-method" class="method-detail ">
|
188
|
+
<a name="method-i-file"></a>
|
189
|
+
|
190
|
+
<div class="method-heading">
|
191
|
+
|
192
|
+
<span class="method-name">file</span><span
|
193
|
+
class="method-args">(log, classes, methods, verbose, separator='|')</span>
|
194
|
+
<span class="method-click-advice">click to toggle source</span>
|
195
|
+
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div class="method-description">
|
199
|
+
|
200
|
+
<p>
|
201
|
+
Display the relevant line of the log matching the classes/methods
|
202
|
+
</p>
|
203
|
+
<p>
|
204
|
+
@param [String] log the log file/stream that we’ll look into
|
205
|
+
@param [String] classes the classes to match in the log @param [String]
|
206
|
+
methods the methods to match in the log @param [Boolean] verbose the
|
207
|
+
verbosity of the output @param [String] separator the separator of the
|
208
|
+
values in the log. it’s “|” per default
|
209
|
+
</p>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<div class="method-source-code"
|
214
|
+
id="file-source">
|
215
|
+
<pre>
|
216
|
+
<span class="ruby-comment cmt"># File lib/easy_logger/easy_logger.rb, line 37</span>
|
217
|
+
37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file</span>(<span class="ruby-identifier">log</span>, <span class="ruby-identifier">classes</span>, <span class="ruby-identifier">methods</span>, <span class="ruby-identifier">verbose</span>, <span class="ruby-identifier">separator</span>=<span class="ruby-value str">'|'</span>)
|
218
|
+
38: <span class="ruby-identifier">result</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
|
219
|
+
39: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Looking in #{log} I/O for line matching #{classes} classe(s) and #{methods} method(s) with separator '#{separator}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
220
|
+
40: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Looking in #{log} I/O for line #{methods} method(s) with separator '#{separator}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
221
|
+
41: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Looking in #{log} I/O for line matching #{classes} classe(s) with separator '#{separator}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
222
|
+
42: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Looking in #{log} I/O for all lines"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
223
|
+
43: <span class="ruby-identifier">classes</span> =<span class="ruby-identifier">classes</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span>
|
224
|
+
44: <span class="ruby-identifier">methods</span> =<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
225
|
+
45: <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">map!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">downcase</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span>
|
226
|
+
46: <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">map!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">downcase</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
227
|
+
47: <span class="ruby-identifier">line_number</span> = <span class="ruby-value">0</span>
|
228
|
+
48: <span class="ruby-identifier">line_match</span> = <span class="ruby-value">0</span>
|
229
|
+
49: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>(<span class="ruby-identifier">log</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
230
|
+
50: <span class="ruby-identifier">line_number</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
231
|
+
51: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">match</span>(<span class="ruby-identifier">line</span>,<span class="ruby-identifier">classes</span>,<span class="ruby-identifier">methods</span>, <span class="ruby-identifier">separator</span>)
|
232
|
+
52: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">line</span>
|
233
|
+
53: <span class="ruby-identifier">line_match</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
234
|
+
54: <span class="ruby-keyword kw">end</span>
|
235
|
+
55:
|
236
|
+
56: <span class="ruby-keyword kw">end</span>
|
237
|
+
57: <span class="ruby-identifier">puts</span> <span class="ruby-node">"#{line_match} lines matched on the #{line_number} lines in the log"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
|
238
|
+
58: <span class="ruby-keyword kw">end</span></pre>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
</div>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
</div>
|
247
|
+
|
248
|
+
|
249
|
+
<div id="match-method" class="method-detail ">
|
250
|
+
<a name="method-i-match"></a>
|
251
|
+
|
252
|
+
<div class="method-heading">
|
253
|
+
|
254
|
+
<span class="method-name">match</span><span
|
255
|
+
class="method-args">(line,classes,methods,separator)</span>
|
256
|
+
<span class="method-click-advice">click to toggle source</span>
|
257
|
+
|
258
|
+
</div>
|
259
|
+
|
260
|
+
<div class="method-description">
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
<div class="method-source-code"
|
267
|
+
id="match-source">
|
268
|
+
<pre>
|
269
|
+
<span class="ruby-comment cmt"># File lib/easy_logger/easy_logger.rb, line 105</span>
|
270
|
+
105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">match</span>(<span class="ruby-identifier">line</span>,<span class="ruby-identifier">classes</span>,<span class="ruby-identifier">methods</span>,<span class="ruby-identifier">separator</span>)
|
271
|
+
106: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">line</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">2</span>].<span class="ruby-identifier">split</span>(<span class="ruby-identifier">separator</span>).<span class="ruby-identifier">length</span> <span class="ruby-operator"><</span> <span class="ruby-value">3</span>
|
272
|
+
107: <span class="ruby-identifier">methode</span> = <span class="ruby-identifier">line</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">2</span>].<span class="ruby-identifier">split</span>(<span class="ruby-identifier">separator</span>)[<span class="ruby-value">2</span>].<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
273
|
+
108: <span class="ruby-identifier">classe</span> = <span class="ruby-identifier">line</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">2</span>].<span class="ruby-identifier">split</span>(<span class="ruby-identifier">separator</span>)[<span class="ruby-value">3</span>].<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
274
|
+
109:
|
275
|
+
110: (<span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">classe</span>)) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">methode</span>))
|
276
|
+
111: <span class="ruby-keyword kw">else</span>
|
277
|
+
112: <span class="ruby-keyword kw">false</span>
|
278
|
+
113: <span class="ruby-keyword kw">end</span>
|
279
|
+
114: <span class="ruby-keyword kw">end</span></pre>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
</div>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
|
290
|
+
<div id="tail-method" class="method-detail ">
|
291
|
+
<a name="method-i-tail"></a>
|
292
|
+
|
293
|
+
<div class="method-heading">
|
294
|
+
|
295
|
+
<span class="method-name">tail</span><span
|
296
|
+
class="method-args">(log, classes, methods, verbose, separator='|')</span>
|
297
|
+
<span class="method-click-advice">click to toggle source</span>
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
<div class="method-description">
|
302
|
+
|
303
|
+
<p>
|
304
|
+
Display the relevant <u>new</u> lines of the log matching the
|
305
|
+
classes/methods
|
306
|
+
</p>
|
307
|
+
<p>
|
308
|
+
@param (see <a href="EasyLogger.html#method-i-file">EasyLogger#file</a>)
|
309
|
+
</p>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
<div class="method-source-code"
|
314
|
+
id="tail-source">
|
315
|
+
<pre>
|
316
|
+
<span class="ruby-comment cmt"># File lib/easy_logger/easy_logger.rb, line 63</span>
|
317
|
+
63: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tail</span>(<span class="ruby-identifier">log</span>, <span class="ruby-identifier">classes</span>, <span class="ruby-identifier">methods</span>, <span class="ruby-identifier">verbose</span>, <span class="ruby-identifier">separator</span>=<span class="ruby-value str">'|'</span>)
|
318
|
+
64: <span class="ruby-identifier">result</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
|
319
|
+
65: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Tailing in #{log} I/O for line matching #{classes} classe(s) and #{methods} method(s) with separator '#{separator}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
320
|
+
66: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Tailing in #{log} I/O for line #{methods} method(s) with separator '#{separator}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
321
|
+
67: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Tailing in #{log} I/O for line matching #{classes} classe(s) with separator '#{separator}'"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
322
|
+
68: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Tailing in #{log} I/O for all lines"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
323
|
+
69: <span class="ruby-identifier">classes</span> =<span class="ruby-identifier">classes</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span>
|
324
|
+
70: <span class="ruby-identifier">methods</span> =<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
325
|
+
71: <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">map!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">downcase</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">nil?</span>
|
326
|
+
72: <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">map!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">downcase</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">nil?</span>
|
327
|
+
73: <span class="ruby-ivar">@line_number</span> = <span class="ruby-value">0</span>
|
328
|
+
74: <span class="ruby-ivar">@line_match</span> = <span class="ruby-value">0</span>
|
329
|
+
75: <span class="ruby-comment cmt"># interrupted = false</span>
|
330
|
+
76: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">"INT"</span>) <span class="ruby-keyword kw">do</span>
|
331
|
+
77: <span class="ruby-identifier">puts</span> <span class="ruby-node">"#{@line_match} lines matched on the #{@line_number} lines in the log"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
|
332
|
+
78: <span class="ruby-keyword kw">break</span>
|
333
|
+
79: <span class="ruby-keyword kw">end</span>
|
334
|
+
80: <span class="ruby-keyword kw">begin</span>
|
335
|
+
81: <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">Tail</span><span class="ruby-operator">::</span><span class="ruby-constant">Logfile</span>.<span class="ruby-identifier">tail</span>(<span class="ruby-identifier">log</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
336
|
+
82: <span class="ruby-ivar">@line_number</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
337
|
+
83: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">match</span>(<span class="ruby-identifier">line</span>,<span class="ruby-identifier">classes</span>,<span class="ruby-identifier">methods</span>, <span class="ruby-identifier">separator</span>)
|
338
|
+
84: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">line</span>
|
339
|
+
85: <span class="ruby-ivar">@line_match</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
340
|
+
86: <span class="ruby-keyword kw">end</span>
|
341
|
+
87: <span class="ruby-comment cmt"># if interrupted</span>
|
342
|
+
88: <span class="ruby-comment cmt"># break</span>
|
343
|
+
89: <span class="ruby-comment cmt"># end</span>
|
344
|
+
90: <span class="ruby-keyword kw">end</span>
|
345
|
+
91: <span class="ruby-keyword kw">rescue</span>
|
346
|
+
92: <span class="ruby-keyword kw">nil</span>
|
347
|
+
93: <span class="ruby-keyword kw">end</span>
|
348
|
+
94: <span class="ruby-keyword kw">end</span></pre>
|
349
|
+
</div>
|
350
|
+
|
351
|
+
</div>
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
</div>
|
357
|
+
|
358
|
+
|
359
|
+
</div>
|
360
|
+
|
361
|
+
|
362
|
+
</div>
|
363
|
+
|
364
|
+
|
365
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
366
|
+
|
367
|
+
<p>Disabled; run with --debug to generate this.</p>
|
368
|
+
|
369
|
+
</div>
|
370
|
+
|
371
|
+
<div id="validator-badges">
|
372
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
373
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
374
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
375
|
+
</div>
|
376
|
+
|
377
|
+
</body>
|
378
|
+
</html>
|
379
|
+
|
data/html/File.html
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: File</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="./bin/EasyLogger.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="bin/EasyLogger">bin/EasyLogger</a></li>
|
43
|
+
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="class-metadata">
|
52
|
+
|
53
|
+
<!-- Parent Class -->
|
54
|
+
|
55
|
+
<div id="parent-class-section" class="section">
|
56
|
+
<h3 class="section-header">Parent</h3>
|
57
|
+
|
58
|
+
<p class="link">Object</p>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Namespace Contents -->
|
64
|
+
|
65
|
+
|
66
|
+
<!-- Method Quickref -->
|
67
|
+
|
68
|
+
<div id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
<li><a href="#method-c-realpath">::realpath</a></li>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
<!-- Included Modules -->
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div id="project-metadata">
|
83
|
+
|
84
|
+
|
85
|
+
<div id="fileindex-section" class="section project-section">
|
86
|
+
<h3 class="section-header">Files</h3>
|
87
|
+
<ul>
|
88
|
+
|
89
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
90
|
+
|
91
|
+
</ul>
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
<div id="classindex-section" class="section project-section">
|
96
|
+
<h3 class="section-header">Class Index
|
97
|
+
<span class="search-toggle"><img src="./images/find.png"
|
98
|
+
height="16" width="16" alt="[+]"
|
99
|
+
title="show/hide quicksearch" /></span></h3>
|
100
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
101
|
+
<fieldset>
|
102
|
+
<legend>Quicksearch</legend>
|
103
|
+
<input type="text" name="quicksearch" value=""
|
104
|
+
class="quicksearch-field" />
|
105
|
+
</fieldset>
|
106
|
+
</form>
|
107
|
+
|
108
|
+
<ul class="link-list">
|
109
|
+
|
110
|
+
<li><a href="./EasyLogger.html">EasyLogger</a></li>
|
111
|
+
|
112
|
+
<li><a href="./EasyLogger/EasyLogger.html">EasyLogger::EasyLogger</a></li>
|
113
|
+
|
114
|
+
<li><a href="./File.html">File</a></li>
|
115
|
+
|
116
|
+
<li><a href="./Logging.html">Logging</a></li>
|
117
|
+
|
118
|
+
</ul>
|
119
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<div id="documentation">
|
127
|
+
<h1 class="class">File</h1>
|
128
|
+
|
129
|
+
<div id="description">
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<!-- Constants -->
|
134
|
+
|
135
|
+
|
136
|
+
<!-- Attributes -->
|
137
|
+
|
138
|
+
|
139
|
+
<!-- Methods -->
|
140
|
+
|
141
|
+
<div id="public-class-method-details" class="method-section section">
|
142
|
+
<h3 class="section-header">Public Class Methods</h3>
|
143
|
+
|
144
|
+
|
145
|
+
<div id="realpath-method" class="method-detail ">
|
146
|
+
<a name="method-c-realpath"></a>
|
147
|
+
|
148
|
+
<div class="method-heading">
|
149
|
+
|
150
|
+
<span class="method-name">realpath</span><span
|
151
|
+
class="method-args">(path)</span>
|
152
|
+
<span class="method-click-advice">click to toggle source</span>
|
153
|
+
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div class="method-description">
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<div class="method-source-code"
|
163
|
+
id="realpath-source">
|
164
|
+
<pre>
|
165
|
+
<span class="ruby-comment cmt"># File bin/EasyLogger, line 7</span>
|
166
|
+
7: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">realpath</span> <span class="ruby-identifier">path</span>
|
167
|
+
8: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">realpath</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">readlink</span>(<span class="ruby-identifier">path</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">symlink?</span>(<span class="ruby-identifier">path</span>)
|
168
|
+
9: <span class="ruby-identifier">path</span>
|
169
|
+
10: <span class="ruby-keyword kw">end</span></pre>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
</div>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
</div>
|
178
|
+
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
187
|
+
|
188
|
+
<p>Disabled; run with --debug to generate this.</p>
|
189
|
+
|
190
|
+
</div>
|
191
|
+
|
192
|
+
<div id="validator-badges">
|
193
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
194
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
195
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
</body>
|
199
|
+
</html>
|
200
|
+
|