rubyrun 0.9.0-powerpc-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +13 -0
- data/README +77 -0
- data/Rakefile +241 -0
- data/bin/confgure +2 -0
- data/docs/rubyrun-0.9.0.htm +6344 -0
- data/docs/rubyrun-0.9.0.pdf +0 -0
- data/docs/rubyrun-0.9.0_files/colorschememapping.xml +2 -0
- data/docs/rubyrun-0.9.0_files/filelist.xml +29 -0
- data/docs/rubyrun-0.9.0_files/header.htm +141 -0
- data/docs/rubyrun-0.9.0_files/image001.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image002.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image003.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image004.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image005.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image006.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image007.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image008.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image009.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image010.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image011.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image012.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image013.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image014.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image015.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image016.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image017.png +0 -0
- data/docs/rubyrun-0.9.0_files/image018.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image019.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image020.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image021.jpg +0 -0
- data/docs/rubyrun-0.9.0_files/image022.png +0 -0
- data/docs/rubyrun-0.9.0_files/themedata.thmx +0 -0
- data/etc/rubyrun_opts.yml +132 -0
- data/ext/extconf.rb +4 -0
- data/ext/rubyrunnative__.bundle +0 -0
- data/ext/rubyrunnative__.c +154 -0
- data/ext/rubyrunnative__.def +2 -0
- data/ext/rubyrunnative__.h +36 -0
- data/ext/rubyrunnative__.so +0 -0
- data/ext/rubyrunnative__linux.so +0 -0
- data/html/classes/Module.html +174 -0
- data/html/classes/Object.html +151 -0
- data/html/classes/RubyRunBufferMgr__.html +182 -0
- data/html/classes/RubyRunCommander__.html +578 -0
- data/html/classes/RubyRunDad__.html +144 -0
- data/html/classes/RubyRunGlobals.html +248 -0
- data/html/classes/RubyRunHTMLWriter/RubyRunHTMLDevice.html +157 -0
- data/html/classes/RubyRunHTMLWriter.html +186 -0
- data/html/classes/RubyRunHTML__.html +198 -0
- data/html/classes/RubyRunInitializer__.html +821 -0
- data/html/classes/RubyRunInstrumentor__.html +576 -0
- data/html/classes/RubyRunMonitor__.html +298 -0
- data/html/classes/RubyRunRSS.html +302 -0
- data/html/classes/RubyRunReport__.html +294 -0
- data/html/classes/RubyRunTracer__.html +253 -0
- data/html/classes/RubyRunUtils__.html +376 -0
- data/html/created.rid +1 -0
- data/html/files/LICENSE.html +119 -0
- data/html/files/README.html +197 -0
- data/html/files/lib/rubyrun/rubyrun_buffer_mgr___rb.html +101 -0
- data/html/files/lib/rubyrun/rubyrun_commander___rb.html +101 -0
- data/html/files/lib/rubyrun/rubyrun_dad___rb.html +101 -0
- data/html/files/lib/rubyrun/rubyrun_globals_rb.html +101 -0
- data/html/files/lib/rubyrun/rubyrun_html___rb.html +101 -0
- data/html/files/lib/rubyrun/rubyrun_html_writer___rb.html +108 -0
- data/html/files/lib/rubyrun/rubyrun_initializer___rb.html +112 -0
- data/html/files/lib/rubyrun/rubyrun_instrumentor___rb.html +116 -0
- data/html/files/lib/rubyrun/rubyrun_monitor___rb.html +116 -0
- data/html/files/lib/rubyrun/rubyrun_rb.html +121 -0
- data/html/files/lib/rubyrun/rubyrun_report___rb.html +101 -0
- data/html/files/lib/rubyrun/rubyrun_rss___rb.html +108 -0
- data/html/files/lib/rubyrun/rubyrun_tracer___rb.html +110 -0
- data/html/files/lib/rubyrun/rubyrun_utils___rb.html +108 -0
- data/html/files/lib/rubyrunm_rb.html +116 -0
- data/html/fr_class_index.html +42 -0
- data/html/fr_file_index.html +43 -0
- data/html/fr_method_index.html +96 -0
- data/html/index.html +24 -0
- data/html/rdoc-style.css +208 -0
- data/lib/rubyrun/rubyrun.rb +78 -0
- data/lib/rubyrun/rubyrun_buffer_mgr__.rb +49 -0
- data/lib/rubyrun/rubyrun_commander__.rb +196 -0
- data/lib/rubyrun/rubyrun_dad__.rb +35 -0
- data/lib/rubyrun/rubyrun_globals.rb +51 -0
- data/lib/rubyrun/rubyrun_html__.rb +136 -0
- data/lib/rubyrun/rubyrun_html_writer__.rb +64 -0
- data/lib/rubyrun/rubyrun_initializer__.rb +286 -0
- data/lib/rubyrun/rubyrun_instrumentor__.rb +226 -0
- data/lib/rubyrun/rubyrun_monitor__.rb +237 -0
- data/lib/rubyrun/rubyrun_report__.rb +109 -0
- data/lib/rubyrun/rubyrun_rss__.rb +97 -0
- data/lib/rubyrun/rubyrun_tracer__.rb +79 -0
- data/lib/rubyrun/rubyrun_utils__.rb +98 -0
- data/lib/rubyrun/rubyrunnative__.bundle +0 -0
- data/lib/rubyrunm.rb +10 -0
- metadata +149 -0
@@ -0,0 +1,821 @@
|
|
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>Module: RubyRunInitializer__</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">RubyRunInitializer__</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/rubyrun/rubyrun_initializer___rb.html">
|
59
|
+
lib/rubyrun/rubyrun_initializer__.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000058">config_prop_exists?</a>
|
84
|
+
<a href="#M000065">deserialize_scan_history</a>
|
85
|
+
<a href="#M000062">directory_changed?</a>
|
86
|
+
<a href="#M000059">discover_targets</a>
|
87
|
+
<a href="#M000061">expand_folder</a>
|
88
|
+
<a href="#M000063">generate_hash</a>
|
89
|
+
<a href="#M000070">get_dir_hash_file</a>
|
90
|
+
<a href="#M000069">get_exclude_hash_file</a>
|
91
|
+
<a href="#M000068">get_include_hash_file</a>
|
92
|
+
<a href="#M000060">identify_candidates</a>
|
93
|
+
<a href="#M000052">init_rubyrun</a>
|
94
|
+
<a href="#M000056">load_config_props</a>
|
95
|
+
<a href="#M000054">make_folder</a>
|
96
|
+
<a href="#M000055">ready_logfile</a>
|
97
|
+
<a href="#M000053">ready_rubyrun_env</a>
|
98
|
+
<a href="#M000066">scan_module_class</a>
|
99
|
+
<a href="#M000067">scan_super</a>
|
100
|
+
<a href="#M000064">serialize_scan_history</a>
|
101
|
+
<a href="#M000057">validate_opts</a>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
<!-- if includes -->
|
109
|
+
<div id="includes">
|
110
|
+
<h3 class="section-bar">Included Modules</h3>
|
111
|
+
|
112
|
+
<div id="includes-list">
|
113
|
+
<span class="include-name"><a href="RubyRunGlobals.html">RubyRunGlobals</a></span>
|
114
|
+
<span class="include-name"><a href="RubyRunUtils__.html">RubyRunUtils__</a></span>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div id="section">
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
<!-- if method_list -->
|
128
|
+
<div id="methods">
|
129
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
130
|
+
|
131
|
+
<div id="method-M000058" class="method-detail">
|
132
|
+
<a name="M000058"></a>
|
133
|
+
|
134
|
+
<div class="method-heading">
|
135
|
+
<a href="#M000058" class="method-signature">
|
136
|
+
<span class="method-name">config_prop_exists?</span><span class="method-args">(prop)</span>
|
137
|
+
</a>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div class="method-description">
|
141
|
+
<p>
|
142
|
+
If the property is not defined or defined but with nil value, it is deemed
|
143
|
+
to be non-existent
|
144
|
+
</p>
|
145
|
+
<p><a class="source-toggle" href="#"
|
146
|
+
onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
|
147
|
+
<div class="method-source-code" id="M000058-source">
|
148
|
+
<pre>
|
149
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 129</span>
|
150
|
+
129: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config_prop_exists?</span>(<span class="ruby-identifier">prop</span>)
|
151
|
+
130: <span class="ruby-identifier">$rubyrun_config</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">prop</span>) <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-identifier">prop</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
|
152
|
+
131: <span class="ruby-keyword kw">end</span>
|
153
|
+
</pre>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div id="method-M000065" class="method-detail">
|
159
|
+
<a name="M000065"></a>
|
160
|
+
|
161
|
+
<div class="method-heading">
|
162
|
+
<a href="#M000065" class="method-signature">
|
163
|
+
<span class="method-name">deserialize_scan_history</span><span class="method-args">()</span>
|
164
|
+
</a>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div class="method-description">
|
168
|
+
<p>
|
169
|
+
Use Marshal to de-serialize the include and exclude hashes
|
170
|
+
</p>
|
171
|
+
<p><a class="source-toggle" href="#"
|
172
|
+
onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
|
173
|
+
<div class="method-source-code" id="M000065-source">
|
174
|
+
<pre>
|
175
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 223</span>
|
176
|
+
223: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deserialize_scan_history</span>
|
177
|
+
224: <span class="ruby-identifier">f</span> = <span class="ruby-identifier">get_include_hash_file</span>
|
178
|
+
225: <span class="ruby-identifier">$rubyrun_include_hash</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">f</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">f</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">f</span>)} <span class="ruby-operator">:</span> {}
|
179
|
+
226: <span class="ruby-identifier">f</span> = <span class="ruby-identifier">get_exclude_hash_file</span>
|
180
|
+
227: <span class="ruby-identifier">$rubyrun_exclude_hash</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">f</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">f</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">f</span>)} <span class="ruby-operator">:</span> {}
|
181
|
+
228: <span class="ruby-keyword kw">end</span>
|
182
|
+
</pre>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div id="method-M000062" class="method-detail">
|
188
|
+
<a name="M000062"></a>
|
189
|
+
|
190
|
+
<div class="method-heading">
|
191
|
+
<a href="#M000062" class="method-signature">
|
192
|
+
<span class="method-name">directory_changed?</span><span class="method-args">(dir_signature)</span>
|
193
|
+
</a>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
<div class="method-description">
|
197
|
+
<p>
|
198
|
+
Compare the digest calculated from the current APP_PATHS directory contents
|
199
|
+
to the last serialized one. Return true(changed) or false (unchanged)
|
200
|
+
</p>
|
201
|
+
<p><a class="source-toggle" href="#"
|
202
|
+
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
203
|
+
<div class="method-source-code" id="M000062-source">
|
204
|
+
<pre>
|
205
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 204</span>
|
206
|
+
204: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directory_changed?</span>(<span class="ruby-identifier">dir_signature</span>)
|
207
|
+
205: <span class="ruby-identifier">f</span> = <span class="ruby-identifier">get_dir_hash_file</span>
|
208
|
+
206: <span class="ruby-identifier">dir_sig</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">f</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">f</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">f</span>)} <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
|
209
|
+
207: <span class="ruby-identifier">dir_signature</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">dir_sig</span>
|
210
|
+
208: <span class="ruby-keyword kw">end</span>
|
211
|
+
</pre>
|
212
|
+
</div>
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div id="method-M000059" class="method-detail">
|
217
|
+
<a name="M000059"></a>
|
218
|
+
|
219
|
+
<div class="method-heading">
|
220
|
+
<a href="#M000059" class="method-signature">
|
221
|
+
<span class="method-name">discover_targets</span><span class="method-args">()</span>
|
222
|
+
</a>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<div class="method-description">
|
226
|
+
<p>
|
227
|
+
Set up global variables from the property file rubyrun_config.yml For
|
228
|
+
APP_PATHS property, expand any subdirectories and look for .rb files
|
229
|
+
recursively
|
230
|
+
</p>
|
231
|
+
<p><a class="source-toggle" href="#"
|
232
|
+
onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
|
233
|
+
<div class="method-source-code" id="M000059-source">
|
234
|
+
<pre>
|
235
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 136</span>
|
236
|
+
136: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discover_targets</span>
|
237
|
+
137: <span class="ruby-identifier">identify_candidates</span>
|
238
|
+
138: <span class="ruby-identifier">$rubyrun_include_hash</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'INCLUDE_HASH'</span>])
|
239
|
+
139: [<span class="ruby-value str">'DB_ADAPTER_HASH'</span>,<span class="ruby-value str">'OUTER_DISPATCH_HASH'</span>,<span class="ruby-value str">'INNER_DISPATCH_HASH'</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">hash_key</span><span class="ruby-operator">|</span>
|
240
|
+
140: <span class="ruby-identifier">$rubyrun_include_hash</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-identifier">hash_key</span>]) { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">o</span>,<span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">n</span>) } <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">config_prop_exists?</span>(<span class="ruby-identifier">hash_key</span>)
|
241
|
+
141: }
|
242
|
+
142: [<span class="ruby-constant">RUBYRUN_OUTER_DISPATCH_HASH</span>,<span class="ruby-constant">RUBYRUN_INNER_DISPATCH_HASH</span>,<span class="ruby-constant">RUBYRUN_THREAD_END_HASH</span>,<span class="ruby-constant">RUBYRUN_VIEW_HASH</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">hash</span><span class="ruby-operator">|</span>
|
243
|
+
143: <span class="ruby-identifier">$rubyrun_include_hash</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">hash</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">o</span>,<span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">n</span>) }
|
244
|
+
144: }
|
245
|
+
145: <span class="ruby-identifier">$rubyrun_exclude_hash</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'EXCLUDE_HASH'</span>])
|
246
|
+
146: <span class="ruby-identifier">$rubyrun_outer_dispatch_hash</span> = <span class="ruby-identifier">config_prop_exists?</span>(<span class="ruby-value str">'OUTER_DISPATCH_HASH'</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">RUBYRUN_OUTER_DISPATCH_HASH</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'OUTER_DISPATCH_HASH'</span>]) <span class="ruby-operator">:</span> <span class="ruby-constant">RUBYRUN_OUTER_DISPATCH_HASH</span>
|
247
|
+
147: <span class="ruby-identifier">$rubyrun_inner_dispatch_hash</span> = <span class="ruby-identifier">config_prop_exists?</span>(<span class="ruby-value str">'INNER_DISPATCH_HASH'</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">RUBYRUN_INNER_DISPATCH_HASH</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'INNER_DISPATCH_HASH'</span>]) <span class="ruby-operator">:</span> <span class="ruby-constant">RUBYRUN_INNER_DISPATCH_HASH</span>
|
248
|
+
148: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Final INCLUDE_HASH = #{$rubyrun_include_hash.inspect}"</span>
|
249
|
+
149: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Final EXCLUDE_HASH = #{$rubyrun_exclude_hash.inspect}"</span>
|
250
|
+
150: <span class="ruby-keyword kw">end</span>
|
251
|
+
</pre>
|
252
|
+
</div>
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
<div id="method-M000061" class="method-detail">
|
257
|
+
<a name="M000061"></a>
|
258
|
+
|
259
|
+
<div class="method-heading">
|
260
|
+
<a href="#M000061" class="method-signature">
|
261
|
+
<span class="method-name">expand_folder</span><span class="method-args">(folder)</span>
|
262
|
+
</a>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<div class="method-description">
|
266
|
+
<p>
|
267
|
+
For each directory, expand into a list of filenames and its modifed time.
|
268
|
+
</p>
|
269
|
+
<p><a class="source-toggle" href="#"
|
270
|
+
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
271
|
+
<div class="method-source-code" id="M000061-source">
|
272
|
+
<pre>
|
273
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 180</span>
|
274
|
+
180: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expand_folder</span>(<span class="ruby-identifier">folder</span>)
|
275
|
+
181: (<span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">"WARN: APP_PATHS not found: #{folder}"</span>) ; <span class="ruby-keyword kw">return</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">folder</span>)
|
276
|
+
182: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">folder</span>)
|
277
|
+
183: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">folder</span>) <span class="ruby-operator">!=</span> <span class="ruby-value str">'.rb'</span>
|
278
|
+
184: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">folder</span>)
|
279
|
+
185: <span class="ruby-identifier">$rubyrun_file_date_hash</span>[<span class="ruby-identifier">path</span>] = <span class="ruby-constant">File</span>.<span class="ruby-identifier">mtime</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">to_i</span>
|
280
|
+
186: <span class="ruby-keyword kw">else</span>
|
281
|
+
187: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">folder</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">entry</span><span class="ruby-operator">|</span>
|
282
|
+
188: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">entry</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\.+/</span>
|
283
|
+
189: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">folder</span>)
|
284
|
+
190: <span class="ruby-keyword kw">case</span>
|
285
|
+
191: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">path</span>)
|
286
|
+
192: <span class="ruby-identifier">expand_folder</span>(<span class="ruby-identifier">path</span>)
|
287
|
+
193: <span class="ruby-keyword kw">else</span>
|
288
|
+
194: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">entry</span>) <span class="ruby-operator">!=</span> <span class="ruby-value str">'.rb'</span>
|
289
|
+
195: <span class="ruby-identifier">$rubyrun_file_date_hash</span>[<span class="ruby-identifier">path</span>] = <span class="ruby-constant">File</span>.<span class="ruby-identifier">mtime</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">to_i</span>
|
290
|
+
196: <span class="ruby-keyword kw">end</span>
|
291
|
+
197: }
|
292
|
+
198: <span class="ruby-keyword kw">end</span>
|
293
|
+
199: <span class="ruby-keyword kw">end</span>
|
294
|
+
</pre>
|
295
|
+
</div>
|
296
|
+
</div>
|
297
|
+
</div>
|
298
|
+
|
299
|
+
<div id="method-M000063" class="method-detail">
|
300
|
+
<a name="M000063"></a>
|
301
|
+
|
302
|
+
<div class="method-heading">
|
303
|
+
<a href="#M000063" class="method-signature">
|
304
|
+
<span class="method-name">generate_hash</span><span class="method-args">(hash)</span>
|
305
|
+
</a>
|
306
|
+
</div>
|
307
|
+
|
308
|
+
<div class="method-description">
|
309
|
+
<p>
|
310
|
+
Calcualte the digest from the directory contents of APP_PATHS
|
311
|
+
</p>
|
312
|
+
<p><a class="source-toggle" href="#"
|
313
|
+
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
314
|
+
<div class="method-source-code" id="M000063-source">
|
315
|
+
<pre>
|
316
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 211</span>
|
317
|
+
211: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate_hash</span>(<span class="ruby-identifier">hash</span>)
|
318
|
+
212: <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">to_s</span>)
|
319
|
+
213: <span class="ruby-keyword kw">end</span>
|
320
|
+
</pre>
|
321
|
+
</div>
|
322
|
+
</div>
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<div id="method-M000070" class="method-detail">
|
326
|
+
<a name="M000070"></a>
|
327
|
+
|
328
|
+
<div class="method-heading">
|
329
|
+
<a href="#M000070" class="method-signature">
|
330
|
+
<span class="method-name">get_dir_hash_file</span><span class="method-args">()</span>
|
331
|
+
</a>
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<div class="method-description">
|
335
|
+
<p>
|
336
|
+
Return the target file name that stores the serialized directory contents
|
337
|
+
digest This file has to be application dependent, and we use the current
|
338
|
+
directory of the running process to represent the application directory.
|
339
|
+
</p>
|
340
|
+
<p><a class="source-toggle" href="#"
|
341
|
+
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
342
|
+
<div class="method-source-code" id="M000070-source">
|
343
|
+
<pre>
|
344
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 282</span>
|
345
|
+
282: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_dir_hash_file</span>
|
346
|
+
283: <span class="ruby-ivar">@rubyrun_signature_folder</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_DIR_HASH_FILE</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'_'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span>)
|
347
|
+
284: <span class="ruby-keyword kw">end</span>
|
348
|
+
</pre>
|
349
|
+
</div>
|
350
|
+
</div>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
<div id="method-M000069" class="method-detail">
|
354
|
+
<a name="M000069"></a>
|
355
|
+
|
356
|
+
<div class="method-heading">
|
357
|
+
<a href="#M000069" class="method-signature">
|
358
|
+
<span class="method-name">get_exclude_hash_file</span><span class="method-args">()</span>
|
359
|
+
</a>
|
360
|
+
</div>
|
361
|
+
|
362
|
+
<div class="method-description">
|
363
|
+
<p>
|
364
|
+
return the target file name that stores the serialized EXCLUDE_HASH
|
365
|
+
</p>
|
366
|
+
<p><a class="source-toggle" href="#"
|
367
|
+
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
368
|
+
<div class="method-source-code" id="M000069-source">
|
369
|
+
<pre>
|
370
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 275</span>
|
371
|
+
275: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_exclude_hash_file</span>
|
372
|
+
276: <span class="ruby-ivar">@rubyrun_signature_folder</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_EXCLUDE_HASH_FILE</span>
|
373
|
+
277: <span class="ruby-keyword kw">end</span>
|
374
|
+
</pre>
|
375
|
+
</div>
|
376
|
+
</div>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
<div id="method-M000068" class="method-detail">
|
380
|
+
<a name="M000068"></a>
|
381
|
+
|
382
|
+
<div class="method-heading">
|
383
|
+
<a href="#M000068" class="method-signature">
|
384
|
+
<span class="method-name">get_include_hash_file</span><span class="method-args">()</span>
|
385
|
+
</a>
|
386
|
+
</div>
|
387
|
+
|
388
|
+
<div class="method-description">
|
389
|
+
<p>
|
390
|
+
Return the target file name that stores the serialized INCLUDE_HASH
|
391
|
+
</p>
|
392
|
+
<p><a class="source-toggle" href="#"
|
393
|
+
onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
|
394
|
+
<div class="method-source-code" id="M000068-source">
|
395
|
+
<pre>
|
396
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 270</span>
|
397
|
+
270: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_include_hash_file</span>
|
398
|
+
271: <span class="ruby-ivar">@rubyrun_signature_folder</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_INCLUDE_HASH_FILE</span>
|
399
|
+
272: <span class="ruby-keyword kw">end</span>
|
400
|
+
</pre>
|
401
|
+
</div>
|
402
|
+
</div>
|
403
|
+
</div>
|
404
|
+
|
405
|
+
<div id="method-M000060" class="method-detail">
|
406
|
+
<a name="M000060"></a>
|
407
|
+
|
408
|
+
<div class="method-heading">
|
409
|
+
<a href="#M000060" class="method-signature">
|
410
|
+
<span class="method-name">identify_candidates</span><span class="method-args">()</span>
|
411
|
+
</a>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
<div class="method-description">
|
415
|
+
<p>
|
416
|
+
If the directory content has changed (new files, modified files, new
|
417
|
+
APP_PATHS) a new scan will be required, otherwise the last scan results
|
418
|
+
will simply be reused. When a new scan is finished, the results are
|
419
|
+
serialized.
|
420
|
+
</p>
|
421
|
+
<p>
|
422
|
+
Digest technique is used to detect changes in directory content.
|
423
|
+
</p>
|
424
|
+
<p><a class="source-toggle" href="#"
|
425
|
+
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
426
|
+
<div class="method-source-code" id="M000060-source">
|
427
|
+
<pre>
|
428
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 158</span>
|
429
|
+
158: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">identify_candidates</span>
|
430
|
+
159: <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'APP_PATHS'</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">element</span><span class="ruby-operator">|</span>
|
431
|
+
160: <span class="ruby-identifier">element</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">element</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span>
|
432
|
+
161: <span class="ruby-identifier">expand_folder</span>(<span class="ruby-identifier">element</span>)
|
433
|
+
162: }
|
434
|
+
163: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">$rubyrun_file_date_hash</span>.<span class="ruby-identifier">empty?</span>
|
435
|
+
164: <span class="ruby-identifier">dir_signature</span> = <span class="ruby-identifier">generate_hash</span>(<span class="ruby-identifier">$rubyrun_file_date_hash</span>)
|
436
|
+
165: <span class="ruby-identifier">exclude_array</span> = []
|
437
|
+
166: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">directory_changed?</span>(<span class="ruby-identifier">dir_signature</span>)
|
438
|
+
167: <span class="ruby-identifier">$rubyrun_file_date_hash</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span>, <span class="ruby-identifier">date</span><span class="ruby-operator">|</span>
|
439
|
+
168: <span class="ruby-identifier">scan_module_class</span>(<span class="ruby-identifier">f</span>)
|
440
|
+
169: <span class="ruby-identifier">scan_super</span>(<span class="ruby-identifier">f</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">exclude_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">name</span>}
|
441
|
+
170: }
|
442
|
+
171: <span class="ruby-identifier">$rubyrun_exclude_hash</span>[<span class="ruby-value str">'*'</span>] = <span class="ruby-identifier">exclude_array</span>.<span class="ruby-identifier">uniq</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exclude_array</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
443
|
+
172: <span class="ruby-identifier">serialize_scan_history</span>(<span class="ruby-identifier">dir_signature</span>)
|
444
|
+
173: <span class="ruby-keyword kw">end</span>
|
445
|
+
174: <span class="ruby-keyword kw">end</span>
|
446
|
+
175: <span class="ruby-identifier">deserialize_scan_history</span>
|
447
|
+
176: <span class="ruby-identifier">$rubyrun_file_date_hash</span>.<span class="ruby-identifier">clear</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$rubyrun_file_date_hash</span>
|
448
|
+
177: <span class="ruby-keyword kw">end</span>
|
449
|
+
</pre>
|
450
|
+
</div>
|
451
|
+
</div>
|
452
|
+
</div>
|
453
|
+
|
454
|
+
<div id="method-M000052" class="method-detail">
|
455
|
+
<a name="M000052"></a>
|
456
|
+
|
457
|
+
<div class="method-heading">
|
458
|
+
<a href="#M000052" class="method-signature">
|
459
|
+
<span class="method-name">init_rubyrun</span><span class="method-args">()</span>
|
460
|
+
</a>
|
461
|
+
</div>
|
462
|
+
|
463
|
+
<div class="method-description">
|
464
|
+
<ol>
|
465
|
+
<li>Get all directories, logs and properties set up correctly
|
466
|
+
|
467
|
+
</li>
|
468
|
+
<li>Scan files in APP_PATHS to create an initial INCLUDE_HASH
|
469
|
+
|
470
|
+
</li>
|
471
|
+
</ol>
|
472
|
+
<p>
|
473
|
+
and an EXCLUDE_HASH
|
474
|
+
</p>
|
475
|
+
<p><a class="source-toggle" href="#"
|
476
|
+
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
477
|
+
<div class="method-source-code" id="M000052-source">
|
478
|
+
<pre>
|
479
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 33</span>
|
480
|
+
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_rubyrun</span>
|
481
|
+
34: <span class="ruby-identifier">ready_rubyrun_env</span>
|
482
|
+
35: <span class="ruby-identifier">discover_targets</span>
|
483
|
+
36: <span class="ruby-keyword kw">end</span>
|
484
|
+
</pre>
|
485
|
+
</div>
|
486
|
+
</div>
|
487
|
+
</div>
|
488
|
+
|
489
|
+
<div id="method-M000056" class="method-detail">
|
490
|
+
<a name="M000056"></a>
|
491
|
+
|
492
|
+
<div class="method-heading">
|
493
|
+
<a href="#M000056" class="method-signature">
|
494
|
+
<span class="method-name">load_config_props</span><span class="method-args">(config_file)</span>
|
495
|
+
</a>
|
496
|
+
</div>
|
497
|
+
|
498
|
+
<div class="method-description">
|
499
|
+
<p>
|
500
|
+
Property file is a yml file. Load the properties into $config hash
|
501
|
+
</p>
|
502
|
+
<p><a class="source-toggle" href="#"
|
503
|
+
onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
|
504
|
+
<div class="method-source-code" id="M000056-source">
|
505
|
+
<pre>
|
506
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 91</span>
|
507
|
+
91: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_config_props</span>(<span class="ruby-identifier">config_file</span>)
|
508
|
+
92: <span class="ruby-keyword kw">begin</span>
|
509
|
+
93: <span class="ruby-identifier">$rubyrun_config</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">config_file</span>)
|
510
|
+
94: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Properties found in #{config_file}:"</span>
|
511
|
+
95: <span class="ruby-constant">RUBYRUN_PROP_DEFAULTS</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">prop</span>, <span class="ruby-identifier">def_value</span><span class="ruby-operator">|</span>
|
512
|
+
96: <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-identifier">prop</span>] = <span class="ruby-identifier">def_value</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config_prop_exists?</span>(<span class="ruby-identifier">prop</span>)
|
513
|
+
97: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"#{prop} = #{$rubyrun_config[prop].inspect}"</span>
|
514
|
+
98: }
|
515
|
+
99: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">"***** APP_PATHS is nil. Applications will not be instrumented. *****"</span> \
|
516
|
+
100: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'APP_PATHS'</span>].<span class="ruby-identifier">empty?</span>
|
517
|
+
101: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
518
|
+
102: <span class="ruby-identifier">fatal_exit</span>(<span class="ruby-identifier">e</span>)
|
519
|
+
103: <span class="ruby-keyword kw">end</span>
|
520
|
+
104: <span class="ruby-identifier">$rubyrun_debug_args</span> = <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'DEBUG_ARGS'</span>]
|
521
|
+
105: <span class="ruby-identifier">$rubyrun_debug_obj</span> = <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'DEBUG_OBJ'</span>]
|
522
|
+
106: <span class="ruby-identifier">$rubyrun_dad</span> = <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'DAD'</span>]
|
523
|
+
107: <span class="ruby-identifier">$rubyrun_report_timer</span> = <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'REPORT_TIMER'</span>]
|
524
|
+
108: <span class="ruby-identifier">$rubyrun_report_shift_age</span> = <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'REPORT_SHIFT_AGE'</span>]
|
525
|
+
109: <span class="ruby-identifier">$rubyrun_trace_hash</span> = <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'TRACE_HASH'</span>]
|
526
|
+
110: <span class="ruby-identifier">$rubyrun_adapter_hash</span> = <span class="ruby-identifier">$rubyrun_config</span>[<span class="ruby-value str">'DB_ADAPTER_HASH'</span>]
|
527
|
+
111: <span class="ruby-identifier">validate_opts</span>
|
528
|
+
112: <span class="ruby-keyword kw">end</span>
|
529
|
+
</pre>
|
530
|
+
</div>
|
531
|
+
</div>
|
532
|
+
</div>
|
533
|
+
|
534
|
+
<div id="method-M000054" class="method-detail">
|
535
|
+
<a name="M000054"></a>
|
536
|
+
|
537
|
+
<div class="method-heading">
|
538
|
+
<a href="#M000054" class="method-signature">
|
539
|
+
<span class="method-name">make_folder</span><span class="method-args">(rubyrun_folders)</span>
|
540
|
+
</a>
|
541
|
+
</div>
|
542
|
+
|
543
|
+
<div class="method-description">
|
544
|
+
<p>
|
545
|
+
Make sub-directories (folders)
|
546
|
+
</p>
|
547
|
+
<p><a class="source-toggle" href="#"
|
548
|
+
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
549
|
+
<div class="method-source-code" id="M000054-source">
|
550
|
+
<pre>
|
551
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 67</span>
|
552
|
+
67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_folder</span>(<span class="ruby-identifier">rubyrun_folders</span>)
|
553
|
+
68: <span class="ruby-identifier">rubyrun_folders</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">rubyrun_folder</span><span class="ruby-operator">|</span>
|
554
|
+
69: <span class="ruby-keyword kw">begin</span>
|
555
|
+
70: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">rubyrun_folder</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">rubyrun_folder</span>)
|
556
|
+
71: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
557
|
+
72: <span class="ruby-identifier">fatal_exit</span>(<span class="ruby-identifier">e</span>)
|
558
|
+
73: <span class="ruby-keyword kw">end</span>
|
559
|
+
74: }
|
560
|
+
75: <span class="ruby-keyword kw">end</span>
|
561
|
+
</pre>
|
562
|
+
</div>
|
563
|
+
</div>
|
564
|
+
</div>
|
565
|
+
|
566
|
+
<div id="method-M000055" class="method-detail">
|
567
|
+
<a name="M000055"></a>
|
568
|
+
|
569
|
+
<div class="method-heading">
|
570
|
+
<a href="#M000055" class="method-signature">
|
571
|
+
<span class="method-name">ready_logfile</span><span class="method-args">(logname)</span>
|
572
|
+
</a>
|
573
|
+
</div>
|
574
|
+
|
575
|
+
<div class="method-description">
|
576
|
+
<p>
|
577
|
+
Initialize rubyrun logger and create its own log format
|
578
|
+
</p>
|
579
|
+
<p><a class="source-toggle" href="#"
|
580
|
+
onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
|
581
|
+
<div class="method-source-code" id="M000055-source">
|
582
|
+
<pre>
|
583
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 78</span>
|
584
|
+
78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ready_logfile</span>(<span class="ruby-identifier">logname</span>)
|
585
|
+
79: <span class="ruby-identifier">$rubyrun_logger</span> = <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@rubyrun_log_folder</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">logname</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'_'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">$$</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'.log'</span>, <span class="ruby-identifier">shift_age</span> = <span class="ruby-value">10</span>, <span class="ruby-identifier">shift_size</span> = <span class="ruby-value">4096000</span>)
|
586
|
+
80: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">level</span> = <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">INFO</span>
|
587
|
+
81: <span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">$rubyrun_logger</span>
|
588
|
+
82: <span class="ruby-identifier">include</span> <span class="ruby-constant">RubyRunUtils__</span>
|
589
|
+
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format_message</span> (<span class="ruby-identifier">severity</span>, <span class="ruby-identifier">timestamp</span>, <span class="ruby-identifier">progname</span>, <span class="ruby-identifier">msg</span>)
|
590
|
+
84: <span class="ruby-node">"[#{timestamp.strftime("%Y-%m-%d %H:%M:%S")}.#{("%.3f" % timestamp.to_f).split('.')[1]}] #{get_thread_id} #{msg}\n"</span>
|
591
|
+
85: <span class="ruby-keyword kw">end</span>
|
592
|
+
86: <span class="ruby-keyword kw">end</span>
|
593
|
+
87: <span class="ruby-keyword kw">end</span>
|
594
|
+
</pre>
|
595
|
+
</div>
|
596
|
+
</div>
|
597
|
+
</div>
|
598
|
+
|
599
|
+
<div id="method-M000053" class="method-detail">
|
600
|
+
<a name="M000053"></a>
|
601
|
+
|
602
|
+
<div class="method-heading">
|
603
|
+
<a href="#M000053" class="method-signature">
|
604
|
+
<span class="method-name">ready_rubyrun_env</span><span class="method-args">()</span>
|
605
|
+
</a>
|
606
|
+
</div>
|
607
|
+
|
608
|
+
<div class="method-description">
|
609
|
+
<ol>
|
610
|
+
<li>Extract the working directory from ENV VAR and recursively create all the
|
611
|
+
|
612
|
+
</li>
|
613
|
+
</ol>
|
614
|
+
<p>
|
615
|
+
subdirectories if they dont exist
|
616
|
+
</p>
|
617
|
+
<ol>
|
618
|
+
<li>Create the log and trace folers
|
619
|
+
|
620
|
+
</li>
|
621
|
+
<li>Initialize the loggers
|
622
|
+
|
623
|
+
</li>
|
624
|
+
<li>Load the properties from either the current working directory or
|
625
|
+
|
626
|
+
</li>
|
627
|
+
</ol>
|
628
|
+
<p>
|
629
|
+
rubyrun working directory
|
630
|
+
</p>
|
631
|
+
<ol>
|
632
|
+
<li>Spawn a separate thread to for monitoring and commands
|
633
|
+
|
634
|
+
</li>
|
635
|
+
</ol>
|
636
|
+
<p><a class="source-toggle" href="#"
|
637
|
+
onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
|
638
|
+
<div class="method-source-code" id="M000053-source">
|
639
|
+
<pre>
|
640
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 45</span>
|
641
|
+
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ready_rubyrun_env</span>
|
642
|
+
46: <span class="ruby-keyword kw">begin</span>
|
643
|
+
47: <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-node">"environment variable #{RUBYRUN_WORKING_DIR} not set"</span>, <span class="ruby-identifier">caller</span> \
|
644
|
+
48: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">env_var_exists?</span>(<span class="ruby-constant">RUBYRUN_WORKING_DIR</span>)
|
645
|
+
49: <span class="ruby-identifier">rubyrun_working_dir</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-constant">RUBYRUN_WORKING_DIR</span>]
|
646
|
+
50: <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-node">"Missing #{RUBYRUN_OPTS_FILE} in #{rubyrun_working_dir}"</span>, <span class="ruby-identifier">caller</span> \
|
647
|
+
51: <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">rubyrun_working_dir</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_OPTS_FILE</span>)
|
648
|
+
52: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
649
|
+
53: <span class="ruby-identifier">fatal_exit</span>(<span class="ruby-identifier">e</span>)
|
650
|
+
54: <span class="ruby-keyword kw">end</span>
|
651
|
+
55: <span class="ruby-operator">*</span><span class="ruby-identifier">rubyrun_folders</span> = <span class="ruby-identifier">rubyrun_working_dir</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_LOG</span>, <span class="ruby-identifier">rubyrun_working_dir</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_REPORT</span>, <span class="ruby-identifier">rubyrun_working_dir</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_SIGNATURE</span>
|
652
|
+
56: <span class="ruby-identifier">make_folder</span>(<span class="ruby-identifier">rubyrun_folders</span>)
|
653
|
+
57: <span class="ruby-ivar">@rubyrun_log_folder</span>, <span class="ruby-ivar">@rubyrun_report_folder</span>, <span class="ruby-ivar">@rubyrun_signature_folder</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">rubyrun_folders</span>
|
654
|
+
58: <span class="ruby-identifier">logname</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">$0</span>, <span class="ruby-value str">".*"</span>)
|
655
|
+
59: <span class="ruby-identifier">ready_logfile</span>(<span class="ruby-identifier">logname</span>)
|
656
|
+
60: <span class="ruby-identifier">system_wide_opts</span> = <span class="ruby-identifier">rubyrun_working_dir</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_OPTS_FILE</span>
|
657
|
+
61: <span class="ruby-identifier">app_wide_opts</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">getwd</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBYRUN_OPTS_FILE</span>
|
658
|
+
62: <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">app_wide_opts</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">load_config_props</span>(<span class="ruby-identifier">app_wide_opts</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">load_config_props</span>(<span class="ruby-identifier">system_wide_opts</span>)
|
659
|
+
63: <span class="ruby-identifier">$rubyrun_tracer</span> = <span class="ruby-constant">RubyRunHTMLWriter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@rubyrun_report_folder</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">logname</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'_'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">$$</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'_trace.html'</span>, <span class="ruby-constant">METHOD_TRACE_HEADER</span>, <span class="ruby-identifier">shift_age</span> = <span class="ruby-value">10</span>, <span class="ruby-identifier">shift_size</span> = <span class="ruby-value">4096000</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">$rubyrun_trace_hash</span>.<span class="ruby-identifier">empty?</span>
|
660
|
+
64: <span class="ruby-keyword kw">end</span>
|
661
|
+
</pre>
|
662
|
+
</div>
|
663
|
+
</div>
|
664
|
+
</div>
|
665
|
+
|
666
|
+
<div id="method-M000066" class="method-detail">
|
667
|
+
<a name="M000066"></a>
|
668
|
+
|
669
|
+
<div class="method-heading">
|
670
|
+
<a href="#M000066" class="method-signature">
|
671
|
+
<span class="method-name">scan_module_class</span><span class="method-args">(path)</span>
|
672
|
+
</a>
|
673
|
+
</div>
|
674
|
+
|
675
|
+
<div class="method-description">
|
676
|
+
<p>
|
677
|
+
Regular expression that detects the class or module names of a given file
|
678
|
+
</p>
|
679
|
+
<p><a class="source-toggle" href="#"
|
680
|
+
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
681
|
+
<div class="method-source-code" id="M000066-source">
|
682
|
+
<pre>
|
683
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 231</span>
|
684
|
+
231: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_module_class</span>(<span class="ruby-identifier">path</span>)
|
685
|
+
232: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Candidate modules/classes for instrumentation in #{path}:"</span>
|
686
|
+
233: <span class="ruby-identifier">open</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/^\s*(class|module)\s+([[:upper:]][A-Za-z0-9_:]*)/</span><span class="ruby-identifier">m</span>) {
|
687
|
+
234: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"\t #{$2}"</span>
|
688
|
+
235: <span class="ruby-identifier">$rubyrun_include_hash</span>[<span class="ruby-identifier">$2</span>] = []
|
689
|
+
236: }
|
690
|
+
237: <span class="ruby-keyword kw">end</span>
|
691
|
+
</pre>
|
692
|
+
</div>
|
693
|
+
</div>
|
694
|
+
</div>
|
695
|
+
|
696
|
+
<div id="method-M000067" class="method-detail">
|
697
|
+
<a name="M000067"></a>
|
698
|
+
|
699
|
+
<div class="method-heading">
|
700
|
+
<a href="#M000067" class="method-signature">
|
701
|
+
<span class="method-name">scan_super</span><span class="method-args">(path)</span>
|
702
|
+
</a>
|
703
|
+
</div>
|
704
|
+
|
705
|
+
<div class="method-description">
|
706
|
+
<p>
|
707
|
+
Line up all the method names in a file by line # Line up all the line
|
708
|
+
numbers that contain the keyworkd super Collate the two arrays to determine
|
709
|
+
which method has super in it Put these method names in EXCLUDE_HASH and
|
710
|
+
skip instrumentation
|
711
|
+
</p>
|
712
|
+
<p><a class="source-toggle" href="#"
|
713
|
+
onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
|
714
|
+
<div class="method-source-code" id="M000067-source">
|
715
|
+
<pre>
|
716
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 243</span>
|
717
|
+
243: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_super</span>(<span class="ruby-identifier">path</span>)
|
718
|
+
244: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Method(s) to be excluded from instrumentation in #{path}:"</span>
|
719
|
+
245: <span class="ruby-identifier">method_name_array</span>, <span class="ruby-identifier">method_lineno_array</span>, <span class="ruby-identifier">super_array</span>, <span class="ruby-identifier">exclude_array</span> = [],[],[],[]
|
720
|
+
246: <span class="ruby-identifier">open</span>(<span class="ruby-identifier">path</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
721
|
+
247: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">readlines</span>.<span class="ruby-identifier">each_with_index</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">code</span>, <span class="ruby-identifier">lineno</span><span class="ruby-operator">|</span>
|
722
|
+
248: <span class="ruby-identifier">code</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^\s*def\s+(.*)\(+.*\)+/</span><span class="ruby-identifier">m</span>)
|
723
|
+
249: (<span class="ruby-identifier">method_name_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">$1</span>; <span class="ruby-identifier">method_lineno_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">lineno</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$1</span>
|
724
|
+
250: <span class="ruby-identifier">code</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^\s*(super)/</span><span class="ruby-identifier">m</span>)
|
725
|
+
251: <span class="ruby-identifier">super_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">lineno</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$1</span>
|
726
|
+
252: }
|
727
|
+
253: }
|
728
|
+
254: <span class="ruby-identifier">method_name_array</span>.<span class="ruby-identifier">reverse!</span>
|
729
|
+
255: <span class="ruby-identifier">method_lineno_array</span>.<span class="ruby-identifier">reverse!</span>
|
730
|
+
256: <span class="ruby-identifier">super_array</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">lineno</span><span class="ruby-operator">|</span>
|
731
|
+
257: <span class="ruby-identifier">method_lineno_array</span>.<span class="ruby-identifier">each_with_index</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
732
|
+
258: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">lineno</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">linenum</span>
|
733
|
+
259: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"\t #{method_name_array[i]}"</span>
|
734
|
+
260: <span class="ruby-identifier">m</span> = <span class="ruby-identifier">method_name_array</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">'.'</span>)
|
735
|
+
261: <span class="ruby-identifier">exclude_array</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">m</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">0</span>])
|
736
|
+
262: <span class="ruby-keyword kw">break</span>
|
737
|
+
263: <span class="ruby-keyword kw">end</span>
|
738
|
+
264: }
|
739
|
+
265: }
|
740
|
+
266: <span class="ruby-identifier">exclude_array</span>
|
741
|
+
267: <span class="ruby-keyword kw">end</span>
|
742
|
+
</pre>
|
743
|
+
</div>
|
744
|
+
</div>
|
745
|
+
</div>
|
746
|
+
|
747
|
+
<div id="method-M000064" class="method-detail">
|
748
|
+
<a name="M000064"></a>
|
749
|
+
|
750
|
+
<div class="method-heading">
|
751
|
+
<a href="#M000064" class="method-signature">
|
752
|
+
<span class="method-name">serialize_scan_history</span><span class="method-args">(dir_signature)</span>
|
753
|
+
</a>
|
754
|
+
</div>
|
755
|
+
|
756
|
+
<div class="method-description">
|
757
|
+
<p>
|
758
|
+
Use Marshal to serialize scan results (the include and exclude hashes)
|
759
|
+
</p>
|
760
|
+
<p><a class="source-toggle" href="#"
|
761
|
+
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
762
|
+
<div class="method-source-code" id="M000064-source">
|
763
|
+
<pre>
|
764
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 216</span>
|
765
|
+
216: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">serialize_scan_history</span>(<span class="ruby-identifier">dir_signature</span>)
|
766
|
+
217: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">get_include_hash_file</span>, <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">$rubyrun_include_hash</span>, <span class="ruby-identifier">f</span>)}
|
767
|
+
218: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">get_exclude_hash_file</span>, <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">$rubyrun_exclude_hash</span>, <span class="ruby-identifier">f</span>)}
|
768
|
+
219: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">get_dir_hash_file</span>, <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">dir_signature</span>, <span class="ruby-identifier">f</span>)}
|
769
|
+
220: <span class="ruby-keyword kw">end</span>
|
770
|
+
</pre>
|
771
|
+
</div>
|
772
|
+
</div>
|
773
|
+
</div>
|
774
|
+
|
775
|
+
<div id="method-M000057" class="method-detail">
|
776
|
+
<a name="M000057"></a>
|
777
|
+
|
778
|
+
<div class="method-heading">
|
779
|
+
<a href="#M000057" class="method-signature">
|
780
|
+
<span class="method-name">validate_opts</span><span class="method-args">()</span>
|
781
|
+
</a>
|
782
|
+
</div>
|
783
|
+
|
784
|
+
<div class="method-description">
|
785
|
+
<p>
|
786
|
+
Validate the range of REPORT_TIMER and REPORT_SHIFT_AGE Use default values
|
787
|
+
if out of acceptable range
|
788
|
+
</p>
|
789
|
+
<p><a class="source-toggle" href="#"
|
790
|
+
onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
|
791
|
+
<div class="method-source-code" id="M000057-source">
|
792
|
+
<pre>
|
793
|
+
<span class="ruby-comment cmt"># File lib/rubyrun/rubyrun_initializer__.rb, line 116</span>
|
794
|
+
116: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_opts</span>
|
795
|
+
117: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$rubyrun_report_timer</span> <span class="ruby-operator">></span> <span class="ruby-value">3600</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">$rubyrun_report_timer</span> <span class="ruby-operator"><</span> <span class="ruby-value">60</span>
|
796
|
+
118: <span class="ruby-identifier">$rubyrun_report_timer</span> = <span class="ruby-constant">RUBYRUN_PROP_DEFAULTS</span>[<span class="ruby-value str">'REPORT_TIMER'</span>]
|
797
|
+
119: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">"REPORT_TIMER value must be between 60 and 3600. #{$rubyrun_report_timer}is used."</span>
|
798
|
+
120: <span class="ruby-keyword kw">end</span>
|
799
|
+
121: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$rubyrun_report_shift_age</span> <span class="ruby-operator">></span> <span class="ruby-value">120</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">$rubyrun_report_shift_age</span> <span class="ruby-operator"><</span> <span class="ruby-value">1</span>
|
800
|
+
122: <span class="ruby-identifier">$rubyrun_report_shift_age</span> = <span class="ruby-constant">RUBYRUN_PROP_DEFAULTS</span>[<span class="ruby-value str">'REPORT_SHIFT_AGE'</span>]
|
801
|
+
123: <span class="ruby-identifier">$rubyrun_logger</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">"REPORT_SHIFT_AGE value must be between 1 and 120. #{$rubyrun_report_shift_age}is used."</span>
|
802
|
+
124: <span class="ruby-keyword kw">end</span>
|
803
|
+
125: <span class="ruby-keyword kw">end</span>
|
804
|
+
</pre>
|
805
|
+
</div>
|
806
|
+
</div>
|
807
|
+
</div>
|
808
|
+
|
809
|
+
|
810
|
+
</div>
|
811
|
+
|
812
|
+
|
813
|
+
</div>
|
814
|
+
|
815
|
+
|
816
|
+
<div id="validator-badges">
|
817
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
818
|
+
</div>
|
819
|
+
|
820
|
+
</body>
|
821
|
+
</html>
|