sprout 1.1.17.pre → 1.1.18.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.

Files changed (111) hide show
  1. data/VERSION +1 -1
  2. data/doc/Dir.html +313 -0
  3. data/doc/Rake/Task.html +206 -0
  4. data/doc/Sprout.html +778 -0
  5. data/doc/Sprout/ArchiveUnpacker.html +1313 -0
  6. data/doc/Sprout/CommandLine.html +521 -0
  7. data/doc/Sprout/Concern.html +382 -0
  8. data/doc/Sprout/Errors.html +120 -0
  9. data/doc/Sprout/Errors/ArchiveUnpackerError.html +139 -0
  10. data/doc/Sprout/Errors/DestinationExistsError.html +143 -0
  11. data/doc/Sprout/Errors/DuplicateMemberError.html +142 -0
  12. data/doc/Sprout/Errors/ExecutableError.html +139 -0
  13. data/doc/Sprout/Errors/ExecutableRegistrationError.html +142 -0
  14. data/doc/Sprout/Errors/ExecutionError.html +135 -0
  15. data/doc/Sprout/Errors/GeneratorError.html +139 -0
  16. data/doc/Sprout/Errors/InvalidArgumentError.html +142 -0
  17. data/doc/Sprout/Errors/LoadError.html +135 -0
  18. data/doc/Sprout/Errors/MissingArgumentError.html +142 -0
  19. data/doc/Sprout/Errors/MissingExecutableError.html +142 -0
  20. data/doc/Sprout/Errors/MissingGeneratorError.html +142 -0
  21. data/doc/Sprout/Errors/MissingTemplateError.html +142 -0
  22. data/doc/Sprout/Errors/ProcessRunnerError.html +135 -0
  23. data/doc/Sprout/Errors/RemoteFileLoaderError.html +128 -0
  24. data/doc/Sprout/Errors/SproutError.html +132 -0
  25. data/doc/Sprout/Errors/UnknownArchiveType.html +136 -0
  26. data/doc/Sprout/Errors/UsageError.html +135 -0
  27. data/doc/Sprout/Errors/ValidationError.html +135 -0
  28. data/doc/Sprout/Errors/VersionRequirementNotMetError.html +135 -0
  29. data/doc/Sprout/Executable.html +183 -0
  30. data/doc/Sprout/Executable/Base.html +2986 -0
  31. data/doc/Sprout/Executable/Boolean.html +577 -0
  32. data/doc/Sprout/Executable/CollectionParam.html +521 -0
  33. data/doc/Sprout/Executable/FileParam.html +517 -0
  34. data/doc/Sprout/Executable/Files.html +311 -0
  35. data/doc/Sprout/Executable/Number.html +164 -0
  36. data/doc/Sprout/Executable/Param.html +3011 -0
  37. data/doc/Sprout/Executable/ParameterFactory.html +262 -0
  38. data/doc/Sprout/Executable/Path.html +247 -0
  39. data/doc/Sprout/Executable/Paths.html +268 -0
  40. data/doc/Sprout/Executable/Session.html +1587 -0
  41. data/doc/Sprout/Executable/StringParam.html +237 -0
  42. data/doc/Sprout/Executable/Strings.html +186 -0
  43. data/doc/Sprout/Executable/Url.html +180 -0
  44. data/doc/Sprout/Executable/Urls.html +185 -0
  45. data/doc/Sprout/FileTarget.html +1170 -0
  46. data/doc/Sprout/Generator.html +800 -0
  47. data/doc/Sprout/Generator/Base.html +1834 -0
  48. data/doc/Sprout/Generator/Command.html +716 -0
  49. data/doc/Sprout/Generator/DirectoryManifest.html +503 -0
  50. data/doc/Sprout/Generator/FileManifest.html +667 -0
  51. data/doc/Sprout/Generator/Manifest.html +403 -0
  52. data/doc/Sprout/Generator/TemplateManifest.html +213 -0
  53. data/doc/Sprout/GeneratorGenerator.html +990 -0
  54. data/doc/Sprout/Library.html +1259 -0
  55. data/doc/Sprout/LibraryGenerator.html +326 -0
  56. data/doc/Sprout/OutputBuffer.html +461 -0
  57. data/doc/Sprout/Platform.html +758 -0
  58. data/doc/Sprout/ProcessRunner.html +1801 -0
  59. data/doc/Sprout/ProgressBar.html +384 -0
  60. data/doc/Sprout/ProgressBarImpl.html +2151 -0
  61. data/doc/Sprout/ProgressBarManager.html +443 -0
  62. data/doc/Sprout/ProgressBarOutputStream.html +429 -0
  63. data/doc/Sprout/RDocParser.html +228 -0
  64. data/doc/Sprout/RemoteFileLoader.html +191 -0
  65. data/doc/Sprout/RemoteFileTarget.html +710 -0
  66. data/doc/Sprout/ReversedProgressBar.html +200 -0
  67. data/doc/Sprout/RubyFeature.html +176 -0
  68. data/doc/Sprout/RubyFeature/ClassMethods.html +1099 -0
  69. data/doc/Sprout/RubyGenerator.html +712 -0
  70. data/doc/Sprout/Specification.html +838 -0
  71. data/doc/Sprout/System.html +212 -0
  72. data/doc/Sprout/System/BaseSystem.html +1732 -0
  73. data/doc/Sprout/System/JavaSystem.html +137 -0
  74. data/doc/Sprout/System/OSXSystem.html +345 -0
  75. data/doc/Sprout/System/ThreadMock.html +201 -0
  76. data/doc/Sprout/System/UnixSystem.html +610 -0
  77. data/doc/Sprout/System/VistaSystem.html +263 -0
  78. data/doc/Sprout/System/WinNixSystem.html +340 -0
  79. data/doc/Sprout/System/WinSystem.html +590 -0
  80. data/doc/Sprout/TestHelper.html +2280 -0
  81. data/doc/Sprout/ToolGenerator.html +995 -0
  82. data/doc/Sprout/VERSION.html +135 -0
  83. data/doc/String.html +313 -0
  84. data/doc/_index.html +829 -0
  85. data/doc/class_list.html +47 -0
  86. data/doc/css/common.css +1 -0
  87. data/doc/css/full_list.css +55 -0
  88. data/doc/css/style.css +322 -0
  89. data/doc/file.README.html +109 -0
  90. data/doc/file_list.html +49 -0
  91. data/doc/frames.html +13 -0
  92. data/doc/index.html +109 -0
  93. data/doc/js/app.js +205 -0
  94. data/doc/js/full_list.js +173 -0
  95. data/doc/js/jquery.js +16 -0
  96. data/doc/method_list.html +3622 -0
  97. data/doc/top-level-namespace.html +220 -0
  98. data/lib/sprout/generators/generator/generator_generator.rb +3 -3
  99. data/lib/sprout/generators/generator/templates/{generator_class.rb → generator_class.erb} +0 -0
  100. data/lib/sprout/generators/generator/templates/{generator_test.rb → generator_test.erb} +0 -0
  101. data/lib/sprout/generators/generator/templates/{generator_test_helper.rb → generator_test_helper.erb} +0 -0
  102. data/lib/sprout/generators/library/library_generator.rb +1 -1
  103. data/lib/sprout/generators/library/templates/{library.rb → library.erb} +0 -0
  104. data/lib/sprout/generators/ruby/ruby_generator.rb +4 -5
  105. data/lib/sprout/generators/ruby/templates/{ruby_base.rb → ruby_base.erb} +0 -0
  106. data/lib/sprout/generators/ruby/templates/{ruby_input.rb → ruby_input.erb} +0 -0
  107. data/lib/sprout/generators/ruby/templates/{ruby_test_case.rb → ruby_test_case.erb} +0 -0
  108. data/lib/sprout/generators/ruby/templates/{ruby_test_helper.rb → ruby_test_helper.erb} +0 -0
  109. data/lib/sprout/generators/tool/templates/{tool.rb → tool.erb} +0 -2
  110. data/lib/sprout/generators/tool/tool_generator.rb +1 -1
  111. metadata +128 -32
