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,384 @@
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::ProgressBar
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>
38
+ &raquo;
39
+ <span class="title">ProgressBar</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::ProgressBar
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">Object</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">Sprout::ProgressBar</li>
75
+
76
+ </ul>
77
+ <a href="#" class="inheritanceTree">show all</a>
78
+
79
+ </dd>
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <dt class="r2 last">Defined in:</dt>
90
+ <dd class="r2 last">lib/sprout/progress_bar.rb</dd>
91
+
92
+ </dl>
93
+ <div class="clear"></div>
94
+
95
+ <div id="subclasses">
96
+ <h2>Direct Known Subclasses</h2>
97
+ <p class="children"><span class='object_link'><a href="ReversedProgressBar.html" title="Sprout::ReversedProgressBar (class)">ReversedProgressBar</a></span></p>
98
+ </div>
99
+
100
+ <h2>Constant Summary</h2>
101
+
102
+ <dl class="constants">
103
+
104
+ <dt id="VERSION-constant" class="">VERSION =
105
+
106
+ </dt>
107
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.9</span><span class='tstring_end'>&quot;</span></span></pre></dd>
108
+
109
+ <dt id="debug-classvariable" class="">@@debug =
110
+
111
+ </dt>
112
+ <dd><pre class="code"><span class='kw'>false</span></pre></dd>
113
+
114
+ <dt id="outio-classvariable" class="">@@outio =
115
+
116
+ </dt>
117
+ <dd><pre class="code"><span class='gvar'>$stderr</span></pre></dd>
118
+
119
+ </dl>
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <h2>
130
+ Class Method Summary
131
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
132
+ </h2>
133
+
134
+ <ul class="summary">
135
+
136
+ <li class="public ">
137
+ <span class="summary_signature">
138
+
139
+ <a href="#debug%3D-class_method" title="debug= (class method)">+ (Object) <strong>debug=</strong>(debug) </a>
140
+
141
+
142
+
143
+ </span>
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ <span class="summary_desc"><div class='inline'></div></span>
153
+
154
+ </li>
155
+
156
+
157
+ <li class="public ">
158
+ <span class="summary_signature">
159
+
160
+ <a href="#debug%3F-class_method" title="debug? (class method)">+ (Boolean) <strong>debug?</strong> </a>
161
+
162
+
163
+
164
+ </span>
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ <span class="summary_desc"><div class='inline'></div></span>
174
+
175
+ </li>
176
+
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#new-class_method" title="new (class method)">+ (Object) <strong>new</strong>(title, total) </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+ <span class="summary_desc"><div class='inline'></div></span>
195
+
196
+ </li>
197
+
198
+
199
+ <li class="public ">
200
+ <span class="summary_signature">
201
+
202
+ <a href="#outio-class_method" title="outio (class method)">+ (Object) <strong>outio</strong> </a>
203
+
204
+
205
+
206
+ </span>
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <span class="summary_desc"><div class='inline'></div></span>
216
+
217
+ </li>
218
+
219
+
220
+ </ul>
221
+
222
+
223
+
224
+
225
+ <div id="class_method_details" class="method_details_list">
226
+ <h2>Class Method Details</h2>
227
+
228
+
229
+ <div class="method_details first">
230
+ <p class="signature first" id="debug=-class_method">
231
+
232
+ + (<tt>Object</tt>) <strong>debug=</strong>(debug)
233
+
234
+
235
+
236
+ </p><table class="source_code">
237
+ <tr>
238
+ <td>
239
+ <pre class="lines">
240
+
241
+
242
+ 29
243
+ 30
244
+ 31
245
+ 32
246
+ 33
247
+ 34
248
+ 35
249
+ 36</pre>
250
+ </td>
251
+ <td>
252
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 29</span>
253
+
254
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_debug='>debug=</span><span class='lparen'>(</span><span class='id identifier rubyid_debug'>debug</span><span class='rparen'>)</span>
255
+ <span class='cvar'>@@debug</span> <span class='op'>=</span> <span class='id identifier rubyid_debug'>debug</span>
256
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_debug'>debug</span><span class='rparen'>)</span>
257
+ <span class='cvar'>@@outio</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
258
+ <span class='kw'>else</span>
259
+ <span class='cvar'>@@outio</span> <span class='op'>=</span> <span class='gvar'>$stderr</span>
260
+ <span class='kw'>end</span>
261
+ <span class='kw'>end</span></pre>
262
+ </td>
263
+ </tr>
264
+ </table>
265
+ </div>
266
+
267
+ <div class="method_details ">
268
+ <p class="signature " id="debug?-class_method">
269
+
270
+ + (<tt>Boolean</tt>) <strong>debug?</strong>
271
+
272
+
273
+
274
+ </p><div class="docstring">
275
+ <div class="discussion">
276
+
277
+
278
+ </div>
279
+ </div>
280
+ <div class="tags">
281
+
282
+ <h3>Returns:</h3>
283
+ <ul class="return">
284
+
285
+ <li>
286
+
287
+
288
+ <span class='type'>(<tt>Boolean</tt>)</span>
289
+
290
+
291
+
292
+ </li>
293
+
294
+ </ul>
295
+
296
+ </div><table class="source_code">
297
+ <tr>
298
+ <td>
299
+ <pre class="lines">
300
+
301
+
302
+ 25
303
+ 26
304
+ 27</pre>
305
+ </td>
306
+ <td>
307
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 25</span>
308
+
309
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_debug?'>debug?</span>
310
+ <span class='cvar'>@@debug</span>
311
+ <span class='kw'>end</span></pre>
312
+ </td>
313
+ </tr>
314
+ </table>
315
+ </div>
316
+
317
+ <div class="method_details ">
318
+ <p class="signature " id="new-class_method">
319
+
320
+ + (<tt>Object</tt>) <strong>new</strong>(title, total)
321
+
322
+
323
+
324
+ </p><table class="source_code">
325
+ <tr>
326
+ <td>
327
+ <pre class="lines">
328
+
329
+
330
+ 21
331
+ 22
332
+ 23</pre>
333
+ </td>
334
+ <td>
335
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 21</span>
336
+
337
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_title'>title</span><span class='comma'>,</span> <span class='id identifier rubyid_total'>total</span><span class='rparen'>)</span>
338
+ <span class='kw'>return</span> <span class='const'>ProgressBarManager</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='id identifier rubyid_title'>title</span><span class='comma'>,</span> <span class='id identifier rubyid_total'>total</span><span class='rparen'>)</span>
339
+ <span class='kw'>end</span></pre>
340
+ </td>
341
+ </tr>
342
+ </table>
343
+ </div>
344
+
345
+ <div class="method_details ">
346
+ <p class="signature " id="outio-class_method">
347
+
348
+ + (<tt>Object</tt>) <strong>outio</strong>
349
+
350
+
351
+
352
+ </p><table class="source_code">
353
+ <tr>
354
+ <td>
355
+ <pre class="lines">
356
+
357
+
358
+ 38
359
+ 39
360
+ 40</pre>
361
+ </td>
362
+ <td>
363
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 38</span>
364
+
365
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_outio'>outio</span>
366
+ <span class='cvar'>@@outio</span>
367
+ <span class='kw'>end</span></pre>
368
+ </td>
369
+ </tr>
370
+ </table>
371
+ </div>
372
+
373
+ </div>
374
+
375
+ </div>
376
+
377
+ <div id="footer">
378
+ Generated on Sun Mar 11 14:30:32 2012 by
379
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
380
+ 0.7.5 (ruby-1.9.2).
381
+ </div>
382
+
383
+ </body>
384
+ </html>
@@ -0,0 +1,2151 @@
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::ProgressBarImpl
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>
38
+ &raquo;
39
+ <span class="title">ProgressBarImpl</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::ProgressBarImpl
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">Object</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">Sprout::ProgressBarImpl</li>
75
+
76
+ </ul>
77
+ <a href="#" class="inheritanceTree">show all</a>
78
+
79
+ </dd>
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <dt class="r2 last">Defined in:</dt>
90
+ <dd class="r2 last">lib/sprout/progress_bar.rb</dd>
91
+
92
+ </dl>
93
+ <div class="clear"></div>
94
+
95
+
96
+
97
+
98
+
99
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
100
+ <ul class="summary">
101
+
102
+ <li class="public ">
103
+ <span class="summary_signature">
104
+
105
+ <a href="#bar_mark-instance_method" title="#bar_mark (instance method)">- (Object) <strong>bar_mark</strong> </a>
106
+
107
+
108
+
109
+ </span>
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ <span class="summary_desc"><div class='inline'><p>
122
+ Returns the value of attribute bar_mark.
123
+ </p>
124
+ </div></span>
125
+
126
+ </li>
127
+
128
+
129
+ <li class="public ">
130
+ <span class="summary_signature">
131
+
132
+ <a href="#current-instance_method" title="#current (instance method)">- (Object) <strong>current</strong> </a>
133
+
134
+
135
+
136
+ </span>
137
+
138
+
139
+ <span class="note title readonly">readonly</span>
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+ <span class="summary_desc"><div class='inline'><p>
149
+ Returns the value of attribute current.
150
+ </p>
151
+ </div></span>
152
+
153
+ </li>
154
+
155
+
156
+ <li class="public ">
157
+ <span class="summary_signature">
158
+
159
+ <a href="#start_time-instance_method" title="#start_time (instance method)">- (Object) <strong>start_time</strong> </a>
160
+
161
+
162
+
163
+ </span>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ <span class="summary_desc"><div class='inline'><p>
176
+ Returns the value of attribute start_time.
177
+ </p>
178
+ </div></span>
179
+
180
+ </li>
181
+
182
+
183
+ <li class="public ">
184
+ <span class="summary_signature">
185
+
186
+ <a href="#title-instance_method" title="#title (instance method)">- (Object) <strong>title</strong> </a>
187
+
188
+
189
+
190
+ </span>
191
+
192
+
193
+ <span class="note title readonly">readonly</span>
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+ <span class="summary_desc"><div class='inline'><p>
203
+ Returns the value of attribute title.
204
+ </p>
205
+ </div></span>
206
+
207
+ </li>
208
+
209
+
210
+ <li class="public ">
211
+ <span class="summary_signature">
212
+
213
+ <a href="#title_width-instance_method" title="#title_width (instance method)">- (Object) <strong>title_width</strong> </a>
214
+
215
+
216
+
217
+ </span>
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+ <span class="summary_desc"><div class='inline'><p>
230
+ Returns the value of attribute title_width.
231
+ </p>
232
+ </div></span>
233
+
234
+ </li>
235
+
236
+
237
+ <li class="public ">
238
+ <span class="summary_signature">
239
+
240
+ <a href="#total-instance_method" title="#total (instance method)">- (Object) <strong>total</strong> </a>
241
+
242
+
243
+
244
+ </span>
245
+
246
+
247
+ <span class="note title readonly">readonly</span>
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+ <span class="summary_desc"><div class='inline'><p>
257
+ Returns the value of attribute total.
258
+ </p>
259
+ </div></span>
260
+
261
+ </li>
262
+
263
+
264
+ </ul>
265
+
266
+
267
+
268
+
269
+
270
+ <h2>
271
+ Instance Method Summary
272
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
273
+ </h2>
274
+
275
+ <ul class="summary">
276
+
277
+ <li class="public ">
278
+ <span class="summary_signature">
279
+
280
+ <a href="#bytes-instance_method" title="#bytes (instance method)">- (Object) <strong>bytes</strong> </a>
281
+
282
+
283
+
284
+ </span>
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+ <span class="summary_desc"><div class='inline'></div></span>
294
+
295
+ </li>
296
+
297
+
298
+ <li class="public ">
299
+ <span class="summary_signature">
300
+
301
+ <a href="#clear-instance_method" title="#clear (instance method)">- (Object) <strong>clear</strong> </a>
302
+
303
+
304
+
305
+ </span>
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+ <span class="summary_desc"><div class='inline'></div></span>
315
+
316
+ </li>
317
+
318
+
319
+ <li class="public ">
320
+ <span class="summary_signature">
321
+
322
+ <a href="#convert_bytes-instance_method" title="#convert_bytes (instance method)">- (Object) <strong>convert_bytes</strong>(bytes) </a>
323
+
324
+
325
+
326
+ </span>
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+ <span class="summary_desc"><div class='inline'></div></span>
336
+
337
+ </li>
338
+
339
+
340
+ <li class="public ">
341
+ <span class="summary_signature">
342
+
343
+ <a href="#do_percentage-instance_method" title="#do_percentage (instance method)">- (Object) <strong>do_percentage</strong> </a>
344
+
345
+
346
+
347
+ </span>
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+ <span class="summary_desc"><div class='inline'></div></span>
357
+
358
+ </li>
359
+
360
+
361
+ <li class="public ">
362
+ <span class="summary_signature">
363
+
364
+ <a href="#elapsed-instance_method" title="#elapsed (instance method)">- (Object) <strong>elapsed</strong> </a>
365
+
366
+
367
+
368
+ </span>
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+ <span class="summary_desc"><div class='inline'></div></span>
378
+
379
+ </li>
380
+
381
+
382
+ <li class="public ">
383
+ <span class="summary_signature">
384
+
385
+ <a href="#eol-instance_method" title="#eol (instance method)">- (Object) <strong>eol</strong> </a>
386
+
387
+
388
+
389
+ </span>
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+ <span class="summary_desc"><div class='inline'></div></span>
399
+
400
+ </li>
401
+
402
+
403
+ <li class="public ">
404
+ <span class="summary_signature">
405
+
406
+ <a href="#eta-instance_method" title="#eta (instance method)">- (Object) <strong>eta</strong> </a>
407
+
408
+
409
+
410
+ </span>
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+ <span class="summary_desc"><div class='inline'><p>
420
+ ETA stands for Estimated Time of Arrival.
421
+ </p>
422
+ </div></span>
423
+
424
+ </li>
425
+
426
+
427
+ <li class="public ">
428
+ <span class="summary_signature">
429
+
430
+ <a href="#file_transfer_mode-instance_method" title="#file_transfer_mode (instance method)">- (Object) <strong>file_transfer_mode</strong> </a>
431
+
432
+
433
+
434
+ </span>
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+ <span class="summary_desc"><div class='inline'></div></span>
444
+
445
+ </li>
446
+
447
+
448
+ <li class="public ">
449
+ <span class="summary_signature">
450
+
451
+ <a href="#finish-instance_method" title="#finish (instance method)">- (Object) <strong>finish</strong> </a>
452
+
453
+
454
+
455
+ </span>
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+ <span class="summary_desc"><div class='inline'></div></span>
465
+
466
+ </li>
467
+
468
+
469
+ <li class="public ">
470
+ <span class="summary_signature">
471
+
472
+ <a href="#finished%3F-instance_method" title="#finished? (instance method)">- (Boolean) <strong>finished?</strong> </a>
473
+
474
+
475
+
476
+ </span>
477
+
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+ <span class="summary_desc"><div class='inline'></div></span>
486
+
487
+ </li>
488
+
489
+
490
+ <li class="public ">
491
+ <span class="summary_signature">
492
+
493
+ <a href="#fmt_bar-instance_method" title="#fmt_bar (instance method)">- (Object) <strong>fmt_bar</strong> </a>
494
+
495
+
496
+
497
+ </span>
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+ <span class="summary_desc"><div class='inline'></div></span>
507
+
508
+ </li>
509
+
510
+
511
+ <li class="public ">
512
+ <span class="summary_signature">
513
+
514
+ <a href="#fmt_percentage-instance_method" title="#fmt_percentage (instance method)">- (Object) <strong>fmt_percentage</strong> </a>
515
+
516
+
517
+
518
+ </span>
519
+
520
+
521
+
522
+
523
+
524
+
525
+
526
+
527
+ <span class="summary_desc"><div class='inline'></div></span>
528
+
529
+ </li>
530
+
531
+
532
+ <li class="public ">
533
+ <span class="summary_signature">
534
+
535
+ <a href="#fmt_stat-instance_method" title="#fmt_stat (instance method)">- (Object) <strong>fmt_stat</strong> </a>
536
+
537
+
538
+
539
+ </span>
540
+
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+ <span class="summary_desc"><div class='inline'></div></span>
549
+
550
+ </li>
551
+
552
+
553
+ <li class="public ">
554
+ <span class="summary_signature">
555
+
556
+ <a href="#fmt_stat_for_file_transfer-instance_method" title="#fmt_stat_for_file_transfer (instance method)">- (Object) <strong>fmt_stat_for_file_transfer</strong> </a>
557
+
558
+
559
+
560
+ </span>
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+ <span class="summary_desc"><div class='inline'></div></span>
570
+
571
+ </li>
572
+
573
+
574
+ <li class="public ">
575
+ <span class="summary_signature">
576
+
577
+ <a href="#fmt_title-instance_method" title="#fmt_title (instance method)">- (Object) <strong>fmt_title</strong> </a>
578
+
579
+
580
+
581
+ </span>
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+ <span class="summary_desc"><div class='inline'></div></span>
591
+
592
+ </li>
593
+
594
+
595
+ <li class="public ">
596
+ <span class="summary_signature">
597
+
598
+ <a href="#format%3D-instance_method" title="#format= (instance method)">- (Object) <strong>format=</strong>(format) </a>
599
+
600
+
601
+
602
+ </span>
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+ <span class="summary_desc"><div class='inline'></div></span>
612
+
613
+ </li>
614
+
615
+
616
+ <li class="public ">
617
+ <span class="summary_signature">
618
+
619
+ <a href="#format_arguments%3D-instance_method" title="#format_arguments= (instance method)">- (Object) <strong>format_arguments=</strong>(arguments) </a>
620
+
621
+
622
+
623
+ </span>
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+ <span class="summary_desc"><div class='inline'></div></span>
633
+
634
+ </li>
635
+
636
+
637
+ <li class="public ">
638
+ <span class="summary_signature">
639
+
640
+ <a href="#format_time-instance_method" title="#format_time (instance method)">- (Object) <strong>format_time</strong>(t) </a>
641
+
642
+
643
+
644
+ </span>
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+ <span class="summary_desc"><div class='inline'></div></span>
654
+
655
+ </li>
656
+
657
+
658
+ <li class="public ">
659
+ <span class="summary_signature">
660
+
661
+ <a href="#get_width-instance_method" title="#get_width (instance method)">- (Object) <strong>get_width</strong> </a>
662
+
663
+
664
+
665
+ </span>
666
+
667
+
668
+
669
+
670
+
671
+
672
+
673
+
674
+ <span class="summary_desc"><div class='inline'></div></span>
675
+
676
+ </li>
677
+
678
+
679
+ <li class="public ">
680
+ <span class="summary_signature">
681
+
682
+ <a href="#halt-instance_method" title="#halt (instance method)">- (Object) <strong>halt</strong> </a>
683
+
684
+
685
+
686
+ </span>
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+ <span class="summary_desc"><div class='inline'></div></span>
696
+
697
+ </li>
698
+
699
+
700
+ <li class="public ">
701
+ <span class="summary_signature">
702
+
703
+ <a href="#inc-instance_method" title="#inc (instance method)">- (Object) <strong>inc</strong>(step = 1) </a>
704
+
705
+
706
+
707
+ </span>
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+
716
+ <span class="summary_desc"><div class='inline'></div></span>
717
+
718
+ </li>
719
+
720
+
721
+ <li class="public ">
722
+ <span class="summary_signature">
723
+
724
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (ProgressBarImpl) <strong>initialize</strong>(title, total, out = STDERR) </a>
725
+
726
+
727
+
728
+ </span>
729
+
730
+ <span class="note title constructor">constructor</span>
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+ <span class="summary_desc"><div class='inline'><p>
740
+ A new instance of ProgressBarImpl.
741
+ </p>
742
+ </div></span>
743
+
744
+ </li>
745
+
746
+
747
+ <li class="public ">
748
+ <span class="summary_signature">
749
+
750
+ <a href="#inspect-instance_method" title="#inspect (instance method)">- (Object) <strong>inspect</strong> </a>
751
+
752
+
753
+
754
+ </span>
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+ <span class="summary_desc"><div class='inline'></div></span>
764
+
765
+ </li>
766
+
767
+
768
+ <li class="public ">
769
+ <span class="summary_signature">
770
+
771
+ <a href="#set-instance_method" title="#set (instance method)">- (Object) <strong>set</strong>(count) </a>
772
+
773
+
774
+
775
+ </span>
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+ <span class="summary_desc"><div class='inline'></div></span>
785
+
786
+ </li>
787
+
788
+
789
+ <li class="public ">
790
+ <span class="summary_signature">
791
+
792
+ <a href="#show-instance_method" title="#show (instance method)">- (Object) <strong>show</strong> </a>
793
+
794
+
795
+
796
+ </span>
797
+
798
+
799
+
800
+
801
+
802
+
803
+
804
+
805
+ <span class="summary_desc"><div class='inline'></div></span>
806
+
807
+ </li>
808
+
809
+
810
+ <li class="public ">
811
+ <span class="summary_signature">
812
+
813
+ <a href="#show_if_needed-instance_method" title="#show_if_needed (instance method)">- (Object) <strong>show_if_needed</strong> </a>
814
+
815
+
816
+
817
+ </span>
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+ <span class="summary_desc"><div class='inline'></div></span>
827
+
828
+ </li>
829
+
830
+
831
+ <li class="public ">
832
+ <span class="summary_signature">
833
+
834
+ <a href="#transfer_rate-instance_method" title="#transfer_rate (instance method)">- (Object) <strong>transfer_rate</strong> </a>
835
+
836
+
837
+
838
+ </span>
839
+
840
+
841
+
842
+
843
+
844
+
845
+
846
+
847
+ <span class="summary_desc"><div class='inline'></div></span>
848
+
849
+ </li>
850
+
851
+
852
+ </ul>
853
+
854
+
855
+ <div id="constructor_details" class="method_details_list">
856
+ <h2>Constructor Details</h2>
857
+
858
+ <div class="method_details first">
859
+ <p class="signature first" id="initialize-instance_method">
860
+
861
+ - (<tt><span class='object_link'><a href="" title="Sprout::ProgressBarImpl (class)">ProgressBarImpl</a></span></tt>) <strong>initialize</strong>(title, total, out = STDERR)
862
+
863
+
864
+
865
+ </p><div class="docstring">
866
+ <div class="discussion">
867
+ <p>
868
+ A new instance of ProgressBarImpl
869
+ </p>
870
+
871
+
872
+ </div>
873
+ </div>
874
+ <div class="tags">
875
+
876
+
877
+ </div><table class="source_code">
878
+ <tr>
879
+ <td>
880
+ <pre class="lines">
881
+
882
+
883
+ 46
884
+ 47
885
+ 48
886
+ 49
887
+ 50
888
+ 51
889
+ 52
890
+ 53
891
+ 54
892
+ 55
893
+ 56
894
+ 57
895
+ 58
896
+ 59
897
+ 60
898
+ 61
899
+ 62</pre>
900
+ </td>
901
+ <td>
902
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 46</span>
903
+
904
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='id identifier rubyid_title'>title</span><span class='comma'>,</span> <span class='id identifier rubyid_total'>total</span><span class='comma'>,</span> <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='const'>STDERR</span><span class='rparen'>)</span>
905
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_title'>title</span>
906
+ <span class='ivar'>@total</span> <span class='op'>=</span> <span class='id identifier rubyid_total'>total</span>
907
+ <span class='ivar'>@out</span> <span class='op'>=</span> <span class='id identifier rubyid_out'>out</span>
908
+ <span class='ivar'>@terminal_width</span> <span class='op'>=</span> <span class='int'>80</span>
909
+ <span class='ivar'>@bar_mark</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span>
910
+ <span class='ivar'>@current</span> <span class='op'>=</span> <span class='int'>0</span>
911
+ <span class='ivar'>@previous</span> <span class='op'>=</span> <span class='int'>0</span>
912
+ <span class='ivar'>@finished_p</span> <span class='op'>=</span> <span class='kw'>false</span>
913
+ <span class='ivar'>@start_time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
914
+ <span class='ivar'>@previous_time</span> <span class='op'>=</span> <span class='ivar'>@start_time</span>
915
+ <span class='ivar'>@title_width</span> <span class='op'>=</span> <span class='int'>18</span>
916
+ <span class='ivar'>@format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%-</span><span class='embexpr_beg'>#{</span><span class='ivar'>@title_width</span><span class='rbrace'>}</span><span class='tstring_content'>s %3d%% %s %s</span><span class='tstring_end'>&quot;</span></span>
917
+ <span class='ivar'>@format_arguments</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='symbol'>:title</span><span class='comma'>,</span> <span class='symbol'>:percentage</span><span class='comma'>,</span> <span class='symbol'>:bar</span><span class='comma'>,</span> <span class='symbol'>:stat</span><span class='rbracket'>]</span>
918
+ <span class='id identifier rubyid_clear'>clear</span>
919
+ <span class='id identifier rubyid_show'>show</span>
920
+ <span class='kw'>end</span></pre>
921
+ </td>
922
+ </tr>
923
+ </table>
924
+ </div>
925
+
926
+ </div>
927
+
928
+ <div id="instance_attr_details" class="attr_details">
929
+ <h2>Instance Attribute Details</h2>
930
+
931
+
932
+ <span id="bar_mark=-instance_method"></span>
933
+ <span id="bar_mark-instance_method"></span>
934
+ <div class="method_details first">
935
+ <p class="signature first" id="bar_mark-instance_method">
936
+
937
+ - (<tt>Object</tt>) <strong>bar_mark</strong>
938
+
939
+
940
+
941
+ </p><div class="docstring">
942
+ <div class="discussion">
943
+ <p>
944
+ Returns the value of attribute bar_mark
945
+ </p>
946
+
947
+
948
+ </div>
949
+ </div>
950
+ <div class="tags">
951
+
952
+
953
+ </div><table class="source_code">
954
+ <tr>
955
+ <td>
956
+ <pre class="lines">
957
+
958
+
959
+ 66
960
+ 67
961
+ 68</pre>
962
+ </td>
963
+ <td>
964
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 66</span>
965
+
966
+ <span class='kw'>def</span> <span class='id identifier rubyid_bar_mark'>bar_mark</span>
967
+ <span class='ivar'>@bar_mark</span>
968
+ <span class='kw'>end</span></pre>
969
+ </td>
970
+ </tr>
971
+ </table>
972
+ </div>
973
+
974
+
975
+ <span id=""></span>
976
+ <span id="current-instance_method"></span>
977
+ <div class="method_details ">
978
+ <p class="signature " id="current-instance_method">
979
+
980
+ - (<tt>Object</tt>) <strong>current</strong> <span class="extras">(readonly)</span>
981
+
982
+
983
+
984
+ </p><div class="docstring">
985
+ <div class="discussion">
986
+ <p>
987
+ Returns the value of attribute current
988
+ </p>
989
+
990
+
991
+ </div>
992
+ </div>
993
+ <div class="tags">
994
+
995
+
996
+ </div><table class="source_code">
997
+ <tr>
998
+ <td>
999
+ <pre class="lines">
1000
+
1001
+
1002
+ 64
1003
+ 65
1004
+ 66</pre>
1005
+ </td>
1006
+ <td>
1007
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 64</span>
1008
+
1009
+ <span class='kw'>def</span> <span class='id identifier rubyid_current'>current</span>
1010
+ <span class='ivar'>@current</span>
1011
+ <span class='kw'>end</span></pre>
1012
+ </td>
1013
+ </tr>
1014
+ </table>
1015
+ </div>
1016
+
1017
+
1018
+ <span id="start_time=-instance_method"></span>
1019
+ <span id="start_time-instance_method"></span>
1020
+ <div class="method_details ">
1021
+ <p class="signature " id="start_time-instance_method">
1022
+
1023
+ - (<tt>Object</tt>) <strong>start_time</strong>
1024
+
1025
+
1026
+
1027
+ </p><div class="docstring">
1028
+ <div class="discussion">
1029
+ <p>
1030
+ Returns the value of attribute start_time
1031
+ </p>
1032
+
1033
+
1034
+ </div>
1035
+ </div>
1036
+ <div class="tags">
1037
+
1038
+
1039
+ </div><table class="source_code">
1040
+ <tr>
1041
+ <td>
1042
+ <pre class="lines">
1043
+
1044
+
1045
+ 66
1046
+ 67
1047
+ 68</pre>
1048
+ </td>
1049
+ <td>
1050
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 66</span>
1051
+
1052
+ <span class='kw'>def</span> <span class='id identifier rubyid_start_time'>start_time</span>
1053
+ <span class='ivar'>@start_time</span>
1054
+ <span class='kw'>end</span></pre>
1055
+ </td>
1056
+ </tr>
1057
+ </table>
1058
+ </div>
1059
+
1060
+
1061
+ <span id=""></span>
1062
+ <span id="title-instance_method"></span>
1063
+ <div class="method_details ">
1064
+ <p class="signature " id="title-instance_method">
1065
+
1066
+ - (<tt>Object</tt>) <strong>title</strong> <span class="extras">(readonly)</span>
1067
+
1068
+
1069
+
1070
+ </p><div class="docstring">
1071
+ <div class="discussion">
1072
+ <p>
1073
+ Returns the value of attribute title
1074
+ </p>
1075
+
1076
+
1077
+ </div>
1078
+ </div>
1079
+ <div class="tags">
1080
+
1081
+
1082
+ </div><table class="source_code">
1083
+ <tr>
1084
+ <td>
1085
+ <pre class="lines">
1086
+
1087
+
1088
+ 63
1089
+ 64
1090
+ 65</pre>
1091
+ </td>
1092
+ <td>
1093
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 63</span>
1094
+
1095
+ <span class='kw'>def</span> <span class='id identifier rubyid_title'>title</span>
1096
+ <span class='ivar'>@title</span>
1097
+ <span class='kw'>end</span></pre>
1098
+ </td>
1099
+ </tr>
1100
+ </table>
1101
+ </div>
1102
+
1103
+
1104
+ <span id="title_width=-instance_method"></span>
1105
+ <span id="title_width-instance_method"></span>
1106
+ <div class="method_details ">
1107
+ <p class="signature " id="title_width-instance_method">
1108
+
1109
+ - (<tt>Object</tt>) <strong>title_width</strong>
1110
+
1111
+
1112
+
1113
+ </p><div class="docstring">
1114
+ <div class="discussion">
1115
+ <p>
1116
+ Returns the value of attribute title_width
1117
+ </p>
1118
+
1119
+
1120
+ </div>
1121
+ </div>
1122
+ <div class="tags">
1123
+
1124
+
1125
+ </div><table class="source_code">
1126
+ <tr>
1127
+ <td>
1128
+ <pre class="lines">
1129
+
1130
+
1131
+ 66
1132
+ 67
1133
+ 68</pre>
1134
+ </td>
1135
+ <td>
1136
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 66</span>
1137
+
1138
+ <span class='kw'>def</span> <span class='id identifier rubyid_title_width'>title_width</span>
1139
+ <span class='ivar'>@title_width</span>
1140
+ <span class='kw'>end</span></pre>
1141
+ </td>
1142
+ </tr>
1143
+ </table>
1144
+ </div>
1145
+
1146
+
1147
+ <span id=""></span>
1148
+ <span id="total-instance_method"></span>
1149
+ <div class="method_details ">
1150
+ <p class="signature " id="total-instance_method">
1151
+
1152
+ - (<tt>Object</tt>) <strong>total</strong> <span class="extras">(readonly)</span>
1153
+
1154
+
1155
+
1156
+ </p><div class="docstring">
1157
+ <div class="discussion">
1158
+ <p>
1159
+ Returns the value of attribute total
1160
+ </p>
1161
+
1162
+
1163
+ </div>
1164
+ </div>
1165
+ <div class="tags">
1166
+
1167
+
1168
+ </div><table class="source_code">
1169
+ <tr>
1170
+ <td>
1171
+ <pre class="lines">
1172
+
1173
+
1174
+ 65
1175
+ 66
1176
+ 67</pre>
1177
+ </td>
1178
+ <td>
1179
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 65</span>
1180
+
1181
+ <span class='kw'>def</span> <span class='id identifier rubyid_total'>total</span>
1182
+ <span class='ivar'>@total</span>
1183
+ <span class='kw'>end</span></pre>
1184
+ </td>
1185
+ </tr>
1186
+ </table>
1187
+ </div>
1188
+
1189
+ </div>
1190
+
1191
+
1192
+ <div id="instance_method_details" class="method_details_list">
1193
+ <h2>Instance Method Details</h2>
1194
+
1195
+
1196
+ <div class="method_details first">
1197
+ <p class="signature first" id="bytes-instance_method">
1198
+
1199
+ - (<tt>Object</tt>) <strong>bytes</strong>
1200
+
1201
+
1202
+
1203
+ </p><table class="source_code">
1204
+ <tr>
1205
+ <td>
1206
+ <pre class="lines">
1207
+
1208
+
1209
+ 114
1210
+ 115
1211
+ 116</pre>
1212
+ </td>
1213
+ <td>
1214
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 114</span>
1215
+
1216
+ <span class='kw'>def</span> <span class='id identifier rubyid_bytes'>bytes</span>
1217
+ <span class='id identifier rubyid_convert_bytes'>convert_bytes</span><span class='lparen'>(</span><span class='ivar'>@current</span><span class='rparen'>)</span>
1218
+ <span class='kw'>end</span></pre>
1219
+ </td>
1220
+ </tr>
1221
+ </table>
1222
+ </div>
1223
+
1224
+ <div class="method_details ">
1225
+ <p class="signature " id="clear-instance_method">
1226
+
1227
+ - (<tt>Object</tt>) <strong>clear</strong>
1228
+
1229
+
1230
+
1231
+ </p><table class="source_code">
1232
+ <tr>
1233
+ <td>
1234
+ <pre class="lines">
1235
+
1236
+
1237
+ 214
1238
+ 215
1239
+ 216
1240
+ 217
1241
+ 218</pre>
1242
+ </td>
1243
+ <td>
1244
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 214</span>
1245
+
1246
+ <span class='kw'>def</span> <span class='id identifier rubyid_clear'>clear</span>
1247
+ <span class='ivar'>@out</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\r</span><span class='tstring_end'>&quot;</span></span>
1248
+ <span class='ivar'>@out</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span> <span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_get_width'>get_width</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span><span class='rparen'>)</span>
1249
+ <span class='ivar'>@out</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\r</span><span class='tstring_end'>&quot;</span></span>
1250
+ <span class='kw'>end</span></pre>
1251
+ </td>
1252
+ </tr>
1253
+ </table>
1254
+ </div>
1255
+
1256
+ <div class="method_details ">
1257
+ <p class="signature " id="convert_bytes-instance_method">
1258
+
1259
+ - (<tt>Object</tt>) <strong>convert_bytes</strong>(bytes)
1260
+
1261
+
1262
+
1263
+ </p><table class="source_code">
1264
+ <tr>
1265
+ <td>
1266
+ <pre class="lines">
1267
+
1268
+
1269
+ 97
1270
+ 98
1271
+ 99
1272
+ 100
1273
+ 101
1274
+ 102
1275
+ 103
1276
+ 104
1277
+ 105
1278
+ 106
1279
+ 107</pre>
1280
+ </td>
1281
+ <td>
1282
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 97</span>
1283
+
1284
+ <span class='kw'>def</span> <span class='id identifier rubyid_convert_bytes'>convert_bytes</span> <span class='lparen'>(</span><span class='id identifier rubyid_bytes'>bytes</span><span class='rparen'>)</span>
1285
+ <span class='kw'>if</span> <span class='id identifier rubyid_bytes'>bytes</span> <span class='op'>&lt;</span> <span class='int'>1024</span>
1286
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%6dB</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='rparen'>)</span>
1287
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_bytes'>bytes</span> <span class='op'>&lt;</span> <span class='int'>1024</span> <span class='op'>*</span> <span class='int'>1000</span> <span class='comment'># 1000kb
1288
+ </span> <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%5.1fKB</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>/</span> <span class='int'>1024</span><span class='rparen'>)</span>
1289
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_bytes'>bytes</span> <span class='op'>&lt;</span> <span class='int'>1024</span> <span class='op'>*</span> <span class='int'>1024</span> <span class='op'>*</span> <span class='int'>1000</span> <span class='comment'># 1000mb
1290
+ </span> <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%5.1fMB</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>/</span> <span class='int'>1024</span> <span class='op'>/</span> <span class='int'>1024</span><span class='rparen'>)</span>
1291
+ <span class='kw'>else</span>
1292
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%5.1fGB</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>/</span> <span class='int'>1024</span> <span class='op'>/</span> <span class='int'>1024</span> <span class='op'>/</span> <span class='int'>1024</span><span class='rparen'>)</span>
1293
+ <span class='kw'>end</span>
1294
+ <span class='kw'>end</span></pre>
1295
+ </td>
1296
+ </tr>
1297
+ </table>
1298
+ </div>
1299
+
1300
+ <div class="method_details ">
1301
+ <p class="signature " id="do_percentage-instance_method">
1302
+
1303
+ - (<tt>Object</tt>) <strong>do_percentage</strong>
1304
+
1305
+
1306
+
1307
+ </p><table class="source_code">
1308
+ <tr>
1309
+ <td>
1310
+ <pre class="lines">
1311
+
1312
+
1313
+ 146
1314
+ 147
1315
+ 148
1316
+ 149
1317
+ 150
1318
+ 151
1319
+ 152</pre>
1320
+ </td>
1321
+ <td>
1322
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 146</span>
1323
+
1324
+ <span class='kw'>def</span> <span class='id identifier rubyid_do_percentage'>do_percentage</span>
1325
+ <span class='kw'>if</span> <span class='ivar'>@total</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
1326
+ <span class='int'>100</span>
1327
+ <span class='kw'>else</span>
1328
+ <span class='ivar'>@current</span> <span class='op'>*</span> <span class='int'>100</span> <span class='op'>/</span> <span class='ivar'>@total</span>
1329
+ <span class='kw'>end</span>
1330
+ <span class='kw'>end</span></pre>
1331
+ </td>
1332
+ </tr>
1333
+ </table>
1334
+ </div>
1335
+
1336
+ <div class="method_details ">
1337
+ <p class="signature " id="elapsed-instance_method">
1338
+
1339
+ - (<tt>Object</tt>) <strong>elapsed</strong>
1340
+
1341
+
1342
+
1343
+ </p><table class="source_code">
1344
+ <tr>
1345
+ <td>
1346
+ <pre class="lines">
1347
+
1348
+
1349
+ 137
1350
+ 138
1351
+ 139
1352
+ 140</pre>
1353
+ </td>
1354
+ <td>
1355
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 137</span>
1356
+
1357
+ <span class='kw'>def</span> <span class='id identifier rubyid_elapsed'>elapsed</span>
1358
+ <span class='id identifier rubyid_elapsed_time'>elapsed_time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span> <span class='op'>-</span> <span class='ivar'>@start_time</span>
1359
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Time: %s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_format_time'>format_time</span><span class='lparen'>(</span><span class='id identifier rubyid_elapsed_time'>elapsed_time</span><span class='rparen'>)</span><span class='rparen'>)</span>
1360
+ <span class='kw'>end</span></pre>
1361
+ </td>
1362
+ </tr>
1363
+ </table>
1364
+ </div>
1365
+
1366
+ <div class="method_details ">
1367
+ <p class="signature " id="eol-instance_method">
1368
+
1369
+ - (<tt>Object</tt>) <strong>eol</strong>
1370
+
1371
+
1372
+
1373
+ </p><table class="source_code">
1374
+ <tr>
1375
+ <td>
1376
+ <pre class="lines">
1377
+
1378
+
1379
+ 142
1380
+ 143
1381
+ 144</pre>
1382
+ </td>
1383
+ <td>
1384
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 142</span>
1385
+
1386
+ <span class='kw'>def</span> <span class='id identifier rubyid_eol'>eol</span>
1387
+ <span class='kw'>if</span> <span class='ivar'>@finished_p</span> <span class='kw'>then</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>else</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\r</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>end</span>
1388
+ <span class='kw'>end</span></pre>
1389
+ </td>
1390
+ </tr>
1391
+ </table>
1392
+ </div>
1393
+
1394
+ <div class="method_details ">
1395
+ <p class="signature " id="eta-instance_method">
1396
+
1397
+ - (<tt>Object</tt>) <strong>eta</strong>
1398
+
1399
+
1400
+
1401
+ </p><div class="docstring">
1402
+ <div class="discussion">
1403
+ <p>
1404
+ ETA stands for Estimated Time of Arrival.
1405
+ </p>
1406
+
1407
+
1408
+ </div>
1409
+ </div>
1410
+ <div class="tags">
1411
+
1412
+
1413
+ </div><table class="source_code">
1414
+ <tr>
1415
+ <td>
1416
+ <pre class="lines">
1417
+
1418
+
1419
+ 127
1420
+ 128
1421
+ 129
1422
+ 130
1423
+ 131
1424
+ 132
1425
+ 133
1426
+ 134
1427
+ 135</pre>
1428
+ </td>
1429
+ <td>
1430
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 127</span>
1431
+
1432
+ <span class='kw'>def</span> <span class='id identifier rubyid_eta'>eta</span>
1433
+ <span class='kw'>if</span> <span class='ivar'>@current</span> <span class='op'>==</span> <span class='int'>0</span>
1434
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ETA: --:--:--</span><span class='tstring_end'>&quot;</span></span>
1435
+ <span class='kw'>else</span>
1436
+ <span class='id identifier rubyid_elapsed_time'>elapsed_time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span> <span class='op'>-</span> <span class='ivar'>@start_time</span>
1437
+ <span class='id identifier rubyid_estimated_time'>estimated_time</span> <span class='op'>=</span> <span class='id identifier rubyid_elapsed_time'>elapsed_time</span> <span class='op'>*</span> <span class='ivar'>@total</span> <span class='op'>/</span> <span class='ivar'>@current</span> <span class='op'>-</span> <span class='id identifier rubyid_elapsed_time'>elapsed_time</span>
1438
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ETA: %s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_format_time'>format_time</span><span class='lparen'>(</span><span class='id identifier rubyid_estimated_time'>estimated_time</span><span class='rparen'>)</span><span class='rparen'>)</span>
1439
+ <span class='kw'>end</span>
1440
+ <span class='kw'>end</span></pre>
1441
+ </td>
1442
+ </tr>
1443
+ </table>
1444
+ </div>
1445
+
1446
+ <div class="method_details ">
1447
+ <p class="signature " id="file_transfer_mode-instance_method">
1448
+
1449
+ - (<tt>Object</tt>) <strong>file_transfer_mode</strong>
1450
+
1451
+
1452
+
1453
+ </p><table class="source_code">
1454
+ <tr>
1455
+ <td>
1456
+ <pre class="lines">
1457
+
1458
+
1459
+ 230
1460
+ 231
1461
+ 232</pre>
1462
+ </td>
1463
+ <td>
1464
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 230</span>
1465
+
1466
+ <span class='kw'>def</span> <span class='id identifier rubyid_file_transfer_mode'>file_transfer_mode</span>
1467
+ <span class='ivar'>@format_arguments</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='symbol'>:title</span><span class='comma'>,</span> <span class='symbol'>:percentage</span><span class='comma'>,</span> <span class='symbol'>:bar</span><span class='comma'>,</span> <span class='symbol'>:stat_for_file_transfer</span><span class='rbracket'>]</span>
1468
+ <span class='kw'>end</span></pre>
1469
+ </td>
1470
+ </tr>
1471
+ </table>
1472
+ </div>
1473
+
1474
+ <div class="method_details ">
1475
+ <p class="signature " id="finish-instance_method">
1476
+
1477
+ - (<tt>Object</tt>) <strong>finish</strong>
1478
+
1479
+
1480
+
1481
+ </p><table class="source_code">
1482
+ <tr>
1483
+ <td>
1484
+ <pre class="lines">
1485
+
1486
+
1487
+ 220
1488
+ 221
1489
+ 222
1490
+ 223
1491
+ 224</pre>
1492
+ </td>
1493
+ <td>
1494
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 220</span>
1495
+
1496
+ <span class='kw'>def</span> <span class='id identifier rubyid_finish'>finish</span>
1497
+ <span class='ivar'>@current</span> <span class='op'>=</span> <span class='ivar'>@total</span>
1498
+ <span class='ivar'>@finished_p</span> <span class='op'>=</span> <span class='kw'>true</span>
1499
+ <span class='id identifier rubyid_show'>show</span>
1500
+ <span class='kw'>end</span></pre>
1501
+ </td>
1502
+ </tr>
1503
+ </table>
1504
+ </div>
1505
+
1506
+ <div class="method_details ">
1507
+ <p class="signature " id="finished?-instance_method">
1508
+
1509
+ - (<tt>Boolean</tt>) <strong>finished?</strong>
1510
+
1511
+
1512
+
1513
+ </p><div class="docstring">
1514
+ <div class="discussion">
1515
+
1516
+
1517
+ </div>
1518
+ </div>
1519
+ <div class="tags">
1520
+
1521
+ <h3>Returns:</h3>
1522
+ <ul class="return">
1523
+
1524
+ <li>
1525
+
1526
+
1527
+ <span class='type'>(<tt>Boolean</tt>)</span>
1528
+
1529
+
1530
+
1531
+ </li>
1532
+
1533
+ </ul>
1534
+
1535
+ </div><table class="source_code">
1536
+ <tr>
1537
+ <td>
1538
+ <pre class="lines">
1539
+
1540
+
1541
+ 226
1542
+ 227
1543
+ 228</pre>
1544
+ </td>
1545
+ <td>
1546
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 226</span>
1547
+
1548
+ <span class='kw'>def</span> <span class='id identifier rubyid_finished?'>finished?</span>
1549
+ <span class='ivar'>@finished_p</span>
1550
+ <span class='kw'>end</span></pre>
1551
+ </td>
1552
+ </tr>
1553
+ </table>
1554
+ </div>
1555
+
1556
+ <div class="method_details ">
1557
+ <p class="signature " id="fmt_bar-instance_method">
1558
+
1559
+ - (<tt>Object</tt>) <strong>fmt_bar</strong>
1560
+
1561
+
1562
+
1563
+ </p><table class="source_code">
1564
+ <tr>
1565
+ <td>
1566
+ <pre class="lines">
1567
+
1568
+
1569
+ 70
1570
+ 71
1571
+ 72
1572
+ 73
1573
+ 74
1574
+ 75</pre>
1575
+ </td>
1576
+ <td>
1577
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 70</span>
1578
+
1579
+ <span class='kw'>def</span> <span class='id identifier rubyid_fmt_bar'>fmt_bar</span>
1580
+ <span class='id identifier rubyid_bar_width'>bar_width</span> <span class='op'>=</span> <span class='id identifier rubyid_do_percentage'>do_percentage</span> <span class='op'>*</span> <span class='ivar'>@terminal_width</span> <span class='op'>/</span> <span class='int'>100</span>
1581
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>|%s%s|</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1582
+ <span class='ivar'>@bar_mark</span> <span class='op'>*</span> <span class='id identifier rubyid_bar_width'>bar_width</span><span class='comma'>,</span>
1583
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span> <span class='op'>*</span> <span class='lparen'>(</span><span class='ivar'>@terminal_width</span> <span class='op'>-</span> <span class='id identifier rubyid_bar_width'>bar_width</span><span class='rparen'>)</span><span class='rparen'>)</span>
1584
+ <span class='kw'>end</span></pre>
1585
+ </td>
1586
+ </tr>
1587
+ </table>
1588
+ </div>
1589
+
1590
+ <div class="method_details ">
1591
+ <p class="signature " id="fmt_percentage-instance_method">
1592
+
1593
+ - (<tt>Object</tt>) <strong>fmt_percentage</strong>
1594
+
1595
+
1596
+
1597
+ </p><table class="source_code">
1598
+ <tr>
1599
+ <td>
1600
+ <pre class="lines">
1601
+
1602
+
1603
+ 77
1604
+ 78
1605
+ 79</pre>
1606
+ </td>
1607
+ <td>
1608
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 77</span>
1609
+
1610
+ <span class='kw'>def</span> <span class='id identifier rubyid_fmt_percentage'>fmt_percentage</span>
1611
+ <span class='id identifier rubyid_do_percentage'>do_percentage</span>
1612
+ <span class='kw'>end</span></pre>
1613
+ </td>
1614
+ </tr>
1615
+ </table>
1616
+ </div>
1617
+
1618
+ <div class="method_details ">
1619
+ <p class="signature " id="fmt_stat-instance_method">
1620
+
1621
+ - (<tt>Object</tt>) <strong>fmt_stat</strong>
1622
+
1623
+
1624
+
1625
+ </p><table class="source_code">
1626
+ <tr>
1627
+ <td>
1628
+ <pre class="lines">
1629
+
1630
+
1631
+ 81
1632
+ 82
1633
+ 83</pre>
1634
+ </td>
1635
+ <td>
1636
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 81</span>
1637
+
1638
+ <span class='kw'>def</span> <span class='id identifier rubyid_fmt_stat'>fmt_stat</span>
1639
+ <span class='kw'>if</span> <span class='ivar'>@finished_p</span> <span class='kw'>then</span> <span class='id identifier rubyid_elapsed'>elapsed</span> <span class='kw'>else</span> <span class='id identifier rubyid_eta'>eta</span> <span class='kw'>end</span>
1640
+ <span class='kw'>end</span></pre>
1641
+ </td>
1642
+ </tr>
1643
+ </table>
1644
+ </div>
1645
+
1646
+ <div class="method_details ">
1647
+ <p class="signature " id="fmt_stat_for_file_transfer-instance_method">
1648
+
1649
+ - (<tt>Object</tt>) <strong>fmt_stat_for_file_transfer</strong>
1650
+
1651
+
1652
+
1653
+ </p><table class="source_code">
1654
+ <tr>
1655
+ <td>
1656
+ <pre class="lines">
1657
+
1658
+
1659
+ 85
1660
+ 86
1661
+ 87
1662
+ 88
1663
+ 89
1664
+ 90
1665
+ 91</pre>
1666
+ </td>
1667
+ <td>
1668
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 85</span>
1669
+
1670
+ <span class='kw'>def</span> <span class='id identifier rubyid_fmt_stat_for_file_transfer'>fmt_stat_for_file_transfer</span>
1671
+ <span class='kw'>if</span> <span class='ivar'>@finished_p</span> <span class='kw'>then</span>
1672
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%s %s %s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='comma'>,</span> <span class='id identifier rubyid_transfer_rate'>transfer_rate</span><span class='comma'>,</span> <span class='id identifier rubyid_elapsed'>elapsed</span><span class='rparen'>)</span>
1673
+ <span class='kw'>else</span>
1674
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%s %s %s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='comma'>,</span> <span class='id identifier rubyid_transfer_rate'>transfer_rate</span><span class='comma'>,</span> <span class='id identifier rubyid_eta'>eta</span><span class='rparen'>)</span>
1675
+ <span class='kw'>end</span>
1676
+ <span class='kw'>end</span></pre>
1677
+ </td>
1678
+ </tr>
1679
+ </table>
1680
+ </div>
1681
+
1682
+ <div class="method_details ">
1683
+ <p class="signature " id="fmt_title-instance_method">
1684
+
1685
+ - (<tt>Object</tt>) <strong>fmt_title</strong>
1686
+
1687
+
1688
+
1689
+ </p><table class="source_code">
1690
+ <tr>
1691
+ <td>
1692
+ <pre class="lines">
1693
+
1694
+
1695
+ 93
1696
+ 94
1697
+ 95</pre>
1698
+ </td>
1699
+ <td>
1700
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 93</span>
1701
+
1702
+ <span class='kw'>def</span> <span class='id identifier rubyid_fmt_title'>fmt_title</span>
1703
+ <span class='ivar'>@title</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='lparen'>(</span><span class='ivar'>@title_width</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>:</span><span class='tstring_end'>&quot;</span></span>
1704
+ <span class='kw'>end</span></pre>
1705
+ </td>
1706
+ </tr>
1707
+ </table>
1708
+ </div>
1709
+
1710
+ <div class="method_details ">
1711
+ <p class="signature " id="format=-instance_method">
1712
+
1713
+ - (<tt>Object</tt>) <strong>format=</strong>(format)
1714
+
1715
+
1716
+
1717
+ </p><table class="source_code">
1718
+ <tr>
1719
+ <td>
1720
+ <pre class="lines">
1721
+
1722
+
1723
+ 234
1724
+ 235
1725
+ 236</pre>
1726
+ </td>
1727
+ <td>
1728
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 234</span>
1729
+
1730
+ <span class='kw'>def</span> <span class='id identifier rubyid_format='>format=</span> <span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
1731
+ <span class='ivar'>@format</span> <span class='op'>=</span> <span class='id identifier rubyid_format'>format</span>
1732
+ <span class='kw'>end</span></pre>
1733
+ </td>
1734
+ </tr>
1735
+ </table>
1736
+ </div>
1737
+
1738
+ <div class="method_details ">
1739
+ <p class="signature " id="format_arguments=-instance_method">
1740
+
1741
+ - (<tt>Object</tt>) <strong>format_arguments=</strong>(arguments)
1742
+
1743
+
1744
+
1745
+ </p><table class="source_code">
1746
+ <tr>
1747
+ <td>
1748
+ <pre class="lines">
1749
+
1750
+
1751
+ 238
1752
+ 239
1753
+ 240</pre>
1754
+ </td>
1755
+ <td>
1756
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 238</span>
1757
+
1758
+ <span class='kw'>def</span> <span class='id identifier rubyid_format_arguments='>format_arguments=</span> <span class='lparen'>(</span><span class='id identifier rubyid_arguments'>arguments</span><span class='rparen'>)</span>
1759
+ <span class='ivar'>@format_arguments</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span>
1760
+ <span class='kw'>end</span></pre>
1761
+ </td>
1762
+ </tr>
1763
+ </table>
1764
+ </div>
1765
+
1766
+ <div class="method_details ">
1767
+ <p class="signature " id="format_time-instance_method">
1768
+
1769
+ - (<tt>Object</tt>) <strong>format_time</strong>(t)
1770
+
1771
+
1772
+
1773
+ </p><table class="source_code">
1774
+ <tr>
1775
+ <td>
1776
+ <pre class="lines">
1777
+
1778
+
1779
+ 118
1780
+ 119
1781
+ 120
1782
+ 121
1783
+ 122
1784
+ 123
1785
+ 124</pre>
1786
+ </td>
1787
+ <td>
1788
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 118</span>
1789
+
1790
+ <span class='kw'>def</span> <span class='id identifier rubyid_format_time'>format_time</span> <span class='lparen'>(</span><span class='id identifier rubyid_t'>t</span><span class='rparen'>)</span>
1791
+ <span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1792
+ <span class='id identifier rubyid_sec'>sec</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span> <span class='op'>%</span> <span class='int'>60</span>
1793
+ <span class='id identifier rubyid_min'>min</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_t'>t</span> <span class='op'>/</span> <span class='int'>60</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='int'>60</span>
1794
+ <span class='id identifier rubyid_hour'>hour</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span> <span class='op'>/</span> <span class='int'>3600</span>
1795
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%02d:%02d:%02d</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_hour'>hour</span><span class='comma'>,</span> <span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_sec'>sec</span><span class='rparen'>)</span>
1796
+ <span class='kw'>end</span></pre>
1797
+ </td>
1798
+ </tr>
1799
+ </table>
1800
+ </div>
1801
+
1802
+ <div class="method_details ">
1803
+ <p class="signature " id="get_width-instance_method">
1804
+
1805
+ - (<tt>Object</tt>) <strong>get_width</strong>
1806
+
1807
+
1808
+
1809
+ </p><table class="source_code">
1810
+ <tr>
1811
+ <td>
1812
+ <pre class="lines">
1813
+
1814
+
1815
+ 154
1816
+ 155
1817
+ 156
1818
+ 157
1819
+ 158
1820
+ 159
1821
+ 160
1822
+ 161
1823
+ 162
1824
+ 163
1825
+ 164
1826
+ 165
1827
+ 166
1828
+ 167
1829
+ 168
1830
+ 169
1831
+ 170
1832
+ 171
1833
+ 172
1834
+ 173
1835
+ 174</pre>
1836
+ </td>
1837
+ <td>
1838
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 154</span>
1839
+
1840
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_width'>get_width</span>
1841
+ <span class='comment'># return 80
1842
+ </span> <span class='comment'># FIXME: I don't know how portable it is.
1843
+ </span> <span class='id identifier rubyid_default_width'>default_width</span> <span class='op'>=</span> <span class='int'>80</span>
1844
+ <span class='kw'>begin</span>
1845
+ <span class='id identifier rubyid_tiocgwinsz'>tiocgwinsz</span> <span class='op'>=</span> <span class='int'>0x5413</span>
1846
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pack'>pack</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>SSSS</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1847
+ <span class='kw'>if</span> <span class='ivar'>@out</span><span class='period'>.</span><span class='id identifier rubyid_ioctl'>ioctl</span><span class='lparen'>(</span><span class='id identifier rubyid_tiocgwinsz'>tiocgwinsz</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span> <span class='op'>&gt;=</span> <span class='int'>0</span> <span class='kw'>then</span>
1848
+ <span class='id identifier rubyid_unpacked'>unpacked</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_unpack'>unpack</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>SSSS</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1849
+ <span class='id identifier rubyid_cols'>cols</span> <span class='op'>=</span> <span class='id identifier rubyid_unpacked'>unpacked</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
1850
+ <span class='comment'># Commented this because Aptana was complaining about
1851
+ </span> <span class='comment'># The unused variables
1852
+ </span> <span class='comment'># rows, cols, xpixels, ypixels = data.unpack(&quot;SSSS&quot;)
1853
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_cols'>cols</span> <span class='op'>&gt;=</span> <span class='int'>0</span> <span class='kw'>then</span> <span class='id identifier rubyid_cols'>cols</span> <span class='kw'>else</span> <span class='id identifier rubyid_default_width'>default_width</span> <span class='kw'>end</span>
1854
+ <span class='kw'>else</span>
1855
+ <span class='id identifier rubyid_default_width'>default_width</span>
1856
+ <span class='kw'>end</span>
1857
+ <span class='kw'>rescue</span> <span class='const'>Exception</span>
1858
+ <span class='id identifier rubyid_default_width'>default_width</span>
1859
+ <span class='kw'>end</span>
1860
+ <span class='kw'>end</span></pre>
1861
+ </td>
1862
+ </tr>
1863
+ </table>
1864
+ </div>
1865
+
1866
+ <div class="method_details ">
1867
+ <p class="signature " id="halt-instance_method">
1868
+
1869
+ - (<tt>Object</tt>) <strong>halt</strong>
1870
+
1871
+
1872
+
1873
+ </p><table class="source_code">
1874
+ <tr>
1875
+ <td>
1876
+ <pre class="lines">
1877
+
1878
+
1879
+ 242
1880
+ 243
1881
+ 244
1882
+ 245</pre>
1883
+ </td>
1884
+ <td>
1885
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 242</span>
1886
+
1887
+ <span class='kw'>def</span> <span class='id identifier rubyid_halt'>halt</span>
1888
+ <span class='ivar'>@finished_p</span> <span class='op'>=</span> <span class='kw'>true</span>
1889
+ <span class='id identifier rubyid_show'>show</span>
1890
+ <span class='kw'>end</span></pre>
1891
+ </td>
1892
+ </tr>
1893
+ </table>
1894
+ </div>
1895
+
1896
+ <div class="method_details ">
1897
+ <p class="signature " id="inc-instance_method">
1898
+
1899
+ - (<tt>Object</tt>) <strong>inc</strong>(step = 1)
1900
+
1901
+
1902
+
1903
+ </p><table class="source_code">
1904
+ <tr>
1905
+ <td>
1906
+ <pre class="lines">
1907
+
1908
+
1909
+ 247
1910
+ 248
1911
+ 249
1912
+ 250
1913
+ 251
1914
+ 252</pre>
1915
+ </td>
1916
+ <td>
1917
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 247</span>
1918
+
1919
+ <span class='kw'>def</span> <span class='id identifier rubyid_inc'>inc</span> <span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span> <span class='op'>=</span> <span class='int'>1</span><span class='rparen'>)</span>
1920
+ <span class='ivar'>@current</span> <span class='op'>+=</span> <span class='id identifier rubyid_step'>step</span>
1921
+ <span class='ivar'>@current</span> <span class='op'>=</span> <span class='ivar'>@total</span> <span class='kw'>if</span> <span class='ivar'>@current</span> <span class='op'>&gt;</span> <span class='ivar'>@total</span>
1922
+ <span class='id identifier rubyid_show_if_needed'>show_if_needed</span>
1923
+ <span class='ivar'>@previous</span> <span class='op'>=</span> <span class='ivar'>@current</span>
1924
+ <span class='kw'>end</span></pre>
1925
+ </td>
1926
+ </tr>
1927
+ </table>
1928
+ </div>
1929
+
1930
+ <div class="method_details ">
1931
+ <p class="signature " id="inspect-instance_method">
1932
+
1933
+ - (<tt>Object</tt>) <strong>inspect</strong>
1934
+
1935
+
1936
+
1937
+ </p><table class="source_code">
1938
+ <tr>
1939
+ <td>
1940
+ <pre class="lines">
1941
+
1942
+
1943
+ 263
1944
+ 264
1945
+ 265</pre>
1946
+ </td>
1947
+ <td>
1948
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 263</span>
1949
+
1950
+ <span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
1951
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>#&lt;ProgressBar:</span><span class='embexpr_beg'>#{</span><span class='ivar'>@current</span><span class='rbrace'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@total</span><span class='rbrace'>}</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&quot;</span></span>
1952
+ <span class='kw'>end</span></pre>
1953
+ </td>
1954
+ </tr>
1955
+ </table>
1956
+ </div>
1957
+
1958
+ <div class="method_details ">
1959
+ <p class="signature " id="set-instance_method">
1960
+
1961
+ - (<tt>Object</tt>) <strong>set</strong>(count)
1962
+
1963
+
1964
+
1965
+ </p><table class="source_code">
1966
+ <tr>
1967
+ <td>
1968
+ <pre class="lines">
1969
+
1970
+
1971
+ 254
1972
+ 255
1973
+ 256
1974
+ 257
1975
+ 258
1976
+ 259
1977
+ 260
1978
+ 261</pre>
1979
+ </td>
1980
+ <td>
1981
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 254</span>
1982
+
1983
+ <span class='kw'>def</span> <span class='id identifier rubyid_set'>set</span> <span class='lparen'>(</span><span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span>
1984
+ <span class='kw'>if</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>&lt;</span> <span class='int'>0</span> <span class='op'>||</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>&gt;</span> <span class='ivar'>@total</span>
1985
+ <span class='ivar'>@total</span> <span class='op'>=</span> <span class='id identifier rubyid_count'>count</span>
1986
+ <span class='kw'>end</span>
1987
+ <span class='ivar'>@current</span> <span class='op'>=</span> <span class='id identifier rubyid_count'>count</span>
1988
+ <span class='id identifier rubyid_show_if_needed'>show_if_needed</span>
1989
+ <span class='ivar'>@previous</span> <span class='op'>=</span> <span class='ivar'>@current</span>
1990
+ <span class='kw'>end</span></pre>
1991
+ </td>
1992
+ </tr>
1993
+ </table>
1994
+ </div>
1995
+
1996
+ <div class="method_details ">
1997
+ <p class="signature " id="show-instance_method">
1998
+
1999
+ - (<tt>Object</tt>) <strong>show</strong>
2000
+
2001
+
2002
+
2003
+ </p><table class="source_code">
2004
+ <tr>
2005
+ <td>
2006
+ <pre class="lines">
2007
+
2008
+
2009
+ 176
2010
+ 177
2011
+ 178
2012
+ 179
2013
+ 180
2014
+ 181
2015
+ 182
2016
+ 183
2017
+ 184
2018
+ 185
2019
+ 186
2020
+ 187
2021
+ 188
2022
+ 189
2023
+ 190
2024
+ 191
2025
+ 192
2026
+ 193
2027
+ 194
2028
+ 195</pre>
2029
+ </td>
2030
+ <td>
2031
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 176</span>
2032
+
2033
+ <span class='kw'>def</span> <span class='id identifier rubyid_show'>show</span>
2034
+ <span class='id identifier rubyid_arguments'>arguments</span> <span class='op'>=</span> <span class='ivar'>@format_arguments</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_method'>method</span><span class='op'>|</span>
2035
+ <span class='id identifier rubyid_method'>method</span> <span class='op'>=</span> <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>fmt_%s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
2036
+ <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
2037
+ <span class='kw'>end</span>
2038
+ <span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='ivar'>@format</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_arguments'>arguments</span><span class='rparen'>)</span>
2039
+
2040
+ <span class='id identifier rubyid_width'>width</span> <span class='op'>=</span> <span class='id identifier rubyid_get_width'>get_width</span>
2041
+ <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='id identifier rubyid_width'>width</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span>
2042
+ <span class='ivar'>@out</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span> <span class='op'>+</span> <span class='id identifier rubyid_eol'>eol</span><span class='rparen'>)</span>
2043
+ <span class='ivar'>@out</span><span class='period'>.</span><span class='id identifier rubyid_flush'>flush</span>
2044
+ <span class='kw'>elsif</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;=</span> <span class='id identifier rubyid_width'>width</span><span class='rparen'>)</span>
2045
+ <span class='ivar'>@terminal_width</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='ivar'>@terminal_width</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='id identifier rubyid_width'>width</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span>
2046
+ <span class='kw'>if</span> <span class='ivar'>@terminal_width</span> <span class='op'>==</span> <span class='int'>0</span> <span class='kw'>then</span> <span class='ivar'>@out</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span> <span class='op'>+</span> <span class='id identifier rubyid_eol'>eol</span><span class='rparen'>)</span> <span class='kw'>else</span> <span class='id identifier rubyid_show'>show</span> <span class='kw'>end</span>
2047
+ <span class='kw'>else</span> <span class='comment'># line.length &lt; width - 1
2048
+ </span> <span class='ivar'>@terminal_width</span> <span class='op'>+=</span> <span class='id identifier rubyid_width'>width</span> <span class='op'>-</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>+</span> <span class='int'>1</span>
2049
+ <span class='id identifier rubyid_show'>show</span>
2050
+ <span class='kw'>end</span>
2051
+ <span class='ivar'>@previous_time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
2052
+ <span class='kw'>end</span></pre>
2053
+ </td>
2054
+ </tr>
2055
+ </table>
2056
+ </div>
2057
+
2058
+ <div class="method_details ">
2059
+ <p class="signature " id="show_if_needed-instance_method">
2060
+
2061
+ - (<tt>Object</tt>) <strong>show_if_needed</strong>
2062
+
2063
+
2064
+
2065
+ </p><table class="source_code">
2066
+ <tr>
2067
+ <td>
2068
+ <pre class="lines">
2069
+
2070
+
2071
+ 197
2072
+ 198
2073
+ 199
2074
+ 200
2075
+ 201
2076
+ 202
2077
+ 203
2078
+ 204
2079
+ 205
2080
+ 206
2081
+ 207
2082
+ 208
2083
+ 209
2084
+ 210
2085
+ 211</pre>
2086
+ </td>
2087
+ <td>
2088
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 197</span>
2089
+
2090
+ <span class='kw'>def</span> <span class='id identifier rubyid_show_if_needed'>show_if_needed</span>
2091
+ <span class='kw'>if</span> <span class='ivar'>@total</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
2092
+ <span class='id identifier rubyid_cur_percentage'>cur_percentage</span> <span class='op'>=</span> <span class='int'>100</span>
2093
+ <span class='id identifier rubyid_prev_percentage'>prev_percentage</span> <span class='op'>=</span> <span class='int'>0</span>
2094
+ <span class='kw'>else</span>
2095
+ <span class='id identifier rubyid_cur_percentage'>cur_percentage</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@current</span> <span class='op'>*</span> <span class='int'>100</span> <span class='op'>/</span> <span class='ivar'>@total</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
2096
+ <span class='id identifier rubyid_prev_percentage'>prev_percentage</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@previous</span> <span class='op'>*</span> <span class='int'>100</span> <span class='op'>/</span> <span class='ivar'>@total</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
2097
+ <span class='kw'>end</span>
2098
+
2099
+ <span class='comment'># Use &quot;!=&quot; instead of &quot;&gt;&quot; to support negative changes
2100
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_cur_percentage'>cur_percentage</span> <span class='op'>!=</span> <span class='id identifier rubyid_prev_percentage'>prev_percentage</span> <span class='op'>||</span>
2101
+ <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span> <span class='op'>-</span> <span class='ivar'>@previous_time</span> <span class='op'>&gt;=</span> <span class='int'>1</span> <span class='op'>||</span> <span class='ivar'>@finished_p</span>
2102
+ <span class='id identifier rubyid_show'>show</span>
2103
+ <span class='kw'>end</span>
2104
+ <span class='kw'>end</span></pre>
2105
+ </td>
2106
+ </tr>
2107
+ </table>
2108
+ </div>
2109
+
2110
+ <div class="method_details ">
2111
+ <p class="signature " id="transfer_rate-instance_method">
2112
+
2113
+ - (<tt>Object</tt>) <strong>transfer_rate</strong>
2114
+
2115
+
2116
+
2117
+ </p><table class="source_code">
2118
+ <tr>
2119
+ <td>
2120
+ <pre class="lines">
2121
+
2122
+
2123
+ 109
2124
+ 110
2125
+ 111
2126
+ 112</pre>
2127
+ </td>
2128
+ <td>
2129
+ <pre class="code"><span class="info file"># File 'lib/sprout/progress_bar.rb', line 109</span>
2130
+
2131
+ <span class='kw'>def</span> <span class='id identifier rubyid_transfer_rate'>transfer_rate</span>
2132
+ <span class='id identifier rubyid_bytes_per_second'>bytes_per_second</span> <span class='op'>=</span> <span class='ivar'>@current</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>/</span> <span class='lparen'>(</span><span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span> <span class='op'>-</span> <span class='ivar'>@start_time</span><span class='rparen'>)</span>
2133
+ <span class='id identifier rubyid_sprintf'>sprintf</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%s/s</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_convert_bytes'>convert_bytes</span><span class='lparen'>(</span><span class='id identifier rubyid_bytes_per_second'>bytes_per_second</span><span class='rparen'>)</span><span class='rparen'>)</span>
2134
+ <span class='kw'>end</span></pre>
2135
+ </td>
2136
+ </tr>
2137
+ </table>
2138
+ </div>
2139
+
2140
+ </div>
2141
+
2142
+ </div>
2143
+
2144
+ <div id="footer">
2145
+ Generated on Sun Mar 11 14:30:32 2012 by
2146
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2147
+ 0.7.5 (ruby-1.9.2).
2148
+ </div>
2149
+
2150
+ </body>
2151
+ </html>