nucleon 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. checksums.yaml +7 -7
  2. data/.gitignore +50 -0
  3. data/ARCHITECTURE.rdoc +12 -11
  4. data/Gemfile +7 -11
  5. data/Gemfile.lock +47 -70
  6. data/Rakefile +22 -20
  7. data/TODO.rdoc +1 -1
  8. data/VERSION +1 -1
  9. data/bin/nucleon +16 -15
  10. data/lib/core/codes.rb +65 -38
  11. data/lib/core/config.rb +774 -153
  12. data/lib/core/config/collection.rb +134 -25
  13. data/lib/core/config/options.rb +160 -36
  14. data/lib/core/core.rb +207 -45
  15. data/lib/core/environment.rb +626 -206
  16. data/lib/core/facade.rb +211 -185
  17. data/lib/core/gems.rb +60 -44
  18. data/lib/core/manager.rb +587 -237
  19. data/lib/core/mixin/colors.rb +66 -36
  20. data/lib/core/mixin/config/collection.rb +58 -23
  21. data/lib/core/mixin/config/options.rb +67 -24
  22. data/lib/core/mixin/macro/object_interface.rb +129 -135
  23. data/lib/core/mixin/macro/plugin_interface.rb +118 -124
  24. data/lib/core/mixin/settings.rb +7 -13
  25. data/lib/core/mixin/sub_config.rb +37 -43
  26. data/lib/core/mod/hash.rb +31 -10
  27. data/lib/core/plugin/action.rb +274 -238
  28. data/lib/core/plugin/base.rb +140 -132
  29. data/lib/core/plugin/project.rb +316 -311
  30. data/lib/core/util/cli.rb +146 -146
  31. data/lib/core/util/console.rb +567 -124
  32. data/lib/core/util/data.rb +654 -139
  33. data/lib/core/util/logger.rb +255 -66
  34. data/lib/nucleon.rb +6 -8
  35. data/lib/nucleon_base.rb +364 -106
  36. data/nucleon.gemspec +40 -389
  37. data/spec/core/codes_spec.rb +209 -0
  38. data/spec/core/config_spec.rb +810 -0
  39. data/spec/core/core_spec.rb +185 -0
  40. data/spec/core/environment_spec.rb +148 -0
  41. data/spec/core/util/console_spec.rb +254 -446
  42. data/spec/nucleon/test.rb +59 -0
  43. data/spec/nucleon/test/first.rb +28 -0
  44. data/spec/nucleon/test/second.rb +28 -0
  45. data/spec/nucleon_codes.rb +98 -0
  46. data/spec/nucleon_config.rb +523 -0
  47. data/spec/nucleon_plugin.rb +439 -0
  48. data/spec/nucleon_test.rb +34 -0
  49. data/spec/spec_helper.rb +6 -4
  50. metadata +157 -615
  51. data/.document +0 -5
  52. data/rdoc/site/0.1.19/ARCHITECTURE_rdoc.html +0 -634
  53. data/rdoc/site/0.1.19/Hash.html +0 -347
  54. data/rdoc/site/0.1.19/Kernel.html +0 -413
  55. data/rdoc/site/0.1.19/Nucleon.html +0 -570
  56. data/rdoc/site/0.1.19/Nucleon/Action.html +0 -280
  57. data/rdoc/site/0.1.19/Nucleon/Action/Add.html +0 -458
  58. data/rdoc/site/0.1.19/Nucleon/Action/Create.html +0 -415
  59. data/rdoc/site/0.1.19/Nucleon/Action/Extract.html +0 -413
  60. data/rdoc/site/0.1.19/Nucleon/Action/Remove.html +0 -461
  61. data/rdoc/site/0.1.19/Nucleon/Action/Save.html +0 -434
  62. data/rdoc/site/0.1.19/Nucleon/Action/Update.html +0 -381
  63. data/rdoc/site/0.1.19/Nucleon/Codes.html +0 -563
  64. data/rdoc/site/0.1.19/Nucleon/Command.html +0 -275
  65. data/rdoc/site/0.1.19/Nucleon/Command/Bash.html +0 -544
  66. data/rdoc/site/0.1.19/Nucleon/Config.html +0 -1623
  67. data/rdoc/site/0.1.19/Nucleon/Config/Collection.html +0 -509
  68. data/rdoc/site/0.1.19/Nucleon/Config/Options.html +0 -489
  69. data/rdoc/site/0.1.19/Nucleon/Core.html +0 -635
  70. data/rdoc/site/0.1.19/Nucleon/Errors.html +0 -275
  71. data/rdoc/site/0.1.19/Nucleon/Errors/BatchError.html +0 -281
  72. data/rdoc/site/0.1.19/Nucleon/Errors/NucleonError.html +0 -657
  73. data/rdoc/site/0.1.19/Nucleon/Errors/SSHUnavailable.html +0 -281
  74. data/rdoc/site/0.1.19/Nucleon/Event.html +0 -275
  75. data/rdoc/site/0.1.19/Nucleon/Event/Regex.html +0 -467
  76. data/rdoc/site/0.1.19/Nucleon/Facade.html +0 -2336
  77. data/rdoc/site/0.1.19/Nucleon/Gems.html +0 -635
  78. data/rdoc/site/0.1.19/Nucleon/Manager.html +0 -1828
  79. data/rdoc/site/0.1.19/Nucleon/Mixin.html +0 -284
  80. data/rdoc/site/0.1.19/Nucleon/Mixin/Action.html +0 -277
  81. data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Commit.html +0 -381
  82. data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Project.html +0 -395
  83. data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Push.html +0 -371
  84. data/rdoc/site/0.1.19/Nucleon/Mixin/Colors.html +0 -545
  85. data/rdoc/site/0.1.19/Nucleon/Mixin/ConfigCollection.html +0 -481
  86. data/rdoc/site/0.1.19/Nucleon/Mixin/ConfigOptions.html +0 -449
  87. data/rdoc/site/0.1.19/Nucleon/Mixin/Macro.html +0 -276
  88. data/rdoc/site/0.1.19/Nucleon/Mixin/Macro/ObjectInterface.html +0 -695
  89. data/rdoc/site/0.1.19/Nucleon/Mixin/Macro/PluginInterface.html +0 -682
  90. data/rdoc/site/0.1.19/Nucleon/Mixin/Settings.html +0 -481
  91. data/rdoc/site/0.1.19/Nucleon/Mixin/SubConfig.html +0 -887
  92. data/rdoc/site/0.1.19/Nucleon/Parallel.html +0 -325
  93. data/rdoc/site/0.1.19/Nucleon/Parallel/ClassMethods.html +0 -325
  94. data/rdoc/site/0.1.19/Nucleon/Parallel/InstanceMethods.html +0 -334
  95. data/rdoc/site/0.1.19/Nucleon/Plugin.html +0 -282
  96. data/rdoc/site/0.1.19/Nucleon/Plugin/Action.html +0 -1368
  97. data/rdoc/site/0.1.19/Nucleon/Plugin/Action/Option.html +0 -459
  98. data/rdoc/site/0.1.19/Nucleon/Plugin/Base.html +0 -1737
  99. data/rdoc/site/0.1.19/Nucleon/Plugin/Command.html +0 -721
  100. data/rdoc/site/0.1.19/Nucleon/Plugin/Event.html +0 -442
  101. data/rdoc/site/0.1.19/Nucleon/Plugin/Extension.html +0 -281
  102. data/rdoc/site/0.1.19/Nucleon/Plugin/Project.html +0 -2864
  103. data/rdoc/site/0.1.19/Nucleon/Plugin/Template.html +0 -476
  104. data/rdoc/site/0.1.19/Nucleon/Plugin/Translator.html +0 -371
  105. data/rdoc/site/0.1.19/Nucleon/Project.html +0 -276
  106. data/rdoc/site/0.1.19/Nucleon/Project/Git.html +0 -1801
  107. data/rdoc/site/0.1.19/Nucleon/Project/Github.html +0 -549
  108. data/rdoc/site/0.1.19/Nucleon/Template.html +0 -277
  109. data/rdoc/site/0.1.19/Nucleon/Template/Json.html +0 -329
  110. data/rdoc/site/0.1.19/Nucleon/Template/Wrapper.html +0 -329
  111. data/rdoc/site/0.1.19/Nucleon/Template/Yaml.html +0 -329
  112. data/rdoc/site/0.1.19/Nucleon/Translator.html +0 -276
  113. data/rdoc/site/0.1.19/Nucleon/Translator/Json.html +0 -366
  114. data/rdoc/site/0.1.19/Nucleon/Translator/Yaml.html +0 -366
  115. data/rdoc/site/0.1.19/Nucleon/Util.html +0 -285
  116. data/rdoc/site/0.1.19/Nucleon/Util/CLI.html +0 -388
  117. data/rdoc/site/0.1.19/Nucleon/Util/CLI/Parser.html +0 -1183
  118. data/rdoc/site/0.1.19/Nucleon/Util/Cache.html +0 -780
  119. data/rdoc/site/0.1.19/Nucleon/Util/Console.html +0 -1294
  120. data/rdoc/site/0.1.19/Nucleon/Util/Data.html +0 -1399
  121. data/rdoc/site/0.1.19/Nucleon/Util/Disk.html +0 -522
  122. data/rdoc/site/0.1.19/Nucleon/Util/Git.html +0 -361
  123. data/rdoc/site/0.1.19/Nucleon/Util/Liquid.html +0 -365
  124. data/rdoc/site/0.1.19/Nucleon/Util/Logger.html +0 -806
  125. data/rdoc/site/0.1.19/Nucleon/Util/Package.html +0 -558
  126. data/rdoc/site/0.1.19/Nucleon/Util/SSH.html +0 -910
  127. data/rdoc/site/0.1.19/Nucleon/Util/SSH/Keypair.html +0 -453
  128. data/rdoc/site/0.1.19/Nucleon/Util/Shell.html +0 -686
  129. data/rdoc/site/0.1.19/Nucleon/Util/Shell/Result.html +0 -497
  130. data/rdoc/site/0.1.19/README_rdoc.html +0 -312
  131. data/rdoc/site/0.1.19/TODO_rdoc.html +0 -267
  132. data/rdoc/site/0.1.19/created.rid +0 -60
  133. data/rdoc/site/0.1.19/images/add.png +0 -0
  134. data/rdoc/site/0.1.19/images/brick.png +0 -0
  135. data/rdoc/site/0.1.19/images/brick_link.png +0 -0
  136. data/rdoc/site/0.1.19/images/bug.png +0 -0
  137. data/rdoc/site/0.1.19/images/bullet_black.png +0 -0
  138. data/rdoc/site/0.1.19/images/bullet_toggle_minus.png +0 -0
  139. data/rdoc/site/0.1.19/images/bullet_toggle_plus.png +0 -0
  140. data/rdoc/site/0.1.19/images/date.png +0 -0
  141. data/rdoc/site/0.1.19/images/delete.png +0 -0
  142. data/rdoc/site/0.1.19/images/find.png +0 -0
  143. data/rdoc/site/0.1.19/images/loadingAnimation.gif +0 -0
  144. data/rdoc/site/0.1.19/images/macFFBgHack.png +0 -0
  145. data/rdoc/site/0.1.19/images/package.png +0 -0
  146. data/rdoc/site/0.1.19/images/page_green.png +0 -0
  147. data/rdoc/site/0.1.19/images/page_white_text.png +0 -0
  148. data/rdoc/site/0.1.19/images/page_white_width.png +0 -0
  149. data/rdoc/site/0.1.19/images/plugin.png +0 -0
  150. data/rdoc/site/0.1.19/images/ruby.png +0 -0
  151. data/rdoc/site/0.1.19/images/tag_blue.png +0 -0
  152. data/rdoc/site/0.1.19/images/tag_green.png +0 -0
  153. data/rdoc/site/0.1.19/images/transparent.png +0 -0
  154. data/rdoc/site/0.1.19/images/wrench.png +0 -0
  155. data/rdoc/site/0.1.19/images/wrench_orange.png +0 -0
  156. data/rdoc/site/0.1.19/images/zoom.png +0 -0
  157. data/rdoc/site/0.1.19/index.html +0 -311
  158. data/rdoc/site/0.1.19/js/darkfish.js +0 -155
  159. data/rdoc/site/0.1.19/js/jquery.js +0 -18
  160. data/rdoc/site/0.1.19/js/navigation.js +0 -142
  161. data/rdoc/site/0.1.19/js/search.js +0 -94
  162. data/rdoc/site/0.1.19/js/search_index.js +0 -1
  163. data/rdoc/site/0.1.19/js/searcher.js +0 -228
  164. data/rdoc/site/0.1.19/rdoc.css +0 -543
  165. data/rdoc/site/0.1.19/table_of_contents.html +0 -1541
  166. data/rdoc/site/0.2.0/ARCHITECTURE_rdoc.html +0 -638
  167. data/rdoc/site/0.2.0/Hash.html +0 -351
  168. data/rdoc/site/0.2.0/Kernel.html +0 -416
  169. data/rdoc/site/0.2.0/Nucleon.html +0 -607
  170. data/rdoc/site/0.2.0/Nucleon/Action.html +0 -284
  171. data/rdoc/site/0.2.0/Nucleon/Action/Extract.html +0 -455
  172. data/rdoc/site/0.2.0/Nucleon/Action/Project.html +0 -283
  173. data/rdoc/site/0.2.0/Nucleon/Action/Project/Add.html +0 -500
  174. data/rdoc/site/0.2.0/Nucleon/Action/Project/Create.html +0 -457
  175. data/rdoc/site/0.2.0/Nucleon/Action/Project/Remove.html +0 -503
  176. data/rdoc/site/0.2.0/Nucleon/Action/Project/Save.html +0 -476
  177. data/rdoc/site/0.2.0/Nucleon/Action/Project/Update.html +0 -423
  178. data/rdoc/site/0.2.0/Nucleon/Codes.html +0 -567
  179. data/rdoc/site/0.2.0/Nucleon/Command.html +0 -279
  180. data/rdoc/site/0.2.0/Nucleon/Command/Bash.html +0 -548
  181. data/rdoc/site/0.2.0/Nucleon/Config.html +0 -1631
  182. data/rdoc/site/0.2.0/Nucleon/Config/Collection.html +0 -513
  183. data/rdoc/site/0.2.0/Nucleon/Config/Options.html +0 -493
  184. data/rdoc/site/0.2.0/Nucleon/Core.html +0 -639
  185. data/rdoc/site/0.2.0/Nucleon/Environment.html +0 -1208
  186. data/rdoc/site/0.2.0/Nucleon/Errors.html +0 -279
  187. data/rdoc/site/0.2.0/Nucleon/Errors/BatchError.html +0 -285
  188. data/rdoc/site/0.2.0/Nucleon/Errors/NucleonError.html +0 -661
  189. data/rdoc/site/0.2.0/Nucleon/Errors/SSHUnavailable.html +0 -285
  190. data/rdoc/site/0.2.0/Nucleon/Event.html +0 -279
  191. data/rdoc/site/0.2.0/Nucleon/Event/Regex.html +0 -471
  192. data/rdoc/site/0.2.0/Nucleon/Facade.html +0 -2409
  193. data/rdoc/site/0.2.0/Nucleon/Gems.html +0 -639
  194. data/rdoc/site/0.2.0/Nucleon/Manager.html +0 -1860
  195. data/rdoc/site/0.2.0/Nucleon/Mixin.html +0 -288
  196. data/rdoc/site/0.2.0/Nucleon/Mixin/Action.html +0 -281
  197. data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Commit.html +0 -385
  198. data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Project.html +0 -399
  199. data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Push.html +0 -375
  200. data/rdoc/site/0.2.0/Nucleon/Mixin/Colors.html +0 -549
  201. data/rdoc/site/0.2.0/Nucleon/Mixin/ConfigCollection.html +0 -485
  202. data/rdoc/site/0.2.0/Nucleon/Mixin/ConfigOptions.html +0 -453
  203. data/rdoc/site/0.2.0/Nucleon/Mixin/Macro.html +0 -280
  204. data/rdoc/site/0.2.0/Nucleon/Mixin/Macro/ObjectInterface.html +0 -699
  205. data/rdoc/site/0.2.0/Nucleon/Mixin/Macro/PluginInterface.html +0 -686
  206. data/rdoc/site/0.2.0/Nucleon/Mixin/Settings.html +0 -485
  207. data/rdoc/site/0.2.0/Nucleon/Mixin/SubConfig.html +0 -891
  208. data/rdoc/site/0.2.0/Nucleon/Parallel.html +0 -330
  209. data/rdoc/site/0.2.0/Nucleon/Parallel/ClassMethods.html +0 -329
  210. data/rdoc/site/0.2.0/Nucleon/Parallel/InstanceMethods.html +0 -456
  211. data/rdoc/site/0.2.0/Nucleon/Plugin.html +0 -286
  212. data/rdoc/site/0.2.0/Nucleon/Plugin/Action.html +0 -1829
  213. data/rdoc/site/0.2.0/Nucleon/Plugin/Action/Option.html +0 -463
  214. data/rdoc/site/0.2.0/Nucleon/Plugin/Base.html +0 -1803
  215. data/rdoc/site/0.2.0/Nucleon/Plugin/Command.html +0 -725
  216. data/rdoc/site/0.2.0/Nucleon/Plugin/Event.html +0 -446
  217. data/rdoc/site/0.2.0/Nucleon/Plugin/Extension.html +0 -285
  218. data/rdoc/site/0.2.0/Nucleon/Plugin/Project.html +0 -2898
  219. data/rdoc/site/0.2.0/Nucleon/Plugin/Template.html +0 -480
  220. data/rdoc/site/0.2.0/Nucleon/Plugin/Translator.html +0 -375
  221. data/rdoc/site/0.2.0/Nucleon/Project.html +0 -280
  222. data/rdoc/site/0.2.0/Nucleon/Project/Git.html +0 -1805
  223. data/rdoc/site/0.2.0/Nucleon/Project/Github.html +0 -553
  224. data/rdoc/site/0.2.0/Nucleon/Template.html +0 -281
  225. data/rdoc/site/0.2.0/Nucleon/Template/JSON.html +0 -333
  226. data/rdoc/site/0.2.0/Nucleon/Template/Wrapper.html +0 -333
  227. data/rdoc/site/0.2.0/Nucleon/Template/YAML.html +0 -333
  228. data/rdoc/site/0.2.0/Nucleon/Translator.html +0 -280
  229. data/rdoc/site/0.2.0/Nucleon/Translator/JSON.html +0 -370
  230. data/rdoc/site/0.2.0/Nucleon/Translator/YAML.html +0 -370
  231. data/rdoc/site/0.2.0/Nucleon/Util.html +0 -289
  232. data/rdoc/site/0.2.0/Nucleon/Util/CLI.html +0 -392
  233. data/rdoc/site/0.2.0/Nucleon/Util/CLI/Parser.html +0 -1250
  234. data/rdoc/site/0.2.0/Nucleon/Util/Cache.html +0 -784
  235. data/rdoc/site/0.2.0/Nucleon/Util/Console.html +0 -1318
  236. data/rdoc/site/0.2.0/Nucleon/Util/Data.html +0 -1411
  237. data/rdoc/site/0.2.0/Nucleon/Util/Disk.html +0 -526
  238. data/rdoc/site/0.2.0/Nucleon/Util/Git.html +0 -365
  239. data/rdoc/site/0.2.0/Nucleon/Util/Liquid.html +0 -369
  240. data/rdoc/site/0.2.0/Nucleon/Util/Logger.html +0 -810
  241. data/rdoc/site/0.2.0/Nucleon/Util/Package.html +0 -562
  242. data/rdoc/site/0.2.0/Nucleon/Util/SSH.html +0 -1033
  243. data/rdoc/site/0.2.0/Nucleon/Util/SSH/Keypair.html +0 -605
  244. data/rdoc/site/0.2.0/Nucleon/Util/Shell.html +0 -693
  245. data/rdoc/site/0.2.0/Nucleon/Util/Shell/Result.html +0 -501
  246. data/rdoc/site/0.2.0/README_rdoc.html +0 -316
  247. data/rdoc/site/0.2.0/TODO_rdoc.html +0 -265
  248. data/rdoc/site/0.2.0/created.rid +0 -61
  249. data/rdoc/site/0.2.0/images/add.png +0 -0
  250. data/rdoc/site/0.2.0/images/brick.png +0 -0
  251. data/rdoc/site/0.2.0/images/brick_link.png +0 -0
  252. data/rdoc/site/0.2.0/images/bug.png +0 -0
  253. data/rdoc/site/0.2.0/images/bullet_black.png +0 -0
  254. data/rdoc/site/0.2.0/images/bullet_toggle_minus.png +0 -0
  255. data/rdoc/site/0.2.0/images/bullet_toggle_plus.png +0 -0
  256. data/rdoc/site/0.2.0/images/date.png +0 -0
  257. data/rdoc/site/0.2.0/images/delete.png +0 -0
  258. data/rdoc/site/0.2.0/images/find.png +0 -0
  259. data/rdoc/site/0.2.0/images/loadingAnimation.gif +0 -0
  260. data/rdoc/site/0.2.0/images/macFFBgHack.png +0 -0
  261. data/rdoc/site/0.2.0/images/package.png +0 -0
  262. data/rdoc/site/0.2.0/images/page_green.png +0 -0
  263. data/rdoc/site/0.2.0/images/page_white_text.png +0 -0
  264. data/rdoc/site/0.2.0/images/page_white_width.png +0 -0
  265. data/rdoc/site/0.2.0/images/plugin.png +0 -0
  266. data/rdoc/site/0.2.0/images/ruby.png +0 -0
  267. data/rdoc/site/0.2.0/images/tag_blue.png +0 -0
  268. data/rdoc/site/0.2.0/images/tag_green.png +0 -0
  269. data/rdoc/site/0.2.0/images/transparent.png +0 -0
  270. data/rdoc/site/0.2.0/images/wrench.png +0 -0
  271. data/rdoc/site/0.2.0/images/wrench_orange.png +0 -0
  272. data/rdoc/site/0.2.0/images/zoom.png +0 -0
  273. data/rdoc/site/0.2.0/index.html +0 -315
  274. data/rdoc/site/0.2.0/js/darkfish.js +0 -155
  275. data/rdoc/site/0.2.0/js/jquery.js +0 -18
  276. data/rdoc/site/0.2.0/js/navigation.js +0 -142
  277. data/rdoc/site/0.2.0/js/search.js +0 -94
  278. data/rdoc/site/0.2.0/js/search_index.js +0 -1
  279. data/rdoc/site/0.2.0/js/searcher.js +0 -228
  280. data/rdoc/site/0.2.0/rdoc.css +0 -543
  281. data/rdoc/site/0.2.0/table_of_contents.html +0 -1657
  282. data/rdoc/site/0.2.1/ARCHITECTURE_rdoc.html +0 -640
  283. data/rdoc/site/0.2.1/Hash.html +0 -353
  284. data/rdoc/site/0.2.1/Kernel.html +0 -420
  285. data/rdoc/site/0.2.1/Nucleon.html +0 -674
  286. data/rdoc/site/0.2.1/Nucleon/Action.html +0 -286
  287. data/rdoc/site/0.2.1/Nucleon/Action/Extract.html +0 -457
  288. data/rdoc/site/0.2.1/Nucleon/Action/Project.html +0 -285
  289. data/rdoc/site/0.2.1/Nucleon/Action/Project/Add.html +0 -502
  290. data/rdoc/site/0.2.1/Nucleon/Action/Project/Create.html +0 -459
  291. data/rdoc/site/0.2.1/Nucleon/Action/Project/Remove.html +0 -505
  292. data/rdoc/site/0.2.1/Nucleon/Action/Project/Save.html +0 -478
  293. data/rdoc/site/0.2.1/Nucleon/Action/Project/Update.html +0 -425
  294. data/rdoc/site/0.2.1/Nucleon/Codes.html +0 -569
  295. data/rdoc/site/0.2.1/Nucleon/Command.html +0 -281
  296. data/rdoc/site/0.2.1/Nucleon/Command/Bash.html +0 -550
  297. data/rdoc/site/0.2.1/Nucleon/Config.html +0 -1634
  298. data/rdoc/site/0.2.1/Nucleon/Config/Collection.html +0 -515
  299. data/rdoc/site/0.2.1/Nucleon/Config/Options.html +0 -495
  300. data/rdoc/site/0.2.1/Nucleon/Core.html +0 -641
  301. data/rdoc/site/0.2.1/Nucleon/Environment.html +0 -1210
  302. data/rdoc/site/0.2.1/Nucleon/Errors.html +0 -281
  303. data/rdoc/site/0.2.1/Nucleon/Errors/BatchError.html +0 -287
  304. data/rdoc/site/0.2.1/Nucleon/Errors/NucleonError.html +0 -663
  305. data/rdoc/site/0.2.1/Nucleon/Errors/SSHUnavailable.html +0 -287
  306. data/rdoc/site/0.2.1/Nucleon/Event.html +0 -281
  307. data/rdoc/site/0.2.1/Nucleon/Event/Regex.html +0 -473
  308. data/rdoc/site/0.2.1/Nucleon/Facade.html +0 -2452
  309. data/rdoc/site/0.2.1/Nucleon/Gems.html +0 -641
  310. data/rdoc/site/0.2.1/Nucleon/Manager.html +0 -1862
  311. data/rdoc/site/0.2.1/Nucleon/Mixin.html +0 -291
  312. data/rdoc/site/0.2.1/Nucleon/Mixin/Action.html +0 -284
  313. data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Commit.html +0 -387
  314. data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Project.html +0 -401
  315. data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Push.html +0 -377
  316. data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Registration.html +0 -575
  317. data/rdoc/site/0.2.1/Nucleon/Mixin/Colors.html +0 -551
  318. data/rdoc/site/0.2.1/Nucleon/Mixin/ConfigCollection.html +0 -487
  319. data/rdoc/site/0.2.1/Nucleon/Mixin/ConfigOptions.html +0 -455
  320. data/rdoc/site/0.2.1/Nucleon/Mixin/Macro.html +0 -282
  321. data/rdoc/site/0.2.1/Nucleon/Mixin/Macro/ObjectInterface.html +0 -701
  322. data/rdoc/site/0.2.1/Nucleon/Mixin/Macro/PluginInterface.html +0 -688
  323. data/rdoc/site/0.2.1/Nucleon/Mixin/Settings.html +0 -487
  324. data/rdoc/site/0.2.1/Nucleon/Mixin/SubConfig.html +0 -893
  325. data/rdoc/site/0.2.1/Nucleon/Parallel.html +0 -332
  326. data/rdoc/site/0.2.1/Nucleon/Parallel/ClassMethods.html +0 -331
  327. data/rdoc/site/0.2.1/Nucleon/Parallel/InstanceMethods.html +0 -458
  328. data/rdoc/site/0.2.1/Nucleon/Plugin.html +0 -288
  329. data/rdoc/site/0.2.1/Nucleon/Plugin/Action.html +0 -2133
  330. data/rdoc/site/0.2.1/Nucleon/Plugin/Action/Option.html +0 -465
  331. data/rdoc/site/0.2.1/Nucleon/Plugin/Base.html +0 -1988
  332. data/rdoc/site/0.2.1/Nucleon/Plugin/Command.html +0 -765
  333. data/rdoc/site/0.2.1/Nucleon/Plugin/Event.html +0 -448
  334. data/rdoc/site/0.2.1/Nucleon/Plugin/Extension.html +0 -287
  335. data/rdoc/site/0.2.1/Nucleon/Plugin/Project.html +0 -2900
  336. data/rdoc/site/0.2.1/Nucleon/Plugin/Template.html +0 -482
  337. data/rdoc/site/0.2.1/Nucleon/Plugin/Translator.html +0 -377
  338. data/rdoc/site/0.2.1/Nucleon/Project.html +0 -282
  339. data/rdoc/site/0.2.1/Nucleon/Project/Git.html +0 -1807
  340. data/rdoc/site/0.2.1/Nucleon/Project/Github.html +0 -555
  341. data/rdoc/site/0.2.1/Nucleon/Template.html +0 -283
  342. data/rdoc/site/0.2.1/Nucleon/Template/JSON.html +0 -335
  343. data/rdoc/site/0.2.1/Nucleon/Template/Wrapper.html +0 -335
  344. data/rdoc/site/0.2.1/Nucleon/Template/YAML.html +0 -335
  345. data/rdoc/site/0.2.1/Nucleon/Translator.html +0 -282
  346. data/rdoc/site/0.2.1/Nucleon/Translator/JSON.html +0 -372
  347. data/rdoc/site/0.2.1/Nucleon/Translator/YAML.html +0 -372
  348. data/rdoc/site/0.2.1/Nucleon/Util.html +0 -291
  349. data/rdoc/site/0.2.1/Nucleon/Util/CLI.html +0 -394
  350. data/rdoc/site/0.2.1/Nucleon/Util/CLI/Parser.html +0 -1404
  351. data/rdoc/site/0.2.1/Nucleon/Util/Cache.html +0 -824
  352. data/rdoc/site/0.2.1/Nucleon/Util/Console.html +0 -1330
  353. data/rdoc/site/0.2.1/Nucleon/Util/Data.html +0 -1423
  354. data/rdoc/site/0.2.1/Nucleon/Util/Disk.html +0 -528
  355. data/rdoc/site/0.2.1/Nucleon/Util/Git.html +0 -367
  356. data/rdoc/site/0.2.1/Nucleon/Util/Liquid.html +0 -371
  357. data/rdoc/site/0.2.1/Nucleon/Util/Logger.html +0 -822
  358. data/rdoc/site/0.2.1/Nucleon/Util/Package.html +0 -564
  359. data/rdoc/site/0.2.1/Nucleon/Util/SSH.html +0 -1036
  360. data/rdoc/site/0.2.1/Nucleon/Util/SSH/Keypair.html +0 -607
  361. data/rdoc/site/0.2.1/Nucleon/Util/Shell.html +0 -697
  362. data/rdoc/site/0.2.1/Nucleon/Util/Shell/Result.html +0 -503
  363. data/rdoc/site/0.2.1/README_rdoc.html +0 -318
  364. data/rdoc/site/0.2.1/TODO_rdoc.html +0 -267
  365. data/rdoc/site/0.2.1/created.rid +0 -62
  366. data/rdoc/site/0.2.1/images/add.png +0 -0
  367. data/rdoc/site/0.2.1/images/brick.png +0 -0
  368. data/rdoc/site/0.2.1/images/brick_link.png +0 -0
  369. data/rdoc/site/0.2.1/images/bug.png +0 -0
  370. data/rdoc/site/0.2.1/images/bullet_black.png +0 -0
  371. data/rdoc/site/0.2.1/images/bullet_toggle_minus.png +0 -0
  372. data/rdoc/site/0.2.1/images/bullet_toggle_plus.png +0 -0
  373. data/rdoc/site/0.2.1/images/date.png +0 -0
  374. data/rdoc/site/0.2.1/images/delete.png +0 -0
  375. data/rdoc/site/0.2.1/images/find.png +0 -0
  376. data/rdoc/site/0.2.1/images/loadingAnimation.gif +0 -0
  377. data/rdoc/site/0.2.1/images/macFFBgHack.png +0 -0
  378. data/rdoc/site/0.2.1/images/package.png +0 -0
  379. data/rdoc/site/0.2.1/images/page_green.png +0 -0
  380. data/rdoc/site/0.2.1/images/page_white_text.png +0 -0
  381. data/rdoc/site/0.2.1/images/page_white_width.png +0 -0
  382. data/rdoc/site/0.2.1/images/plugin.png +0 -0
  383. data/rdoc/site/0.2.1/images/ruby.png +0 -0
  384. data/rdoc/site/0.2.1/images/tag_blue.png +0 -0
  385. data/rdoc/site/0.2.1/images/tag_green.png +0 -0
  386. data/rdoc/site/0.2.1/images/transparent.png +0 -0
  387. data/rdoc/site/0.2.1/images/wrench.png +0 -0
  388. data/rdoc/site/0.2.1/images/wrench_orange.png +0 -0
  389. data/rdoc/site/0.2.1/images/zoom.png +0 -0
  390. data/rdoc/site/0.2.1/index.html +0 -317
  391. data/rdoc/site/0.2.1/js/darkfish.js +0 -155
  392. data/rdoc/site/0.2.1/js/jquery.js +0 -18
  393. data/rdoc/site/0.2.1/js/navigation.js +0 -142
  394. data/rdoc/site/0.2.1/js/search.js +0 -94
  395. data/rdoc/site/0.2.1/js/search_index.js +0 -1
  396. data/rdoc/site/0.2.1/js/searcher.js +0 -228
  397. data/rdoc/site/0.2.1/rdoc.css +0 -543
  398. data/rdoc/site/0.2.1/table_of_contents.html +0 -1718
  399. data/spec/coral_mock_input.rb +0 -29
  400. data/spec/coral_test_kernel.rb +0 -22
