sprout 1.0.32.pre → 1.0.35.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 +2 -1
- data/Gemfile.lock +4 -2
- data/README.textile +12 -13
- data/VERSION +1 -0
- data/doc/Dir.html +288 -0
- data/doc/Rake/Task.html +184 -0
- data/doc/Sprout.html +144 -0
- data/doc/Sprout/ArchiveUnpacker.html +1246 -0
- data/doc/Sprout/Base.html +126 -0
- data/doc/Sprout/Base/ClassMethods.html +434 -0
- data/doc/Sprout/Concern.html +353 -0
- data/doc/Sprout/Daemon.html +166 -0
- data/doc/Sprout/Daemon/ClassMethods.html +244 -0
- data/doc/Sprout/Daemon/InstanceMethods.html +601 -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 +173 -0
- data/doc/Sprout/Executable/Boolean.html +483 -0
- data/doc/Sprout/Executable/ClassMethods.html +417 -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/InstanceMethods.html +2006 -0
- data/doc/Sprout/Executable/Number.html +141 -0
- data/doc/Sprout/Executable/Param.html +2818 -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/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 +689 -0
- data/doc/Sprout/Generator/Base.html +1626 -0
- data/doc/Sprout/Generator/Command.html +690 -0
- data/doc/Sprout/Generator/DirectoryManifest.html +476 -0
- data/doc/Sprout/Generator/FileManifest.html +572 -0
- data/doc/Sprout/Generator/Manifest.html +377 -0
- data/doc/Sprout/Generator/TemplateManifest.html +196 -0
- data/doc/Sprout/GeneratorGenerator.html +1018 -0
- data/doc/Sprout/Library.html +1141 -0
- data/doc/Sprout/LibraryGenerator.html +309 -0
- data/doc/Sprout/Log.html +496 -0
- data/doc/Sprout/MXMLC.html +6373 -0
- data/doc/Sprout/Platform.html +714 -0
- data/doc/Sprout/ProcessRunner.html +1352 -0
- data/doc/Sprout/ProgressBar.html +376 -0
- data/doc/Sprout/ProgressBarImpl.html +2119 -0
- data/doc/Sprout/ProgressBarManager.html +434 -0
- data/doc/Sprout/ProgressBarOutputStream.html +416 -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 +194 -0
- data/doc/Sprout/RubyFeature.html +155 -0
- data/doc/Sprout/RubyFeature/ClassMethods.html +1065 -0
- data/doc/Sprout/RubyGenerator.html +764 -0
- data/doc/Sprout/Specification.html +767 -0
- data/doc/Sprout/System.html +191 -0
- data/doc/Sprout/System/BaseSystem.html +1455 -0
- data/doc/Sprout/System/JavaSystem.html +122 -0
- data/doc/Sprout/System/OSXSystem.html +335 -0
- data/doc/Sprout/System/ThreadMock.html +193 -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/ToolGenerator.html +931 -0
- data/doc/Sprout/VERSION.html +128 -0
- data/doc/SproutTestCase.html +1412 -0
- data/doc/String.html +286 -0
- data/doc/_index.html +1035 -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.archive_unpacker.html +288 -0
- data/doc/file.base.html +208 -0
- data/doc/file.base_system.html +278 -0
- data/doc/file.boolean.html +135 -0
- data/doc/file.collection_param.html +139 -0
- data/doc/file.command.html +126 -0
- data/doc/file.concern.html +136 -0
- data/doc/file.daemon.html +309 -0
- data/doc/file.dir.html +76 -0
- data/doc/file.directory_manifest.html +122 -0
- data/doc/file.errors.html +147 -0
- data/doc/file.executable.html +638 -0
- data/doc/file.file_manifest.html +109 -0
- data/doc/file.file_param.html +120 -0
- data/doc/file.file_target.html +140 -0
- data/doc/file.files.html +85 -0
- data/doc/file.generator.html +296 -0
- data/doc/file.generator_class.html +72 -0
- data/doc/file.generator_generator.html +137 -0
- data/doc/file.generator_test.html +92 -0
- data/doc/file.generator_test_helper.html +67 -0
- data/doc/file.java_system.html +62 -0
- data/doc/file.library.html +291 -0
- data/doc/file.library_generator.html +74 -0
- data/doc/file.log.html +100 -0
- data/doc/file.manifest.html +67 -0
- data/doc/file.mxmlc.html +740 -0
- data/doc/file.number.html +67 -0
- data/doc/file.osx_system.html +79 -0
- data/doc/file.param.html +491 -0
- data/doc/file.parameter_factory.html +119 -0
- data/doc/file.path.html +81 -0
- data/doc/file.paths.html +80 -0
- data/doc/file.platform.html +124 -0
- data/doc/file.process_runner.html +224 -0
- data/doc/file.progress_bar.html +390 -0
- data/doc/file.rdoc_parser.html +145 -0
- data/doc/file.remote_file_loader.html +117 -0
- data/doc/file.remote_file_target.html +176 -0
- data/doc/file.ruby_base.html +64 -0
- data/doc/file.ruby_feature.html +244 -0
- data/doc/file.ruby_generator.html +118 -0
- data/doc/file.ruby_input.html +62 -0
- data/doc/file.ruby_test_case.html +78 -0
- data/doc/file.ruby_test_helper.html +61 -0
- data/doc/file.specification.html +248 -0
- data/doc/file.sprout.html +64 -0
- data/doc/file.sprout_test_case.html +280 -0
- data/doc/file.string.html +72 -0
- data/doc/file.string_param.html +76 -0
- data/doc/file.strings.html +71 -0
- data/doc/file.system.html +86 -0
- data/doc/file.template_manifest.html +67 -0
- data/doc/file.tool.html +92 -0
- data/doc/file.tool_generator.html +90 -0
- data/doc/file.unix_system.html +128 -0
- data/doc/file.url.html +71 -0
- data/doc/file.urls.html +70 -0
- data/doc/file.version.html +71 -0
- data/doc/file.vista_system.html +69 -0
- data/doc/file.win_nix_system.html +88 -0
- data/doc/file.win_system.html +129 -0
- data/doc/file_list.html +230 -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 +3355 -0
- data/doc/top-level-namespace.html +192 -0
- data/lib/sprout/archive_unpacker.rb +203 -137
- data/lib/sprout/base.rb +38 -11
- data/lib/sprout/concern.rb +51 -0
- data/lib/sprout/daemon.rb +256 -0
- data/lib/sprout/executable.rb +40 -11
- data/lib/sprout/executable/boolean.rb +47 -1
- data/lib/sprout/executable/collection_param.rb +33 -1
- data/lib/sprout/executable/file_param.rb +16 -3
- data/lib/sprout/executable/files.rb +5 -0
- data/lib/sprout/executable/number.rb +5 -1
- data/lib/sprout/executable/param.rb +232 -16
- data/lib/sprout/executable/parameter_factory.rb +39 -1
- data/lib/sprout/executable/path.rb +7 -1
- data/lib/sprout/executable/paths.rb +6 -1
- data/lib/sprout/executable/string_param.rb +8 -1
- data/lib/sprout/executable/strings.rb +7 -1
- data/lib/sprout/executable/url.rb +8 -1
- data/lib/sprout/executable/urls.rb +7 -1
- data/lib/sprout/file_target.rb +11 -11
- data/lib/sprout/generator.rb +244 -0
- data/lib/sprout/generator/base.rb +0 -94
- data/lib/sprout/generators/generator/generator_generator.rb +35 -1
- data/lib/sprout/generators/generator/templates/generator_class.rb +3 -3
- data/lib/sprout/library.rb +75 -0
- data/lib/sprout/log.rb +11 -12
- data/lib/sprout/process_runner.rb +29 -9
- data/lib/sprout/remote_file_target.rb +20 -9
- data/lib/sprout/system/base_system.rb +11 -3
- data/lib/sprout/test/sprout_test_case.rb +1 -0
- data/lib/sprout/version.rb +7 -11
- data/rakefile.rb +7 -12
- data/script/add_param_handler.rb +43 -0
- data/sprout.gemspec +2 -3
- data/test/fixtures/executable/fdb.rb +764 -0
- data/test/fixtures/executable/flex3sdk_gem/fdb +60 -0
- data/test/fixtures/executable/mxmlc.rb +9 -11
- data/test/unit/daemon_test.rb +61 -0
- data/test/unit/process_runner_test.rb +21 -0
- data/test/unit/remote_file_target_test.rb +45 -11
- data/test/unit/sprout_test_helper.rb +1 -1
- metadata +210 -29
@@ -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/osx_system.rb,<br /> lib/sprout/system/win_system.rb,<br /> lib/sprout/system/unix_system.rb,<br /> lib/sprout/system/java_system.rb,<br /> lib/sprout/system/base_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 Wed Dec 22 11:58:33 2010 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,1455 @@
|
|
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)">- (Object) <strong>execute_thread</strong>(tool, options = '') </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.</p>
|
375
|
+
</div></span>
|
376
|
+
|
377
|
+
</li>
|
378
|
+
|
379
|
+
|
380
|
+
<li class="protected ">
|
381
|
+
<span class="summary_signature">
|
382
|
+
|
383
|
+
<a href="#find_home-instance_method" title="#find_home (instance method)">- (Object) <strong>find_home</strong> </a>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
</span>
|
388
|
+
|
389
|
+
|
390
|
+
<span class="note title protected">protected</span>
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
397
|
+
|
398
|
+
</li>
|
399
|
+
|
400
|
+
|
401
|
+
<li class="public ">
|
402
|
+
<span class="summary_signature">
|
403
|
+
|
404
|
+
<a href="#format_application_name-instance_method" title="#format_application_name (instance method)">- (Object) <strong>format_application_name</strong>(name) </a>
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
</span>
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
<span class="summary_desc"><div class='inline'>
|
418
|
+
<p>Template method that should be overridden by subclasses.</p>
|
419
|
+
</div></span>
|
420
|
+
|
421
|
+
</li>
|
422
|
+
|
423
|
+
|
424
|
+
<li class="protected ">
|
425
|
+
<span class="summary_signature">
|
426
|
+
|
427
|
+
<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>
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
</span>
|
432
|
+
|
433
|
+
|
434
|
+
<span class="note title protected">protected</span>
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
<span class="summary_desc"><div class='inline'>
|
441
|
+
<p>Get a process runner and execute the provided <tt>executable</tt>, with the
|
442
|
+
provided <tt>options</tt>.</p>
|
443
|
+
</div></span>
|
444
|
+
|
445
|
+
</li>
|
446
|
+
|
447
|
+
|
448
|
+
<li class="public ">
|
449
|
+
<span class="summary_signature">
|
450
|
+
|
451
|
+
<a href="#get_process_runner-instance_method" title="#get_process_runner (instance method)">- (Object) <strong>get_process_runner</strong> </a>
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
</span>
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
<span class="summary_desc"><div class='inline'>
|
465
|
+
<p>Instantiate and return a new Sprout::ProcessRunner so that we can execute
|
466
|
+
it.</p>
|
467
|
+
</div></span>
|
468
|
+
|
469
|
+
</li>
|
470
|
+
|
471
|
+
|
472
|
+
<li class="public ">
|
473
|
+
<span class="summary_signature">
|
474
|
+
|
475
|
+
<a href="#home-instance_method" title="#home (instance method)">- (Object) <strong>home</strong> </a>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
</span>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
<span class="summary_desc"><div class='inline'>
|
489
|
+
<p>Get the home path for a system on a particular operating system.</p>
|
490
|
+
</div></span>
|
491
|
+
|
492
|
+
</li>
|
493
|
+
|
494
|
+
|
495
|
+
<li class="public ">
|
496
|
+
<span class="summary_signature">
|
497
|
+
|
498
|
+
<a href="#home%3D-instance_method" title="#home= (instance method)">- (Object) <strong>home=</strong>(home) </a>
|
499
|
+
|
500
|
+
|
501
|
+
|
502
|
+
</span>
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
<span class="summary_desc"><div class='inline'>
|
512
|
+
<p>Set the home path for a system on a particular operating system.</p>
|
513
|
+
</div></span>
|
514
|
+
|
515
|
+
</li>
|
516
|
+
|
517
|
+
|
518
|
+
<li class="public ">
|
519
|
+
<span class="summary_signature">
|
520
|
+
|
521
|
+
<a href="#library-instance_method" title="#library (instance method)">- (Object) <strong>library</strong> </a>
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
</span>
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
<span class="summary_desc"><div class='inline'>
|
535
|
+
<p>Some operating systems (like OS X and Windows) have a specific location
|
536
|
+
where applications are expected to store files for a particular system.</p>
|
537
|
+
</div></span>
|
538
|
+
|
539
|
+
</li>
|
540
|
+
|
541
|
+
|
542
|
+
<li class="protected ">
|
543
|
+
<span class="summary_signature">
|
544
|
+
|
545
|
+
<a href="#tilde_home-instance_method" title="#tilde_home (instance method)">- (Object) <strong>tilde_home</strong> </a>
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
</span>
|
550
|
+
|
551
|
+
|
552
|
+
<span class="note title protected">protected</span>
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
559
|
+
|
560
|
+
</li>
|
561
|
+
|
562
|
+
|
563
|
+
<li class="protected ">
|
564
|
+
<span class="summary_signature">
|
565
|
+
|
566
|
+
<a href="#worst_case_home-instance_method" title="#worst_case_home (instance method)">- (Object) <strong>worst_case_home</strong> </a>
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
</span>
|
571
|
+
|
572
|
+
|
573
|
+
<span class="note title protected">protected</span>
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
580
|
+
|
581
|
+
</li>
|
582
|
+
|
583
|
+
|
584
|
+
</ul>
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
<div id="instance_method_details" class="method_details_list">
|
590
|
+
<h2>Instance Method Details</h2>
|
591
|
+
|
592
|
+
|
593
|
+
<div class="method_details first">
|
594
|
+
<p class="signature first" id="alt_separator?-instance_method">
|
595
|
+
|
596
|
+
- (<tt>Boolean</tt>) <strong>alt_separator?</strong> <span class="extras">(protected)</span>
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
</p><div class="docstring">
|
601
|
+
<div class="discussion">
|
602
|
+
|
603
|
+
|
604
|
+
</div>
|
605
|
+
</div>
|
606
|
+
<div class="tags">
|
607
|
+
<h3>Returns:</h3>
|
608
|
+
<ul class="return">
|
609
|
+
|
610
|
+
<li>
|
611
|
+
|
612
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
</li>
|
618
|
+
|
619
|
+
</ul>
|
620
|
+
|
621
|
+
</div><table class="source_code">
|
622
|
+
<tr>
|
623
|
+
<td>
|
624
|
+
<pre class="lines">
|
625
|
+
|
626
|
+
|
627
|
+
179
|
628
|
+
180
|
629
|
+
181</pre>
|
630
|
+
</td>
|
631
|
+
<td>
|
632
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 179</span>
|
633
|
+
|
634
|
+
<span class='kw'>def</span> <span class='id alt_separator?'>alt_separator?</span>
|
635
|
+
<span class='const'>File</span><span class='op'>::</span><span class='const'>ALT_SEPARATOR</span>
|
636
|
+
<span class='kw'>end</span></pre>
|
637
|
+
</td>
|
638
|
+
</tr>
|
639
|
+
</table>
|
640
|
+
</div>
|
641
|
+
|
642
|
+
<div class="method_details ">
|
643
|
+
<p class="signature " id="application_home-instance_method">
|
644
|
+
|
645
|
+
- (<tt>Object</tt>) <strong>application_home</strong>(name)
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
</p><div class="docstring">
|
650
|
+
<div class="discussion">
|
651
|
+
|
652
|
+
<p>Different operating systems will store Application data different default
|
653
|
+
locations.</p>
|
654
|
+
|
655
|
+
<p>Subclasses will generally override this method and return the appropriate
|
656
|
+
location for their operating system.</p>
|
657
|
+
|
658
|
+
<p><tt>name</tt> String value of the Application name for which we'd like to
|
659
|
+
store data.</p>
|
660
|
+
|
661
|
+
|
662
|
+
</div>
|
663
|
+
</div>
|
664
|
+
<div class="tags">
|
665
|
+
|
666
|
+
</div><table class="source_code">
|
667
|
+
<tr>
|
668
|
+
<td>
|
669
|
+
<pre class="lines">
|
670
|
+
|
671
|
+
|
672
|
+
139
|
673
|
+
140
|
674
|
+
141</pre>
|
675
|
+
</td>
|
676
|
+
<td>
|
677
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 139</span>
|
678
|
+
|
679
|
+
<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>
|
680
|
+
<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>
|
681
|
+
<span class='kw'>end</span></pre>
|
682
|
+
</td>
|
683
|
+
</tr>
|
684
|
+
</table>
|
685
|
+
</div>
|
686
|
+
|
687
|
+
<div class="method_details ">
|
688
|
+
<p class="signature " id="can_execute?-instance_method">
|
689
|
+
|
690
|
+
- (<tt>Boolean</tt>) <strong>can_execute?</strong>(platform)
|
691
|
+
|
692
|
+
|
693
|
+
|
694
|
+
</p><div class="docstring">
|
695
|
+
<div class="discussion">
|
696
|
+
|
697
|
+
|
698
|
+
</div>
|
699
|
+
</div>
|
700
|
+
<div class="tags">
|
701
|
+
<h3>Returns:</h3>
|
702
|
+
<ul class="return">
|
703
|
+
|
704
|
+
<li>
|
705
|
+
|
706
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
|
711
|
+
</li>
|
712
|
+
|
713
|
+
</ul>
|
714
|
+
|
715
|
+
</div><table class="source_code">
|
716
|
+
<tr>
|
717
|
+
<td>
|
718
|
+
<pre class="lines">
|
719
|
+
|
720
|
+
|
721
|
+
60
|
722
|
+
61
|
723
|
+
62</pre>
|
724
|
+
</td>
|
725
|
+
<td>
|
726
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 60</span>
|
727
|
+
|
728
|
+
<span class='kw'>def</span> <span class='id can_execute?'>can_execute?</span> <span class='id platform'>platform</span>
|
729
|
+
<span class='id platform'>platform</span> <span class='op'>==</span> <span class='symbol'>:universal</span>
|
730
|
+
<span class='kw'>end</span></pre>
|
731
|
+
</td>
|
732
|
+
</tr>
|
733
|
+
</table>
|
734
|
+
</div>
|
735
|
+
|
736
|
+
<div class="method_details ">
|
737
|
+
<p class="signature " id="clean_path-instance_method">
|
738
|
+
|
739
|
+
- (<tt>Object</tt>) <strong>clean_path</strong>(path)
|
740
|
+
|
741
|
+
|
742
|
+
|
743
|
+
</p><div class="docstring">
|
744
|
+
<div class="discussion">
|
745
|
+
|
746
|
+
<p>Clean the provided <tt>path</tt> String for the current operating system.</p>
|
747
|
+
|
748
|
+
<p>Each operating system behaves differently when we attempt to execute a file
|
749
|
+
with spaces in the <tt>path</tt> to the file.</p>
|
750
|
+
|
751
|
+
<p>Subclasses will generally override this method and clean the path
|
752
|
+
appropriately for their operating system.</p>
|
753
|
+
|
754
|
+
|
755
|
+
</div>
|
756
|
+
</div>
|
757
|
+
<div class="tags">
|
758
|
+
|
759
|
+
</div><table class="source_code">
|
760
|
+
<tr>
|
761
|
+
<td>
|
762
|
+
<pre class="lines">
|
763
|
+
|
764
|
+
|
765
|
+
126
|
766
|
+
127</pre>
|
767
|
+
</td>
|
768
|
+
<td>
|
769
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 126</span>
|
770
|
+
|
771
|
+
<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>
|
772
|
+
<span class='kw'>end</span></pre>
|
773
|
+
</td>
|
774
|
+
</tr>
|
775
|
+
</table>
|
776
|
+
</div>
|
777
|
+
|
778
|
+
<div class="method_details ">
|
779
|
+
<p class="signature " id="env_home-instance_method">
|
780
|
+
|
781
|
+
- (<tt>Object</tt>) <strong>env_home</strong> <span class="extras">(protected)</span>
|
782
|
+
|
783
|
+
|
784
|
+
|
785
|
+
</p><table class="source_code">
|
786
|
+
<tr>
|
787
|
+
<td>
|
788
|
+
<pre class="lines">
|
789
|
+
|
790
|
+
|
791
|
+
171
|
792
|
+
172
|
793
|
+
173</pre>
|
794
|
+
</td>
|
795
|
+
<td>
|
796
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 171</span>
|
797
|
+
|
798
|
+
<span class='kw'>def</span> <span class='id env_home'>env_home</span>
|
799
|
+
<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>
|
800
|
+
<span class='kw'>end</span></pre>
|
801
|
+
</td>
|
802
|
+
</tr>
|
803
|
+
</table>
|
804
|
+
</div>
|
805
|
+
|
806
|
+
<div class="method_details ">
|
807
|
+
<p class="signature " id="env_homedrive-instance_method">
|
808
|
+
|
809
|
+
- (<tt>Object</tt>) <strong>env_homedrive</strong> <span class="extras">(protected)</span>
|
810
|
+
|
811
|
+
|
812
|
+
|
813
|
+
</p><table class="source_code">
|
814
|
+
<tr>
|
815
|
+
<td>
|
816
|
+
<pre class="lines">
|
817
|
+
|
818
|
+
|
819
|
+
153
|
820
|
+
154
|
821
|
+
155</pre>
|
822
|
+
</td>
|
823
|
+
<td>
|
824
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 153</span>
|
825
|
+
|
826
|
+
<span class='kw'>def</span> <span class='id env_homedrive'>env_homedrive</span>
|
827
|
+
<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>
|
828
|
+
<span class='kw'>end</span></pre>
|
829
|
+
</td>
|
830
|
+
</tr>
|
831
|
+
</table>
|
832
|
+
</div>
|
833
|
+
|
834
|
+
<div class="method_details ">
|
835
|
+
<p class="signature " id="env_homedrive_and_homepath-instance_method">
|
836
|
+
|
837
|
+
- (<tt>Object</tt>) <strong>env_homedrive_and_homepath</strong> <span class="extras">(protected)</span>
|
838
|
+
|
839
|
+
|
840
|
+
|
841
|
+
</p><table class="source_code">
|
842
|
+
<tr>
|
843
|
+
<td>
|
844
|
+
<pre class="lines">
|
845
|
+
|
846
|
+
|
847
|
+
161
|
848
|
+
162
|
849
|
+
163
|
850
|
+
164
|
851
|
+
165</pre>
|
852
|
+
</td>
|
853
|
+
<td>
|
854
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 161</span>
|
855
|
+
|
856
|
+
<span class='kw'>def</span> <span class='id env_homedrive_and_homepath'>env_homedrive_and_homepath</span>
|
857
|
+
<span class='id drive'>drive</span> <span class='op'>=</span> <span class='id env_homedrive'>env_homedrive</span>
|
858
|
+
<span class='id path'>path</span> <span class='op'>=</span> <span class='id env_homepath'>env_homepath</span>
|
859
|
+
<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>
|
860
|
+
<span class='kw'>end</span></pre>
|
861
|
+
</td>
|
862
|
+
</tr>
|
863
|
+
</table>
|
864
|
+
</div>
|
865
|
+
|
866
|
+
<div class="method_details ">
|
867
|
+
<p class="signature " id="env_homepath-instance_method">
|
868
|
+
|
869
|
+
- (<tt>Object</tt>) <strong>env_homepath</strong> <span class="extras">(protected)</span>
|
870
|
+
|
871
|
+
|
872
|
+
|
873
|
+
</p><table class="source_code">
|
874
|
+
<tr>
|
875
|
+
<td>
|
876
|
+
<pre class="lines">
|
877
|
+
|
878
|
+
|
879
|
+
157
|
880
|
+
158
|
881
|
+
159</pre>
|
882
|
+
</td>
|
883
|
+
<td>
|
884
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 157</span>
|
885
|
+
|
886
|
+
<span class='kw'>def</span> <span class='id env_homepath'>env_homepath</span>
|
887
|
+
<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>
|
888
|
+
<span class='kw'>end</span></pre>
|
889
|
+
</td>
|
890
|
+
</tr>
|
891
|
+
</table>
|
892
|
+
</div>
|
893
|
+
|
894
|
+
<div class="method_details ">
|
895
|
+
<p class="signature " id="env_userprofile-instance_method">
|
896
|
+
|
897
|
+
- (<tt>Object</tt>) <strong>env_userprofile</strong> <span class="extras">(protected)</span>
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
</p><table class="source_code">
|
902
|
+
<tr>
|
903
|
+
<td>
|
904
|
+
<pre class="lines">
|
905
|
+
|
906
|
+
|
907
|
+
167
|
908
|
+
168
|
909
|
+
169</pre>
|
910
|
+
</td>
|
911
|
+
<td>
|
912
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 167</span>
|
913
|
+
|
914
|
+
<span class='kw'>def</span> <span class='id env_userprofile'>env_userprofile</span>
|
915
|
+
<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>
|
916
|
+
<span class='kw'>end</span></pre>
|
917
|
+
</td>
|
918
|
+
</tr>
|
919
|
+
</table>
|
920
|
+
</div>
|
921
|
+
|
922
|
+
<div class="method_details ">
|
923
|
+
<p class="signature " id="execute-instance_method">
|
924
|
+
|
925
|
+
- (<tt>Object</tt>) <strong>execute</strong>(tool, options = '')
|
926
|
+
|
927
|
+
|
928
|
+
|
929
|
+
</p><div class="docstring">
|
930
|
+
<div class="discussion">
|
931
|
+
|
932
|
+
<p>Creates a new process, executes the command and returns whatever the
|
933
|
+
process wrote to stdout, or stderr.</p>
|
934
|
+
|
935
|
+
<p>Raises a <tt>Sprout::Errors::ExecutionError</tt> if the process writes to stderr</p>
|
936
|
+
|
937
|
+
|
938
|
+
</div>
|
939
|
+
</div>
|
940
|
+
<div class="tags">
|
941
|
+
|
942
|
+
</div><table class="source_code">
|
943
|
+
<tr>
|
944
|
+
<td>
|
945
|
+
<pre class="lines">
|
946
|
+
|
947
|
+
|
948
|
+
70
|
949
|
+
71
|
950
|
+
72
|
951
|
+
73
|
952
|
+
74
|
953
|
+
75
|
954
|
+
76
|
955
|
+
77
|
956
|
+
78
|
957
|
+
79
|
958
|
+
80
|
959
|
+
81
|
960
|
+
82
|
961
|
+
83
|
962
|
+
84
|
963
|
+
85</pre>
|
964
|
+
</td>
|
965
|
+
<td>
|
966
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 70</span>
|
967
|
+
|
968
|
+
<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>
|
969
|
+
<span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Log</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>
|
970
|
+
<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>
|
971
|
+
<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>
|
972
|
+
<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>
|
973
|
+
|
974
|
+
<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>
|
975
|
+
<span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Log</span><span class='period'>.</span><span class='id puts'>puts</span> <span class='id result'>result</span>
|
976
|
+
<span class='kw'>end</span>
|
977
|
+
|
978
|
+
<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>
|
979
|
+
<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>
|
980
|
+
<span class='kw'>end</span>
|
981
|
+
|
982
|
+
<span class='id result'>result</span> <span class='op'>||</span> <span class='id error'>error</span>
|
983
|
+
<span class='kw'>end</span></pre>
|
984
|
+
</td>
|
985
|
+
</tr>
|
986
|
+
</table>
|
987
|
+
</div>
|
988
|
+
|
989
|
+
<div class="method_details ">
|
990
|
+
<p class="signature " id="execute_silent-instance_method">
|
991
|
+
|
992
|
+
- (<tt>Object</tt>) <strong>execute_silent</strong>(tool, options = '')
|
993
|
+
|
994
|
+
|
995
|
+
|
996
|
+
</p><div class="docstring">
|
997
|
+
<div class="discussion">
|
998
|
+
|
999
|
+
<p>Creates and returns the process without attempting to read or write to the
|
1000
|
+
stream. This is useful for interacting with long-lived CLI processes like
|
1001
|
+
FCSH or FDB.</p>
|
1002
|
+
|
1003
|
+
|
1004
|
+
</div>
|
1005
|
+
</div>
|
1006
|
+
<div class="tags">
|
1007
|
+
|
1008
|
+
</div><table class="source_code">
|
1009
|
+
<tr>
|
1010
|
+
<td>
|
1011
|
+
<pre class="lines">
|
1012
|
+
|
1013
|
+
|
1014
|
+
93
|
1015
|
+
94
|
1016
|
+
95</pre>
|
1017
|
+
</td>
|
1018
|
+
<td>
|
1019
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 93</span>
|
1020
|
+
|
1021
|
+
<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>
|
1022
|
+
<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>
|
1023
|
+
<span class='kw'>end</span></pre>
|
1024
|
+
</td>
|
1025
|
+
</tr>
|
1026
|
+
</table>
|
1027
|
+
</div>
|
1028
|
+
|
1029
|
+
<div class="method_details ">
|
1030
|
+
<p class="signature " id="execute_thread-instance_method">
|
1031
|
+
|
1032
|
+
- (<tt>Object</tt>) <strong>execute_thread</strong>(tool, options = '')
|
1033
|
+
|
1034
|
+
|
1035
|
+
|
1036
|
+
</p><div class="docstring">
|
1037
|
+
<div class="discussion">
|
1038
|
+
|
1039
|
+
<p>Execute a new process in a separate thread.</p>
|
1040
|
+
|
1041
|
+
|
1042
|
+
</div>
|
1043
|
+
</div>
|
1044
|
+
<div class="tags">
|
1045
|
+
|
1046
|
+
</div><table class="source_code">
|
1047
|
+
<tr>
|
1048
|
+
<td>
|
1049
|
+
<pre class="lines">
|
1050
|
+
|
1051
|
+
|
1052
|
+
100
|
1053
|
+
101
|
1054
|
+
102
|
1055
|
+
103
|
1056
|
+
104
|
1057
|
+
105
|
1058
|
+
106
|
1059
|
+
107
|
1060
|
+
108
|
1061
|
+
109
|
1062
|
+
110
|
1063
|
+
111
|
1064
|
+
112</pre>
|
1065
|
+
</td>
|
1066
|
+
<td>
|
1067
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 100</span>
|
1068
|
+
|
1069
|
+
<span class='kw'>def</span> <span class='id execute_thread'>execute_thread</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>
|
1070
|
+
<span class='id runner'>runner</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
1071
|
+
<span class='const'>Thread</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>do</span>
|
1072
|
+
<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>
|
1073
|
+
<span class='kw'>end</span>
|
1074
|
+
<span class='comment'># Wait for the runner to be created
|
1075
|
+
</span> <span class='comment'># before returning a nil reference
|
1076
|
+
</span> <span class='comment'># that never gets populated...
|
1077
|
+
</span> <span class='kw'>while</span> <span class='id runner'>runner</span><span class='period'>.</span><span class='id nil?'>nil?</span> <span class='kw'>do</span>
|
1078
|
+
<span class='id sleep'>sleep</span><span class='lparen'>(</span><span class='float'>0.1</span><span class='rparen'>)</span>
|
1079
|
+
<span class='kw'>end</span>
|
1080
|
+
<span class='id runner'>runner</span>
|
1081
|
+
<span class='kw'>end</span></pre>
|
1082
|
+
</td>
|
1083
|
+
</tr>
|
1084
|
+
</table>
|
1085
|
+
</div>
|
1086
|
+
|
1087
|
+
<div class="method_details ">
|
1088
|
+
<p class="signature " id="find_home-instance_method">
|
1089
|
+
|
1090
|
+
- (<tt>Object</tt>) <strong>find_home</strong> <span class="extras">(protected)</span>
|
1091
|
+
|
1092
|
+
|
1093
|
+
|
1094
|
+
</p><table class="source_code">
|
1095
|
+
<tr>
|
1096
|
+
<td>
|
1097
|
+
<pre class="lines">
|
1098
|
+
|
1099
|
+
|
1100
|
+
188
|
1101
|
+
189
|
1102
|
+
190
|
1103
|
+
191
|
1104
|
+
192
|
1105
|
+
193
|
1106
|
+
194
|
1107
|
+
195
|
1108
|
+
196
|
1109
|
+
197
|
1110
|
+
198
|
1111
|
+
199</pre>
|
1112
|
+
</td>
|
1113
|
+
<td>
|
1114
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 188</span>
|
1115
|
+
|
1116
|
+
<span class='kw'>def</span> <span class='id find_home'>find_home</span>
|
1117
|
+
<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>
|
1118
|
+
<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>
|
1119
|
+
<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>
|
1120
|
+
<span class='kw'>end</span>
|
1121
|
+
|
1122
|
+
<span class='kw'>begin</span>
|
1123
|
+
<span class='kw'>return</span> <span class='id tilde_home'>tilde_home</span>
|
1124
|
+
<span class='kw'>rescue</span> <span class='const'>StandardError</span>
|
1125
|
+
<span class='id worst_case_home'>worst_case_home</span>
|
1126
|
+
<span class='kw'>end</span>
|
1127
|
+
<span class='kw'>end</span></pre>
|
1128
|
+
</td>
|
1129
|
+
</tr>
|
1130
|
+
</table>
|
1131
|
+
</div>
|
1132
|
+
|
1133
|
+
<div class="method_details ">
|
1134
|
+
<p class="signature " id="format_application_name-instance_method">
|
1135
|
+
|
1136
|
+
- (<tt>Object</tt>) <strong>format_application_name</strong>(name)
|
1137
|
+
|
1138
|
+
|
1139
|
+
|
1140
|
+
</p><div class="docstring">
|
1141
|
+
<div class="discussion">
|
1142
|
+
|
1143
|
+
<p>Template method that should be overridden by subclasses.</p>
|
1144
|
+
|
1145
|
+
|
1146
|
+
</div>
|
1147
|
+
</div>
|
1148
|
+
<div class="tags">
|
1149
|
+
|
1150
|
+
</div><table class="source_code">
|
1151
|
+
<tr>
|
1152
|
+
<td>
|
1153
|
+
<pre class="lines">
|
1154
|
+
|
1155
|
+
|
1156
|
+
147
|
1157
|
+
148
|
1158
|
+
149</pre>
|
1159
|
+
</td>
|
1160
|
+
<td>
|
1161
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 147</span>
|
1162
|
+
|
1163
|
+
<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>
|
1164
|
+
<span class='id name'>name</span>
|
1165
|
+
<span class='kw'>end</span></pre>
|
1166
|
+
</td>
|
1167
|
+
</tr>
|
1168
|
+
</table>
|
1169
|
+
</div>
|
1170
|
+
|
1171
|
+
<div class="method_details ">
|
1172
|
+
<p class="signature " id="get_and_execute_process_runner-instance_method">
|
1173
|
+
|
1174
|
+
- (<tt>Object</tt>) <strong>get_and_execute_process_runner</strong>(tool, options = nil) <span class="extras">(protected)</span>
|
1175
|
+
|
1176
|
+
|
1177
|
+
|
1178
|
+
</p><div class="docstring">
|
1179
|
+
<div class="discussion">
|
1180
|
+
|
1181
|
+
<p>Get a process runner and execute the provided <tt>executable</tt>, with the
|
1182
|
+
provided <tt>options</tt>.</p>
|
1183
|
+
|
1184
|
+
<p><tt>executable</tt> String path to the external executable file.</p>
|
1185
|
+
|
1186
|
+
<p><tt>options</tt> String commandline options to send to the
|
1187
|
+
<tt>executable</tt>.</p>
|
1188
|
+
|
1189
|
+
|
1190
|
+
</div>
|
1191
|
+
</div>
|
1192
|
+
<div class="tags">
|
1193
|
+
|
1194
|
+
</div><table class="source_code">
|
1195
|
+
<tr>
|
1196
|
+
<td>
|
1197
|
+
<pre class="lines">
|
1198
|
+
|
1199
|
+
|
1200
|
+
211
|
1201
|
+
212
|
1202
|
+
213
|
1203
|
+
214
|
1204
|
+
215</pre>
|
1205
|
+
</td>
|
1206
|
+
<td>
|
1207
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 211</span>
|
1208
|
+
|
1209
|
+
<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>
|
1210
|
+
<span class='id runner'>runner</span> <span class='op'>=</span> <span class='id get_process_runner'>get_process_runner</span>
|
1211
|
+
<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>
|
1212
|
+
<span class='id runner'>runner</span>
|
1213
|
+
<span class='kw'>end</span></pre>
|
1214
|
+
</td>
|
1215
|
+
</tr>
|
1216
|
+
</table>
|
1217
|
+
</div>
|
1218
|
+
|
1219
|
+
<div class="method_details ">
|
1220
|
+
<p class="signature " id="get_process_runner-instance_method">
|
1221
|
+
|
1222
|
+
- (<tt>Object</tt>) <strong>get_process_runner</strong>
|
1223
|
+
|
1224
|
+
|
1225
|
+
|
1226
|
+
</p><div class="docstring">
|
1227
|
+
<div class="discussion">
|
1228
|
+
|
1229
|
+
<p>Instantiate and return a new Sprout::ProcessRunner so that we can execute
|
1230
|
+
it.</p>
|
1231
|
+
|
1232
|
+
|
1233
|
+
</div>
|
1234
|
+
</div>
|
1235
|
+
<div class="tags">
|
1236
|
+
|
1237
|
+
</div><table class="source_code">
|
1238
|
+
<tr>
|
1239
|
+
<td>
|
1240
|
+
<pre class="lines">
|
1241
|
+
|
1242
|
+
|
1243
|
+
56
|
1244
|
+
57
|
1245
|
+
58</pre>
|
1246
|
+
</td>
|
1247
|
+
<td>
|
1248
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 56</span>
|
1249
|
+
|
1250
|
+
<span class='kw'>def</span> <span class='id get_process_runner'>get_process_runner</span>
|
1251
|
+
<span class='const'>Sprout</span><span class='op'>::</span><span class='const'>ProcessRunner</span><span class='period'>.</span><span class='id new'>new</span>
|
1252
|
+
<span class='kw'>end</span></pre>
|
1253
|
+
</td>
|
1254
|
+
</tr>
|
1255
|
+
</table>
|
1256
|
+
</div>
|
1257
|
+
|
1258
|
+
<div class="method_details ">
|
1259
|
+
<p class="signature " id="home-instance_method">
|
1260
|
+
|
1261
|
+
- (<tt>Object</tt>) <strong>home</strong>
|
1262
|
+
|
1263
|
+
|
1264
|
+
|
1265
|
+
</p><div class="docstring">
|
1266
|
+
<div class="discussion">
|
1267
|
+
|
1268
|
+
<p>Get the home path for a system on a particular operating system.</p>
|
1269
|
+
|
1270
|
+
<p>This path will be different, depending on which system owns the curren
|
1271
|
+
process, and which operating system they are on.</p>
|
1272
|
+
|
1273
|
+
|
1274
|
+
</div>
|
1275
|
+
</div>
|
1276
|
+
<div class="tags">
|
1277
|
+
|
1278
|
+
</div><table class="source_code">
|
1279
|
+
<tr>
|
1280
|
+
<td>
|
1281
|
+
<pre class="lines">
|
1282
|
+
|
1283
|
+
|
1284
|
+
22
|
1285
|
+
23
|
1286
|
+
24</pre>
|
1287
|
+
</td>
|
1288
|
+
<td>
|
1289
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 22</span>
|
1290
|
+
|
1291
|
+
<span class='kw'>def</span> <span class='id home'>home</span>
|
1292
|
+
<span class='ivar'>@home</span> <span class='op'>||=</span> <span class='id find_home'>find_home</span>
|
1293
|
+
<span class='kw'>end</span></pre>
|
1294
|
+
</td>
|
1295
|
+
</tr>
|
1296
|
+
</table>
|
1297
|
+
</div>
|
1298
|
+
|
1299
|
+
<div class="method_details ">
|
1300
|
+
<p class="signature " id="home=-instance_method">
|
1301
|
+
|
1302
|
+
- (<tt>Object</tt>) <strong>home=</strong>(home)
|
1303
|
+
|
1304
|
+
|
1305
|
+
|
1306
|
+
</p><div class="docstring">
|
1307
|
+
<div class="discussion">
|
1308
|
+
|
1309
|
+
<p>Set the home path for a system on a particular operating system.</p>
|
1310
|
+
|
1311
|
+
<p>If you request the home path before setting it, we will attempt to
|
1312
|
+
determine the home path of the current system for the current operating
|
1313
|
+
system.</p>
|
1314
|
+
|
1315
|
+
<p>This is just a simple way to override the default behavior.</p>
|
1316
|
+
|
1317
|
+
|
1318
|
+
</div>
|
1319
|
+
</div>
|
1320
|
+
<div class="tags">
|
1321
|
+
|
1322
|
+
</div><table class="source_code">
|
1323
|
+
<tr>
|
1324
|
+
<td>
|
1325
|
+
<pre class="lines">
|
1326
|
+
|
1327
|
+
|
1328
|
+
35
|
1329
|
+
36
|
1330
|
+
37</pre>
|
1331
|
+
</td>
|
1332
|
+
<td>
|
1333
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 35</span>
|
1334
|
+
|
1335
|
+
<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>
|
1336
|
+
<span class='ivar'>@home</span> <span class='op'>=</span> <span class='id home'>home</span>
|
1337
|
+
<span class='kw'>end</span></pre>
|
1338
|
+
</td>
|
1339
|
+
</tr>
|
1340
|
+
</table>
|
1341
|
+
</div>
|
1342
|
+
|
1343
|
+
<div class="method_details ">
|
1344
|
+
<p class="signature " id="library-instance_method">
|
1345
|
+
|
1346
|
+
- (<tt>Object</tt>) <strong>library</strong>
|
1347
|
+
|
1348
|
+
|
1349
|
+
|
1350
|
+
</p><div class="docstring">
|
1351
|
+
<div class="discussion">
|
1352
|
+
|
1353
|
+
<p>Some operating systems (like OS X and Windows) have a specific location
|
1354
|
+
where applications are expected to store files for a particular system.
|
1355
|
+
This location is generally a subdirectory of <tt>home</tt>.</p>
|
1356
|
+
|
1357
|
+
<p>The value of this location will usually be overridden in concrete System
|
1358
|
+
classes.</p>
|
1359
|
+
|
1360
|
+
|
1361
|
+
</div>
|
1362
|
+
</div>
|
1363
|
+
<div class="tags">
|
1364
|
+
|
1365
|
+
</div><table class="source_code">
|
1366
|
+
<tr>
|
1367
|
+
<td>
|
1368
|
+
<pre class="lines">
|
1369
|
+
|
1370
|
+
|
1371
|
+
48
|
1372
|
+
49
|
1373
|
+
50</pre>
|
1374
|
+
</td>
|
1375
|
+
<td>
|
1376
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 48</span>
|
1377
|
+
|
1378
|
+
<span class='kw'>def</span> <span class='id library'>library</span>
|
1379
|
+
<span class='kw'>return</span> <span class='id home'>home</span>
|
1380
|
+
<span class='kw'>end</span></pre>
|
1381
|
+
</td>
|
1382
|
+
</tr>
|
1383
|
+
</table>
|
1384
|
+
</div>
|
1385
|
+
|
1386
|
+
<div class="method_details ">
|
1387
|
+
<p class="signature " id="tilde_home-instance_method">
|
1388
|
+
|
1389
|
+
- (<tt>Object</tt>) <strong>tilde_home</strong> <span class="extras">(protected)</span>
|
1390
|
+
|
1391
|
+
|
1392
|
+
|
1393
|
+
</p><table class="source_code">
|
1394
|
+
<tr>
|
1395
|
+
<td>
|
1396
|
+
<pre class="lines">
|
1397
|
+
|
1398
|
+
|
1399
|
+
175
|
1400
|
+
176
|
1401
|
+
177</pre>
|
1402
|
+
</td>
|
1403
|
+
<td>
|
1404
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 175</span>
|
1405
|
+
|
1406
|
+
<span class='kw'>def</span> <span class='id tilde_home'>tilde_home</span>
|
1407
|
+
<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>
|
1408
|
+
<span class='kw'>end</span></pre>
|
1409
|
+
</td>
|
1410
|
+
</tr>
|
1411
|
+
</table>
|
1412
|
+
</div>
|
1413
|
+
|
1414
|
+
<div class="method_details ">
|
1415
|
+
<p class="signature " id="worst_case_home-instance_method">
|
1416
|
+
|
1417
|
+
- (<tt>Object</tt>) <strong>worst_case_home</strong> <span class="extras">(protected)</span>
|
1418
|
+
|
1419
|
+
|
1420
|
+
|
1421
|
+
</p><table class="source_code">
|
1422
|
+
<tr>
|
1423
|
+
<td>
|
1424
|
+
<pre class="lines">
|
1425
|
+
|
1426
|
+
|
1427
|
+
183
|
1428
|
+
184
|
1429
|
+
185
|
1430
|
+
186</pre>
|
1431
|
+
</td>
|
1432
|
+
<td>
|
1433
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/system/base_system.rb', line 183</span>
|
1434
|
+
|
1435
|
+
<span class='kw'>def</span> <span class='id worst_case_home'>worst_case_home</span>
|
1436
|
+
<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>
|
1437
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span>
|
1438
|
+
<span class='kw'>end</span></pre>
|
1439
|
+
</td>
|
1440
|
+
</tr>
|
1441
|
+
</table>
|
1442
|
+
</div>
|
1443
|
+
|
1444
|
+
</div>
|
1445
|
+
|
1446
|
+
</div>
|
1447
|
+
|
1448
|
+
<div id="footer">
|
1449
|
+
Generated on Wed Dec 22 11:58:36 2010 by
|
1450
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1451
|
+
0.6.3 (ruby-1.9.2).
|
1452
|
+
</div>
|
1453
|
+
|
1454
|
+
</body>
|
1455
|
+
</html>
|