sprout 1.0.35.pre → 1.1.2.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 (234) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +0 -2
  3. data/README.textile +1 -1
  4. data/VERSION +1 -1
  5. data/lib/sprout/concern.rb +5 -7
  6. data/lib/sprout/daemon.rb +183 -143
  7. data/lib/sprout/executable/base.rb +564 -0
  8. data/lib/sprout/executable.rb +1 -550
  9. data/lib/sprout/generator/base.rb +2 -3
  10. data/lib/sprout/generator.rb +2 -1
  11. data/lib/sprout/generators/ruby/templates/ruby_base.rb +1 -2
  12. data/lib/sprout/library.rb +3 -3
  13. data/lib/sprout/output_buffer.rb +35 -0
  14. data/lib/sprout/process_runner.rb +68 -17
  15. data/lib/sprout/progress_bar.rb +5 -5
  16. data/lib/sprout/remote_file_target.rb +1 -1
  17. data/lib/sprout/system/base_system.rb +3 -3
  18. data/lib/sprout/system/unix_system.rb +1 -1
  19. data/lib/sprout/{test/sprout_test_case.rb → test_helper.rb} +214 -14
  20. data/lib/sprout/version.rb +1 -1
  21. data/lib/sprout.rb +133 -2
  22. data/rakefile.rb +2 -0
  23. data/test/fixtures/examples/echo_inputs.rb +1 -2
  24. data/test/fixtures/executable/fdb.rb +7 -9
  25. data/test/fixtures/executable/flex3sdk_gem/fdb +49 -18
  26. data/test/fixtures/executable/mxmlc.rb +1 -2
  27. data/test/fixtures/executable/subclass/executable_subclass.rb +0 -1
  28. data/test/fixtures/executable/subclass/executable_superclass.rb +1 -2
  29. data/test/fixtures/specification/flex4sdk.rb +35 -24
  30. data/test/unit/archive_unpacker_test.rb +1 -1
  31. data/test/unit/boolean_param_test.rb +1 -1
  32. data/test/unit/daemon_test.rb +35 -3
  33. data/test/unit/executable_option_parser_test.rb +2 -3
  34. data/test/unit/executable_param_test.rb +1 -1
  35. data/test/unit/executable_test.rb +8 -15
  36. data/test/unit/fake_other_executable.rb +1 -2
  37. data/test/unit/file_param_test.rb +1 -1
  38. data/test/unit/file_target_test.rb +1 -1
  39. data/test/unit/files_param_test.rb +1 -1
  40. data/test/unit/generator_generator_test.rb +1 -1
  41. data/test/unit/generator_test.rb +1 -1
  42. data/test/unit/library_generator_test.rb +1 -1
  43. data/test/unit/library_test.rb +1 -1
  44. data/test/unit/osx_system_test.rb +1 -1
  45. data/test/unit/path_param_test.rb +1 -1
  46. data/test/unit/paths_param_test.rb +1 -1
  47. data/test/unit/platform_test.rb +1 -1
  48. data/test/unit/process_runner_test.rb +1 -1
  49. data/test/unit/rdoc_parser_test.rb +1 -1
  50. data/test/unit/remote_file_loader_test.rb +1 -1
  51. data/test/unit/remote_file_target_test.rb +1 -1
  52. data/test/unit/ruby_feature_test.rb +1 -1
  53. data/test/unit/ruby_generator_test.rb +1 -1
  54. data/test/unit/specification_test.rb +8 -1
  55. data/test/unit/sprout_test.rb +2 -2
  56. data/test/unit/string_param_test.rb +1 -1
  57. data/test/unit/string_test.rb +1 -1
  58. data/test/unit/strings_param_test.rb +1 -1
  59. data/test/unit/test_helper.rb +33 -1
  60. data/test/unit/tool_generator_test.rb +1 -1
  61. data/test/unit/unix_system_test.rb +1 -1
  62. data/test/unit/user_test.rb +1 -1
  63. data/test/unit/vista_system_test.rb +1 -1
  64. data/test/unit/win_nix_system_test.rb +1 -1
  65. data/test/unit/win_system_test.rb +1 -1
  66. data/test-stderr.log +1 -0
  67. data/test-stdout.log +237 -0
  68. metadata +15 -190
  69. data/doc/Dir.html +0 -288
  70. data/doc/Rake/Task.html +0 -184
  71. data/doc/Sprout/ArchiveUnpacker.html +0 -1246
  72. data/doc/Sprout/Base/ClassMethods.html +0 -434
  73. data/doc/Sprout/Base.html +0 -126
  74. data/doc/Sprout/Concern.html +0 -353
  75. data/doc/Sprout/Daemon/ClassMethods.html +0 -244
  76. data/doc/Sprout/Daemon/InstanceMethods.html +0 -601
  77. data/doc/Sprout/Daemon.html +0 -166
  78. data/doc/Sprout/Errors/ArchiveUnpackerError.html +0 -125
  79. data/doc/Sprout/Errors/DestinationExistsError.html +0 -133
  80. data/doc/Sprout/Errors/DuplicateMemberError.html +0 -132
  81. data/doc/Sprout/Errors/ExecutableError.html +0 -125
  82. data/doc/Sprout/Errors/ExecutableRegistrationError.html +0 -132
  83. data/doc/Sprout/Errors/ExecutionError.html +0 -121
  84. data/doc/Sprout/Errors/GeneratorError.html +0 -125
  85. data/doc/Sprout/Errors/InvalidArgumentError.html +0 -132
  86. data/doc/Sprout/Errors/LoadError.html +0 -121
  87. data/doc/Sprout/Errors/MissingArgumentError.html +0 -132
  88. data/doc/Sprout/Errors/MissingExecutableError.html +0 -132
  89. data/doc/Sprout/Errors/MissingGeneratorError.html +0 -132
  90. data/doc/Sprout/Errors/MissingTemplateError.html +0 -132
  91. data/doc/Sprout/Errors/ProcessRunnerError.html +0 -121
  92. data/doc/Sprout/Errors/RemoteFileLoaderError.html +0 -110
  93. data/doc/Sprout/Errors/SproutError.html +0 -114
  94. data/doc/Sprout/Errors/UnknownArchiveType.html +0 -122
  95. data/doc/Sprout/Errors/UsageError.html +0 -121
  96. data/doc/Sprout/Errors/ValidationError.html +0 -121
  97. data/doc/Sprout/Errors/VersionRequirementNotMetError.html +0 -121
  98. data/doc/Sprout/Errors.html +0 -101
  99. data/doc/Sprout/Executable/Boolean.html +0 -483
  100. data/doc/Sprout/Executable/ClassMethods.html +0 -417
  101. data/doc/Sprout/Executable/CollectionParam.html +0 -483
  102. data/doc/Sprout/Executable/FileParam.html +0 -484
  103. data/doc/Sprout/Executable/Files.html +0 -292
  104. data/doc/Sprout/Executable/InstanceMethods.html +0 -2006
  105. data/doc/Sprout/Executable/Number.html +0 -141
  106. data/doc/Sprout/Executable/Param.html +0 -2818
  107. data/doc/Sprout/Executable/ParameterFactory.html +0 -232
  108. data/doc/Sprout/Executable/Path.html +0 -223
  109. data/doc/Sprout/Executable/Paths.html +0 -253
  110. data/doc/Sprout/Executable/StringParam.html +0 -213
  111. data/doc/Sprout/Executable/Strings.html +0 -167
  112. data/doc/Sprout/Executable/Url.html +0 -160
  113. data/doc/Sprout/Executable/Urls.html +0 -170
  114. data/doc/Sprout/Executable.html +0 -173
  115. data/doc/Sprout/FileTarget.html +0 -1109
  116. data/doc/Sprout/Generator/Base.html +0 -1626
  117. data/doc/Sprout/Generator/Command.html +0 -690
  118. data/doc/Sprout/Generator/DirectoryManifest.html +0 -476
  119. data/doc/Sprout/Generator/FileManifest.html +0 -572
  120. data/doc/Sprout/Generator/Manifest.html +0 -377
  121. data/doc/Sprout/Generator/TemplateManifest.html +0 -196
  122. data/doc/Sprout/Generator.html +0 -689
  123. data/doc/Sprout/GeneratorGenerator.html +0 -1018
  124. data/doc/Sprout/Library.html +0 -1141
  125. data/doc/Sprout/LibraryGenerator.html +0 -309
  126. data/doc/Sprout/Log.html +0 -496
  127. data/doc/Sprout/MXMLC.html +0 -6373
  128. data/doc/Sprout/Platform.html +0 -714
  129. data/doc/Sprout/ProcessRunner.html +0 -1352
  130. data/doc/Sprout/ProgressBar.html +0 -376
  131. data/doc/Sprout/ProgressBarImpl.html +0 -2119
  132. data/doc/Sprout/ProgressBarManager.html +0 -434
  133. data/doc/Sprout/ProgressBarOutputStream.html +0 -416
  134. data/doc/Sprout/RDocParser.html +0 -211
  135. data/doc/Sprout/RemoteFileLoader.html +0 -172
  136. data/doc/Sprout/RemoteFileTarget.html +0 -679
  137. data/doc/Sprout/ReversedProgressBar.html +0 -194
  138. data/doc/Sprout/RubyFeature/ClassMethods.html +0 -1065
  139. data/doc/Sprout/RubyFeature.html +0 -155
  140. data/doc/Sprout/RubyGenerator.html +0 -764
  141. data/doc/Sprout/Specification.html +0 -767
  142. data/doc/Sprout/System/BaseSystem.html +0 -1455
  143. data/doc/Sprout/System/JavaSystem.html +0 -122
  144. data/doc/Sprout/System/OSXSystem.html +0 -335
  145. data/doc/Sprout/System/ThreadMock.html +0 -193
  146. data/doc/Sprout/System/UnixSystem.html +0 -584
  147. data/doc/Sprout/System/VistaSystem.html +0 -251
  148. data/doc/Sprout/System/WinNixSystem.html +0 -325
  149. data/doc/Sprout/System/WinSystem.html +0 -571
  150. data/doc/Sprout/System.html +0 -191
  151. data/doc/Sprout/ToolGenerator.html +0 -931
  152. data/doc/Sprout/VERSION.html +0 -128
  153. data/doc/Sprout.html +0 -144
  154. data/doc/SproutTestCase.html +0 -1412
  155. data/doc/String.html +0 -286
  156. data/doc/_index.html +0 -1035
  157. data/doc/class_list.html +0 -36
  158. data/doc/css/common.css +0 -1
  159. data/doc/css/full_list.css +0 -53
  160. data/doc/css/style.css +0 -310
  161. data/doc/file.README.html +0 -96
  162. data/doc/file.archive_unpacker.html +0 -288
  163. data/doc/file.base.html +0 -208
  164. data/doc/file.base_system.html +0 -278
  165. data/doc/file.boolean.html +0 -135
  166. data/doc/file.collection_param.html +0 -139
  167. data/doc/file.command.html +0 -126
  168. data/doc/file.concern.html +0 -136
  169. data/doc/file.daemon.html +0 -309
  170. data/doc/file.dir.html +0 -76
  171. data/doc/file.directory_manifest.html +0 -122
  172. data/doc/file.errors.html +0 -147
  173. data/doc/file.executable.html +0 -638
  174. data/doc/file.file_manifest.html +0 -109
  175. data/doc/file.file_param.html +0 -120
  176. data/doc/file.file_target.html +0 -140
  177. data/doc/file.files.html +0 -85
  178. data/doc/file.generator.html +0 -296
  179. data/doc/file.generator_class.html +0 -72
  180. data/doc/file.generator_generator.html +0 -137
  181. data/doc/file.generator_test.html +0 -92
  182. data/doc/file.generator_test_helper.html +0 -67
  183. data/doc/file.java_system.html +0 -62
  184. data/doc/file.library.html +0 -291
  185. data/doc/file.library_generator.html +0 -74
  186. data/doc/file.log.html +0 -100
  187. data/doc/file.manifest.html +0 -67
  188. data/doc/file.mxmlc.html +0 -740
  189. data/doc/file.number.html +0 -67
  190. data/doc/file.osx_system.html +0 -79
  191. data/doc/file.param.html +0 -491
  192. data/doc/file.parameter_factory.html +0 -119
  193. data/doc/file.path.html +0 -81
  194. data/doc/file.paths.html +0 -80
  195. data/doc/file.platform.html +0 -124
  196. data/doc/file.process_runner.html +0 -224
  197. data/doc/file.progress_bar.html +0 -390
  198. data/doc/file.rdoc_parser.html +0 -145
  199. data/doc/file.remote_file_loader.html +0 -117
  200. data/doc/file.remote_file_target.html +0 -176
  201. data/doc/file.ruby_base.html +0 -64
  202. data/doc/file.ruby_feature.html +0 -244
  203. data/doc/file.ruby_generator.html +0 -118
  204. data/doc/file.ruby_input.html +0 -62
  205. data/doc/file.ruby_test_case.html +0 -78
  206. data/doc/file.ruby_test_helper.html +0 -61
  207. data/doc/file.specification.html +0 -248
  208. data/doc/file.sprout.html +0 -64
  209. data/doc/file.sprout_test_case.html +0 -280
  210. data/doc/file.string.html +0 -72
  211. data/doc/file.string_param.html +0 -76
  212. data/doc/file.strings.html +0 -71
  213. data/doc/file.system.html +0 -86
  214. data/doc/file.template_manifest.html +0 -67
  215. data/doc/file.tool.html +0 -92
  216. data/doc/file.tool_generator.html +0 -90
  217. data/doc/file.unix_system.html +0 -128
  218. data/doc/file.url.html +0 -71
  219. data/doc/file.urls.html +0 -70
  220. data/doc/file.version.html +0 -71
  221. data/doc/file.vista_system.html +0 -69
  222. data/doc/file.win_nix_system.html +0 -88
  223. data/doc/file.win_system.html +0 -129
  224. data/doc/file_list.html +0 -230
  225. data/doc/frames.html +0 -13
  226. data/doc/index.html +0 -96
  227. data/doc/js/app.js +0 -202
  228. data/doc/js/full_list.js +0 -149
  229. data/doc/js/jquery.js +0 -154
  230. data/doc/method_list.html +0 -3355
  231. data/doc/top-level-namespace.html +0 -192
  232. data/lib/sprout/base.rb +0 -121
  233. data/lib/sprout/log.rb +0 -46
  234. data/test/unit/sprout_test_helper.rb +0 -33