@@ -2,61 +2,61 @@
2
2
  module Nucleon
3
3
  module Util
4
4
  module CLI
5
-
5
+
6
6
  #-----------------------------------------------------------------------------
7
7
  # Utilities
8
-
8
+
9
9
  def self.message(name, default = nil)
10
10
  if default.nil?
11
11
  default = :none
12
12
  end
13
- return I18n.t(name.to_s, :default_value => default.to_s)
13
+ return I18n.t(name.to_s, :default_value => Console.purple(default.to_s))
14
14
  end
15
-
15
+
16
16
  #---
17
-
17
+
18
18
  def self.encode(data)
19
19
  Base64.urlsafe_encode64(Util::Data.to_json(data, false))
20
20
  end
21
-
21
+
22
22
  def self.decode(encoded_string)
23
- Util::Data.symbol_map(Util::Data.parse_json(Base64.urlsafe_decode64(encoded_string)))
23
+ Util::Data.symbol_map(Util::Data.parse_json(Base64.urlsafe_decode64(encoded_string)))
24
24
  end
25
-
25
+
26
26
  #-------------------------------------------------------------------------
27
27
  # Parser
28
-
28
+
29
29
  class Parser
30
-
30
+
31
31
  attr_accessor :parser, :options, :arguments, :extra, :processed, :strict
