sprout 1.1.11.pre → 1.1.13.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sprout might be problematic. Click here for more details.
- data/Gemfile.lock +3 -4
- data/VERSION +1 -1
- data/doc/Dir.html +288 -0
- data/doc/Rake/Task.html +184 -0
- data/doc/Sprout.html +740 -0
- data/doc/Sprout/ArchiveUnpacker.html +1246 -0
- data/doc/Sprout/CommandLine.html +520 -0
- data/doc/Sprout/Concern.html +351 -0
- data/doc/Sprout/Errors.html +101 -0
- data/doc/Sprout/Errors/ArchiveUnpackerError.html +125 -0
- data/doc/Sprout/Errors/DestinationExistsError.html +133 -0
- data/doc/Sprout/Errors/DuplicateMemberError.html +132 -0
- data/doc/Sprout/Errors/ExecutableError.html +125 -0
- data/doc/Sprout/Errors/ExecutableRegistrationError.html +132 -0
- data/doc/Sprout/Errors/ExecutionError.html +121 -0
- data/doc/Sprout/Errors/GeneratorError.html +125 -0
- data/doc/Sprout/Errors/InvalidArgumentError.html +132 -0
- data/doc/Sprout/Errors/LoadError.html +121 -0
- data/doc/Sprout/Errors/MissingArgumentError.html +132 -0
- data/doc/Sprout/Errors/MissingExecutableError.html +132 -0
- data/doc/Sprout/Errors/MissingGeneratorError.html +132 -0
- data/doc/Sprout/Errors/MissingTemplateError.html +132 -0
- data/doc/Sprout/Errors/ProcessRunnerError.html +121 -0
- data/doc/Sprout/Errors/RemoteFileLoaderError.html +110 -0
- data/doc/Sprout/Errors/SproutError.html +114 -0
- data/doc/Sprout/Errors/UnknownArchiveType.html +122 -0
- data/doc/Sprout/Errors/UsageError.html +121 -0
- data/doc/Sprout/Errors/ValidationError.html +121 -0
- data/doc/Sprout/Errors/VersionRequirementNotMetError.html +121 -0
- data/doc/Sprout/Executable.html +169 -0
- data/doc/Sprout/Executable/Base.html +2813 -0
- data/doc/Sprout/Executable/Boolean.html +534 -0
- data/doc/Sprout/Executable/CollectionParam.html +483 -0
- data/doc/Sprout/Executable/FileParam.html +484 -0
- data/doc/Sprout/Executable/Files.html +292 -0
- data/doc/Sprout/Executable/Number.html +141 -0
- data/doc/Sprout/Executable/Param.html +2874 -0
- data/doc/Sprout/Executable/ParameterFactory.html +232 -0
- data/doc/Sprout/Executable/Path.html +223 -0
- data/doc/Sprout/Executable/Paths.html +253 -0
- data/doc/Sprout/Executable/Session.html +1513 -0
- data/doc/Sprout/Executable/StringParam.html +213 -0
- data/doc/Sprout/Executable/Strings.html +167 -0
- data/doc/Sprout/Executable/Url.html +160 -0
- data/doc/Sprout/Executable/Urls.html +170 -0
- data/doc/Sprout/FileTarget.html +1109 -0
- data/doc/Sprout/Generator.html +750 -0
- data/doc/Sprout/Generator/Base.html +1902 -0
- data/doc/Sprout/Generator/Command.html +690 -0
- data/doc/Sprout/Generator/DirectoryManifest.html +476 -0
- data/doc/Sprout/Generator/FileManifest.html +643 -0
- data/doc/Sprout/Generator/Manifest.html +377 -0
- data/doc/Sprout/Generator/TemplateManifest.html +194 -0
- data/doc/Sprout/GeneratorGenerator.html +1115 -0
- data/doc/Sprout/Library.html +1146 -0
- data/doc/Sprout/LibraryGenerator.html +331 -0
- data/doc/Sprout/OutputBuffer.html +445 -0
- data/doc/Sprout/Platform.html +714 -0
- data/doc/Sprout/ProcessRunner.html +1707 -0
- data/doc/Sprout/ProgressBar.html +366 -0
- data/doc/Sprout/ProgressBarImpl.html +2109 -0
- data/doc/Sprout/ProgressBarManager.html +424 -0
- data/doc/Sprout/ProgressBarOutputStream.html +406 -0
- data/doc/Sprout/RDocParser.html +211 -0
- data/doc/Sprout/RemoteFileLoader.html +172 -0
- data/doc/Sprout/RemoteFileTarget.html +679 -0
- data/doc/Sprout/ReversedProgressBar.html +184 -0
- data/doc/Sprout/RubyFeature.html +155 -0
- data/doc/Sprout/RubyFeature/ClassMethods.html +1065 -0
- data/doc/Sprout/RubyGenerator.html +786 -0
- data/doc/Sprout/Specification.html +767 -0
- data/doc/Sprout/System.html +191 -0
- data/doc/Sprout/System/BaseSystem.html +1660 -0
- data/doc/Sprout/System/JavaSystem.html +122 -0
- data/doc/Sprout/System/OSXSystem.html +335 -0
- data/doc/Sprout/System/ThreadMock.html +183 -0
- data/doc/Sprout/System/UnixSystem.html +584 -0
- data/doc/Sprout/System/VistaSystem.html +251 -0
- data/doc/Sprout/System/WinNixSystem.html +325 -0
- data/doc/Sprout/System/WinSystem.html +571 -0
- data/doc/Sprout/TestHelper.html +2165 -0
- data/doc/Sprout/ToolGenerator.html +953 -0
- data/doc/Sprout/VERSION.html +118 -0
- data/doc/String.html +290 -0
- data/doc/_index.html +820 -0
- data/doc/class_list.html +36 -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/file.README.html +96 -0
- data/doc/file_list.html +41 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +96 -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/method_list.html +3603 -0
- data/doc/top-level-namespace.html +192 -0
- data/lib/sprout.rb +1 -0
- data/lib/sprout/executable/base.rb +2 -5
- data/lib/sprout/executable/param.rb +15 -8
- data/lib/sprout/executable/session.rb +1 -1
- data/lib/sprout/library.rb +44 -2
- data/test/unit/executable_test.rb +3 -5
- metadata +99 -3
@@ -0,0 +1,191 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Module: Sprout::System</title>
|
7
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '..';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="../_index.html">Index (S)</a> »
|
27
|
+
<span class='title'><span class='object_link'><a href="../Sprout.html" title="Sprout (module)">Sprout</a></span></span>
|
28
|
+
»
|
29
|
+
<span class="title">System</span>
|
30
|
+
|
31
|
+
|
32
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="search">
|
36
|
+
<a id="class_list_link" href="#">Class List</a>
|
37
|
+
<a id="method_list_link" href="#">Method List</a>
|
38
|
+
<a id ="file_list_link" href="#">File List</a>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="clear"></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<iframe id="search_frame"></iframe>
|
45
|
+
|
46
|
+
<div id="content"><h1>Module: Sprout::System
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
</h1>
|
51
|
+
|
52
|
+
<dl class="box">
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<dt class="r1 last">Defined in:</dt>
|
62
|
+
<dd class="r1 last">lib/sprout/system.rb<span class="defines">,<br />
|
63
|
+
lib/sprout/system/win_system.rb,<br /> lib/sprout/system/osx_system.rb,<br /> lib/sprout/system/unix_system.rb,<br /> lib/sprout/system/base_system.rb,<br /> lib/sprout/system/java_system.rb,<br /> lib/sprout/system/vista_system.rb,<br /> lib/sprout/system/win_nix_system.rb</span>
|
64
|
+
</dd>
|
65
|
+
|
66
|
+
</dl>
|
67
|
+
<div class="clear"></div>
|
68
|
+
|
69
|
+
<h2>Defined Under Namespace</h2>
|
70
|
+
<p class="children">
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="System/BaseSystem.html" title="Sprout::System::BaseSystem (class)">BaseSystem</a></span>, <span class='object_link'><a href="System/JavaSystem.html" title="Sprout::System::JavaSystem (class)">JavaSystem</a></span>, <span class='object_link'><a href="System/OSXSystem.html" title="Sprout::System::OSXSystem (class)">OSXSystem</a></span>, <span class='object_link'><a href="System/ThreadMock.html" title="Sprout::System::ThreadMock (class)">ThreadMock</a></span>, <span class='object_link'><a href="System/UnixSystem.html" title="Sprout::System::UnixSystem (class)">UnixSystem</a></span>, <span class='object_link'><a href="System/VistaSystem.html" title="Sprout::System::VistaSystem (class)">VistaSystem</a></span>, <span class='object_link'><a href="System/WinNixSystem.html" title="Sprout::System::WinNixSystem (class)">WinNixSystem</a></span>, <span class='object_link'><a href="System/WinSystem.html" title="Sprout::System::WinSystem (class)">WinSystem</a></span>
|
76
|
+
|
77
|
+
|
78
|
+
</p>
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<h2>
|
84
|
+
Class Method Summary
|
85
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
86
|
+
</h2>
|
87
|
+
|
88
|
+
<ul class="summary">
|
89
|
+
|
90
|
+
<li class="public ">
|
91
|
+
<span class="summary_signature">
|
92
|
+
|
93
|
+
<a href="#create-class_method" title="create (class method)">+ (Object) <strong>create</strong> </a>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
</span>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<span class="summary_desc"><div class='inline'>
|
107
|
+
<p>This is the factory that one should generally be used to create new,
|
108
|
+
concrete System objects.</p>
|
109
|
+
</div></span>
|
110
|
+
|
111
|
+
</li>
|
112
|
+
|
113
|
+
|
114
|
+
</ul>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<div id="class_method_details" class="method_details_list">
|
120
|
+
<h2>Class Method Details</h2>
|
121
|
+
|
122
|
+
|
123
|
+
<div class="method_details first">
|
124
|
+
<p class="signature first" id="create-class_method">
|
125
|
+
|
126
|
+
+ (<tt>Object</tt>) <strong>create</strong>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
</p><div class="docstring">
|
131
|
+
<div class="discussion">
|
132
|
+
|
133
|
+
<p>This is the factory that one should generally be used to create new,
|
134
|
+
concrete System objects.</p>
|
135
|
+
|
136
|
+
<p>A typical example follows:</p>
|
137
|
+
|
138
|
+
<pre class="code"><span class='id system'>system</span> <span class='op'>=</span> <span class='const'>System</span><span class='period'>.</span><span class='id create'>create</span>
|
139
|
+
<span class='const'>Dir</span><span class='period'>.</span><span class='id chdir'>chdir</span> <span class='id system'>system</span><span class='period'>.</span><span class='id home'>home</span>
|
140
|
+
<span class='id system'>system</span><span class='period'>.</span><span class='id execute'>execute</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pwd</span><span class='tstring_end'>"</span></span> <span class='comment'># /home/yourusername</span></pre>
|
141
|
+
|
142
|
+
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
<div class="tags">
|
146
|
+
|
147
|
+
</div><table class="source_code">
|
148
|
+
<tr>
|
149
|
+
<td>
|
150
|
+
<pre class="lines">
|
151
|
+
|
152
|
+
|
153
|
+
23
|
154
|
+
24
|
155
|
+
25
|
156
|
+
26
|
157
|
+
27
|
158
|
+
28
|
159
|
+
29
|
160
|
+
30
|
161
|
+
31</pre>
|
162
|
+
</td>
|
163
|
+
<td>
|
164
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system.rb', line 23</span>
|
165
|
+
|
166
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id create'>create</span>
|
167
|
+
<span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Platform</span><span class='period'>.</span><span class='id new'>new</span>
|
168
|
+
<span class='kw'>return</span> <span class='const'>VistaSystem</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>if</span> <span class='id p'>p</span><span class='period'>.</span><span class='id vista?'>vista?</span>
|
169
|
+
<span class='kw'>return</span> <span class='const'>WinNixSystem</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>if</span> <span class='id p'>p</span><span class='period'>.</span><span class='id windows_nix?'>windows_nix?</span>
|
170
|
+
<span class='kw'>return</span> <span class='const'>WinSystem</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>if</span> <span class='id p'>p</span><span class='period'>.</span><span class='id windows?'>windows?</span>
|
171
|
+
<span class='kw'>return</span> <span class='const'>JavaSystem</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>if</span> <span class='id p'>p</span><span class='period'>.</span><span class='id java?'>java?</span>
|
172
|
+
<span class='kw'>return</span> <span class='const'>OSXSystem</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>if</span> <span class='id p'>p</span><span class='period'>.</span><span class='id mac?'>mac?</span>
|
173
|
+
<span class='kw'>return</span> <span class='const'>UnixSystem</span><span class='period'>.</span><span class='id new'>new</span>
|
174
|
+
<span class='kw'>end</span></pre>
|
175
|
+
</td>
|
176
|
+
</tr>
|
177
|
+
</table>
|
178
|
+
</div>
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div id="footer">
|
185
|
+
Generated on Fri Apr 29 18:33:05 2011 by
|
186
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
187
|
+
0.6.3 (ruby-1.9.2).
|
188
|
+
</div>
|
189
|
+
|
190
|
+
</body>
|
191
|
+
</html>
|
@@ -0,0 +1,1660 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Class: Sprout::System::BaseSystem</title>
|
7
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '../..';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="../../_index.html">Index (B)</a> »
|
27
|
+
<span class='title'><span class='object_link'><a href="../../Sprout.html" title="Sprout (module)">Sprout</a></span></span> » <span class='title'><span class='object_link'><a href="../System.html" title="Sprout::System (module)">System</a></span></span>
|
28
|
+
»
|
29
|
+
<span class="title">BaseSystem</span>
|
30
|
+
|
31
|
+
|
32
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="search">
|
36
|
+
<a id="class_list_link" href="#">Class List</a>
|
37
|
+
<a id="method_list_link" href="#">Method List</a>
|
38
|
+
<a id ="file_list_link" href="#">File List</a>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="clear"></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<iframe id="search_frame"></iframe>
|
45
|
+
|
46
|
+
<div id="content"><h1>Class: Sprout::System::BaseSystem
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
</h1>
|
51
|
+
|
52
|
+
<dl class="box">
|
53
|
+
|
54
|
+
<dt class="r1">Inherits:</dt>
|
55
|
+
<dd class="r1">
|
56
|
+
<span class="inheritName">Object</span>
|
57
|
+
|
58
|
+
<ul class="fullTree">
|
59
|
+
<li>Object</li>
|
60
|
+
|
61
|
+
<li class="next">Sprout::System::BaseSystem</li>
|
62
|
+
|
63
|
+
</ul>
|
64
|
+
<a href="#" class="inheritanceTree">show all</a>
|
65
|
+
|
66
|
+
</dd>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
<dt class="r2 last">Defined in:</dt>
|
77
|
+
<dd class="r2 last">lib/sprout/system/base_system.rb</dd>
|
78
|
+
|
79
|
+
</dl>
|
80
|
+
<div class="clear"></div>
|
81
|
+
|
82
|
+
<h2>Overview</h2><div class="docstring">
|
83
|
+
<div class="discussion">
|
84
|
+
|
85
|
+
<p>The abstract base class for all supported system/platform types. In
|
86
|
+
general, users are created by calling the <tt>create</tt> factory method on
|
87
|
+
the <tt>System</tt> module.</p>
|
88
|
+
|
89
|
+
<pre class="code"><span class='const'>System</span><span class='period'>.</span><span class='id create'>create</span></pre>
|
90
|
+
|
91
|
+
<p>Assuming you call the create method, you should wind up with a concrete
|
92
|
+
system that matches your system, and these concrete users will generally be
|
93
|
+
derived from this base class.</p>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
<div class="tags">
|
99
|
+
|
100
|
+
</div><div id="subclasses">
|
101
|
+
<h2>Direct Known Subclasses</h2>
|
102
|
+
<p class="children"><span class='object_link'><a href="JavaSystem.html" title="Sprout::System::JavaSystem (class)">JavaSystem</a></span>, <span class='object_link'><a href="UnixSystem.html" title="Sprout::System::UnixSystem (class)">UnixSystem</a></span>, <span class='object_link'><a href="WinSystem.html" title="Sprout::System::WinSystem (class)">WinSystem</a></span></p>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
<h2>
|
109
|
+
Instance Method Summary
|
110
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
111
|
+
</h2>
|
112
|
+
|
113
|
+
<ul class="summary">
|
114
|
+
|
115
|
+
<li class="protected ">
|
116
|
+
<span class="summary_signature">
|
117
|
+
|
118
|
+
<a href="#alt_separator%3F-instance_method" title="#alt_separator? (instance method)">- (Boolean) <strong>alt_separator?</strong> </a>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
</span>
|
123
|
+
|
124
|
+
|
125
|
+
<span class="note title protected">protected</span>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
132
|
+
|
133
|
+
</li>
|
134
|
+
|
135
|
+
|
136
|
+
<li class="public ">
|
137
|
+
<span class="summary_signature">
|
138
|
+
|
139
|
+
<a href="#application_home-instance_method" title="#application_home (instance method)">- (Object) <strong>application_home</strong>(name) </a>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
</span>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<span class="summary_desc"><div class='inline'>
|
153
|
+
<p>Different operating systems will store Application data different default
|
154
|
+
locations.</p>
|
155
|
+
</div></span>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
|
160
|
+
<li class="public ">
|
161
|
+
<span class="summary_signature">
|
162
|
+
|
163
|
+
<a href="#can_execute%3F-instance_method" title="#can_execute? (instance method)">- (Boolean) <strong>can_execute?</strong>(platform) </a>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</span>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
177
|
+
|
178
|
+
</li>
|
179
|
+
|
180
|
+
|
181
|
+
<li class="public ">
|
182
|
+
<span class="summary_signature">
|
183
|
+
|
184
|
+
<a href="#clean_path-instance_method" title="#clean_path (instance method)">- (Object) <strong>clean_path</strong>(path) </a>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</span>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<span class="summary_desc"><div class='inline'>
|
198
|
+
<p>Clean the provided <tt>path</tt> String for the current operating system.</p>
|
199
|
+
</div></span>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
<li class="protected ">
|
205
|
+
<span class="summary_signature">
|
206
|
+
|
207
|
+
<a href="#env_home-instance_method" title="#env_home (instance method)">- (Object) <strong>env_home</strong> </a>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
|
214
|
+
<span class="note title protected">protected</span>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
221
|
+
|
222
|
+
</li>
|
223
|
+
|
224
|
+
|
225
|
+
<li class="protected ">
|
226
|
+
<span class="summary_signature">
|
227
|
+
|
228
|
+
<a href="#env_homedrive-instance_method" title="#env_homedrive (instance method)">- (Object) <strong>env_homedrive</strong> </a>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
</span>
|
233
|
+
|
234
|
+
|
235
|
+
<span class="note title protected">protected</span>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
242
|
+
|
243
|
+
</li>
|
244
|
+
|
245
|
+
|
246
|
+
<li class="protected ">
|
247
|
+
<span class="summary_signature">
|
248
|
+
|
249
|
+
<a href="#env_homedrive_and_homepath-instance_method" title="#env_homedrive_and_homepath (instance method)">- (Object) <strong>env_homedrive_and_homepath</strong> </a>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
</span>
|
254
|
+
|
255
|
+
|
256
|
+
<span class="note title protected">protected</span>
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
263
|
+
|
264
|
+
</li>
|
265
|
+
|
266
|
+
|
267
|
+
<li class="protected ">
|
268
|
+
<span class="summary_signature">
|
269
|
+
|
270
|
+
<a href="#env_homepath-instance_method" title="#env_homepath (instance method)">- (Object) <strong>env_homepath</strong> </a>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
</span>
|
275
|
+
|
276
|
+
|
277
|
+
<span class="note title protected">protected</span>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
284
|
+
|
285
|
+
</li>
|
286
|
+
|
287
|
+
|
288
|
+
<li class="protected ">
|
289
|
+
<span class="summary_signature">
|
290
|
+
|
291
|
+
<a href="#env_userprofile-instance_method" title="#env_userprofile (instance method)">- (Object) <strong>env_userprofile</strong> </a>
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
</span>
|
296
|
+
|
297
|
+
|
298
|
+
<span class="note title protected">protected</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
305
|
+
|
306
|
+
</li>
|
307
|
+
|
308
|
+
|
309
|
+
<li class="public ">
|
310
|
+
<span class="summary_signature">
|
311
|
+
|
312
|
+
<a href="#execute-instance_method" title="#execute (instance method)">- (Object) <strong>execute</strong>(tool, options = '') </a>
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
</span>
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
<span class="summary_desc"><div class='inline'>
|
326
|
+
<p>Creates a new process, executes the command and returns whatever the
|
327
|
+
process wrote to stdout, or stderr.</p>
|
328
|
+
</div></span>
|
329
|
+
|
330
|
+
</li>
|
331
|
+
|
332
|
+
|
333
|
+
<li class="public ">
|
334
|
+
<span class="summary_signature">
|
335
|
+
|
336
|
+
<a href="#execute_silent-instance_method" title="#execute_silent (instance method)">- (Object) <strong>execute_silent</strong>(tool, options = '') </a>
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
</span>
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
<span class="summary_desc"><div class='inline'>
|
350
|
+
<p>Creates and returns the process without attempting to read or write to the
|
351
|
+
stream.</p>
|
352
|
+
</div></span>
|
353
|
+
|
354
|
+
</li>
|
355
|
+
|
356
|
+
|
357
|
+
<li class="public ">
|
358
|
+
<span class="summary_signature">
|
359
|
+
|
360
|
+
<a href="#execute_thread-instance_method" title="#execute_thread (instance method)">- (Sprout::ProcessRunner) <strong>execute_thread</strong>(tool, options = '', prompt = nil) {|String| ... }</a>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
</span>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
<span class="summary_desc"><div class='inline'>
|
374
|
+
<p>Execute a new process in a separate thread and yield whatever output is
|
375
|
+
written to its stderr and stdout.</p>
|
376
|
+
</div></span>
|
377
|
+
|
378
|
+
</li>
|
379
|
+
|
380
|
+
|
381
|
+
<li class="protected ">
|
382
|
+
<span class="summary_signature">
|
383
|
+
|
384
|
+
<a href="#find_home-instance_method" title="#find_home (instance method)">- (Object) <strong>find_home</strong> </a>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
</span>
|
389
|
+
|
390
|
+
|
391
|
+
<span class="note title protected">protected</span>
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
398
|
+
|
399
|
+
</li>
|
400
|
+
|
401
|
+
|
402
|
+
<li class="public ">
|
403
|
+
<span class="summary_signature">
|
404
|
+
|
405
|
+
<a href="#format_application_name-instance_method" title="#format_application_name (instance method)">- (Object) <strong>format_application_name</strong>(name) </a>
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
</span>
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
<span class="summary_desc"><div class='inline'>
|
419
|
+
<p>Template method that should be overridden by subclasses.</p>
|
420
|
+
</div></span>
|
421
|
+
|
422
|
+
</li>
|
423
|
+
|
424
|
+
|
425
|
+
<li class="protected ">
|
426
|
+
<span class="summary_signature">
|
427
|
+
|
428
|
+
<a href="#get_and_execute_process_runner-instance_method" title="#get_and_execute_process_runner (instance method)">- (Object) <strong>get_and_execute_process_runner</strong>(tool, options = nil) </a>
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
</span>
|
433
|
+
|
434
|
+
|
435
|
+
<span class="note title protected">protected</span>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
<span class="summary_desc"><div class='inline'>
|
442
|
+
<p>Get a process runner and execute the provided <tt>executable</tt>, with the
|
443
|
+
provided <tt>options</tt>.</p>
|
444
|
+
</div></span>
|
445
|
+
|
446
|
+
</li>
|
447
|
+
|
448
|
+
|
449
|
+
<li class="public ">
|
450
|
+
<span class="summary_signature">
|
451
|
+
|
452
|
+
<a href="#get_process_runner-instance_method" title="#get_process_runner (instance method)">- (Object) <strong>get_process_runner</strong> </a>
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
</span>
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
<span class="summary_desc"><div class='inline'>
|
466
|
+
<p>Instantiate and return a new Sprout::ProcessRunner so that we can execute
|
467
|
+
it.</p>
|
468
|
+
</div></span>
|
469
|
+
|
470
|
+
</li>
|
471
|
+
|
472
|
+
|
473
|
+
<li class="public ">
|
474
|
+
<span class="summary_signature">
|
475
|
+
|
476
|
+
<a href="#home-instance_method" title="#home (instance method)">- (Object) <strong>home</strong> </a>
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
</span>
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
<span class="summary_desc"><div class='inline'>
|
490
|
+
<p>Get the home path for a system on a particular operating system.</p>
|
491
|
+
</div></span>
|
492
|
+
|
493
|
+
</li>
|
494
|
+
|
495
|
+
|
496
|
+
<li class="public ">
|
497
|
+
<span class="summary_signature">
|
498
|
+
|
499
|
+
<a href="#home%3D-instance_method" title="#home= (instance method)">- (Object) <strong>home=</strong>(home) </a>
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
</span>
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
<span class="summary_desc"><div class='inline'>
|
513
|
+
<p>Set the home path for a system on a particular operating system.</p>
|
514
|
+
</div></span>
|
515
|
+
|
516
|
+
</li>
|
517
|
+
|
518
|
+
|
519
|
+
<li class="public ">
|
520
|
+
<span class="summary_signature">
|
521
|
+
|
522
|
+
<a href="#library-instance_method" title="#library (instance method)">- (Object) <strong>library</strong> </a>
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
</span>
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
<span class="summary_desc"><div class='inline'>
|
536
|
+
<p>Some operating systems (like OS X and Windows) have a specific location
|
537
|
+
where applications are expected to store files for a particular system.</p>
|
538
|
+
</div></span>
|
539
|
+
|
540
|
+
</li>
|
541
|
+
|
542
|
+
|
543
|
+
<li class="public ">
|
544
|
+
<span class="summary_signature">
|
545
|
+
|
546
|
+
<a href="#read_from-instance_method" title="#read_from (instance method)">- (Object) <strong>read_from</strong>(pipe, prompt, &block) </a>
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
</span>
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
560
|
+
|
561
|
+
</li>
|
562
|
+
|
563
|
+
|
564
|
+
<li class="protected ">
|
565
|
+
<span class="summary_signature">
|
566
|
+
|
567
|
+
<a href="#tilde_home-instance_method" title="#tilde_home (instance method)">- (Object) <strong>tilde_home</strong> </a>
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
</span>
|
572
|
+
|
573
|
+
|
574
|
+
<span class="note title protected">protected</span>
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
581
|
+
|
582
|
+
</li>
|
583
|
+
|
584
|
+
|
585
|
+
<li class="protected ">
|
586
|
+
<span class="summary_signature">
|
587
|
+
|
588
|
+
<a href="#worst_case_home-instance_method" title="#worst_case_home (instance method)">- (Object) <strong>worst_case_home</strong> </a>
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
</span>
|
593
|
+
|
594
|
+
|
595
|
+
<span class="note title protected">protected</span>
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
602
|
+
|
603
|
+
</li>
|
604
|
+
|
605
|
+
|
606
|
+
</ul>
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
<div id="instance_method_details" class="method_details_list">
|
612
|
+
<h2>Instance Method Details</h2>
|
613
|
+
|
614
|
+
|
615
|
+
<div class="method_details first">
|
616
|
+
<p class="signature first" id="alt_separator?-instance_method">
|
617
|
+
|
618
|
+
- (<tt>Boolean</tt>) <strong>alt_separator?</strong> <span class="extras">(protected)</span>
|
619
|
+
|
620
|
+
|
621
|
+
|
622
|
+
</p><div class="docstring">
|
623
|
+
<div class="discussion">
|
624
|
+
|
625
|
+
|
626
|
+
</div>
|
627
|
+
</div>
|
628
|
+
<div class="tags">
|
629
|
+
<h3>Returns:</h3>
|
630
|
+
<ul class="return">
|
631
|
+
|
632
|
+
<li>
|
633
|
+
|
634
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
</li>
|
640
|
+
|
641
|
+
</ul>
|
642
|
+
|
643
|
+
</div><table class="source_code">
|
644
|
+
<tr>
|
645
|
+
<td>
|
646
|
+
<pre class="lines">
|
647
|
+
|
648
|
+
|
649
|
+
223
|
650
|
+
224
|
651
|
+
225</pre>
|
652
|
+
</td>
|
653
|
+
<td>
|
654
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 223</span>
|
655
|
+
|
656
|
+
<span class='kw'>def</span> <span class='id alt_separator?'>alt_separator?</span>
|
657
|
+
<span class='const'>File</span><span class='op'>::</span><span class='const'>ALT_SEPARATOR</span>
|
658
|
+
<span class='kw'>end</span></pre>
|
659
|
+
</td>
|
660
|
+
</tr>
|
661
|
+
</table>
|
662
|
+
</div>
|
663
|
+
|
664
|
+
<div class="method_details ">
|
665
|
+
<p class="signature " id="application_home-instance_method">
|
666
|
+
|
667
|
+
- (<tt>Object</tt>) <strong>application_home</strong>(name)
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
</p><div class="docstring">
|
672
|
+
<div class="discussion">
|
673
|
+
|
674
|
+
<p>Different operating systems will store Application data different default
|
675
|
+
locations.</p>
|
676
|
+
|
677
|
+
<p>Subclasses will generally override this method and return the appropriate
|
678
|
+
location for their operating system.</p>
|
679
|
+
|
680
|
+
<p><tt>name</tt> String value of the Application name for which we'd like to
|
681
|
+
store data.</p>
|
682
|
+
|
683
|
+
|
684
|
+
</div>
|
685
|
+
</div>
|
686
|
+
<div class="tags">
|
687
|
+
|
688
|
+
</div><table class="source_code">
|
689
|
+
<tr>
|
690
|
+
<td>
|
691
|
+
<pre class="lines">
|
692
|
+
|
693
|
+
|
694
|
+
183
|
695
|
+
184
|
696
|
+
185</pre>
|
697
|
+
</td>
|
698
|
+
<td>
|
699
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 183</span>
|
700
|
+
|
701
|
+
<span class='kw'>def</span> <span class='id application_home'>application_home</span><span class='lparen'>(</span><span class='id name'>name</span><span class='rparen'>)</span>
|
702
|
+
<span class='kw'>return</span> <span class='const'>File</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='id library'>library</span><span class='comma'>,</span> <span class='id format_application_name'>format_application_name</span><span class='lparen'>(</span><span class='id name'>name</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='semicolon'>;</span>
|
703
|
+
<span class='kw'>end</span></pre>
|
704
|
+
</td>
|
705
|
+
</tr>
|
706
|
+
</table>
|
707
|
+
</div>
|
708
|
+
|
709
|
+
<div class="method_details ">
|
710
|
+
<p class="signature " id="can_execute?-instance_method">
|
711
|
+
|
712
|
+
- (<tt>Boolean</tt>) <strong>can_execute?</strong>(platform)
|
713
|
+
|
714
|
+
|
715
|
+
|
716
|
+
</p><div class="docstring">
|
717
|
+
<div class="discussion">
|
718
|
+
|
719
|
+
|
720
|
+
</div>
|
721
|
+
</div>
|
722
|
+
<div class="tags">
|
723
|
+
<h3>Returns:</h3>
|
724
|
+
<ul class="return">
|
725
|
+
|
726
|
+
<li>
|
727
|
+
|
728
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
729
|
+
|
730
|
+
|
731
|
+
|
732
|
+
|
733
|
+
</li>
|
734
|
+
|
735
|
+
</ul>
|
736
|
+
|
737
|
+
</div><table class="source_code">
|
738
|
+
<tr>
|
739
|
+
<td>
|
740
|
+
<pre class="lines">
|
741
|
+
|
742
|
+
|
743
|
+
60
|
744
|
+
61
|
745
|
+
62</pre>
|
746
|
+
</td>
|
747
|
+
<td>
|
748
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 60</span>
|
749
|
+
|
750
|
+
<span class='kw'>def</span> <span class='id can_execute?'>can_execute?</span> <span class='id platform'>platform</span>
|
751
|
+
<span class='id platform'>platform</span> <span class='op'>==</span> <span class='symbol'>:universal</span>
|
752
|
+
<span class='kw'>end</span></pre>
|
753
|
+
</td>
|
754
|
+
</tr>
|
755
|
+
</table>
|
756
|
+
</div>
|
757
|
+
|
758
|
+
<div class="method_details ">
|
759
|
+
<p class="signature " id="clean_path-instance_method">
|
760
|
+
|
761
|
+
- (<tt>Object</tt>) <strong>clean_path</strong>(path)
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
</p><div class="docstring">
|
766
|
+
<div class="discussion">
|
767
|
+
|
768
|
+
<p>Clean the provided <tt>path</tt> String for the current operating system.</p>
|
769
|
+
|
770
|
+
<p>Each operating system behaves differently when we attempt to execute a file
|
771
|
+
with spaces in the <tt>path</tt> to the file.</p>
|
772
|
+
|
773
|
+
<p>Subclasses will generally override this method and clean the path
|
774
|
+
appropriately for their operating system.</p>
|
775
|
+
|
776
|
+
|
777
|
+
</div>
|
778
|
+
</div>
|
779
|
+
<div class="tags">
|
780
|
+
|
781
|
+
</div><table class="source_code">
|
782
|
+
<tr>
|
783
|
+
<td>
|
784
|
+
<pre class="lines">
|
785
|
+
|
786
|
+
|
787
|
+
170
|
788
|
+
171</pre>
|
789
|
+
</td>
|
790
|
+
<td>
|
791
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 170</span>
|
792
|
+
|
793
|
+
<span class='kw'>def</span> <span class='id clean_path'>clean_path</span><span class='lparen'>(</span><span class='id path'>path</span><span class='rparen'>)</span>
|
794
|
+
<span class='kw'>end</span></pre>
|
795
|
+
</td>
|
796
|
+
</tr>
|
797
|
+
</table>
|
798
|
+
</div>
|
799
|
+
|
800
|
+
<div class="method_details ">
|
801
|
+
<p class="signature " id="env_home-instance_method">
|
802
|
+
|
803
|
+
- (<tt>Object</tt>) <strong>env_home</strong> <span class="extras">(protected)</span>
|
804
|
+
|
805
|
+
|
806
|
+
|
807
|
+
</p><table class="source_code">
|
808
|
+
<tr>
|
809
|
+
<td>
|
810
|
+
<pre class="lines">
|
811
|
+
|
812
|
+
|
813
|
+
215
|
814
|
+
216
|
815
|
+
217</pre>
|
816
|
+
</td>
|
817
|
+
<td>
|
818
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 215</span>
|
819
|
+
|
820
|
+
<span class='kw'>def</span> <span class='id env_home'>env_home</span>
|
821
|
+
<span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>HOME</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
822
|
+
<span class='kw'>end</span></pre>
|
823
|
+
</td>
|
824
|
+
</tr>
|
825
|
+
</table>
|
826
|
+
</div>
|
827
|
+
|
828
|
+
<div class="method_details ">
|
829
|
+
<p class="signature " id="env_homedrive-instance_method">
|
830
|
+
|
831
|
+
- (<tt>Object</tt>) <strong>env_homedrive</strong> <span class="extras">(protected)</span>
|
832
|
+
|
833
|
+
|
834
|
+
|
835
|
+
</p><table class="source_code">
|
836
|
+
<tr>
|
837
|
+
<td>
|
838
|
+
<pre class="lines">
|
839
|
+
|
840
|
+
|
841
|
+
197
|
842
|
+
198
|
843
|
+
199</pre>
|
844
|
+
</td>
|
845
|
+
<td>
|
846
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 197</span>
|
847
|
+
|
848
|
+
<span class='kw'>def</span> <span class='id env_homedrive'>env_homedrive</span>
|
849
|
+
<span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>HOMEDRIVE</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
850
|
+
<span class='kw'>end</span></pre>
|
851
|
+
</td>
|
852
|
+
</tr>
|
853
|
+
</table>
|
854
|
+
</div>
|
855
|
+
|
856
|
+
<div class="method_details ">
|
857
|
+
<p class="signature " id="env_homedrive_and_homepath-instance_method">
|
858
|
+
|
859
|
+
- (<tt>Object</tt>) <strong>env_homedrive_and_homepath</strong> <span class="extras">(protected)</span>
|
860
|
+
|
861
|
+
|
862
|
+
|
863
|
+
</p><table class="source_code">
|
864
|
+
<tr>
|
865
|
+
<td>
|
866
|
+
<pre class="lines">
|
867
|
+
|
868
|
+
|
869
|
+
205
|
870
|
+
206
|
871
|
+
207
|
872
|
+
208
|
873
|
+
209</pre>
|
874
|
+
</td>
|
875
|
+
<td>
|
876
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 205</span>
|
877
|
+
|
878
|
+
<span class='kw'>def</span> <span class='id env_homedrive_and_homepath'>env_homedrive_and_homepath</span>
|
879
|
+
<span class='id drive'>drive</span> <span class='op'>=</span> <span class='id env_homedrive'>env_homedrive</span>
|
880
|
+
<span class='id path'>path</span> <span class='op'>=</span> <span class='id env_homepath'>env_homepath</span>
|
881
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id drive'>drive</span><span class='rbrace'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id path'>path</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id drive'>drive</span> <span class='op'>&&</span> <span class='id path'>path</span>
|
882
|
+
<span class='kw'>end</span></pre>
|
883
|
+
</td>
|
884
|
+
</tr>
|
885
|
+
</table>
|
886
|
+
</div>
|
887
|
+
|
888
|
+
<div class="method_details ">
|
889
|
+
<p class="signature " id="env_homepath-instance_method">
|
890
|
+
|
891
|
+
- (<tt>Object</tt>) <strong>env_homepath</strong> <span class="extras">(protected)</span>
|
892
|
+
|
893
|
+
|
894
|
+
|
895
|
+
</p><table class="source_code">
|
896
|
+
<tr>
|
897
|
+
<td>
|
898
|
+
<pre class="lines">
|
899
|
+
|
900
|
+
|
901
|
+
201
|
902
|
+
202
|
903
|
+
203</pre>
|
904
|
+
</td>
|
905
|
+
<td>
|
906
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 201</span>
|
907
|
+
|
908
|
+
<span class='kw'>def</span> <span class='id env_homepath'>env_homepath</span>
|
909
|
+
<span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>HOMEPATH</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
910
|
+
<span class='kw'>end</span></pre>
|
911
|
+
</td>
|
912
|
+
</tr>
|
913
|
+
</table>
|
914
|
+
</div>
|
915
|
+
|
916
|
+
<div class="method_details ">
|
917
|
+
<p class="signature " id="env_userprofile-instance_method">
|
918
|
+
|
919
|
+
- (<tt>Object</tt>) <strong>env_userprofile</strong> <span class="extras">(protected)</span>
|
920
|
+
|
921
|
+
|
922
|
+
|
923
|
+
</p><table class="source_code">
|
924
|
+
<tr>
|
925
|
+
<td>
|
926
|
+
<pre class="lines">
|
927
|
+
|
928
|
+
|
929
|
+
211
|
930
|
+
212
|
931
|
+
213</pre>
|
932
|
+
</td>
|
933
|
+
<td>
|
934
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 211</span>
|
935
|
+
|
936
|
+
<span class='kw'>def</span> <span class='id env_userprofile'>env_userprofile</span>
|
937
|
+
<span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>USERPROFILE</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
938
|
+
<span class='kw'>end</span></pre>
|
939
|
+
</td>
|
940
|
+
</tr>
|
941
|
+
</table>
|
942
|
+
</div>
|
943
|
+
|
944
|
+
<div class="method_details ">
|
945
|
+
<p class="signature " id="execute-instance_method">
|
946
|
+
|
947
|
+
- (<tt>Object</tt>) <strong>execute</strong>(tool, options = '')
|
948
|
+
|
949
|
+
|
950
|
+
|
951
|
+
</p><div class="docstring">
|
952
|
+
<div class="discussion">
|
953
|
+
|
954
|
+
<p>Creates a new process, executes the command and returns whatever the
|
955
|
+
process wrote to stdout, or stderr.</p>
|
956
|
+
|
957
|
+
<p>Raises a <tt>Sprout::Errors::ExecutionError</tt> if the process writes to stderr</p>
|
958
|
+
|
959
|
+
|
960
|
+
</div>
|
961
|
+
</div>
|
962
|
+
<div class="tags">
|
963
|
+
|
964
|
+
</div><table class="source_code">
|
965
|
+
<tr>
|
966
|
+
<td>
|
967
|
+
<pre class="lines">
|
968
|
+
|
969
|
+
|
970
|
+
70
|
971
|
+
71
|
972
|
+
72
|
973
|
+
73
|
974
|
+
74
|
975
|
+
75
|
976
|
+
76
|
977
|
+
77
|
978
|
+
78
|
979
|
+
79
|
980
|
+
80
|
981
|
+
81
|
982
|
+
82
|
983
|
+
83
|
984
|
+
84
|
985
|
+
85</pre>
|
986
|
+
</td>
|
987
|
+
<td>
|
988
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 70</span>
|
989
|
+
|
990
|
+
<span class='kw'>def</span> <span class='id execute'>execute</span><span class='lparen'>(</span><span class='id tool'>tool</span><span class='comma'>,</span> <span class='id options'>options</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
991
|
+
<span class='const'>Sprout</span><span class='period'>.</span><span class='id stdout'>stdout</span><span class='period'>.</span><span class='id puts'>puts</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id tool'>tool</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id options'>options</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
992
|
+
<span class='id runner'>runner</span> <span class='op'>=</span> <span class='id get_and_execute_process_runner'>get_and_execute_process_runner</span><span class='lparen'>(</span><span class='id tool'>tool</span><span class='comma'>,</span> <span class='id options'>options</span><span class='rparen'>)</span>
|
993
|
+
<span class='id error'>error</span> <span class='op'>=</span> <span class='id runner'>runner</span><span class='period'>.</span><span class='id read_err'>read_err</span>
|
994
|
+
<span class='id result'>result</span> <span class='op'>=</span> <span class='id runner'>runner</span><span class='period'>.</span><span class='id read'>read</span>
|
995
|
+
|
996
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id result'>result</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>></span> <span class='int'>0</span><span class='rparen'>)</span>
|
997
|
+
<span class='const'>Sprout</span><span class='period'>.</span><span class='id stdout'>stdout</span><span class='period'>.</span><span class='id puts'>puts</span> <span class='id result'>result</span>
|
998
|
+
<span class='kw'>end</span>
|
999
|
+
|
1000
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id error'>error</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>></span> <span class='int'>0</span><span class='rparen'>)</span>
|
1001
|
+
<span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>ExecutionError</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>[ERROR] </span><span class='embexpr_beg'>#{</span><span class='id error'>error</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1002
|
+
<span class='kw'>end</span>
|
1003
|
+
|
1004
|
+
<span class='id result'>result</span> <span class='op'>||</span> <span class='id error'>error</span>
|
1005
|
+
<span class='kw'>end</span></pre>
|
1006
|
+
</td>
|
1007
|
+
</tr>
|
1008
|
+
</table>
|
1009
|
+
</div>
|
1010
|
+
|
1011
|
+
<div class="method_details ">
|
1012
|
+
<p class="signature " id="execute_silent-instance_method">
|
1013
|
+
|
1014
|
+
- (<tt>Object</tt>) <strong>execute_silent</strong>(tool, options = '')
|
1015
|
+
|
1016
|
+
|
1017
|
+
|
1018
|
+
</p><div class="docstring">
|
1019
|
+
<div class="discussion">
|
1020
|
+
|
1021
|
+
<p>Creates and returns the process without attempting to read or write to the
|
1022
|
+
stream. This is useful for interacting with long-lived CLI processes like
|
1023
|
+
FCSH or FDB.</p>
|
1024
|
+
|
1025
|
+
|
1026
|
+
</div>
|
1027
|
+
</div>
|
1028
|
+
<div class="tags">
|
1029
|
+
|
1030
|
+
</div><table class="source_code">
|
1031
|
+
<tr>
|
1032
|
+
<td>
|
1033
|
+
<pre class="lines">
|
1034
|
+
|
1035
|
+
|
1036
|
+
93
|
1037
|
+
94
|
1038
|
+
95</pre>
|
1039
|
+
</td>
|
1040
|
+
<td>
|
1041
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 93</span>
|
1042
|
+
|
1043
|
+
<span class='kw'>def</span> <span class='id execute_silent'>execute_silent</span><span class='lparen'>(</span><span class='id tool'>tool</span><span class='comma'>,</span> <span class='id options'>options</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1044
|
+
<span class='id get_and_execute_process_runner'>get_and_execute_process_runner</span><span class='lparen'>(</span><span class='id tool'>tool</span><span class='comma'>,</span> <span class='id options'>options</span><span class='rparen'>)</span>
|
1045
|
+
<span class='kw'>end</span></pre>
|
1046
|
+
</td>
|
1047
|
+
</tr>
|
1048
|
+
</table>
|
1049
|
+
</div>
|
1050
|
+
|
1051
|
+
<div class="method_details ">
|
1052
|
+
<p class="signature " id="execute_thread-instance_method">
|
1053
|
+
|
1054
|
+
- (<tt><span class='object_link'><a href="../ProcessRunner.html" title="Sprout::ProcessRunner (class)">Sprout::ProcessRunner</a></span></tt>) <strong>execute_thread</strong>(tool, options = '', prompt = nil) {|String| ... }
|
1055
|
+
|
1056
|
+
|
1057
|
+
|
1058
|
+
</p><div class="docstring">
|
1059
|
+
<div class="discussion">
|
1060
|
+
|
1061
|
+
<p>Execute a new process in a separate thread and yield whatever output is
|
1062
|
+
written to its stderr and stdout.</p>
|
1063
|
+
|
1064
|
+
|
1065
|
+
</div>
|
1066
|
+
</div>
|
1067
|
+
<div class="tags">
|
1068
|
+
<h3>Parameters:</h3>
|
1069
|
+
<ul class="param">
|
1070
|
+
|
1071
|
+
<li>
|
1072
|
+
|
1073
|
+
<span class='type'>(<tt>File</tt>)</span>
|
1074
|
+
|
1075
|
+
|
1076
|
+
<span class='name'>tool</span>
|
1077
|
+
|
1078
|
+
|
1079
|
+
|
1080
|
+
—
|
1081
|
+
<div class='inline'>
|
1082
|
+
<p>Path to the executable.</p>
|
1083
|
+
</div>
|
1084
|
+
|
1085
|
+
</li>
|
1086
|
+
|
1087
|
+
<li>
|
1088
|
+
|
1089
|
+
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
|
1090
|
+
|
1091
|
+
|
1092
|
+
<span class='name'>options</span>
|
1093
|
+
|
1094
|
+
|
1095
|
+
<em class="default">(defaults to: <tt>''</tt>)</em>
|
1096
|
+
|
1097
|
+
|
1098
|
+
—
|
1099
|
+
<div class='inline'>
|
1100
|
+
<p>The command line options that the executable accepts.</p>
|
1101
|
+
</div>
|
1102
|
+
|
1103
|
+
</li>
|
1104
|
+
|
1105
|
+
<li>
|
1106
|
+
|
1107
|
+
<span class='type'>(<tt>Regex</tt>)</span>
|
1108
|
+
|
1109
|
+
|
1110
|
+
<span class='name'>prompt</span>
|
1111
|
+
|
1112
|
+
|
1113
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1114
|
+
|
1115
|
+
|
1116
|
+
—
|
1117
|
+
<div class='inline'>
|
1118
|
+
<p>The prompt that will trigger the listener block to be called.</p>
|
1119
|
+
</div>
|
1120
|
+
|
1121
|
+
</li>
|
1122
|
+
|
1123
|
+
</ul>
|
1124
|
+
<h3>Yields:</h3>
|
1125
|
+
<ul class="yield">
|
1126
|
+
|
1127
|
+
<li>
|
1128
|
+
|
1129
|
+
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
|
1130
|
+
|
1131
|
+
|
1132
|
+
|
1133
|
+
|
1134
|
+
—
|
1135
|
+
<div class='inline'>
|
1136
|
+
<p>Message that was received from the process, called when #prompt is
|
1137
|
+
encountered.</p>
|
1138
|
+
</div>
|
1139
|
+
|
1140
|
+
</li>
|
1141
|
+
|
1142
|
+
</ul>
|
1143
|
+
<h3>Returns:</h3>
|
1144
|
+
<ul class="return">
|
1145
|
+
|
1146
|
+
<li>
|
1147
|
+
|
1148
|
+
<span class='type'>(<tt><span class='object_link'><a href="../ProcessRunner.html" title="Sprout::ProcessRunner (class)">Sprout::ProcessRunner</a></span></tt>)</span>
|
1149
|
+
|
1150
|
+
|
1151
|
+
|
1152
|
+
|
1153
|
+
</li>
|
1154
|
+
|
1155
|
+
</ul>
|
1156
|
+
|
1157
|
+
</div><table class="source_code">
|
1158
|
+
<tr>
|
1159
|
+
<td>
|
1160
|
+
<pre class="lines">
|
1161
|
+
|
1162
|
+
|
1163
|
+
107
|
1164
|
+
108
|
1165
|
+
109
|
1166
|
+
110
|
1167
|
+
111
|
1168
|
+
112
|
1169
|
+
113
|
1170
|
+
114
|
1171
|
+
115
|
1172
|
+
116
|
1173
|
+
117
|
1174
|
+
118
|
1175
|
+
119
|
1176
|
+
120
|
1177
|
+
121
|
1178
|
+
122
|
1179
|
+
123
|
1180
|
+
124
|
1181
|
+
125
|
1182
|
+
126
|
1183
|
+
127
|
1184
|
+
128
|
1185
|
+
129</pre>
|
1186
|
+
</td>
|
1187
|
+
<td>
|
1188
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 107</span>
|
1189
|
+
|
1190
|
+
<span class='kw'>def</span> <span class='id execute_thread'>execute_thread</span> <span class='id tool'>tool</span><span class='comma'>,</span> <span class='id options'>options</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id prompt'>prompt</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1191
|
+
<span class='id t'>t</span> <span class='op'>=</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>do</span>
|
1192
|
+
<span class='const'>Thread</span><span class='period'>.</span><span class='id current'>current</span><span class='period'>.</span><span class='id abort_on_exception'>abort_on_exception</span> <span class='op'>=</span> <span class='kw'>true</span>
|
1193
|
+
<span class='id runner'>runner</span> <span class='op'>=</span> <span class='id execute_silent'>execute_silent</span><span class='lparen'>(</span><span class='id tool'>tool</span><span class='comma'>,</span> <span class='id options'>options</span><span class='rparen'>)</span>
|
1194
|
+
<span class='const'>Thread</span><span class='period'>.</span><span class='id current'>current</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>runner</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id runner'>runner</span>
|
1195
|
+
<span class='id out'>out</span> <span class='op'>=</span> <span class='id read_from'>read_from</span> <span class='id runner'>runner</span><span class='period'>.</span><span class='id r'>r</span><span class='comma'>,</span> <span class='id prompt'>prompt</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1196
|
+
<span class='id err'>err</span> <span class='op'>=</span> <span class='id read_from'>read_from</span> <span class='id runner'>runner</span><span class='period'>.</span><span class='id e'>e</span><span class='comma'>,</span> <span class='id prompt'>prompt</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1197
|
+
<span class='id out'>out</span><span class='period'>.</span><span class='id join'>join</span> <span class='op'>&&</span> <span class='id err'>err</span><span class='period'>.</span><span class='id kill'>kill</span>
|
1198
|
+
<span class='kw'>end</span>
|
1199
|
+
|
1200
|
+
<span class='comment'># Wait for the runner to be created
|
1201
|
+
</span> <span class='comment'># before returning a nil reference
|
1202
|
+
</span> <span class='comment'># that never gets populated...
|
1203
|
+
</span> <span class='kw'>while</span> <span class='id t'>t</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>runner</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id nil?'>nil?</span> <span class='kw'>do</span>
|
1204
|
+
<span class='id sleep'>sleep</span><span class='lparen'>(</span><span class='float'>0.1</span><span class='rparen'>)</span>
|
1205
|
+
<span class='kw'>end</span>
|
1206
|
+
|
1207
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='id t'>t</span><span class='period'>.</span><span class='id alive?'>alive?</span>
|
1208
|
+
<span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>UsageError</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id t'>t</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>runner</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id read_err'>read_err</span><span class='rparen'>)</span>
|
1209
|
+
<span class='kw'>end</span>
|
1210
|
+
|
1211
|
+
<span class='id t'>t</span>
|
1212
|
+
<span class='kw'>end</span></pre>
|
1213
|
+
</td>
|
1214
|
+
</tr>
|
1215
|
+
</table>
|
1216
|
+
</div>
|
1217
|
+
|
1218
|
+
<div class="method_details ">
|
1219
|
+
<p class="signature " id="find_home-instance_method">
|
1220
|
+
|
1221
|
+
- (<tt>Object</tt>) <strong>find_home</strong> <span class="extras">(protected)</span>
|
1222
|
+
|
1223
|
+
|
1224
|
+
|
1225
|
+
</p><table class="source_code">
|
1226
|
+
<tr>
|
1227
|
+
<td>
|
1228
|
+
<pre class="lines">
|
1229
|
+
|
1230
|
+
|
1231
|
+
232
|
1232
|
+
233
|
1233
|
+
234
|
1234
|
+
235
|
1235
|
+
236
|
1236
|
+
237
|
1237
|
+
238
|
1238
|
+
239
|
1239
|
+
240
|
1240
|
+
241
|
1241
|
+
242
|
1242
|
+
243</pre>
|
1243
|
+
</td>
|
1244
|
+
<td>
|
1245
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 232</span>
|
1246
|
+
|
1247
|
+
<span class='kw'>def</span> <span class='id find_home'>find_home</span>
|
1248
|
+
<span class='lbracket'>[</span><span class='symbol'>:env_userprofile</span><span class='comma'>,</span> <span class='symbol'>:env_home</span><span class='comma'>,</span> <span class='symbol'>:env_homedrive_and_homepath</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id key'>key</span><span class='op'>|</span>
|
1249
|
+
<span class='id value'>value</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id send'>send</span><span class='lparen'>(</span><span class='id key'>key</span><span class='rparen'>)</span>
|
1250
|
+
<span class='kw'>return</span> <span class='id value'>value</span> <span class='kw'>unless</span> <span class='id value'>value</span><span class='period'>.</span><span class='id nil?'>nil?</span>
|
1251
|
+
<span class='kw'>end</span>
|
1252
|
+
|
1253
|
+
<span class='kw'>begin</span>
|
1254
|
+
<span class='kw'>return</span> <span class='id tilde_home'>tilde_home</span>
|
1255
|
+
<span class='kw'>rescue</span> <span class='const'>StandardError</span>
|
1256
|
+
<span class='id worst_case_home'>worst_case_home</span>
|
1257
|
+
<span class='kw'>end</span>
|
1258
|
+
<span class='kw'>end</span></pre>
|
1259
|
+
</td>
|
1260
|
+
</tr>
|
1261
|
+
</table>
|
1262
|
+
</div>
|
1263
|
+
|
1264
|
+
<div class="method_details ">
|
1265
|
+
<p class="signature " id="format_application_name-instance_method">
|
1266
|
+
|
1267
|
+
- (<tt>Object</tt>) <strong>format_application_name</strong>(name)
|
1268
|
+
|
1269
|
+
|
1270
|
+
|
1271
|
+
</p><div class="docstring">
|
1272
|
+
<div class="discussion">
|
1273
|
+
|
1274
|
+
<p>Template method that should be overridden by subclasses.</p>
|
1275
|
+
|
1276
|
+
|
1277
|
+
</div>
|
1278
|
+
</div>
|
1279
|
+
<div class="tags">
|
1280
|
+
|
1281
|
+
</div><table class="source_code">
|
1282
|
+
<tr>
|
1283
|
+
<td>
|
1284
|
+
<pre class="lines">
|
1285
|
+
|
1286
|
+
|
1287
|
+
191
|
1288
|
+
192
|
1289
|
+
193</pre>
|
1290
|
+
</td>
|
1291
|
+
<td>
|
1292
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 191</span>
|
1293
|
+
|
1294
|
+
<span class='kw'>def</span> <span class='id format_application_name'>format_application_name</span><span class='lparen'>(</span><span class='id name'>name</span><span class='rparen'>)</span>
|
1295
|
+
<span class='id name'>name</span>
|
1296
|
+
<span class='kw'>end</span></pre>
|
1297
|
+
</td>
|
1298
|
+
</tr>
|
1299
|
+
</table>
|
1300
|
+
</div>
|
1301
|
+
|
1302
|
+
<div class="method_details ">
|
1303
|
+
<p class="signature " id="get_and_execute_process_runner-instance_method">
|
1304
|
+
|
1305
|
+
- (<tt>Object</tt>) <strong>get_and_execute_process_runner</strong>(tool, options = nil) <span class="extras">(protected)</span>
|
1306
|
+
|
1307
|
+
|
1308
|
+
|
1309
|
+
</p><div class="docstring">
|
1310
|
+
<div class="discussion">
|
1311
|
+
|
1312
|
+
<p>Get a process runner and execute the provided <tt>executable</tt>, with the
|
1313
|
+
provided <tt>options</tt>.</p>
|
1314
|
+
|
1315
|
+
<p><tt>executable</tt> String path to the external executable file.</p>
|
1316
|
+
|
1317
|
+
<p><tt>options</tt> String commandline options to send to the
|
1318
|
+
<tt>executable</tt>.</p>
|
1319
|
+
|
1320
|
+
|
1321
|
+
</div>
|
1322
|
+
</div>
|
1323
|
+
<div class="tags">
|
1324
|
+
|
1325
|
+
</div><table class="source_code">
|
1326
|
+
<tr>
|
1327
|
+
<td>
|
1328
|
+
<pre class="lines">
|
1329
|
+
|
1330
|
+
|
1331
|
+
255
|
1332
|
+
256
|
1333
|
+
257
|
1334
|
+
258
|
1335
|
+
259</pre>
|
1336
|
+
</td>
|
1337
|
+
<td>
|
1338
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 255</span>
|
1339
|
+
|
1340
|
+
<span class='kw'>def</span> <span class='id get_and_execute_process_runner'>get_and_execute_process_runner</span> <span class='id tool'>tool</span><span class='comma'>,</span> <span class='id options'>options</span><span class='op'>=</span><span class='kw'>nil</span>
|
1341
|
+
<span class='id runner'>runner</span> <span class='op'>=</span> <span class='id get_process_runner'>get_process_runner</span>
|
1342
|
+
<span class='id runner'>runner</span><span class='period'>.</span><span class='id execute_open4'>execute_open4</span> <span class='id clean_path'>clean_path</span><span class='lparen'>(</span><span class='id tool'>tool</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id options'>options</span>
|
1343
|
+
<span class='id runner'>runner</span>
|
1344
|
+
<span class='kw'>end</span></pre>
|
1345
|
+
</td>
|
1346
|
+
</tr>
|
1347
|
+
</table>
|
1348
|
+
</div>
|
1349
|
+
|
1350
|
+
<div class="method_details ">
|
1351
|
+
<p class="signature " id="get_process_runner-instance_method">
|
1352
|
+
|
1353
|
+
- (<tt>Object</tt>) <strong>get_process_runner</strong>
|
1354
|
+
|
1355
|
+
|
1356
|
+
|
1357
|
+
</p><div class="docstring">
|
1358
|
+
<div class="discussion">
|
1359
|
+
|
1360
|
+
<p>Instantiate and return a new Sprout::ProcessRunner so that we can execute
|
1361
|
+
it.</p>
|
1362
|
+
|
1363
|
+
|
1364
|
+
</div>
|
1365
|
+
</div>
|
1366
|
+
<div class="tags">
|
1367
|
+
|
1368
|
+
</div><table class="source_code">
|
1369
|
+
<tr>
|
1370
|
+
<td>
|
1371
|
+
<pre class="lines">
|
1372
|
+
|
1373
|
+
|
1374
|
+
56
|
1375
|
+
57
|
1376
|
+
58</pre>
|
1377
|
+
</td>
|
1378
|
+
<td>
|
1379
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 56</span>
|
1380
|
+
|
1381
|
+
<span class='kw'>def</span> <span class='id get_process_runner'>get_process_runner</span>
|
1382
|
+
<span class='const'>Sprout</span><span class='op'>::</span><span class='const'>ProcessRunner</span><span class='period'>.</span><span class='id new'>new</span>
|
1383
|
+
<span class='kw'>end</span></pre>
|
1384
|
+
</td>
|
1385
|
+
</tr>
|
1386
|
+
</table>
|
1387
|
+
</div>
|
1388
|
+
|
1389
|
+
<div class="method_details ">
|
1390
|
+
<p class="signature " id="home-instance_method">
|
1391
|
+
|
1392
|
+
- (<tt>Object</tt>) <strong>home</strong>
|
1393
|
+
|
1394
|
+
|
1395
|
+
|
1396
|
+
</p><div class="docstring">
|
1397
|
+
<div class="discussion">
|
1398
|
+
|
1399
|
+
<p>Get the home path for a system on a particular operating system.</p>
|
1400
|
+
|
1401
|
+
<p>This path will be different, depending on which system owns the curren
|
1402
|
+
process, and which operating system they are on.</p>
|
1403
|
+
|
1404
|
+
|
1405
|
+
</div>
|
1406
|
+
</div>
|
1407
|
+
<div class="tags">
|
1408
|
+
|
1409
|
+
</div><table class="source_code">
|
1410
|
+
<tr>
|
1411
|
+
<td>
|
1412
|
+
<pre class="lines">
|
1413
|
+
|
1414
|
+
|
1415
|
+
22
|
1416
|
+
23
|
1417
|
+
24</pre>
|
1418
|
+
</td>
|
1419
|
+
<td>
|
1420
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 22</span>
|
1421
|
+
|
1422
|
+
<span class='kw'>def</span> <span class='id home'>home</span>
|
1423
|
+
<span class='ivar'>@home</span> <span class='op'>||=</span> <span class='id find_home'>find_home</span>
|
1424
|
+
<span class='kw'>end</span></pre>
|
1425
|
+
</td>
|
1426
|
+
</tr>
|
1427
|
+
</table>
|
1428
|
+
</div>
|
1429
|
+
|
1430
|
+
<div class="method_details ">
|
1431
|
+
<p class="signature " id="home=-instance_method">
|
1432
|
+
|
1433
|
+
- (<tt>Object</tt>) <strong>home=</strong>(home)
|
1434
|
+
|
1435
|
+
|
1436
|
+
|
1437
|
+
</p><div class="docstring">
|
1438
|
+
<div class="discussion">
|
1439
|
+
|
1440
|
+
<p>Set the home path for a system on a particular operating system.</p>
|
1441
|
+
|
1442
|
+
<p>If you request the home path before setting it, we will attempt to
|
1443
|
+
determine the home path of the current system for the current operating
|
1444
|
+
system.</p>
|
1445
|
+
|
1446
|
+
<p>This is just a simple way to override the default behavior.</p>
|
1447
|
+
|
1448
|
+
|
1449
|
+
</div>
|
1450
|
+
</div>
|
1451
|
+
<div class="tags">
|
1452
|
+
|
1453
|
+
</div><table class="source_code">
|
1454
|
+
<tr>
|
1455
|
+
<td>
|
1456
|
+
<pre class="lines">
|
1457
|
+
|
1458
|
+
|
1459
|
+
35
|
1460
|
+
36
|
1461
|
+
37</pre>
|
1462
|
+
</td>
|
1463
|
+
<td>
|
1464
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 35</span>
|
1465
|
+
|
1466
|
+
<span class='kw'>def</span> <span class='id home='>home=</span><span class='lparen'>(</span><span class='id home'>home</span><span class='rparen'>)</span>
|
1467
|
+
<span class='ivar'>@home</span> <span class='op'>=</span> <span class='id home'>home</span>
|
1468
|
+
<span class='kw'>end</span></pre>
|
1469
|
+
</td>
|
1470
|
+
</tr>
|
1471
|
+
</table>
|
1472
|
+
</div>
|
1473
|
+
|
1474
|
+
<div class="method_details ">
|
1475
|
+
<p class="signature " id="library-instance_method">
|
1476
|
+
|
1477
|
+
- (<tt>Object</tt>) <strong>library</strong>
|
1478
|
+
|
1479
|
+
|
1480
|
+
|
1481
|
+
</p><div class="docstring">
|
1482
|
+
<div class="discussion">
|
1483
|
+
|
1484
|
+
<p>Some operating systems (like OS X and Windows) have a specific location
|
1485
|
+
where applications are expected to store files for a particular system.
|
1486
|
+
This location is generally a subdirectory of <tt>home</tt>.</p>
|
1487
|
+
|
1488
|
+
<p>The value of this location will usually be overridden in concrete System
|
1489
|
+
classes.</p>
|
1490
|
+
|
1491
|
+
|
1492
|
+
</div>
|
1493
|
+
</div>
|
1494
|
+
<div class="tags">
|
1495
|
+
|
1496
|
+
</div><table class="source_code">
|
1497
|
+
<tr>
|
1498
|
+
<td>
|
1499
|
+
<pre class="lines">
|
1500
|
+
|
1501
|
+
|
1502
|
+
48
|
1503
|
+
49
|
1504
|
+
50</pre>
|
1505
|
+
</td>
|
1506
|
+
<td>
|
1507
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 48</span>
|
1508
|
+
|
1509
|
+
<span class='kw'>def</span> <span class='id library'>library</span>
|
1510
|
+
<span class='kw'>return</span> <span class='id home'>home</span>
|
1511
|
+
<span class='kw'>end</span></pre>
|
1512
|
+
</td>
|
1513
|
+
</tr>
|
1514
|
+
</table>
|
1515
|
+
</div>
|
1516
|
+
|
1517
|
+
<div class="method_details ">
|
1518
|
+
<p class="signature " id="read_from-instance_method">
|
1519
|
+
|
1520
|
+
- (<tt>Object</tt>) <strong>read_from</strong>(pipe, prompt, &block)
|
1521
|
+
|
1522
|
+
|
1523
|
+
|
1524
|
+
</p><table class="source_code">
|
1525
|
+
<tr>
|
1526
|
+
<td>
|
1527
|
+
<pre class="lines">
|
1528
|
+
|
1529
|
+
|
1530
|
+
131
|
1531
|
+
132
|
1532
|
+
133
|
1533
|
+
134
|
1534
|
+
135
|
1535
|
+
136
|
1536
|
+
137
|
1537
|
+
138
|
1538
|
+
139
|
1539
|
+
140
|
1540
|
+
141
|
1541
|
+
142
|
1542
|
+
143
|
1543
|
+
144
|
1544
|
+
145
|
1545
|
+
146
|
1546
|
+
147
|
1547
|
+
148
|
1548
|
+
149
|
1549
|
+
150
|
1550
|
+
151
|
1551
|
+
152
|
1552
|
+
153
|
1553
|
+
154
|
1554
|
+
155
|
1555
|
+
156</pre>
|
1556
|
+
</td>
|
1557
|
+
<td>
|
1558
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 131</span>
|
1559
|
+
|
1560
|
+
<span class='kw'>def</span> <span class='id read_from'>read_from</span> <span class='id pipe'>pipe</span><span class='comma'>,</span> <span class='id prompt'>prompt</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1561
|
+
<span class='const'>Thread</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>do</span>
|
1562
|
+
<span class='const'>Thread</span><span class='period'>.</span><span class='id current'>current</span><span class='period'>.</span><span class='id abort_on_exception'>abort_on_exception</span> <span class='op'>=</span> <span class='kw'>true</span>
|
1563
|
+
<span class='id lines'>lines</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
1564
|
+
<span class='id line'>line</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
1565
|
+
<span class='id pipe'>pipe</span><span class='period'>.</span><span class='id sync'>sync</span> <span class='op'>=</span> <span class='kw'>true</span>
|
1566
|
+
<span class='id pipe'>pipe</span><span class='period'>.</span><span class='id each_char'>each_char</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id char'>char</span><span class='op'>|</span>
|
1567
|
+
<span class='kw'>break</span> <span class='kw'>if</span> <span class='id pipe'>pipe</span><span class='period'>.</span><span class='id closed?'>closed?</span>
|
1568
|
+
<span class='id line'>line</span> <span class='op'><<</span> <span class='id char'>char</span>
|
1569
|
+
|
1570
|
+
<span class='kw'>if</span> <span class='id line'>line</span><span class='period'>.</span><span class='id match'>match</span> <span class='id prompt'>prompt</span>
|
1571
|
+
<span class='kw'>yield</span> <span class='id line'>line</span> <span class='kw'>if</span> <span class='id block_given?'>block_given?</span>
|
1572
|
+
<span class='id lines'>lines</span> <span class='op'><<</span> <span class='id line'>line</span>
|
1573
|
+
<span class='id lines'>lines</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
1574
|
+
<span class='id line'>line</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
1575
|
+
<span class='kw'>next</span>
|
1576
|
+
<span class='kw'>end</span>
|
1577
|
+
|
1578
|
+
<span class='kw'>if</span> <span class='id char'>char</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
1579
|
+
<span class='id lines'>lines</span> <span class='op'><<</span> <span class='id line'>line</span>
|
1580
|
+
<span class='kw'>yield</span> <span class='id line'>line</span> <span class='kw'>if</span> <span class='id block_given?'>block_given?</span>
|
1581
|
+
<span class='id line'>line</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
1582
|
+
<span class='kw'>end</span>
|
1583
|
+
<span class='kw'>end</span>
|
1584
|
+
<span class='kw'>end</span>
|
1585
|
+
<span class='kw'>end</span></pre>
|
1586
|
+
</td>
|
1587
|
+
</tr>
|
1588
|
+
</table>
|
1589
|
+
</div>
|
1590
|
+
|
1591
|
+
<div class="method_details ">
|
1592
|
+
<p class="signature " id="tilde_home-instance_method">
|
1593
|
+
|
1594
|
+
- (<tt>Object</tt>) <strong>tilde_home</strong> <span class="extras">(protected)</span>
|
1595
|
+
|
1596
|
+
|
1597
|
+
|
1598
|
+
</p><table class="source_code">
|
1599
|
+
<tr>
|
1600
|
+
<td>
|
1601
|
+
<pre class="lines">
|
1602
|
+
|
1603
|
+
|
1604
|
+
219
|
1605
|
+
220
|
1606
|
+
221</pre>
|
1607
|
+
</td>
|
1608
|
+
<td>
|
1609
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 219</span>
|
1610
|
+
|
1611
|
+
<span class='kw'>def</span> <span class='id tilde_home'>tilde_home</span>
|
1612
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>~</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1613
|
+
<span class='kw'>end</span></pre>
|
1614
|
+
</td>
|
1615
|
+
</tr>
|
1616
|
+
</table>
|
1617
|
+
</div>
|
1618
|
+
|
1619
|
+
<div class="method_details ">
|
1620
|
+
<p class="signature " id="worst_case_home-instance_method">
|
1621
|
+
|
1622
|
+
- (<tt>Object</tt>) <strong>worst_case_home</strong> <span class="extras">(protected)</span>
|
1623
|
+
|
1624
|
+
|
1625
|
+
|
1626
|
+
</p><table class="source_code">
|
1627
|
+
<tr>
|
1628
|
+
<td>
|
1629
|
+
<pre class="lines">
|
1630
|
+
|
1631
|
+
|
1632
|
+
227
|
1633
|
+
228
|
1634
|
+
229
|
1635
|
+
230</pre>
|
1636
|
+
</td>
|
1637
|
+
<td>
|
1638
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 227</span>
|
1639
|
+
|
1640
|
+
<span class='kw'>def</span> <span class='id worst_case_home'>worst_case_home</span>
|
1641
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>C:\\</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id alt_separator?'>alt_separator?</span>
|
1642
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span>
|
1643
|
+
<span class='kw'>end</span></pre>
|
1644
|
+
</td>
|
1645
|
+
</tr>
|
1646
|
+
</table>
|
1647
|
+
</div>
|
1648
|
+
|
1649
|
+
</div>
|
1650
|
+
|
1651
|
+
</div>
|
1652
|
+
|
1653
|
+
<div id="footer">
|
1654
|
+
Generated on Fri Apr 29 18:33:08 2011 by
|
1655
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1656
|
+
0.6.3 (ruby-1.9.2).
|
1657
|
+
</div>
|
1658
|
+
|
1659
|
+
</body>
|
1660
|
+
</html>
|