@@ -1,145 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta name="Content-Type" content="text/html; charset=utf-8" />
6
- <title>File: rdoc_parser</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- relpath = '';
12
- if (relpath != '') relpath += '/';
13
- </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
-
17
- </head>
18
- <body>
19
- <script type="text/javascript" charset="utf-8">
20
- if (window.top.frames.main) document.body.className = 'frames';
21
- </script>
22
-
23
- <div id="header">
24
- <div id="menu">
25
-
26
- <a href="_index.html" title="Index">Index</a> &raquo;
27
- <span class="title">File: rdoc_parser</span>
28
-
29
-
30
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
- </div>
32
-
33
- <div id="search">
34
- <a id="class_list_link" href="#">Class List</a>
35
- <a id="method_list_link" href="#">Method List</a>
36
- <a id ="file_list_link" href="#">File List</a>
37
- </div>
38
-
39
- <div class="clear"></div>
40
- </div>
41
-
42
- <iframe id="search_frame"></iframe>
43
-
44
- <div id="content"><div id='filecontents'>
45
- <p>require ‘rdoc/rdoc’</p>
46
-
47
- <p>module Sprout</p>
48
-
49
- <pre class="code"><span class='kw'>class</span> <span class='const'>RDocParser</span>
50
-
51
- <span class='kw'>def</span> <span class='id parse'>parse</span> <span class='id content'>content</span>
52
- <span class='kw'>end</span>
53
-
54
- <span class='kw'>def</span> <span class='id parse_from_caller_string'>parse_from_caller_string</span> <span class='id caller_string'>caller_string</span>
55
- <span class='id class_name'>class_name</span><span class='comma'>,</span> <span class='id file_name'>file_name</span><span class='comma'>,</span> <span class='id line_number'>line_number</span> <span class='op'>=</span> <span class='id parse_caller_string'>parse_caller_string</span> <span class='id caller_string'>caller_string</span>
56
- <span class='id rdoc_description_for'>rdoc_description_for</span> <span class='id class_name'>class_name</span><span class='comma'>,</span> <span class='id file_name'>file_name</span><span class='comma'>,</span> <span class='id line_number'>line_number</span>
57
- <span class='kw'>end</span>
58
-
59
- <span class='id private'>private</span>
60
-
61
- <span class='comment'>##
62
- </span> <span class='comment'># NOTE: Don't forget that this string *sometimes* contains a colon on Windows...
63
- </span> <span class='kw'>def</span> <span class='id parse_caller_string'>parse_caller_string</span> <span class='id caller_string'>caller_string</span>
64
- <span class='id sections'>sections</span> <span class='op'>=</span> <span class='id caller_string'>caller_string</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
65
- <span class='id parts'>parts</span> <span class='op'>=</span> <span class='id sections'>sections</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
66
- <span class='id file_name'>file_name</span> <span class='op'>=</span> <span class='id parts'>parts</span><span class='period'>.</span><span class='id shift'>shift</span>
67
- <span class='id line_number'>line_number</span> <span class='op'>=</span> <span class='id parts'>parts</span><span class='period'>.</span><span class='id shift'>shift</span>
68
- <span class='id class_name'>class_name</span> <span class='op'>=</span> <span class='id class_name_from_caller_string'>class_name_from_caller_string</span> <span class='id caller_string'>caller_string</span>
69
- <span class='comment'>#puts &quot;&gt;&gt; class_name: #{class_name} file_name: #{file_name} line_number: #{line_number}&quot;
70
- </span> <span class='lbracket'>[</span><span class='id class_name'>class_name</span><span class='comma'>,</span> <span class='id file_name'>file_name</span><span class='comma'>,</span> <span class='id line_number'>line_number</span><span class='rbracket'>]</span>
71
- <span class='kw'>end</span>
72
-
73
- <span class='kw'>def</span> <span class='id class_name_from_caller_string'>class_name_from_caller_string</span> <span class='id caller_string'>caller_string</span>
74
- <span class='id parts'>parts</span> <span class='op'>=</span> <span class='id caller_string'>caller_string</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
75
- <span class='id long'>long</span> <span class='op'>=</span> <span class='id parts'>parts</span><span class='period'>.</span><span class='id pop'>pop</span>
76
- <span class='id matched'>matched</span> <span class='op'>=</span> <span class='id long'>long</span><span class='period'>.</span><span class='id match'>match</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>&lt;class:([\w:]+)&gt;</span><span class='regexp_end'>/</span></span>
77
- <span class='id matched'>matched</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id matched'>matched</span><span class='period'>.</span><span class='id nil?'>nil?</span>
78
- <span class='kw'>end</span>
79
-
80
- <span class='kw'>def</span> <span class='id rdoc_description_for'>rdoc_description_for</span> <span class='id class_name'>class_name</span><span class='comma'>,</span> <span class='id file_name'>file_name</span><span class='comma'>,</span> <span class='id line_number'>line_number</span>
81
- <span class='id rendered'>rendered</span> <span class='op'>=</span> <span class='id rendered_rdoc'>rendered_rdoc</span> <span class='id file_name'>file_name</span>
82
- <span class='kw'>end</span>
83
-
84
- <span class='kw'>def</span> <span class='id rendered_rdoc'>rendered_rdoc</span> <span class='id file'>file</span>
85
- <span class='ivar'>@rendered_rdoc</span> <span class='op'>||=</span> <span class='id render_rdoc'>render_rdoc</span> <span class='id file'>file</span>
86
- <span class='kw'>end</span>
87
-
88
- <span class='kw'>def</span> <span class='id render_rdoc'>render_rdoc</span> <span class='id file'>file</span>
89
- <span class='id rdoc'>rdoc</span> <span class='op'>=</span> <span class='const'>RDoc</span><span class='op'>::</span><span class='const'>RDoc</span><span class='period'>.</span><span class='id new'>new</span>
90
- <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>===================================</span><span class='tstring_end'>&quot;</span></span>
91
- <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;&gt; generating rdoc for: </span><span class='embexpr_beg'>#{</span><span class='id file'>file</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
92
-
93
- <span class='id rdoc'>rdoc</span><span class='period'>.</span><span class='id document'>document</span> <span class='lbracket'>[</span> <span class='id file'>file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--format=xml</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--output=temp</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span>
94
- <span class='lbrace'>{</span><span class='rbrace'>}</span>
95
- <span class='kw'>end</span>
96
-
97
- <span class='kw'>def</span> <span class='id render_rdoc_from_files'>render_rdoc_from_files</span>
98
- <span class='comment'># This works to some extent...
99
- </span> <span class='comment'>#rdoc test/fixtures/examples/echo_inputs.rb --fmt=xml --op=tmp --all -q
100
- </span> <span class='comment'># But the following does not do the same thing:
101
- </span> <span class='comment'>#response = rdoc.document [ file, '--fmt=xml', '--op=tmp', '--all', '-q' ]
102
- </span>
103
- <span class='id options'>options</span> <span class='op'>=</span> <span class='const'>RDoc</span><span class='op'>::</span><span class='const'>Options</span><span class='period'>.</span><span class='id new'>new</span>
104
- <span class='id options'>options</span><span class='period'>.</span><span class='id files'>files</span> <span class='op'>=</span> <span class='const'>FileList</span><span class='lbracket'>[</span> <span class='id file'>file</span> <span class='rbracket'>]</span>
105
- <span class='id options'>options</span><span class='period'>.</span><span class='id formatter'>formatter</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>markup</span><span class='tstring_end'>'</span></span>
106
- <span class='id options'>options</span><span class='period'>.</span><span class='id op_dir'>op_dir</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>./tmp</span><span class='tstring_end'>'</span></span>
107
- <span class='id options'>options</span><span class='period'>.</span><span class='id verbosity'>verbosity</span> <span class='op'>=</span> <span class='int'>0</span>
108
-
109
- <span class='id rdoc'>rdoc</span><span class='period'>.</span><span class='id options'>options</span> <span class='op'>=</span> <span class='id options'>options</span>
110
-
111
- <span class='comment'>#rdoc.stats = RDoc::Stats.new 1, options.verbosity
112
- </span> <span class='comment'>#response = rdoc.document []
113
- </span>
114
- <span class='id response'>response</span> <span class='op'>=</span> <span class='id rdoc'>rdoc</span><span class='period'>.</span><span class='id parse_files'>parse_files</span> <span class='lbracket'>[</span> <span class='id file'>file</span> <span class='rbracket'>]</span>
115
- <span class='id render_rdoc_toplevel'>render_rdoc_toplevel</span> <span class='id response'>response</span>
116
- <span class='kw'>end</span>
117
-
118
- <span class='kw'>def</span> <span class='id render_rdoc_toplevel'>render_rdoc_toplevel</span> <span class='id toplevel'>toplevel</span>
119
- <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;&gt; toplevel: </span><span class='embexpr_beg'>#{</span><span class='id toplevel'>toplevel</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
120
- <span class='id toplevel'>toplevel</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id file'>file</span><span class='op'>|</span>
121
- <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;&gt; file: </span><span class='embexpr_beg'>#{</span><span class='id file'>file</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
122
- <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;&gt; pretty: </span><span class='embexpr_beg'>#{</span><span class='id file'>file</span><span class='period'>.</span><span class='id pretty_print'>pretty_print</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
123
- <span class='kw'>end</span>
124
-
125
- <span class='id toplevel'>toplevel</span>
126
- <span class='kw'>end</span>
127
-
128
- <span class='kw'>def</span> <span class='id render_rdoc_bak'>render_rdoc_bak</span> <span class='id file'>file</span>
129
- <span class='id rdoc'>rdoc</span> <span class='op'>=</span> <span class='const'>RDoc</span><span class='op'>::</span><span class='const'>RDoc</span><span class='period'>.</span><span class='id new'>new</span>
130
- <span class='id rdoc'>rdoc</span><span class='period'>.</span><span class='id options'>options</span> <span class='op'>=</span> <span class='const'>RDoc</span><span class='op'>::</span><span class='const'>Options</span><span class='period'>.</span><span class='id new'>new</span>
131
- <span class='id rdoc'>rdoc</span><span class='period'>.</span><span class='id parse_files'>parse_files</span> <span class='lbracket'>[</span><span class='id file'>file</span><span class='rbracket'>]</span>
132
- <span class='kw'>end</span>
133
- <span class='kw'>end</span></pre>
134
-
135
- <p>end</p>
136
- </div></div>
137
-
138
- <div id="footer">
139
- Generated on Wed Dec 22 11:58:32 2010 by
140
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
141
- 0.6.3 (ruby-1.9.2).
142
- </div>
143
-
144
- </body>
145
- </html>
@@ -1,117 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta name="Content-Type" content="text/html; charset=utf-8" />
6
- <title>File: remote_file_loader</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- relpath = '';
12
- if (relpath != '') relpath += '/';
13
- </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
-
17
- </head>
18
- <body>
19
- <script type="text/javascript" charset="utf-8">
20
- if (window.top.frames.main) document.body.className = 'frames';
21
- </script>
22
-
23
- <div id="header">
24
- <div id="menu">
25
-
26
- <a href="_index.html" title="Index">Index</a> &raquo;
27
- <span class="title">File: remote_file_loader</span>
28
-
29
-
30
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
- </div>
32
-
33
- <div id="search">
34
- <a id="class_list_link" href="#">Class List</a>
35
- <a id="method_list_link" href="#">Method List</a>
36
- <a id ="file_list_link" href="#">File List</a>
37
- </div>
38
-
39
- <div class="clear"></div>
40
- </div>
41
-
42
- <iframe id="search_frame"></iframe>
43
-
44
- <div id="content"><div id='filecontents'>
45
- <p>module Sprout</p>
46
-
47
- <pre class="code"><span class='comment'>##
48
- </span><span class='comment'># This class is used to load remote files from the network.
49
- </span><span class='kw'>class</span> <span class='const'>RemoteFileLoader</span>
50
-
51
- <span class='kw'>class</span> <span class='op'>&lt;&lt;</span> <span class='kw'>self</span>
52
-
53
- <span class='kw'>def</span> <span class='id load'>load</span> <span class='id uri'>uri</span><span class='comma'>,</span> <span class='id md5'>md5</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id display_name'>display_name</span><span class='op'>=</span><span class='kw'>nil</span>
54
- <span class='id fetch'>fetch</span> <span class='id uri'>uri</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='comma'>,</span> <span class='id display_name'>display_name</span>
55
- <span class='kw'>end</span>
56
-
57
- <span class='id private'>private</span>
58
-
59
- <span class='kw'>def</span> <span class='id fetch'>fetch</span> <span class='id uri'>uri</span><span class='comma'>,</span> <span class='id display_name'>display_name</span><span class='op'>=</span><span class='kw'>nil</span>
60
- <span class='kw'>begin</span>
61
- <span class='kw'>return</span> <span class='id open_uri'>open_uri</span> <span class='id uri'>uri</span><span class='comma'>,</span> <span class='id display_name'>display_name</span>
62
- <span class='kw'>rescue</span> <span class='const'>SocketError</span> <span class='op'>=&gt;</span> <span class='id sock_err'>sock_err</span>
63
- <span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>RemoteFileLoaderError</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[ERROR] Failed to load file from: '</span><span class='embexpr_beg'>#{</span><span class='id uri'>uri</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_content'>' - Please check that your machine has a connection to the internet.\n[REMOTE ERROR] </span><span class='embexpr_beg'>#{</span><span class='id sock_err'>sock_err</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
64
- <span class='kw'>rescue</span> <span class='const'>OpenURI</span><span class='op'>::</span><span class='const'>HTTPError</span> <span class='op'>=&gt;</span> <span class='id http_err'>http_err</span>
65
- <span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>RemoteFileLoaderError</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[ERROR] Failed to load file from: '</span><span class='embexpr_beg'>#{</span><span class='id uri'>uri</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_content'>'\n[REMOTE ERROR] </span><span class='embexpr_beg'>#{</span><span class='id http_err'>http_err</span><span class='period'>.</span><span class='id io'>io</span><span class='period'>.</span><span class='id read'>read</span><span class='period'>.</span><span class='id strip'>strip</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
66
- <span class='kw'>rescue</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>ECONNREFUSED</span> <span class='op'>=&gt;</span> <span class='id econ_err'>econ_err</span>
67
- <span class='id raise'>raise</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>ECONNREFUSED</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[ERROR] Connection refused at: '</span><span class='embexpr_beg'>#{</span><span class='id uri'>uri</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
68
- <span class='kw'>end</span>
69
- <span class='kw'>end</span>
70
-
71
- <span class='id private'>private</span>
72
-
73
- <span class='kw'>def</span> <span class='id open_uri'>open_uri</span> <span class='id uri'>uri</span><span class='comma'>,</span> <span class='id display_name'>display_name</span><span class='op'>=</span><span class='kw'>nil</span>
74
- <span class='id uri'>uri</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id parse'>parse</span><span class='lparen'>(</span><span class='id uri'>uri</span><span class='rparen'>)</span>
75
- <span class='id progress'>progress</span> <span class='op'>=</span> <span class='kw'>nil</span>
76
- <span class='id response'>response</span> <span class='op'>=</span> <span class='kw'>nil</span>
77
- <span class='id display_name'>display_name</span> <span class='op'>||=</span> <span class='id uri'>uri</span><span class='period'>.</span><span class='id path'>path</span><span class='period'>.</span><span class='id split'>split</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='rparen'>)</span><span class='period'>.</span><span class='id pop'>pop</span>
78
-
79
- <span class='comment'># Why was this here? Shouldn't the 'open' command work for other
80
- </span> <span class='comment'># protocols like https?
81
- </span> <span class='comment'>#
82
- </span> <span class='comment'>#message = &quot;The RemoteFileTask failed for #{display_name}. We can only handle HTTP requests at this time, it seems you were trying: '#{uri.scheme}'&quot;
83
- </span> <span class='comment'>#raise Sprout::Errors::RemoteFileLoaderError.new(message) if uri.scheme != 'http' || uri.scheme != 'https'
84
- </span>
85
- <span class='comment'># This is the strangest implementation I've seen in Ruby yet.
86
- </span> <span class='comment'># Double lambda arguments with a block to top it off?! Gawsh.
87
- </span> <span class='id open'>open</span><span class='lparen'>(</span><span class='id uri'>uri</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='comma'>,</span>
88
- <span class='symbol'>:content_length_proc</span> <span class='op'>=&gt;</span> <span class='id lambda'>lambda</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id length'>length</span><span class='op'>|</span>
89
- <span class='id length'>length</span> <span class='op'>||=</span> <span class='int'>0</span>
90
- <span class='id progress'>progress</span> <span class='op'>=</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>ProgressBar</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id display_name'>display_name</span><span class='comma'>,</span> <span class='id length'>length</span><span class='rparen'>)</span>
91
- <span class='id progress'>progress</span><span class='period'>.</span><span class='id file_transfer_mode'>file_transfer_mode</span>
92
- <span class='id progress'>progress</span><span class='period'>.</span><span class='id set'>set</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
93
- <span class='rbrace'>}</span><span class='comma'>,</span>
94
- <span class='symbol'>:progress_proc</span> <span class='op'>=&gt;</span> <span class='id lambda'>lambda</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id length'>length</span><span class='op'>|</span>
95
- <span class='id progress'>progress</span><span class='period'>.</span><span class='id set'>set</span> <span class='id length'>length</span> <span class='kw'>if</span> <span class='id progress'>progress</span>
96
- <span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id f'>f</span><span class='op'>|</span>
97
- <span class='id response'>response</span> <span class='op'>=</span> <span class='id f'>f</span><span class='period'>.</span><span class='id read'>read</span>
98
- <span class='id progress'>progress</span><span class='period'>.</span><span class='id finish'>finish</span>
99
- <span class='kw'>end</span>
100
-
101
- <span class='id response'>response</span>
102
- <span class='kw'>end</span>
103
-
104
- <span class='kw'>end</span>
105
- <span class='kw'>end</span></pre>
106
-
107
- <p>end</p>
108
- </div></div>
109
-
110
- <div id="footer">
111
- Generated on Wed Dec 22 11:58:32 2010 by
112
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
113
- 0.6.3 (ruby-1.9.2).
114
- </div>
115
-
116
- </body>
117
- </html>
@@ -1,176 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta name="Content-Type" content="text/html; charset=utf-8" />
6
- <title>File: remote_file_target</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- relpath = '';
12
- if (relpath != '') relpath += '/';
13
- </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
-
17
- </head>
18
- <body>
19
- <script type="text/javascript" charset="utf-8">
20
- if (window.top.frames.main) document.body.className = 'frames';
21
- </script>
22
-
23
- <div id="header">
24
- <div id="menu">
25
-
26
- <a href="_index.html" title="Index">Index</a> &raquo;
27
- <span class="title">File: remote_file_target</span>
28
-
29
-
30
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
- </div>
32
-
33
- <div id="search">
34
- <a id="class_list_link" href="#">Class List</a>
35
- <a id="method_list_link" href="#">Method List</a>
36
- <a id ="file_list_link" href="#">File List</a>
37
- </div>
38
-
39
- <div class="clear"></div>
40
- </div>
41
-
42
- <iframe id="search_frame"></iframe>
43
-
44
- <div id="content"><div id='filecontents'>
45
- <p>require ‘digest/md5’</p>
46
-
47
- <p>module Sprout</p>
48
-
49
- <pre class="code"><span class='kw'>class</span> <span class='const'>RemoteFileTarget</span> <span class='op'>&lt;</span> <span class='const'>FileTarget</span>
50
-
51
- <span class='id attr_accessor'>attr_accessor</span> <span class='symbol'>:archive_type</span>
52
- <span class='id attr_accessor'>attr_accessor</span> <span class='symbol'>:url</span>
53
- <span class='id attr_accessor'>attr_accessor</span> <span class='symbol'>:md5</span>
54
-
55
- <span class='kw'>def</span> <span class='id validate'>validate</span>
56
- <span class='kw'>super</span>
57
- <span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>ValidationError</span><span class='period'>.</span><span class='id new'>new</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>RemoteFileTarget.url is a required field</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id url'>url</span><span class='period'>.</span><span class='id nil?'>nil?</span>
58
- <span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>ValidationError</span><span class='period'>.</span><span class='id new'>new</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>RemoteFileTarget.md5 is a required field</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id md5'>md5</span><span class='period'>.</span><span class='id nil?'>nil?</span>
59
- <span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>ValidationError</span><span class='period'>.</span><span class='id new'>new</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>RemoteFileTarget.archive_type is a required field</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id archive_type'>archive_type</span><span class='period'>.</span><span class='id nil?'>nil?</span>
60
- <span class='kw'>end</span>
61
-
62
- <span class='kw'>def</span> <span class='id resolve'>resolve</span>
63
- <span class='id validate'>validate</span>
64
- <span class='id load_unpack_or_ignore_archive'>load_unpack_or_ignore_archive</span>
65
- <span class='kw'>self</span>
66
- <span class='kw'>end</span>
67
-
68
- <span class='comment'>##
69
- </span> <span class='comment'># Do not cache this value...
70
- </span> <span class='comment'>#
71
- </span> <span class='comment'># This response can change over time IF:
72
- </span> <span class='comment'># - The downloaded bytes do not match the expected MD5
73
- </span> <span class='comment'># - AND the user confirms the prompt that they are OK with this
74
- </span> <span class='kw'>def</span> <span class='id downloaded_file'>downloaded_file</span>
75
- <span class='const'>File</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='const'>Sprout</span><span class='period'>.</span><span class='id cache'>cache</span><span class='comma'>,</span> <span class='id pkg_name'>pkg_name</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id md5'>md5</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id archive_type'>archive_type</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
76
- <span class='kw'>end</span>
77
-
78
- <span class='kw'>def</span> <span class='id unpacked_file'>unpacked_file</span>
79
- <span class='id upcased_pkg'>upcased_pkg</span> <span class='op'>=</span> <span class='id pkg_name'>pkg_name</span><span class='period'>.</span><span class='id upcase'>upcase</span>
80
- <span class='id upcased_version'>upcased_version</span> <span class='op'>=</span> <span class='id pkg_version'>pkg_version</span><span class='period'>.</span><span class='id upcase'>upcase</span><span class='period'>.</span><span class='id gsub'>gsub</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\.</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_</span><span class='tstring_end'>'</span></span>
81
- <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>SPROUT_</span><span class='embexpr_beg'>#{</span><span class='id upcased_pkg'>upcased_pkg</span><span class='rbrace'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id upcased_version'>upcased_version</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>||</span>
82
- <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>SPROUT_</span><span class='embexpr_beg'>#{</span><span class='id upcased_pkg'>upcased_pkg</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>||</span>
83
- <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id upcased_pkg'>upcased_pkg</span><span class='rbrace'>}</span><span class='tstring_content'>_</span><span class='embexpr_beg'>#{</span><span class='id upcased_version'>upcased_version</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>||</span>
84
- <span class='const'>ENV</span><span class='lbracket'>[</span><span class='id upcased_pkg'>upcased_pkg</span><span class='rbracket'>]</span> <span class='op'>||</span>
85
- <span class='const'>File</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='const'>Sprout</span><span class='period'>.</span><span class='id cache'>cache</span><span class='comma'>,</span> <span class='id pkg_name'>pkg_name</span><span class='comma'>,</span> <span class='id pkg_version'>pkg_version</span><span class='rparen'>)</span>
86
- <span class='kw'>end</span>
87
-
88
- <span class='id protected'>protected</span>
89
-
90
- <span class='kw'>def</span> <span class='id logger'>logger</span>
91
- <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Log</span>
92
- <span class='kw'>end</span>
93
-
94
- <span class='kw'>def</span> <span class='id expand_local_path'>expand_local_path</span> <span class='id path'>path</span>
95
- <span class='const'>File</span><span class='period'>.</span><span class='id join'>join</span> <span class='id unpacked_file'>unpacked_file</span><span class='comma'>,</span> <span class='id path'>path</span>
96
- <span class='kw'>end</span>
97
-
98
- <span class='id private'>private</span>
99
-
100
- <span class='kw'>def</span> <span class='id load_unpack_or_ignore_archive'>load_unpack_or_ignore_archive</span>
101
- <span class='kw'>if</span><span class='lparen'>(</span><span class='op'>!</span><span class='id unpacked_files_exist?'>unpacked_files_exist?</span><span class='rparen'>)</span>
102
- <span class='kw'>if</span><span class='lparen'>(</span><span class='op'>!</span><span class='const'>File</span><span class='period'>.</span><span class='id exists?'>exists?</span><span class='lparen'>(</span><span class='id downloaded_file'>downloaded_file</span><span class='rparen'>)</span><span class='rparen'>)</span>
103
- <span class='id bytes'>bytes</span> <span class='op'>=</span> <span class='id download_archive'>download_archive</span>
104
- <span class='id write_archive'>write_archive</span> <span class='id bytes'>bytes</span>
105
- <span class='kw'>end</span>
106
-
107
- <span class='comment'># If we *just* downloaded the file,
108
- </span> <span class='comment'># use the bytes directly, otherwise
109
- </span> <span class='comment'># read them off disk from a previous
110
- </span> <span class='comment'># download attempt:
111
- </span> <span class='id bytes'>bytes</span> <span class='op'>||=</span> <span class='const'>File</span><span class='period'>.</span><span class='id open'>open</span><span class='lparen'>(</span><span class='id downloaded_file'>downloaded_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rb</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id read'>read</span>
112
-
113
- <span class='kw'>if</span> <span class='id should_unpack?'>should_unpack?</span><span class='lparen'>(</span><span class='id bytes'>bytes</span><span class='comma'>,</span> <span class='id md5'>md5</span><span class='rparen'>)</span>
114
- <span class='id unpack_archive'>unpack_archive</span>
115
- <span class='kw'>end</span>
116
- <span class='kw'>end</span>
117
- <span class='kw'>end</span>
118
-
119
- <span class='kw'>def</span> <span class='id unpacked_files_exist?'>unpacked_files_exist?</span>
120
- <span class='const'>File</span><span class='period'>.</span><span class='id exists?'>exists?</span><span class='lparen'>(</span><span class='id unpacked_file'>unpacked_file</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='const'>Dir</span><span class='period'>.</span><span class='id empty?'>empty?</span><span class='lparen'>(</span><span class='id unpacked_file'>unpacked_file</span><span class='rparen'>)</span>
121
- <span class='kw'>end</span>
122
-
123
- <span class='kw'>def</span> <span class='id download_archive'>download_archive</span>
124
- <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>RemoteFileLoader</span><span class='period'>.</span><span class='id load'>load</span> <span class='id url'>url</span><span class='comma'>,</span> <span class='id pkg_name'>pkg_name</span>
125
- <span class='kw'>end</span>
126
-
127
- <span class='kw'>def</span> <span class='id write_archive'>write_archive</span> <span class='id bytes'>bytes</span>
128
- <span class='const'>FileUtils</span><span class='period'>.</span><span class='id mkdir_p'>mkdir_p</span> <span class='const'>File</span><span class='period'>.</span><span class='id dirname'>dirname</span><span class='lparen'>(</span><span class='id downloaded_file'>downloaded_file</span><span class='rparen'>)</span>
129
- <span class='const'>File</span><span class='period'>.</span><span class='id open'>open</span> <span class='id downloaded_file'>downloaded_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>wb+</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id f'>f</span><span class='op'>|</span>
130
- <span class='id f'>f</span><span class='period'>.</span><span class='id write'>write</span> <span class='id bytes'>bytes</span>
131
- <span class='kw'>end</span>
132
- <span class='kw'>end</span>
133
-
134
- <span class='kw'>def</span> <span class='id should_unpack?'>should_unpack?</span> <span class='id bytes'>bytes</span><span class='comma'>,</span> <span class='id expected_md5sum'>expected_md5sum</span>
135
- <span class='kw'>if</span> <span class='id expected_md5sum'>expected_md5sum</span>
136
- <span class='id downloaded_md5'>downloaded_md5</span> <span class='op'>=</span> <span class='const'>Digest</span><span class='op'>::</span><span class='const'>MD5</span><span class='period'>.</span><span class='id new'>new</span>
137
- <span class='id downloaded_md5'>downloaded_md5</span> <span class='op'>&lt;&lt;</span> <span class='id bytes'>bytes</span>
138
-
139
- <span class='kw'>if</span><span class='lparen'>(</span><span class='id expected_md5sum'>expected_md5sum</span> <span class='op'>!=</span> <span class='id downloaded_md5'>downloaded_md5</span><span class='period'>.</span><span class='id hexdigest'>hexdigest</span><span class='rparen'>)</span>
140
- <span class='kw'>return</span> <span class='id prompt_for_md5_failure'>prompt_for_md5_failure</span> <span class='id downloaded_md5'>downloaded_md5</span><span class='comma'>,</span> <span class='id expected_md5sum'>expected_md5sum</span>
141
- <span class='kw'>end</span>
142
- <span class='kw'>end</span>
143
- <span class='kw'>return</span> <span class='kw'>true</span>
144
- <span class='kw'>end</span>
145
-
146
- <span class='kw'>def</span> <span class='id prompt_for_md5_failure'>prompt_for_md5_failure</span> <span class='id downloaded_md5'>downloaded_md5</span><span class='comma'>,</span> <span class='id expected_md5sum'>expected_md5sum</span>
147
- <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The MD5 Sum of the downloaded file (</span><span class='embexpr_beg'>#{</span><span class='id downloaded_md5'>downloaded_md5</span><span class='period'>.</span><span class='id hexdigest'>hexdigest</span><span class='rbrace'>}</span><span class='tstring_content'>) does not match what was expected (</span><span class='embexpr_beg'>#{</span><span class='id expected_md5sum'>expected_md5sum</span><span class='rbrace'>}</span><span class='tstring_content'>).</span><span class='tstring_end'>&quot;</span></span>
148
- <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Would you like to install anyway? [Yn]</span><span class='tstring_end'>&quot;</span></span>
149
- <span class='id user_response'>user_response</span> <span class='op'>=</span> <span class='gvar'>$stdin</span><span class='period'>.</span><span class='id gets'>gets</span><span class='period'>.</span><span class='id chomp!'>chomp!</span>
150
- <span class='kw'>if</span><span class='lparen'>(</span><span class='id user_response'>user_response</span><span class='period'>.</span><span class='id downcase'>downcase</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>y</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
151
- <span class='kw'>return</span> <span class='kw'>true</span>
152
- <span class='kw'>else</span>
153
- <span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>RemoteFileLoaderError</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>MD5 Checksum failed</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
154
- <span class='kw'>end</span>
155
- <span class='kw'>end</span>
156
-
157
- <span class='kw'>def</span> <span class='id unpack_archive'>unpack_archive</span>
158
- <span class='id logger'>logger</span><span class='period'>.</span><span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unpacking archive at </span><span class='embexpr_beg'>#{</span><span class='id downloaded_file'>downloaded_file</span><span class='rbrace'>}</span><span class='tstring_content'> now. This can take anywhere from a few seconds to many minutes depending on your OS and the size of the archive.\n\nIf you're on windows, consider using this ample time to look into improving the zip utils in Ruby...</span><span class='tstring_end'>&quot;</span></span>
159
- <span class='const'>FileUtils</span><span class='period'>.</span><span class='id mkdir_p'>mkdir_p</span> <span class='id unpacked_file'>unpacked_file</span>
160
- <span class='id unpacker'>unpacker</span> <span class='op'>=</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>ArchiveUnpacker</span><span class='period'>.</span><span class='id new'>new</span>
161
- <span class='id unpacker'>unpacker</span><span class='period'>.</span><span class='id unpack'>unpack</span> <span class='id downloaded_file'>downloaded_file</span><span class='comma'>,</span> <span class='id unpacked_file'>unpacked_file</span><span class='comma'>,</span> <span class='id archive_type'>archive_type</span>
162
- <span class='kw'>end</span>
163
-
164
- <span class='kw'>end</span></pre>
165
-
166
- <p>end</p>
167
- </div></div>
168
-
169
- <div id="footer">
170
- Generated on Wed Dec 22 11:58:32 2010 by
171
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
172
- 0.6.3 (ruby-1.9.2).
173
- </div>
174
-
175
- </body>
176
- </html>
@@ -1,64 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta name="Content-Type" content="text/html; charset=utf-8" />
6
- <title>File: ruby_base</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- relpath = '';
12
- if (relpath != '') relpath += '/';
13
- </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
-
17
- </head>
18
- <body>
19
- <script type="text/javascript" charset="utf-8">
20
- if (window.top.frames.main) document.body.className = 'frames';
21
- </script>
22
-
23
- <div id="header">
24
- <div id="menu">
25
-
26
- <a href="_index.html" title="Index">Index</a> &raquo;
27
- <span class="title">File: ruby_base</span>
28
-
29
-
30
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
- </div>
32
-
33
- <div id="search">
34
- <a id="class_list_link" href="#">Class List</a>
35
- <a id="method_list_link" href="#">Method List</a>
36
- <a id ="file_list_link" href="#">File List</a>
37
- </div>
38
-
39
- <div class="clear"></div>
40
- </div>
41
-
42
- <iframe id="search_frame"></iframe>
43
-
44
- <div id="content"><div id='filecontents'>
45
- <p>require ‘sprout’</p>
46
-
47
- <p>module &lt;%= input.camel_case %&gt;</p>
48
-
49
- <pre class="code"><span class='kw'>class</span> <span class='const'>Base</span>
50
- <span class='id include'>include</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Executable</span>
51
-
52
- <span class='kw'>end</span></pre>
53
-
54
- <p>end</p>
55
- </div></div>
56
-
57
- <div id="footer">
58
- Generated on Wed Dec 22 11:58:32 2010 by
59
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
60
- 0.6.3 (ruby-1.9.2).
61
- </div>
62
-
63
- </body>
64
- </html>