32
-
32
+
33
33
  #---
34
-
34
+
35
35
  include Mixin::Colors
36
-
36
+
37
37
  #---
38
-
38
+
39
39
  def initialize(args, banner = '', help = '', split_help = false)
40
40
  @parser = OptionParser.new
41
-
41
+
42
42
  self.options = {}
43
43
  self.arguments = {}
44
44
  self.extra = {}
45
45
  self.processed = false
46
- self.strict = true
47
-
46
+ self.strict = true
47
+
48
48
  @arg_settings = []
49
-
49
+
50
50
  self.banner = banner
51
51
  self.help = help
52
-
52
+
53
53
  yield(self) if block_given?
54
-
54
+
55
55
  parse_command(args, split_help)
56
56
  end
57
-
57
+
58
58
  #---
59
-
59
+
60
60
  def self.split(args, banner, separator = '')
61
61
  main_args = nil
62
62
  sub_command = nil
@@ -73,64 +73,64 @@ module CLI
73
73
 
74
74
  main_args = args.dup if main_args.nil?
75
75
  results = [ Parser.new(main_args, banner, separator, true) ]
76
-
76
+
77
77
  if sub_command
78
78
  results << [ sub_command, sub_args ]
79
79
  end
80
-
80
+
81
81
  return results.flatten