@@ -0,0 +1,268 @@
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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Sprout::Executable::Paths
8
+
9
+ &mdash; Sprouts v.1.0.34.pre
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '../..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../../_index.html">Index (P)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../../Sprout.html" title="Sprout (module)">Sprout</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Executable.html" title="Sprout::Executable (module)">Executable</a></span></span>
38
+ &raquo;
39
+ <span class="title">Paths</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Class: Sprout::Executable::Paths
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+ <dt class="r1">Inherits:</dt>
68
+ <dd class="r1">
69
+ <span class="inheritName"><span class='object_link'><a href="Files.html" title="Sprout::Executable::Files (class)">Files</a></span></span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next"><span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></li>
75
+
76
+ <li class="next"><span class='object_link'><a href="Files.html" title="Sprout::Executable::Files (class)">Files</a></span></li>
77
+
78
+ <li class="next">Sprout::Executable::Paths</li>
79
+
80
+ </ul>
81
+ <a href="#" class="inheritanceTree">show all</a>
82
+
83
+ </dd>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r2 last">Defined in:</dt>
94
+ <dd class="r2 last">lib/sprout/executable/paths.rb</dd>
95
+
96
+ </dl>
97
+ <div class="clear"></div>
98
+
99
+ <h2>Overview</h2><div class="docstring">
100
+ <div class="discussion">
101
+ <p>
102
+ A collection of Paths.
103
+ </p>
104
+
105
+
106
+ </div>
107
+ </div>
108
+ <div class="tags">
109
+
110
+
111
+ <h3>See Also:</h3>
112
+ <ul class="see">
113
+
114
+ <li><span class='object_link'><a href="Path.html" title="Sprout::Executable::Path (class)">Path</a></span></li>
115
+
116
+ <li><span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></li>
117
+
118
+ <li><span class='object_link'><a href="CollectionParam.html" title="Sprout::Executable::CollectionParam (module)">CollectionParam</a></span></li>
119
+
120
+ </ul>
121
+
122
+ </div>
123
+ <h2>Constant Summary</h2>
124
+
125
+
126
+
127
+
128
+ <h2>Constant Summary</h2>
129
+
130
+ <h3 class="inherited">Constants inherited
131
+ from <span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></h3>
132
+ <p class="inherited"><span class='object_link'><a href="Param.html#DEFAULT_DELIMITER-constant" title="Sprout::Executable::Param::DEFAULT_DELIMITER (constant)">Sprout::Executable::Param::DEFAULT_DELIMITER</a></span>, <span class='object_link'><a href="Param.html#DEFAULT_OPTION_PARSER_TYPE_NAME-constant" title="Sprout::Executable::Param::DEFAULT_OPTION_PARSER_TYPE_NAME (constant)">Sprout::Executable::Param::DEFAULT_OPTION_PARSER_TYPE_NAME</a></span>, <span class='object_link'><a href="Param.html#DEFAULT_PREFIX-constant" title="Sprout::Executable::Param::DEFAULT_PREFIX (constant)">Sprout::Executable::Param::DEFAULT_PREFIX</a></span>, <span class='object_link'><a href="Param.html#DEFAULT_SHORT_PREFIX-constant" title="Sprout::Executable::Param::DEFAULT_SHORT_PREFIX (constant)">Sprout::Executable::Param::DEFAULT_SHORT_PREFIX</a></span></p>
133
+
134
+
135
+
136
+
137
+ <h2>Instance Attribute Summary</h2>
138
+
139
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></h3>
140
+ <p class="inherited"><span class='object_link'><a href="Param.html#belongs_to-instance_method" title="Sprout::Executable::Param#belongs_to (method)">#belongs_to</a></span>, <span class='object_link'><a href="Param.html#delimiter-instance_method" title="Sprout::Executable::Param#delimiter (method)">#delimiter</a></span>, <span class='object_link'><a href="Param.html#description-instance_method" title="Sprout::Executable::Param#description (method)">#description</a></span>, <span class='object_link'><a href="Param.html#file_expression-instance_method" title="Sprout::Executable::Param#file_expression (method)">#file_expression</a></span>, <span class='object_link'><a href="Param.html#hidden_name-instance_method" title="Sprout::Executable::Param#hidden_name (method)">#hidden_name</a></span>, <span class='object_link'><a href="Param.html#hidden_value-instance_method" title="Sprout::Executable::Param#hidden_value (method)">#hidden_value</a></span>, <span class='object_link'><a href="Param.html#name-instance_method" title="Sprout::Executable::Param#name (method)">#name</a></span>, <span class='object_link'><a href="Param.html#prefix-instance_method" title="Sprout::Executable::Param#prefix (method)">#prefix</a></span>, <span class='object_link'><a href="Param.html#reader-instance_method" title="Sprout::Executable::Param#reader (method)">#reader</a></span>, <span class='object_link'><a href="Param.html#required-instance_method" title="Sprout::Executable::Param#required (method)">#required</a></span>, <span class='object_link'><a href="Param.html#shell_name-instance_method" title="Sprout::Executable::Param#shell_name (method)">#shell_name</a></span>, <span class='object_link'><a href="Param.html#short_name-instance_method" title="Sprout::Executable::Param#short_name (method)">#short_name</a></span>, <span class='object_link'><a href="Param.html#to_shell_proc-instance_method" title="Sprout::Executable::Param#to_shell_proc (method)">#to_shell_proc</a></span>, <span class='object_link'><a href="Param.html#type-instance_method" title="Sprout::Executable::Param#type (method)">#type</a></span>, <span class='object_link'><a href="Param.html#value-instance_method" title="Sprout::Executable::Param#value (method)">#value</a></span>, <span class='object_link'><a href="Param.html#writer-instance_method" title="Sprout::Executable::Param#writer (method)">#writer</a></span></p>
141
+
142
+
143
+
144
+ <h2>
145
+ Instance Method Summary
146
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
147
+ </h2>
148
+
149
+ <ul class="summary">
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#prepare_prerequisites-instance_method" title="#prepare_prerequisites (instance method)">- (Object) <strong>prepare_prerequisites</strong> </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+ <span class="summary_desc"><div class='inline'></div></span>
168
+
169
+ </li>
170
+
171
+
172
+ </ul>
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Files.html" title="Sprout::Executable::Files (class)">Files</a></span></h3>
184
+ <p class="inherited"><span class='object_link'><a href="Files.html#to_shell_value-instance_method" title="Sprout::Executable::Files#to_shell_value (method)">#to_shell_value</a></span></p>
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="CollectionParam.html" title="Sprout::Executable::CollectionParam (module)">CollectionParam</a></span></h3>
194
+ <p class="inherited"><span class='object_link'><a href="CollectionParam.html#initialize-instance_method" title="Sprout::Executable::CollectionParam#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="CollectionParam.html#to_shell-instance_method" title="Sprout::Executable::CollectionParam#to_shell (method)">#to_shell</a></span>, <span class='object_link'><a href="CollectionParam.html#to_shell_value-instance_method" title="Sprout::Executable::CollectionParam#to_shell_value (method)">#to_shell_value</a></span>, <span class='object_link'><a href="CollectionParam.html#value%3D-instance_method" title="Sprout::Executable::CollectionParam#value= (method)">#value=</a></span>, <span class='object_link'><a href="CollectionParam.html#visible%3F-instance_method" title="Sprout::Executable::CollectionParam#visible? (method)">#visible?</a></span></p>
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></h3>
204
+ <p class="inherited"><span class='object_link'><a href="Param.html#clean_path-instance_method" title="Sprout::Executable::Param#clean_path (method)">#clean_path</a></span>, <span class='object_link'><a href="Param.html#default-instance_method" title="Sprout::Executable::Param#default (method)">#default</a></span>, <span class='object_link'><a href="Param.html#default%3D-instance_method" title="Sprout::Executable::Param#default= (method)">#default=</a></span>, <span class='object_link'><a href="Param.html#default_option_parser_declaration-instance_method" title="Sprout::Executable::Param#default_option_parser_declaration (method)">#default_option_parser_declaration</a></span>, <span class='object_link'><a href="Param.html#file_is_output%3F-instance_method" title="Sprout::Executable::Param#file_is_output? (method)">#file_is_output?</a></span>, <span class='object_link'><a href="Param.html#hidden_name%3F-instance_method" title="Sprout::Executable::Param#hidden_name? (method)">#hidden_name?</a></span>, <span class='object_link'><a href="Param.html#hidden_value%3F-instance_method" title="Sprout::Executable::Param#hidden_value? (method)">#hidden_value?</a></span>, <span class='object_link'><a href="Param.html#initialize-instance_method" title="Sprout::Executable::Param#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Param.html#option_parser_declaration-instance_method" title="Sprout::Executable::Param#option_parser_declaration (method)">#option_parser_declaration</a></span>, <span class='object_link'><a href="Param.html#option_parser_name-instance_method" title="Sprout::Executable::Param#option_parser_name (method)">#option_parser_name</a></span>, <span class='object_link'><a href="Param.html#option_parser_short_name-instance_method" title="Sprout::Executable::Param#option_parser_short_name (method)">#option_parser_short_name</a></span>, <span class='object_link'><a href="Param.html#option_parser_type_name-instance_method" title="Sprout::Executable::Param#option_parser_type_name (method)">#option_parser_type_name</a></span>, <span class='object_link'><a href="Param.html#option_parser_type_output-instance_method" title="Sprout::Executable::Param#option_parser_type_output (method)">#option_parser_type_output</a></span>, <span class='object_link'><a href="Param.html#prepare-instance_method" title="Sprout::Executable::Param#prepare (method)">#prepare</a></span>, <span class='object_link'><a href="Param.html#prepared%3F-instance_method" title="Sprout::Executable::Param#prepared? (method)">#prepared?</a></span>, <span class='object_link'><a href="Param.html#required%3F-instance_method" title="Sprout::Executable::Param#required? (method)">#required?</a></span>, <span class='object_link'><a href="Param.html#shell_value-instance_method" title="Sprout::Executable::Param#shell_value (method)">#shell_value</a></span>, <span class='object_link'><a href="Param.html#short_prefix-instance_method" title="Sprout::Executable::Param#short_prefix (method)">#short_prefix</a></span>, <span class='object_link'><a href="Param.html#to_rdoc-instance_method" title="Sprout::Executable::Param#to_rdoc (method)">#to_rdoc</a></span>, <span class='object_link'><a href="Param.html#to_shell-instance_method" title="Sprout::Executable::Param#to_shell (method)">#to_shell</a></span>, <span class='object_link'><a href="Param.html#validate-instance_method" title="Sprout::Executable::Param#validate (method)">#validate</a></span>, <span class='object_link'><a href="Param.html#visible%3F-instance_method" title="Sprout::Executable::Param#visible? (method)">#visible?</a></span></p>
205
+ <div id="constructor_details" class="method_details_list">
206
+ <h2>Constructor Details</h2>
207
+
208
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="CollectionParam.html#initialize-instance_method" title="Sprout::Executable::CollectionParam#initialize (method)">Sprout::Executable::CollectionParam</a></span></p>
209
+
210
+ </div>
211
+
212
+
213
+ <div id="instance_method_details" class="method_details_list">
214
+ <h2>Instance Method Details</h2>
215
+
216
+
217
+ <div class="method_details first">
218
+ <p class="signature first" id="prepare_prerequisites-instance_method">
219
+
220
+ - (<tt>Object</tt>) <strong>prepare_prerequisites</strong>
221
+
222
+
223
+
224
+ </p><table class="source_code">
225
+ <tr>
226
+ <td>
227
+ <pre class="lines">
228
+
229
+
230
+ 14
231
+ 15
232
+ 16
233
+ 17
234
+ 18
235
+ 19
236
+ 20
237
+ 21
238
+ 22</pre>
239
+ </td>
240
+ <td>
241
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/paths.rb', line 14</span>
242
+
243
+ <span class='kw'>def</span> <span class='id identifier rubyid_prepare_prerequisites'>prepare_prerequisites</span>
244
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
245
+ <span class='id identifier rubyid_files'>files</span> <span class='op'>=</span> <span class='const'>FileList</span><span class='lbracket'>[</span><span class='id identifier rubyid_path'>path</span> <span class='op'>+</span> <span class='id identifier rubyid_file_expression'>file_expression</span><span class='rbracket'>]</span>
246
+ <span class='id identifier rubyid_files'>files</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
247
+ <span class='const'>Rake</span><span class='op'>::</span><span class='const'>FileTask</span><span class='period'>.</span><span class='id identifier rubyid_define_task'>define_task</span> <span class='id identifier rubyid_f'>f</span>
248
+ <span class='id identifier rubyid_belongs_to'>belongs_to</span><span class='period'>.</span><span class='id identifier rubyid_prerequisites'>prerequisites</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_f'>f</span>
249
+ <span class='kw'>end</span>
250
+ <span class='kw'>end</span>
251
+ <span class='kw'>end</span></pre>
252
+ </td>
253
+ </tr>
254
+ </table>
255
+ </div>
256
+
257
+ </div>
258
+
259
+ </div>
260
+
261
+ <div id="footer">
262
+ Generated on Sun Mar 11 14:30:33 2012 by
263
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
264
+ 0.7.5 (ruby-1.9.2).
265
+ </div>
266
+
267
+ </body>
268
+ </html>
@@ -0,0 +1,1587 @@
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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Sprout::Executable::Session
8
+
9
+ &mdash; Sprouts v.1.0.34.pre
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '../..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../../_index.html">Index (S)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../../Sprout.html" title="Sprout (module)">Sprout</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Executable.html" title="Sprout::Executable (module)">Executable</a></span></span>
38
+ &raquo;
39
+ <span class="title">Session</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Class: Sprout::Executable::Session
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+ <dt class="r1">Inherits:</dt>
68
+ <dd class="r1">
69
+ <span class="inheritName"><span class='object_link'><a href="Base.html" title="Sprout::Executable::Base (class)">Base</a></span></span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next"><span class='object_link'><a href="Base.html" title="Sprout::Executable::Base (class)">Base</a></span></li>
75
+
76
+ <li class="next">Sprout::Executable::Session</li>
77
+
78
+ </ul>
79
+ <a href="#" class="inheritanceTree">show all</a>
80
+
81
+ </dd>
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+ <dt class="r2 last">Defined in:</dt>
92
+ <dd class="r2 last">lib/sprout/executable/session.rb</dd>
93
+
94
+ </dl>
95
+ <div class="clear"></div>
96
+
97
+ <h2>Overview</h2><div class="docstring">
98
+ <div class="discussion">
99
+ <p>
100
+ The Sprout::Daemon class exposes the Domain Specific Language provided by
101
+ the Sprout::Executable, along with enhancements (and modifications) to
102
+ support long-lived processes (like FDB and FCSH).
103
+ </p>
104
+ <pre class="code ruby"><code>
105
+ <span class='comment'>##
106
+ </span> <span class='comment'># The Foo class extends Sprout::Daemon
107
+ </span> <span class='kw'>class</span> <span class='const'>Foo</span> <span class='op'>&lt;</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Daemon</span>
108
+
109
+ <span class='comment'>##
110
+ </span> <span class='comment'># Keep in mind that we're still working
111
+ </span> <span class='comment'># with Executable, so add_param is available
112
+ </span> <span class='comment'># for the initialization of the process.
113
+ </span> <span class='id identifier rubyid_add_param'>add_param</span> <span class='symbol'>:input</span><span class='comma'>,</span> <span class='const'>File</span>
114
+
115
+ <span class='comment'>##
116
+ </span> <span class='comment'># Expose the do_something action after
117
+ </span> <span class='comment'># the process is started.
118
+ </span> <span class='id identifier rubyid_add_action'>add_action</span> <span class='symbol'>:do_something</span>
119
+
120
+ <span class='comment'>##
121
+ </span> <span class='comment'># Expose the do_something_else action after
122
+ </span> <span class='comment'># the process is started.
123
+ </span> <span class='id identifier rubyid_add_action'>add_action</span> <span class='symbol'>:do_something_else</span>
124
+ <span class='kw'>end</span>
125
+ </code></pre>
126
+ <p>
127
+ You can also create a globally-accessible rake task to use your new Daemon
128
+ instance by creating a method like the following:
129
+ </p>
130
+ <pre class="code ruby"><code>
131
+ <span class='kw'>def</span> <span class='id identifier rubyid_foo'>foo</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span>
132
+ <span class='id identifier rubyid_foo_tool'>foo_tool</span> <span class='op'>=</span> <span class='const'>Foo</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
133
+ <span class='id identifier rubyid_foo_tool'>foo_tool</span><span class='period'>.</span><span class='id identifier rubyid_to_rake'>to_rake</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span>
134
+ <span class='kw'>end</span>
135
+ </code></pre>
136
+ <p>
137
+ The previous Rake task could be used like:
138
+ </p>
139
+ <pre class="code ruby"><code>
140
+ <span class='id identifier rubyid_foo'>foo</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Bar.txt</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_t'>t</span><span class='op'>|</span>
141
+ <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_do_something'>do_something</span>
142
+ <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_do_something_else'>do_something_else</span>
143
+ <span class='kw'>end</span></code></pre>
144
+
145
+
146
+ </div>
147
+ </div>
148
+ <div class="tags">
149
+
150
+
151
+ </div>
152
+ <h2>Constant Summary</h2>
153
+
154
+
155
+
156
+
157
+ <h2>Constant Summary</h2>
158
+
159
+ <h3 class="inherited">Constants included
160
+ from <span class='object_link'><a href="../Executable.html" title="Sprout::Executable (module)">Sprout::Executable</a></span></h3>
161
+ <p class="inherited"><span class='object_link'><a href="../Executable.html#DEFAULT_FILE_EXPRESSION-constant" title="Sprout::Executable::DEFAULT_FILE_EXPRESSION (constant)">DEFAULT_FILE_EXPRESSION</a></span>, <span class='object_link'><a href="../Executable.html#DEFAULT_PREFIX-constant" title="Sprout::Executable::DEFAULT_PREFIX (constant)">DEFAULT_PREFIX</a></span>, <span class='object_link'><a href="../Executable.html#DEFAULT_SHORT_PREFIX-constant" title="Sprout::Executable::DEFAULT_SHORT_PREFIX (constant)">DEFAULT_SHORT_PREFIX</a></span></p>
162
+
163
+
164
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
165
+ <ul class="summary">
166
+
167
+ <li class="public ">
168
+ <span class="summary_signature">
169
+
170
+ <a href="#process_runner-instance_method" title="#process_runner (instance method)">- (Object) <strong>process_runner</strong> </a>
171
+
172
+
173
+
174
+ </span>
175
+
176
+
177
+ <span class="note title readonly">readonly</span>
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+ <span class="summary_desc"><div class='inline'><p>
187
+ The Sprout::ProcessRunner that delegates to the long-running process, via
188
+ stdin, stdout and stderr.
189
+ </p>
190
+ </div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#process_thread-instance_method" title="#process_thread (instance method)">- (Object) <strong>process_thread</strong> </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+ <span class="note title readonly">readonly</span>
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+ <span class="summary_desc"><div class='inline'><p>
215
+ The Thread that contains the forked running process.
216
+ </p>
217
+ </div></span>
218
+
219
+ </li>
220
+
221
+
222
+ <li class="public ">
223
+ <span class="summary_signature">
224
+
225
+ <a href="#prompt-instance_method" title="#prompt (instance method)">- (Regexp) <strong>prompt</strong> </a>
226
+
227
+
228
+
229
+ </span>
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+ <span class="summary_desc"><div class='inline'><p>
242
+ The prompt expression for this daemon process.
243
+ </p>
244
+ </div></span>
245
+
246
+ </li>
247
+
248
+
249
+ </ul>
250
+
251
+
252
+
253
+
254
+
255
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Sprout::Executable::Base (class)">Base</a></span></h3>
256
+ <p class="inherited"><span class='object_link'><a href="Base.html#abort_on_failure-instance_method" title="Sprout::Executable::Base#abort_on_failure (method)">#abort_on_failure</a></span>, <span class='object_link'><a href="Base.html#default_prefix-instance_method" title="Sprout::Executable::Base#default_prefix (method)">#default_prefix</a></span>, <span class='object_link'><a href="Base.html#default_short_prefix-instance_method" title="Sprout::Executable::Base#default_short_prefix (method)">#default_short_prefix</a></span>, <span class='object_link'><a href="Base.html#executable-instance_method" title="Sprout::Executable::Base#executable (method)">#executable</a></span>, <span class='object_link'><a href="Base.html#param_hash-instance_method" title="Sprout::Executable::Base#param_hash (method)">#param_hash</a></span>, <span class='object_link'><a href="Base.html#params-instance_method" title="Sprout::Executable::Base#params (method)">#params</a></span>, <span class='object_link'><a href="Base.html#pkg_name-instance_method" title="Sprout::Executable::Base#pkg_name (method)">#pkg_name</a></span>, <span class='object_link'><a href="Base.html#pkg_version-instance_method" title="Sprout::Executable::Base#pkg_version (method)">#pkg_version</a></span>, <span class='object_link'><a href="Base.html#prerequisites-instance_method" title="Sprout::Executable::Base#prerequisites (method)">#prerequisites</a></span>, <span class='object_link'><a href="Base.html#rake_task_name-instance_method" title="Sprout::Executable::Base#rake_task_name (method)">#rake_task_name</a></span></p>
257
+
258
+
259
+
260
+ <h2>
261
+ Class Method Summary
262
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
263
+ </h2>
264
+
265
+ <ul class="summary">
266
+
267
+ <li class="public ">
268
+ <span class="summary_signature">
269
+
270
+ <a href="#add_action-class_method" title="add_action (class method)">+ (nil) <strong>add_action</strong>(name, arguments = nil, options = nil) </a>
271
+
272
+
273
+
274
+ </span>
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+ <span class="summary_desc"><div class='inline'><p>
284
+ Add an action that can be called while the long-lived process is active.
285
+ </p>
286
+ </div></span>
287
+
288
+ </li>
289
+
290
+
291
+ <li class="public ">
292
+ <span class="summary_signature">
293
+
294
+ <a href="#add_action_alias-class_method" title="add_action_alias (class method)">+ (nil) <strong>add_action_alias</strong>(alias_name, source_name) </a>
295
+
296
+
297
+
298
+ </span>
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+ <span class="summary_desc"><div class='inline'><p>
308
+ Create an (often shorter) alias to an existing action name.
309
+ </p>
310
+ </div></span>
311
+
312
+ </li>
313
+
314
+
315
+ </ul>
316
+
317
+ <h2>
318
+ Instance Method Summary
319
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
320
+ </h2>
321
+
322
+ <ul class="summary">
323
+
324
+ <li class="public ">
325
+ <span class="summary_signature">
326
+
327
+ <a href="#action_stack-instance_method" title="#action_stack (instance method)">- (Array&lt;Hash&gt;) <strong>action_stack</strong> </a>
328
+
329
+
330
+
331
+ </span>
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+ <span class="summary_desc"><div class='inline'><p>
341
+ Return or create a new array.
342
+ </p>
343
+ </div></span>
344
+
345
+ </li>
346
+
347
+
348
+ <li class="protected ">
349
+ <span class="summary_signature">
350
+
351
+ <a href="#create_outer_task-instance_method" title="#create_outer_task (instance method)">- (Rake::Task) <strong>create_outer_task</strong>(*args) </a>
352
+
353
+
354
+
355
+ </span>
356
+
357
+
358
+ <span class="note title protected">protected</span>
359
+
360
+
361
+
362
+
363
+
364
+ <span class="summary_desc"><div class='inline'><p>
365
+ This is the override of the underlying Sprout::Executable template method
366
+ so that we create a &#8216;task&#8217; instead of a &#8216;file&#8217;
367
+ task.
368
+ </p>
369
+ </div></span>
370
+
371
+ </li>
372
+
373
+
374
+ <li class="public ">
375
+ <span class="summary_signature">
376
+
377
+ <a href="#execute-instance_method" title="#execute (instance method)">- (Object) <strong>execute</strong>(should_wait = true) </a>
378
+
379
+
380
+
381
+ </span>
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+ <span class="summary_desc"><div class='inline'><p>
391
+ Execute the Daemon executable, followed by the collection of stored actions
392
+ in the order they were called.
393
+ </p>
394
+ </div></span>
395
+
396
+ </li>
397
+
398
+
399
+ <li class="public ">
400
+ <span class="summary_signature">
401
+
402
+ <a href="#handle_user_input-instance_method" title="#handle_user_input (instance method)">- (Object) <strong>handle_user_input</strong> </a>
403
+
404
+
405
+
406
+ </span>
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+ <span class="summary_desc"><div class='inline'><p>
416
+ Expose the running process to manual input on the terminal, and write
417
+ stdout back to the user.
418
+ </p>
419
+ </div></span>
420
+
421
+ </li>
422
+
423
+
424
+ <li class="protected ">
425
+ <span class="summary_signature">
426
+
427
+ <a href="#process_launched%3F-instance_method" title="#process_launched? (instance method)">- (Boolean) <strong>process_launched?</strong> </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'></div></span>
441
+
442
+ </li>
443
+
444
+
445
+ <li class="public ">
446
+ <span class="summary_signature">
447
+
448
+ <a href="#prompted%3F-instance_method" title="#prompted? (instance method)">- (Boolean) <strong>prompted?</strong> </a>
449
+
450
+
451
+
452
+ </span>
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+ <span class="summary_desc"><div class='inline'><p>
462
+ If executable is awaiting input.
463
+ </p>
464
+ </div></span>
465
+
466
+ </li>
467
+
468
+
469
+ <li class="protected ">
470
+ <span class="summary_signature">
471
+
472
+ <a href="#system_execute-instance_method" title="#system_execute (instance method)">- (Thread) <strong>system_execute</strong>(binary, params) </a>
473
+
474
+
475
+
476
+ </span>
477
+
478
+
479
+ <span class="note title protected">protected</span>
480
+
481
+
482
+
483
+
484
+
485
+ <span class="summary_desc"><div class='inline'><p>
486
+ This is the override of the underlying Sprout::Executable template method
487
+ so that we create the process in a thread in order to read and write to
488
+ it.
489
+ </p>
490
+ </div></span>
491
+
492
+ </li>
493
+
494
+
495
+ <li class="protected ">
496
+ <span class="summary_signature">
497
+
498
+ <a href="#update_rake_task_name_from_args-instance_method" title="#update_rake_task_name_from_args (instance method)">- (String) <strong>update_rake_task_name_from_args</strong>(*args) </a>
499
+
500
+
501
+
502
+ </span>
503
+
504
+
505
+ <span class="note title protected">protected</span>
506
+
507
+
508
+
509
+
510
+
511
+ <span class="summary_desc"><div class='inline'><p>
512
+ This is the override of the underlying Sprout::Executable template method
513
+ so that we are NOT added to the CLEAN collection.
514
+ </p>
515
+ </div></span>
516
+
517
+ </li>
518
+
519
+
520
+ <li class="public ">
521
+ <span class="summary_signature">
522
+
523
+ <a href="#wait-instance_method" title="#wait (instance method)">- (Object) <strong>wait</strong> </a>
524
+
525
+
526
+
527
+ </span>
528
+
529
+
530
+
531
+
532
+
533
+
534
+
535
+
536
+ <span class="summary_desc"><div class='inline'></div></span>
537
+
538
+ </li>
539
+
540
+
541
+ <li class="public ">
542
+ <span class="summary_signature">
543
+
544
+ <a href="#wait_for_prompt-instance_method" title="#wait_for_prompt (instance method)">- (Object) <strong>wait_for_prompt</strong> </a>
545
+
546
+
547
+
548
+ </span>
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+ <span class="summary_desc"><div class='inline'><p>
558
+ Wait for the underlying process to present an input prompt, so that another
559
+ action can be submitted, or user input can be collected.
560
+ </p>
561
+ </div></span>
562
+
563
+ </li>
564
+
565
+
566
+ </ul>
567
+
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Sprout::Executable::Base (class)">Base</a></span></h3>
578
+ <p class="inherited"><span class='object_link'><a href="Base.html#add_param-class_method" title="Sprout::Executable::Base.add_param (method)">add_param</a></span>, <span class='object_link'><a href="Base.html#add_param_alias-class_method" title="Sprout::Executable::Base.add_param_alias (method)">add_param_alias</a></span>, <span class='object_link'><a href="Base.html#binary_path-instance_method" title="Sprout::Executable::Base#binary_path (method)">#binary_path</a></span>, <span class='object_link'><a href="Base.html#binary_path%3D-instance_method" title="Sprout::Executable::Base#binary_path= (method)">#binary_path=</a></span>, <span class='object_link'><a href="Base.html#default_file_expression-instance_method" title="Sprout::Executable::Base#default_file_expression (method)">#default_file_expression</a></span>, <span class='object_link'><a href="Base.html#execute_delegate-instance_method" title="Sprout::Executable::Base#execute_delegate (method)">#execute_delegate</a></span>, <span class='object_link'><a href="Base.html#from_hash-instance_method" title="Sprout::Executable::Base#from_hash (method)">#from_hash</a></span>, <span class='object_link'><a href="Base.html#initialize-instance_method" title="Sprout::Executable::Base#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Base.html#initialize_defaults-instance_method" title="Sprout::Executable::Base#initialize_defaults (method)">#initialize_defaults</a></span>, <span class='object_link'><a href="Base.html#library_added-instance_method" title="Sprout::Executable::Base#library_added (method)">#library_added</a></span>, <span class='object_link'><a href="Base.html#parse%21-instance_method" title="Sprout::Executable::Base#parse! (method)">#parse!</a></span>, <span class='object_link'><a href="Base.html#parse_extra_options%21-instance_method" title="Sprout::Executable::Base#parse_extra_options! (method)">#parse_extra_options!</a></span>, <span class='object_link'><a href="Base.html#parse_rake_task_arg-instance_method" title="Sprout::Executable::Base#parse_rake_task_arg (method)">#parse_rake_task_arg</a></span>, <span class='object_link'><a href="Base.html#prepare-instance_method" title="Sprout::Executable::Base#prepare (method)">#prepare</a></span>, <span class='object_link'><a href="Base.html#set-class_method" title="Sprout::Executable::Base.set (method)">set</a></span>, <span class='object_link'><a href="Base.html#static_default_value_collection-class_method" title="Sprout::Executable::Base.static_default_value_collection (method)">static_default_value_collection</a></span>, <span class='object_link'><a href="Base.html#static_parameter_collection-class_method" title="Sprout::Executable::Base.static_parameter_collection (method)">static_parameter_collection</a></span>, <span class='object_link'><a href="Base.html#stderr-instance_method" title="Sprout::Executable::Base#stderr (method)">#stderr</a></span>, <span class='object_link'><a href="Base.html#stderr%3D-instance_method" title="Sprout::Executable::Base#stderr= (method)">#stderr=</a></span>, <span class='object_link'><a href="Base.html#stdout-instance_method" title="Sprout::Executable::Base#stdout (method)">#stdout</a></span>, <span class='object_link'><a href="Base.html#stdout%3D-instance_method" title="Sprout::Executable::Base#stdout= (method)">#stdout=</a></span>, <span class='object_link'><a href="Base.html#to_hash-instance_method" title="Sprout::Executable::Base#to_hash (method)">#to_hash</a></span>, <span class='object_link'><a href="Base.html#to_help-instance_method" title="Sprout::Executable::Base#to_help (method)">#to_help</a></span>, <span class='object_link'><a href="Base.html#to_rake-instance_method" title="Sprout::Executable::Base#to_rake (method)">#to_rake</a></span>, <span class='object_link'><a href="Base.html#to_shell-instance_method" title="Sprout::Executable::Base#to_shell (method)">#to_shell</a></span></p>
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="../Concern.html" title="Sprout::Concern (module)">Concern</a></span></h3>
598
+ <p class="inherited"><span class='object_link'><a href="../Concern.html#append_features-instance_method" title="Sprout::Concern#append_features (method)">#append_features</a></span>, <span class='object_link'><a href="../Concern.html#extended-class_method" title="Sprout::Concern.extended (method)">extended</a></span>, <span class='object_link'><a href="../Concern.html#included-instance_method" title="Sprout::Concern#included (method)">#included</a></span></p>
599
+ <div id="constructor_details" class="method_details_list">
600
+ <h2>Constructor Details</h2>
601
+
602
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="Sprout::Executable::Base#initialize (method)">Sprout::Executable::Base</a></span></p>
603
+
604
+ </div>
605
+
606
+ <div id="instance_attr_details" class="attr_details">
607
+ <h2>Instance Attribute Details</h2>
608
+
609
+
610
+ <span id=""></span>
611
+ <span id="process_runner-instance_method"></span>
612
+ <div class="method_details first">
613
+ <p class="signature first" id="process_runner-instance_method">
614
+
615
+ - (<tt>Object</tt>) <strong>process_runner</strong> <span class="extras">(readonly)</span>
616
+
617
+
618
+
619
+ </p><div class="docstring">
620
+ <div class="discussion">
621
+ <p>
622
+ The Sprout::ProcessRunner that delegates to the long-running process, via
623
+ stdin, stdout and stderr.
624
+ </p>
625
+
626
+
627
+ </div>
628
+ </div>
629
+ <div class="tags">
630
+
631
+
632
+ </div><table class="source_code">
633
+ <tr>
634
+ <td>
635
+ <pre class="lines">
636
+
637
+
638
+ 148
639
+ 149
640
+ 150</pre>
641
+ </td>
642
+ <td>
643
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 148</span>
644
+
645
+ <span class='kw'>def</span> <span class='id identifier rubyid_process_runner'>process_runner</span>
646
+ <span class='ivar'>@process_runner</span>
647
+ <span class='kw'>end</span></pre>
648
+ </td>
649
+ </tr>
650
+ </table>
651
+ </div>
652
+
653
+
654
+ <span id=""></span>
655
+ <span id="process_thread-instance_method"></span>
656
+ <div class="method_details ">
657
+ <p class="signature " id="process_thread-instance_method">
658
+
659
+ - (<tt>Object</tt>) <strong>process_thread</strong> <span class="extras">(readonly)</span>
660
+
661
+
662
+
663
+ </p><div class="docstring">
664
+ <div class="discussion">
665
+ <p>
666
+ The Thread that contains the forked running process.
667
+ </p>
668
+
669
+
670
+ </div>
671
+ </div>
672
+ <div class="tags">
673
+
674
+
675
+ </div><table class="source_code">
676
+ <tr>
677
+ <td>
678
+ <pre class="lines">
679
+
680
+
681
+ 152
682
+ 153
683
+ 154</pre>
684
+ </td>
685
+ <td>
686
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 152</span>
687
+
688
+ <span class='kw'>def</span> <span class='id identifier rubyid_process_thread'>process_thread</span>
689
+ <span class='ivar'>@process_thread</span>
690
+ <span class='kw'>end</span></pre>
691
+ </td>
692
+ </tr>
693
+ </table>
694
+ </div>
695
+
696
+
697
+ <span id="prompt=-instance_method"></span>
698
+ <span id="prompt-instance_method"></span>
699
+ <div class="method_details ">
700
+ <p class="signature " id="prompt-instance_method">
701
+
702
+ - (<tt>Regexp</tt>) <strong>prompt</strong>
703
+
704
+
705
+
706
+ </p><div class="docstring">
707
+ <div class="discussion">
708
+ <p>
709
+ The prompt expression for this daemon process.
710
+ </p>
711
+ <p>
712
+ When executing a series of commands, the wrapper will wait until it matches
713
+ this expression on stdout before continuing the series.
714
+ </p>
715
+ <p>
716
+ For FDB, this value is set like:
717
+ </p>
718
+ <pre class="code ruby"><code>
719
+ <span class='id identifier rubyid_set'>set</span> <span class='symbol'>:prompt</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\(fdb\) </span><span class='regexp_end'>/</span></span>
720
+ </code></pre>
721
+ <p>
722
+ Most processes can trigger a variety of different prompts, these can be
723
+ expressed here using the | (or) operator.
724
+ </p>
725
+ <p>
726
+ FDB actually uses the following:
727
+ </p>
728
+ <pre class="code ruby"><code>
729
+ <span class='id identifier rubyid_set'>set</span> <span class='symbol'>:prompt</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\(fdb\) |\(y or n\) </span><span class='regexp_end'>/</span></span></code></pre>
730
+
731
+
732
+ </div>
733
+ </div>
734
+ <div class="tags">
735
+
736
+ <h3>Returns:</h3>
737
+ <ul class="return">
738
+
739
+ <li>
740
+
741
+
742
+ <span class='type'>(<tt>Regexp</tt>)</span>
743
+
744
+
745
+
746
+ </li>
747
+
748
+ </ul>
749
+
750
+ </div><table class="source_code">
751
+ <tr>
752
+ <td>
753
+ <pre class="lines">
754
+
755
+
756
+ 142
757
+ 143
758
+ 144</pre>
759
+ </td>
760
+ <td>
761
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 142</span>
762
+
763
+ <span class='kw'>def</span> <span class='id identifier rubyid_prompt'>prompt</span>
764
+ <span class='ivar'>@prompt</span>
765
+ <span class='kw'>end</span></pre>
766
+ </td>
767
+ </tr>
768
+ </table>
769
+ </div>
770
+
771
+ </div>
772
+
773
+
774
+ <div id="class_method_details" class="method_details_list">
775
+ <h2>Class Method Details</h2>
776
+
777
+
778
+ <div class="method_details first">
779
+ <p class="signature first" id="add_action-class_method">
780
+
781
+ + (<tt>nil</tt>) <strong>add_action</strong>(name, arguments = nil, options = nil)
782
+
783
+
784
+
785
+ </p><div class="docstring">
786
+ <div class="discussion">
787
+ <p>
788
+ Add an action that can be called while the long-lived process is active.
789
+ </p>
790
+ <p>
791
+ This method should raise a Sprout::Errors::UsageError if the provided
792
+ action name is already defined for the provided instance.
793
+ </p>
794
+
795
+
796
+ </div>
797
+ </div>
798
+ <div class="tags">
799
+ <h3>Parameters:</h3>
800
+ <ul class="param">
801
+
802
+ <li>
803
+
804
+ <span class='name'>name</span>
805
+
806
+
807
+ <span class='type'>(<tt>Symbol</tt>, <tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
808
+
809
+
810
+
811
+ &mdash;
812
+ <div class='inline'><p>
813
+ The name of the method.
814
+ </p>
815
+ </div>
816
+
817
+ </li>
818
+
819
+ <li>
820
+
821
+ <span class='name'>arguments</span>
822
+
823
+
824
+ <span class='type'>(<tt>Array&lt;Object&gt;</tt>)</span>
825
+
826
+
827
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
828
+
829
+
830
+ &mdash;
831
+ <div class='inline'><p>
832
+ An array of arguments that the method accepts.
833
+ </p>
834
+ </div>
835
+
836
+ </li>
837
+
838
+ <li>
839
+
840
+ <span class='name'>options</span>
841
+
842
+
843
+ <span class='type'>(<tt>Hash</tt>)</span>
844
+
845
+
846
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
847
+
848
+
849
+ &mdash;
850
+ <div class='inline'><p>
851
+ The options hash is reserved for future use.
852
+ </p>
853
+ <p>
854
+ class Foo < Sprout::Daemon
855
+ </p>
856
+ <pre class="code ruby"><code>
857
+ <span class='id identifier rubyid_add_action'>add_action</span> <span class='symbol'>:continue</span>
858
+
859
+ <span class='id identifier rubyid_add_action'>add_action</span> <span class='symbol'>:quit</span>
860
+ </code></pre>
861
+ <p>
862
+ end
863
+ </p>
864
+ </div>
865
+
866
+ </li>
867
+
868
+ </ul>
869
+
870
+ <h3>Returns:</h3>
871
+ <ul class="return">
872
+
873
+ <li>
874
+
875
+
876
+ <span class='type'>(<tt>nil</tt>)</span>
877
+
878
+
879
+
880
+ </li>
881
+
882
+ </ul>
883
+
884
+ </div><table class="source_code">
885
+ <tr>
886
+ <td>
887
+ <pre class="lines">
888
+
889
+
890
+ 70
891
+ 71
892
+ 72
893
+ 73
894
+ 74
895
+ 75
896
+ 76</pre>
897
+ </td>
898
+ <td>
899
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 70</span>
900
+
901
+ <span class='kw'>def</span> <span class='id identifier rubyid_add_action'>add_action</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='kw'>nil</span>
902
+ <span class='id identifier rubyid_options'>options</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
903
+ <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
904
+ <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:arguments</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span>
905
+ <span class='id identifier rubyid_create_action_method'>create_action_method</span> <span class='id identifier rubyid_options'>options</span>
906
+ <span class='kw'>nil</span>
907
+ <span class='kw'>end</span></pre>
908
+ </td>
909
+ </tr>
910
+ </table>
911
+ </div>
912
+
913
+ <div class="method_details ">
914
+ <p class="signature " id="add_action_alias-class_method">
915
+
916
+ + (<tt>nil</tt>) <strong>add_action_alias</strong>(alias_name, source_name)
917
+
918
+
919
+
920
+ </p><div class="docstring">
921
+ <div class="discussion">
922
+ <p>
923
+ Create an (often shorter) alias to an existing action name.
924
+ </p>
925
+
926
+
927
+ </div>
928
+ </div>
929
+ <div class="tags">
930
+
931
+ <h3>Returns:</h3>
932
+ <ul class="return">
933
+
934
+ <li>
935
+
936
+
937
+ <span class='type'>(<tt>nil</tt>)</span>
938
+
939
+
940
+
941
+ </li>
942
+
943
+ </ul>
944
+
945
+ <h3>See Also:</h3>
946
+ <ul class="see">
947
+
948
+ <li><span class='object_link'><a href="#add_action-class_method" title="Sprout::Executable::Session.add_action (method)">add_action</a></span></li>
949
+
950
+ </ul>
951
+
952
+ </div><table class="source_code">
953
+ <tr>
954
+ <td>
955
+ <pre class="lines">
956
+
957
+
958
+ 85
959
+ 86
960
+ 87
961
+ 88
962
+ 89
963
+ 90</pre>
964
+ </td>
965
+ <td>
966
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 85</span>
967
+
968
+ <span class='kw'>def</span> <span class='id identifier rubyid_add_action_alias'>add_action_alias</span> <span class='id identifier rubyid_alias_name'>alias_name</span><span class='comma'>,</span> <span class='id identifier rubyid_source_name'>source_name</span>
969
+ <span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='id identifier rubyid_alias_name'>alias_name</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_params'>params</span><span class='op'>|</span>
970
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_source_name'>source_name</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
971
+ <span class='kw'>end</span>
972
+ <span class='kw'>nil</span>
973
+ <span class='kw'>end</span></pre>
974
+ </td>
975
+ </tr>
976
+ </table>
977
+ </div>
978
+
979
+ </div>
980
+
981
+ <div id="instance_method_details" class="method_details_list">
982
+ <h2>Instance Method Details</h2>
983
+
984
+
985
+ <div class="method_details first">
986
+ <p class="signature first" id="action_stack-instance_method">
987
+
988
+ - (<tt>Array&lt;Hash&gt;</tt>) <strong>action_stack</strong>
989
+
990
+
991
+
992
+ </p><div class="docstring">
993
+ <div class="discussion">
994
+ <p>
995
+ Return or create a new array.
996
+ </p>
997
+
998
+
999
+ </div>
1000
+ </div>
1001
+ <div class="tags">
1002
+
1003
+ <h3>Returns:</h3>
1004
+ <ul class="return">
1005
+
1006
+ <li>
1007
+
1008
+
1009
+ <span class='type'>(<tt>Array&lt;Hash&gt;</tt>)</span>
1010
+
1011
+
1012
+
1013
+ &mdash;
1014
+ <div class='inline'><p>
1015
+ Return or create a new array.
1016
+ </p>
1017
+ </div>
1018
+
1019
+ </li>
1020
+
1021
+ </ul>
1022
+
1023
+ </div><table class="source_code">
1024
+ <tr>
1025
+ <td>
1026
+ <pre class="lines">
1027
+
1028
+
1029
+ 156
1030
+ 157
1031
+ 158</pre>
1032
+ </td>
1033
+ <td>
1034
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 156</span>
1035
+
1036
+ <span class='kw'>def</span> <span class='id identifier rubyid_action_stack'>action_stack</span>
1037
+ <span class='ivar'>@action_stack</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1038
+ <span class='kw'>end</span></pre>
1039
+ </td>
1040
+ </tr>
1041
+ </table>
1042
+ </div>
1043
+
1044
+ <div class="method_details ">
1045
+ <p class="signature " id="create_outer_task-instance_method">
1046
+
1047
+ - (<tt><span class='object_link'><a href="../../Rake/Task.html" title="Rake::Task (class)">Rake::Task</a></span></tt>) <strong>create_outer_task</strong>(*args) <span class="extras">(protected)</span>
1048
+
1049
+
1050
+
1051
+ </p><div class="docstring">
1052
+ <div class="discussion">
1053
+ <p>
1054
+ This is the override of the underlying Sprout::Executable template method
1055
+ so that we create a &#8216;task&#8217; instead of a &#8216;file&#8217;
1056
+ task.
1057
+ </p>
1058
+
1059
+
1060
+ </div>
1061
+ </div>
1062
+ <div class="tags">
1063
+
1064
+ <h3>Returns:</h3>
1065
+ <ul class="return">
1066
+
1067
+ <li>
1068
+
1069
+
1070
+ <span class='type'>(<tt><span class='object_link'><a href="../../Rake/Task.html" title="Rake::Task (class)">Rake::Task</a></span></tt>)</span>
1071
+
1072
+
1073
+
1074
+ </li>
1075
+
1076
+ </ul>
1077
+
1078
+ </div><table class="source_code">
1079
+ <tr>
1080
+ <td>
1081
+ <pre class="lines">
1082
+
1083
+
1084
+ 250
1085
+ 251
1086
+ 252
1087
+ 253
1088
+ 254</pre>
1089
+ </td>
1090
+ <td>
1091
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 250</span>
1092
+
1093
+ <span class='kw'>def</span> <span class='id identifier rubyid_create_outer_task'>create_outer_task</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span>
1094
+ <span class='const'>Rake</span><span class='op'>::</span><span class='const'>Task</span><span class='period'>.</span><span class='id identifier rubyid_define_task'>define_task</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span> <span class='kw'>do</span>
1095
+ <span class='id identifier rubyid_execute'>execute</span>
1096
+ <span class='kw'>end</span>
1097
+ <span class='kw'>end</span></pre>
1098
+ </td>
1099
+ </tr>
1100
+ </table>
1101
+ </div>
1102
+
1103
+ <div class="method_details ">
1104
+ <p class="signature " id="execute-instance_method">
1105
+
1106
+ - (<tt>Object</tt>) <strong>execute</strong>(should_wait = true)
1107
+
1108
+
1109
+
1110
+ </p><div class="docstring">
1111
+ <div class="discussion">
1112
+ <p>
1113
+ Execute the Daemon executable, followed by the collection of stored actions
1114
+ in the order they were called.
1115
+ </p>
1116
+ <p>
1117
+ If none of the stored actions result in terminating the process, the
1118
+ underlying daemon will be connected to the terminal for user (manual)
1119
+ input.
1120
+ </p>
1121
+ <p>
1122
+ You can also send wait=false to connect to a daemon process from Ruby and
1123
+ execute actions over time. This might look like:
1124
+ </p>
1125
+ <pre class="code ruby"><code>
1126
+ <span class='id identifier rubyid_fdb'>fdb</span> <span class='op'>=</span> <span class='const'>FlashSDK</span><span class='op'>::</span><span class='const'>FDB</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1127
+ <span class='id identifier rubyid_fdb'>fdb</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span> <span class='kw'>false</span>
1128
+
1129
+ <span class='comment'># Do something else while FDB
1130
+ </span> <span class='comment'># is open, then:
1131
+ </span>
1132
+ <span class='id identifier rubyid_fdb'>fdb</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
1133
+ <span class='id identifier rubyid_fdb'>fdb</span><span class='period'>.</span><span class='id identifier rubyid_break'>break</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>AsUnitRunner:12</span><span class='tstring_end'>&quot;</span></span>
1134
+ <span class='id identifier rubyid_fdb'>fdb</span><span class='period'>.</span><span class='id identifier rubyid_continue'>continue</span>
1135
+ <span class='id identifier rubyid_fdb'>fdb</span><span class='period'>.</span><span class='id identifier rubyid_kill'>kill</span>
1136
+ <span class='id identifier rubyid_fdb'>fdb</span><span class='period'>.</span><span class='id identifier rubyid_confirm'>confirm</span>
1137
+ <span class='id identifier rubyid_fdb'>fdb</span><span class='period'>.</span><span class='id identifier rubyid_quit'>quit</span></code></pre>
1138
+
1139
+
1140
+ </div>
1141
+ </div>
1142
+ <div class="tags">
1143
+ <h3>Parameters:</h3>
1144
+ <ul class="param">
1145
+
1146
+ <li>
1147
+
1148
+ <span class='name'>wait</span>
1149
+
1150
+
1151
+ <span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
1152
+
1153
+
1154
+
1155
+ &mdash;
1156
+ <div class='inline'><p>
1157
+ default true. Send false to connect to a daemon from Ruby code.
1158
+ </p>
1159
+ </div>
1160
+
1161
+ </li>
1162
+
1163
+ </ul>
1164
+
1165
+
1166
+ </div><table class="source_code">
1167
+ <tr>
1168
+ <td>
1169
+ <pre class="lines">
1170
+
1171
+
1172
+ 196
1173
+ 197
1174
+ 198
1175
+ 199
1176
+ 200
1177
+ 201
1178
+ 202</pre>
1179
+ </td>
1180
+ <td>
1181
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 196</span>
1182
+
1183
+ <span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span> <span class='id identifier rubyid_should_wait'>should_wait</span><span class='op'>=</span><span class='kw'>true</span>
1184
+ <span class='ivar'>@process_runner</span> <span class='op'>=</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
1185
+ <span class='ivar'>@process_launched</span> <span class='op'>=</span> <span class='kw'>true</span>
1186
+ <span class='id identifier rubyid_wait_for_prompt'>wait_for_prompt</span>
1187
+ <span class='id identifier rubyid_execute_actions'>execute_actions</span>
1188
+ <span class='id identifier rubyid_handle_user_input'>handle_user_input</span> <span class='kw'>if</span> <span class='id identifier rubyid_should_wait'>should_wait</span>
1189
+ <span class='kw'>end</span></pre>
1190
+ </td>
1191
+ </tr>
1192
+ </table>
1193
+ </div>
1194
+
1195
+ <div class="method_details ">
1196
+ <p class="signature " id="handle_user_input-instance_method">
1197
+
1198
+ - (<tt>Object</tt>) <strong>handle_user_input</strong>
1199
+
1200
+
1201
+
1202
+ </p><div class="docstring">
1203
+ <div class="discussion">
1204
+ <p>
1205
+ Expose the running process to manual input on the terminal, and write
1206
+ stdout back to the user.
1207
+ </p>
1208
+
1209
+
1210
+ </div>
1211
+ </div>
1212
+ <div class="tags">
1213
+
1214
+
1215
+ </div><table class="source_code">
1216
+ <tr>
1217
+ <td>
1218
+ <pre class="lines">
1219
+
1220
+
1221
+ 225
1222
+ 226
1223
+ 227
1224
+ 228
1225
+ 229
1226
+ 230
1227
+ 231
1228
+ 232
1229
+ 233
1230
+ 234
1231
+ 235
1232
+ 236</pre>
1233
+ </td>
1234
+ <td>
1235
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 225</span>
1236
+
1237
+ <span class='kw'>def</span> <span class='id identifier rubyid_handle_user_input'>handle_user_input</span>
1238
+ <span class='kw'>while</span> <span class='kw'>true</span>
1239
+ <span class='kw'>begin</span>
1240
+ <span class='kw'>break</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_wait_for_prompt'>wait_for_prompt</span>
1241
+ <span class='id identifier rubyid_input'>input</span> <span class='op'>=</span> <span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_gets'>gets</span><span class='period'>.</span><span class='id identifier rubyid_chomp!'>chomp!</span>
1242
+ <span class='id identifier rubyid_execute_action'>execute_action</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
1243
+ <span class='kw'>rescue</span> <span class='const'>SignalException</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
1244
+ <span class='kw'>return</span> <span class='kw'>false</span>
1245
+ <span class='kw'>end</span>
1246
+ <span class='kw'>end</span>
1247
+ <span class='id identifier rubyid_wait'>wait</span>
1248
+ <span class='kw'>end</span></pre>
1249
+ </td>
1250
+ </tr>
1251
+ </table>
1252
+ </div>
1253
+
1254
+ <div class="method_details ">
1255
+ <p class="signature " id="process_launched?-instance_method">
1256
+
1257
+ - (<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>) <strong>process_launched?</strong> <span class="extras">(protected)</span>
1258
+
1259
+
1260
+
1261
+ </p><div class="docstring">
1262
+ <div class="discussion">
1263
+
1264
+
1265
+ </div>
1266
+ </div>
1267
+ <div class="tags">
1268
+
1269
+ <h3>Returns:</h3>
1270
+ <ul class="return">
1271
+
1272
+ <li>
1273
+
1274
+
1275
+ <span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
1276
+
1277
+
1278
+
1279
+ </li>
1280
+
1281
+ </ul>
1282
+
1283
+ </div><table class="source_code">
1284
+ <tr>
1285
+ <td>
1286
+ <pre class="lines">
1287
+
1288
+
1289
+ 240
1290
+ 241
1291
+ 242</pre>
1292
+ </td>
1293
+ <td>
1294
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 240</span>
1295
+
1296
+ <span class='kw'>def</span> <span class='id identifier rubyid_process_launched?'>process_launched?</span>
1297
+ <span class='ivar'>@process_launched</span>
1298
+ <span class='kw'>end</span></pre>
1299
+ </td>
1300
+ </tr>
1301
+ </table>
1302
+ </div>
1303
+
1304
+ <div class="method_details ">
1305
+ <p class="signature " id="prompted?-instance_method">
1306
+
1307
+ - (<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>) <strong>prompted?</strong>
1308
+
1309
+
1310
+
1311
+ </p><div class="docstring">
1312
+ <div class="discussion">
1313
+ <p>
1314
+ If executable is awaiting input.
1315
+ </p>
1316
+
1317
+
1318
+ </div>
1319
+ </div>
1320
+ <div class="tags">
1321
+
1322
+ <h3>Returns:</h3>
1323
+ <ul class="return">
1324
+
1325
+ <li>
1326
+
1327
+
1328
+ <span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
1329
+
1330
+
1331
+
1332
+ &mdash;
1333
+ <div class='inline'><p>
1334
+ If executable is awaiting input.
1335
+ </p>
1336
+ </div>
1337
+
1338
+ </li>
1339
+
1340
+ </ul>
1341
+
1342
+ </div><table class="source_code">
1343
+ <tr>
1344
+ <td>
1345
+ <pre class="lines">
1346
+
1347
+
1348
+ 162
1349
+ 163
1350
+ 164</pre>
1351
+ </td>
1352
+ <td>
1353
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 162</span>
1354
+
1355
+ <span class='kw'>def</span> <span class='id identifier rubyid_prompted?'>prompted?</span>
1356
+ <span class='ivar'>@prompted</span>
1357
+ <span class='kw'>end</span></pre>
1358
+ </td>
1359
+ </tr>
1360
+ </table>
1361
+ </div>
1362
+
1363
+ <div class="method_details ">
1364
+ <p class="signature " id="system_execute-instance_method">
1365
+
1366
+ - (<tt>Thread</tt>) <strong>system_execute</strong>(binary, params) <span class="extras">(protected)</span>
1367
+
1368
+
1369
+
1370
+ </p><div class="docstring">
1371
+ <div class="discussion">
1372
+ <p>
1373
+ This is the override of the underlying Sprout::Executable template method
1374
+ so that we create the process in a thread in order to read and write to
1375
+ it.
1376
+ </p>
1377
+
1378
+
1379
+ </div>
1380
+ </div>
1381
+ <div class="tags">
1382
+
1383
+ <h3>Returns:</h3>
1384
+ <ul class="return">
1385
+
1386
+ <li>
1387
+
1388
+
1389
+ <span class='type'>(<tt>Thread</tt>)</span>
1390
+
1391
+
1392
+
1393
+ </li>
1394
+
1395
+ </ul>
1396
+
1397
+ </div><table class="source_code">
1398
+ <tr>
1399
+ <td>
1400
+ <pre class="lines">
1401
+
1402
+
1403
+ 274
1404
+ 275
1405
+ 276
1406
+ 277
1407
+ 278
1408
+ 279
1409
+ 280
1410
+ 281
1411
+ 282
1412
+ 283
1413
+ 284
1414
+ 285
1415
+ 286
1416
+ 287
1417
+ 288
1418
+ 289</pre>
1419
+ </td>
1420
+ <td>
1421
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 274</span>
1422
+
1423
+ <span class='kw'>def</span> <span class='id identifier rubyid_system_execute'>system_execute</span> <span class='id identifier rubyid_binary'>binary</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span>
1424
+ <span class='comment'># Combine the stderr and stdout for long-lived
1425
+ </span> <span class='comment'># processes so that they are both written to
1426
+ </span> <span class='comment'># stdout, this allows us to collect these streams
1427
+ </span> <span class='comment'># without threads or blocking eternally.
1428
+ </span> <span class='comment'>#
1429
+ </span> <span class='comment'># Thanks to https://github.com/apinstein for this
1430
+ </span> <span class='comment'># solution.
1431
+ </span> <span class='comment'>#params = &quot;#{params} &quot; + '2&gt;&amp;1'
1432
+ </span> <span class='ivar'>@process_thread</span> <span class='op'>=</span> <span class='const'>Sprout</span><span class='period'>.</span><span class='id identifier rubyid_current_system'>current_system</span><span class='period'>.</span><span class='id identifier rubyid_execute_thread'>execute_thread</span> <span class='id identifier rubyid_binary'>binary</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='comma'>,</span> <span class='id identifier rubyid_prompt'>prompt</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_message'>message</span><span class='op'>|</span>
1433
+ <span class='kw'>yield</span> <span class='id identifier rubyid_message'>message</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1434
+ <span class='const'>Sprout</span><span class='period'>.</span><span class='id identifier rubyid_stdout'>stdout</span><span class='period'>.</span><span class='id identifier rubyid_printf'>printf</span> <span class='id identifier rubyid_message'>message</span>
1435
+ <span class='ivar'>@prompted</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_prompt'>prompt</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span> <span class='id identifier rubyid_message'>message</span>
1436
+ <span class='kw'>end</span>
1437
+ <span class='ivar'>@process_runner</span> <span class='op'>=</span> <span class='id identifier rubyid_process_thread'>process_thread</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>
1438
+ <span class='kw'>end</span></pre>
1439
+ </td>
1440
+ </tr>
1441
+ </table>
1442
+ </div>
1443
+
1444
+ <div class="method_details ">
1445
+ <p class="signature " id="update_rake_task_name_from_args-instance_method">
1446
+
1447
+ - (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>) <strong>update_rake_task_name_from_args</strong>(*args) <span class="extras">(protected)</span>
1448
+
1449
+
1450
+
1451
+ </p><div class="docstring">
1452
+ <div class="discussion">
1453
+ <p>
1454
+ This is the override of the underlying Sprout::Executable template method
1455
+ so that we are NOT added to the CLEAN collection. (Work performed in the
1456
+ Executable)
1457
+ </p>
1458
+
1459
+
1460
+ </div>
1461
+ </div>
1462
+ <div class="tags">
1463
+
1464
+ <h3>Returns:</h3>
1465
+ <ul class="return">
1466
+
1467
+ <li>
1468
+
1469
+
1470
+ <span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
1471
+
1472
+
1473
+
1474
+ </li>
1475
+
1476
+ </ul>
1477
+
1478
+ </div><table class="source_code">
1479
+ <tr>
1480
+ <td>
1481
+ <pre class="lines">
1482
+
1483
+
1484
+ 263
1485
+ 264
1486
+ 265</pre>
1487
+ </td>
1488
+ <td>
1489
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 263</span>
1490
+
1491
+ <span class='kw'>def</span> <span class='id identifier rubyid_update_rake_task_name_from_args'>update_rake_task_name_from_args</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span>
1492
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_rake_task_name'>rake_task_name</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_rake_task_arg'>parse_rake_task_arg</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span>
1493
+ <span class='kw'>end</span></pre>
1494
+ </td>
1495
+ </tr>
1496
+ </table>
1497
+ </div>
1498
+
1499
+ <div class="method_details ">
1500
+ <p class="signature " id="wait-instance_method">
1501
+
1502
+ - (<tt>Object</tt>) <strong>wait</strong>
1503
+
1504
+
1505
+
1506
+ </p><table class="source_code">
1507
+ <tr>
1508
+ <td>
1509
+ <pre class="lines">
1510
+
1511
+
1512
+ 204
1513
+ 205
1514
+ 206
1515
+ 207</pre>
1516
+ </td>
1517
+ <td>
1518
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 204</span>
1519
+
1520
+ <span class='kw'>def</span> <span class='id identifier rubyid_wait'>wait</span>
1521
+ <span class='const'>Process</span><span class='period'>.</span><span class='id identifier rubyid_wait'>wait</span> <span class='id identifier rubyid_process_runner'>process_runner</span><span class='period'>.</span><span class='id identifier rubyid_pid'>pid</span>
1522
+ <span class='kw'>rescue</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>ECHILD</span>
1523
+ <span class='kw'>end</span></pre>
1524
+ </td>
1525
+ </tr>
1526
+ </table>
1527
+ </div>
1528
+
1529
+ <div class="method_details ">
1530
+ <p class="signature " id="wait_for_prompt-instance_method">
1531
+
1532
+ - (<tt>Object</tt>) <strong>wait_for_prompt</strong>
1533
+
1534
+
1535
+
1536
+ </p><div class="docstring">
1537
+ <div class="discussion">
1538
+ <p>
1539
+ Wait for the underlying process to present an input prompt, so that another
1540
+ action can be submitted, or user input can be collected.
1541
+ </p>
1542
+
1543
+
1544
+ </div>
1545
+ </div>
1546
+ <div class="tags">
1547
+
1548
+
1549
+ </div><table class="source_code">
1550
+ <tr>
1551
+ <td>
1552
+ <pre class="lines">
1553
+
1554
+
1555
+ 214
1556
+ 215
1557
+ 216
1558
+ 217
1559
+ 218
1560
+ 219</pre>
1561
+ </td>
1562
+ <td>
1563
+ <pre class="code"><span class="info file"># File 'lib/sprout/executable/session.rb', line 214</span>
1564
+
1565
+ <span class='kw'>def</span> <span class='id identifier rubyid_wait_for_prompt'>wait_for_prompt</span>
1566
+ <span class='kw'>while</span> <span class='id identifier rubyid_process_thread'>process_thread</span><span class='period'>.</span><span class='id identifier rubyid_alive?'>alive?</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_prompted?'>prompted?</span>
1567
+ <span class='id identifier rubyid_sleep'>sleep</span> <span class='float'>0.2</span>
1568
+ <span class='kw'>end</span>
1569
+ <span class='id identifier rubyid_process_thread'>process_thread</span><span class='period'>.</span><span class='id identifier rubyid_alive?'>alive?</span>
1570
+ <span class='kw'>end</span></pre>
1571
+ </td>
1572
+ </tr>
1573
+ </table>
1574
+ </div>
1575
+
1576
+ </div>
1577
+
1578
+ </div>
1579
+
1580
+ <div id="footer">
1581
+ Generated on Sun Mar 11 14:30:34 2012 by
1582
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1583
+ 0.7.5 (ruby-1.9.2).
1584
+ </div>
1585
+
1586
+ </body>
1587
+ </html>