82
82
  end
83
-
83
+
84
84
  #---
85
-
85
+
86
86
  def banner=banner
87
- parser.banner = banner
87
+ parser.banner = banner
88
88
  end
89
-
89
+
90
90
  #---
91
-
91
+
92
92
  def help
93
93
  return parser.help
94
94
  end
95
-
95
+
96
96
  def help=help
97
97
  if help.is_a?(Array)
98
98
  help.each do |line|
99
- parser.separator line
100
- end
99
+ parser.separator line
100
+ end
101
101
  else
102
102
  parser.separator help
103
103
  end
104
104
  end
105
-
105
+
106
106
  #---
107
-
107
+
108
108
  def version
109
109
  # Override in executable script
110
110
  end
111
-
111
+
112
112
  #---
113
-
113
+
114
114
  def parse_command(args, split_help = false)
115
115
  args = args.dup
116
116
  error = false
117
-
117
+
118
118
  self.processed = false
119
-
120
- option_bool(:version, false,
121
- '--version',
119
+
120
+ option_bool(:version, false,
121
+ '--version',
122
122
  'nucleon.core.util.cli.options.version'
123
123
  )
124
- option_bool(:color, true,
125
- '--[no]-color',
124
+ option_bool(:color, true,
125
+ '--[no]-color',
126
126
  'nucleon.core.util.cli.options.color'
127
127
  )
128
- option_str(:log_level, nil,
129
- '--log_level STR',
128
+ option_str(:log_level, nil,
129
+ '--log_level STR',
130
130
  'nucleon.core.util.cli.options.log_level'
131
131
  )
132
- option_str(:encoded_params, false,
133
- '--encoded STR',
132
+ option_str(:encoded_params, false,
133
+ '--encoded STR',
134
134
  'nucleon.core.util.cli.options.encoded'
135
135
  )
136
136
  if split_help
@@ -144,35 +144,35 @@ module CLI
144
144
  else
145
145
  parser.on_tail('-h', '--help', CLI.message('nucleon.core.util.cli.options.short_help')) do
146
146
  options[:help] = true
147
- end
147
+ end
148
148
  end
149
-
149
+
150
150
  if strict
151
151
  parser.parse!(args)
152
152
  extra_args = {}
153
153
  else
154
154
  args, extra_args = parse_known_args(parser, args)
155
155
  end
156
-
156
+
157
157
  # Now we can act on options given
158
158
  options[:color] = Util::Console.use_colors
159
-
159
+
160
160
  if options[:version]
161
161
  puts version
162
162
  exit 0
163
163
  end
164
-
164
+
165
165
  return if options[:help]
166
-
166
+
167
167
  parse_encoded
168
-
168
+
169
169
  Nucleon.log_level = options[:log_level] if options[:log_level]
170
-
170
+
171
171
  self.extra = normalize_extra_options(extra_args) unless extra_args.empty?
172
-
172
+
173
173
  remaining_args = args.dup
174
174
  arg_messages = []
175
-
175
+
176
176
  if arguments.empty?
177
177
  @arg_settings.each_with_index do |settings, index|
178
178
  if index >= args.length
@@ -180,7 +180,7 @@ module CLI
180
180
  else
181
181
  value = Util::Data.value(args[index])
182
182
  end
183
-
183
+
184
184
  if !value.nil? && settings.has_key?(:allowed)
185
185
  allowed = settings[:allowed]
186
186
  case allowed
@@ -196,11 +196,11 @@ module CLI
196
196
  when Array
197
197
  unless allowed.include(value)
198
198
  arg_messages << CLI.message(settings[:message])
199
- error = true
199
+ error = true
200
200
  end
201
201
  end
202
202
  end
203
-
203
+
204
204
  if value.nil?
205
205
  if settings.has_key?(:default)
206
206
  value = settings[:default]
@@ -208,48 +208,48 @@ module CLI
208
208
  error = true
209
209
  end
210
210
  end
211
-
211
+
212
212
  if !value.nil? && settings.has_key?(:block)
213
213
  value = settings[:block].call(value)
214
214
  error = true if value.nil?
215
215
  end
216
-
216
+
217
217
  break if error
218
-
218
+
219
219
  remaining_args.shift unless remaining_args.empty?
220
220
  self.arguments[settings[:name]] = value
221
- end
221
+ end
222
222
  end
223
-
223
+
224
224
  if error
225
225
  if ! arg_messages.empty?
226
226
  parser.warn(CLI.message('nucleon.core.util.cli.parse.error') + "\n\n" + arg_messages.join("\n") + "\n\n" + parser.help)
227
227
  else
228
- parser.warn(CLI.message('nucleon.core.util.cli.parse.error') + "\n\n" + parser.help)
228
+ parser.warn(CLI.message('nucleon.core.util.cli.parse.error') + "\n\n" + parser.help)
229
229
  end
230
230
  else
231
231
  self.processed = true
232
232
  end
233
-
233
+
234
234
  rescue OptionParser::InvalidOption => e
235
235
  parser.warn(e.message + "\n\n" + parser.help)
236
236
  end
237
-
237
+
238
238
  #---
239
-
239
+
240
240
  def parse_encoded
241
241
  if options[:encoded_params]
242
242
  encoded_properties = CLI.decode(options[:encoded_params])
243
-
243
+
244
244
  @arg_settings.each do |settings|
245
245
  if encoded_properties.has_key?(settings[:name].to_sym)
246
246
  self.arguments[settings[:name]] = encoded_properties.delete(settings[:name].to_sym)
247
247
  end
248
248
  end
249
-
249
+
250
250
  encoded_properties.each do |name, value|
251
251
  self.options[name] = value
252
-
252
+
253
253
  if name == :color
254
254
  Util::Console.use_colors = value
255
255
  end
@@ -257,19 +257,19 @@ module CLI
257
257
  end
258
258
  options.delete(:encoded_params)
259
259
  end
260
-
260
+
261
261
  #---
262
-
262
+
263
263
  def parse_known_args(parser, args)
264
264
  extra_args = []
265
-
265
+
266
266
  parse_args = lambda do |arg_list|
267
267
  begin
268
268
  original_list = arg_list.clone
269
-
269
+
270
270
  parser.parse! arg_list
271
271
  args = arg_list
272
-
272
+
273
273
  rescue OptionParser::InvalidOption => e
274
274
  extra_args += e.args
275
275
  while arg_list[0] && arg_list[0][0] != '-'
@@ -281,55 +281,55 @@ module CLI
281
281
  parse_args.call args
282
282
  [ args, extra_args ]
283
283
  end
284
-
284
+
285
285
  #---
286
-
286
+
287
287
  def normalize_extra_options(arg_list)
288
- options = {}
288
+ options = {}
289
289
  last_option = nil
290
-
290
+
291
291
  Util::Data.array(arg_list).each do |arg|
292
292
  components = arg.split('=')
293
- value = nil
294
-
293
+ value = nil
294
+
295
295
  if components.size > 1
296
296
  arg = components[0]
297
- value = components[1]
297
+ value = components[1]
298
298
  end
299
-
299
+
300
300
  if arg[0] == '-'
301
301
  last_option = arg.sub(/^\-+/, '').to_sym
302
- options[last_option] = Util::Data.value(value) if value
302
+ options[last_option] = Util::Data.value(value) if value
303
303
  else
304
304
  if last_option
305
305
  if options[last_option]
306
306
  options[last_option] = [ options[last_option] ] unless options[last_option].is_a?(Array)
307
307
  options[last_option] << Util::Data.value(arg)
308
308
  else
309
- options[last_option] = Util::Data.value(arg)
310
- end
309
+ options[last_option] = Util::Data.value(arg)
310
+ end
311
311
  else
312
312
  parser.warn(CLI.message('nucleon.core.util.cli.parse.error') + "\n\n" + parser.help)
313
- break
313
+ break
314
314
  end
315
- end
316
- end
315
+ end
316
+ end
317
317
  options
318
318
  end
319
319
  protected :normalize_extra_options
320
-
320
+
321
321
  #---
322
-
322
+
323
323
  def option(name, default, option_str, allowed_values, message_id, config = {})
324
324
  config = Config.ensure(config)
325
325
  name = name.to_sym
326
326
  options[name] = config.get(name, default)
327
-
327
+
328
328
  message_name = name.to_s + '_message'
329
329
  message = CLI.message(message_id, options[name])
330
-
330
+
331
331
  option_str = Util::Data.array(option_str)
332
-
332
+
333
333
  if allowed_values
334
334
  parser.on(*option_str, allowed_values, config.get(message_name.to_sym, message)) do |value|
335
335
  value = yield(value) if block_given?
@@ -339,34 +339,34 @@ module CLI
339
339
  parser.on(*option_str, config.get(message_name.to_sym, message)) do |value|
340
340
  value = yield(value) if block_given?
341
341
  options[name] = value unless value.nil?
342
- end
342
+ end
343
343
  end
344
344
  end
345
-
345
+
346
346
  #---
347
-
347
+
348
348
  def arg(name, default, allowed_values, message_id, config = {}, &block)
349
349
  config = Config.ensure(config)
350
350
  name = name.to_sym
351
-
351
+
352
352
  message_name = name.to_s + '_message'
353
353
  message = CLI.message(message_id, arguments[name])
354
-
355
- settings = {
354
+
355
+ settings = {
356
356
  :name => name,
357
357
  :default => config.get(name, default),
358
- :message => config.get(message_name.to_sym, message)
358
+ :message => config.get(message_name.to_sym, message)
359
359
  }
360
360
  settings[:allowed] = allowed_values if allowed_values
361
361
  settings[:block] = block if block
362
-
362
+
363
363
  settings.delete(:default) if settings[:default].nil?
364
-
365
- @arg_settings << settings
364
+
365
+ @arg_settings << settings
366
366
  end
367
-
367
+
368
368
  #---
369
-
369
+
370
370
  def option_bool(name, default, option_str, message_id, config = {})
371
371
  option(name, default, option_str, nil, message_id, config) do |value|
372
372
  value = Util::Data.value(value)
@@ -374,12 +374,12 @@ module CLI
374
374
  block_given? ? yield(value) : value
375
375
  else
376
376
  nil
377
- end
378
- end
377
+ end
378
+ end
379
379
  end
380
-
380
+
381
381
  #---
382
-
382
+
383
383
  def arg_bool(name, default, message_id, config = {})
384
384
  arg(name, default, nil, message_id, config) do |value|
385
385
  value = Util::Data.value(value)
@@ -387,74 +387,74 @@ module CLI
387
387
  block_given? ? yield(value) : value
388
388
  else
389
389
  nil
390
- end
391
- end
390
+ end
391
+ end
392
392
  end
393
-
393
+
394
394
  #---
395
-
395
+
396
396
  def option_int(name, default, option_str, message_id, config = {})
397
397
  option(name, default, option_str, Integer, message_id, config) do |value|
398
- block_given? ? yield(value) : value
399
- end
398
+ block_given? ? yield(value) : value
399
+ end
400
400
  end
401
-
401
+
402
402
  #---
403
-
403
+
404
404
  def arg_int(name, default, message_id, config = {})
405
405
  arg(name, default, Integer, message_id, config) do |value|
406
- block_given? ? yield(value) : value
407
- end
406
+ block_given? ? yield(value) : value
407
+ end
408
408
  end
409
-
409
+
410
410
  #---
411
-
411
+
412
412
  def option_float(name, default, option_str, message_id, config = {})
413
413
  option(name, default, option_str, Float, message_id, config) do |value|
414
- block_given? ? yield(value) : value
415
- end
414
+ block_given? ? yield(value) : value
415
+ end
416
416
  end
417
-
417
+
418
418
  #---
419
-
419
+
420
420
  def arg_float(name, default, message_id, config = {})
421
421
  arg(name, default, Float, message_id, config) do |value|
422
- block_given? ? yield(value) : value
423
- end
422
+ block_given? ? yield(value) : value
423
+ end
424
424
  end
425
-
425
+
426
426
  #---
427
-
427
+
428
428
  def option_str(name, default, option_str, message_id, config = {})
429
429
  option(name, default, option_str, nil, message_id, config) do |value|
430
- block_given? ? yield(value) : value
431
- end
430
+ block_given? ? yield(value) : value
431
+ end
432
432
  end
433
-
433
+
434
434
  #---
435
-
435
+
436
436
  def arg_str(name, default, message_id, config = {})
437
437
  arg(name, default, nil, message_id, config) do |value|
438
- block_given? ? yield(value) : value
439
- end
438
+ block_given? ? yield(value) : value
439
+ end
440
440
  end
441
-
441
+
442
442
  #---
443
-
443
+
444
444
  def option_array(name, default, option_str, message_id, config = {})
445
445
  option(name, default, option_str, Array, message_id, config) do |value|
446
- block_given? ? yield(value) : value
447
- end
446
+ block_given? ? yield(value) : value
447
+ end
448
448
  end
449
-
449
+
450
450
  #---
451
-
451
+
452
452
  def arg_array(name, default, message_id, config = {})
453
453
  arg(name, default, Array, message_id, config) do |value|
454
- block_given? ? yield(value) : value
455
- end
454
+ block_given? ? yield(value) : value
455
+ end
456
456
  end
457
- end
457
+ end
458
458
  end
459
459
  end
460
460
  end