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
@@ -1,45 +1,132 @@
1
-
2
1
  module Nucleon
3
2
  module Util
3
+ #
4
+ # == Logger
5
+ #
6
+ # The Nucleon::Util::Logger class defines a logging interface that wraps the Log4r
7
+ # gem interface to provide all Nucleon classes with logging capabilities.
8
+ #
9
+ # Logging methods exposed:
10
+ #
11
+ # 1. *error* Display all serious errors
12
+ # 2. *warn* Warnings that do not trigger an error
13
+ # 3. *info* Concise runtime information
14
+ # 4. *debug* Potentially verbose debug information
15
+ #
16
+ # *Note*: This is the first Nucleon library loaded so it can *NOT* depend on
17
+ # any other library or core object.
18
+ #
19
+ # See also:
20
+ # - Nucleon::Core (base logging capable object)
21
+ #
4
22
  class Logger
5
-
6
- #-----------------------------------------------------------------------------
23
+
24
+ #*****************************************************************************
7
25
  # Properties
8
-
9
- @@level = nil
26
+
27
+ #
28
+ # Global log level
29
+ #
30
+ # Can be:
31
+ # - *:debug*
32
+ # - *:info*
33
+ # - *:warn*
34
+ # - *:error*
35
+ #
36
+ @@level = nil
37
+
38
+ #
39
+ # Global collection of instantiated loggers
40
+ #
10
41
  @@loggers = {}
11
-
12
- #---
13
-
42
+
43
+ # Check current global log level
44
+ #
45
+ # * *Parameters*
46
+ #
47
+ # * *Returns*
48
+ # - [Symbol] Global log level; *:debug*, *:info*, *:warn*, *:error*
49
+ #
50
+ # * *Errors*
51
+ #
52
+ # See also:
53
+ # - ::level=
54
+ #
14
55
  def self.level
15
- @@level
56
+ @@level
16
57
  end
17
-
58
+
59
+ # Set current global log level
60
+ #
61
+ # * *Parameters*
62
+ # - [Symbol] *level* Global log level; *:debug*, *:info*, *:warn*, *:error*
63
+ #
64
+ # * *Returns*
65
+ # - [Void] This method does not return a value
66
+ #
67
+ # * *Errors*
68
+ #
69
+ # See also:
70
+ # - ::level
71
+ # - ::set_level
72
+ #
18
73
  def self.level=level
19
74
  @@level = set_level(level)
20
75
  end
21
-
22
- #---
23
-
76
+
77
+ # Return a reference to all globally instantiated loggers
78
+ #
79
+ # * *Parameters*
80
+ #
81
+ # * *Returns*
82
+ # - [Hash<Symbol|Log4r>] Collection of globally accessible loggers
83
+ #
84
+ # * *Errors*
85
+ #
24
86
  def self.loggers
25
87
  @@loggers
26
88
  end
27
-
28
- #---
29
-
89
+
90
+ # Define a list of Log4r levels
91
+ #
92
+ # Due to how Log4r is built this can only happen at the very beginning of our
93
+ # execution run before any loggers are instantiated.
94
+ #
95
+ # This should never be called directly outside of this class.
96
+ #
97
+ # * *Parameters*
98
+ # - [Symbol, String, Array<Symbol, String>] *levels* Available log levels
99
+ #
100
+ # * *Returns*
101
+ # - [Void] This method does not return a value
102
+ #
103
+ # * *Errors*
104
+ #
30
105
  def self.set_levels(*levels)
31
- levels = levels.flatten.collect do |level|
106
+ levels = levels.flatten.collect do |level|
32
107
  level.to_s.upcase
33
108
  end
34
109
  Log4r::Configurator.custom_levels(*levels)
35
110
  end
36
-
37
- #---
38
-
111
+
112
+ # Set the logging level for either all instantiated loggers or a specified logger.
113
+ #
114
+ # * *Parameters*
115
+ # - [Symbol, String] *level* Global log level; *:debug*, *:info*, *:warn*, *:error*
116
+ # - [Log4r] *logger* Log4r instance to set log level or all if none provided
117
+ #
118
+ # * *Returns*
119
+ # - [Symbol] Return the current global log level
120
+ #
121
+ # * *Errors*
122
+ #
123
+ # See also:
124
+ # - ::level=
125
+ #
39
126
  def self.set_level(level, logger = nil)
40
127
  level_sym = level.to_s.downcase.to_sym
41
128
  level_id = level.to_s.upcase
42
-
129
+
43
130
  if logger.nil?
44
131
  loggers.each do |name, registered_logger|
45
132
  @@loggers[name].level = Log4r.const_get(level_id)
@@ -51,37 +138,78 @@ class Logger
51
138
  end
52
139
  level_sym
53
140
  end
54
-
55
- #---
56
-
141
+
142
+ # Add a instantiated logger to the global logger registry.
143
+ #
144
+ # TODO: Is there a better way to handle the outputter for more flexibility?
145
+ #
146
+ # * *Parameters*
147
+ # - [Symbol, String] *name* Logger name
148
+ # - [Log4r] *logger* Log4r instance to register
149
+ #
150
+ # * *Returns*
151
+ # - [Void] This method does not return a value
152
+ #
153
+ # * *Errors*
154
+ #
155
+ # See also:
156
+ # - ::set_level
157
+ #
57
158
  def self.add_logger(name, logger)
58
159
  logger.outputters = Log4r::StdoutOutputter.new('console')
59
-
160
+
60
161
  level = Logger.level.nil? ? 'off' : Logger.level
61
- set_level(level, logger)
62
-
63
- @@loggers[name] = logger
162
+ set_level(level, logger)
163
+
164
+ @@loggers[name.to_sym] = logger
64
165
  end
65
-
166
+
167
+ #
66
168
  # Initialize log levels
67
-
68
- set_levels :debug, :info, :warn, :error, :hook
69
-
169
+ #
170
+ # *IMPORTANT* Log levels must be registered before Log4r instances are created
171
+ #
172
+ # TODO: This process does not work when using as a library through another
173
+ # executable that already loads Log4r.
174
+ #
175
+ set_levels :debug, :info, :warn, :error
176
+
177
+ #
178
+ # Set starting log level if defined in "NUCLEON_LOG" environment variable
179
+ #
70
180
  if ENV['NUCLEON_LOG']
71
181
  Logger.level = ENV['NUCLEON_LOG']
72
182
  end
73
-
74
- #-----------------------------------------------------------------------------
183
+
184
+ #*****************************************************************************
75
185
  # Constructor
76
-
186
+
187
+ # Initialize a new logging object
188
+ #
189
+ # TODO: Figure out some way to make the logger system pluggable?
190
+ #
191
+ # * *Parameters*
192
+ # - [Hash] *options* Logger options
193
+ # - [String] *:resource* Logger resource identifier (also serves as prefix)
194
+ # - [nil, Log4r] *:logger* Log4r logger of nil if new one created
195
+ #
196
+ # * *Returns*
197
+ # - [Void] This method does not return a value
198
+ #
199
+ # * *Errors*
200
+ #
201
+ # See also:
202
+ # - #logger=
203
+ # - Nucleon::Config::ensure
204
+ #
77
205
  def initialize(options = {})
78
206
  if options.is_a?(String)
79
207
  options = { :logger => options }
80
208
  end
81
209
  config = Config.ensure(options)
82
-
210
+
83
211
  @resource = config.get(:resource, '')
84
-
212
+
85
213
  if config.get(:logger, false)
86
214
  self.logger = config[:logger]
87
215
  else
@@ -89,19 +217,42 @@ class Logger
89
217
  end
90
218
  end
91
219
 
92
- #---
93
-
220
+ # Return a string reference that identifies this logger
221
+ #
222
+ # * *Parameters*
223
+ #
224
+ # * *Returns*
225
+ # - [String] Identification string
226
+ #
227
+ # * *Errors*
228
+ #
94
229
  def inspect
95
230
  "#<#{self.class}: #{@resource}>"
96
231
  end
97
-
98
- #-----------------------------------------------------------------------------
232
+
233
+ #*****************************************************************************
99
234
  # Accessors / Modifiers
100
-
235
+
236
+ #
237
+ # [String] Logger resource name
238
+ #
239
+ # This is the string identifier and logger prefix used when logging.
240
+ #
101
241
  attr_reader :resource
102
-
103
- #---
104
-
242
+
243
+ # Set current logger object
244
+ #
245
+ # * *Parameters*
246
+ # - [String, Log4r] *logger* Log4r object or string resource name
247
+ #
248
+ # * *Returns*
249
+ # - [Void] This method does not return a value
250
+ #
251
+ # * *Errors*
252
+ #
253
+ # See also:
254
+ # - ::add_logger
255
+ #
105
256
  def logger=logger
106
257
  if logger.is_a?(String)
107
258
  @resource = logger
@@ -109,49 +260,87 @@ class Logger
109
260
  else
110
261
  @logger = logger
111
262
  end
112
- self.class.add_logger(@resource, @logger) unless self.class.loggers.has_key?(@resource)
263
+ self.class.add_logger(@resource, @logger) unless self.class.loggers.has_key?(@resource)
113
264
  end
114
-
115
- #-----------------------------------------------------------------------------
265
+
266
+ #*****************************************************************************
116
267
  # Log statements
117
-
268
+
269
+ # Log a debug message
270
+ #
271
+ # * *Parameters*
272
+ # - [String] *message* Debug related message
273
+ #
274
+ # * *Returns*
275
+ # - [Void] This method does not return a value
276
+ #
277
+ # * *Errors*
278
+ #
279
+ # See also:
280
+ # - Nucleon::Util::Console::quiet
281
+ #
118
282
  def debug(message)
119
283
  unless Util::Console.quiet
120
284
  @logger.debug(message)
121
285
  end
122
286
  end
123
-
124
- #---
125
-
287
+
288
+ # Log an info message
289
+ #
290
+ # * *Parameters*
291
+ # - [String] *message* Concise informational message
292
+ #
293
+ # * *Returns*
294
+ # - [Void] This method does not return a value
295
+ #
296
+ # * *Errors*
297
+ #
298
+ # See also:
299
+ # - Nucleon::Util::Console::quiet
300
+ #
126
301
  def info(message)
127
302
  unless Util::Console.quiet
128
303
  @logger.info(message)
129
304
  end
130
305
  end
131
-
132
- #---
133
-
306
+
307
+ # Log a warning message (non error)
308
+ #
309
+ # * *Parameters*
310
+ # - [String] *message* Warning message
311
+ #
312
+ # * *Returns*
313
+ # - [Void] This method does not return a value
314
+ #
315
+ # * *Errors*
316
+ #
317
+ # See also:
318
+ # - Nucleon::Util::Console::quiet
319
+ #
134
320
  def warn(message)
135
321
  unless Util::Console.quiet
136
322
  @logger.warn(message)
137
323
  end
138
324
  end
139
-
140
- #---
141
-
325
+
326
+ # Log an error message
327
+ #
328
+ # * *Parameters*
329
+ # - [String] *message* Error message
330
+ #
331
+ # * *Returns*
332
+ # - [Void] This method does not return a value
333
+ #
334
+ # * *Errors*
335
+ #
336
+ # See also:
337
+ # - Nucleon::Util::Console::quiet
338
+ #
142
339
  def error(message)
143
340
  unless Util::Console.quiet
144
341
  @logger.error(message)
145
342
  end
146
343
  end
147
-
148
- #---
149
-
150
- def hook(message)
151
- unless Util::Console.quiet
152
- @logger.hook(message)
153
- end
154
- end
155
344
  end
156
345
  end
157
346
  end
@@ -1,17 +1,15 @@
1
-
2
- #*******************************************************************************
3
- # Nucleon
4
1
  #
5
- # Framework that provides a simple foundation for building distributively
6
- # configured, extremely pluggable and extendable, and easily parallel
7
- # applications.
2
+ # == Nucleon
3
+ #
4
+ # Framework that provides a simple foundation for building distributed,
5
+ # pluggable, and integrated applications.
8
6
  #
9
7
  # Author:: Adrian Webb (mailto:adrian.webb@coralnexus.com)
10
- # License:: GPLv3
8
+ # License:: Apache License, version 2
11
9
 
12
10
  require File.join(File.dirname(__FILE__), "nucleon_base.rb")
13
11
 
14
- #-------------------------------------------------------------------------------
12
+ #*******************************************************************************
15
13
  # Core initialization
16
14
 
17
15
  Nucleon.reload(true)
@@ -1,18 +1,36 @@
1
- #*******************************************************************************
2
- # Nucleon
3
1
  #
4
- # Framework that provides a simple foundation for building distributively
5
- # configured, extremely pluggable and extendable, and easily parallel
6
- # applications.
2
+ # == Nucleon
3
+ #
4
+ # Framework that provides a simple foundation for building distributed,
5
+ # pluggable, and integrated applications.
7
6
  #
8
7
  # Author:: Adrian Webb (mailto:adrian.webb@coralnexus.com)
9
- # License:: GPLv3
8
+ # License:: Apache License, version 2
9
+
10
10
 
11
- #-------------------------------------------------------------------------------
11
+ #*******************************************************************************
12
12
  # Global namespace
13
13
 
14
+ # Kernel module additions
15
+ #
16
+ # These methods, all of which are prefixed with "nucleon_" are available in any
17
+ # class or module within the Nucleon framework or derivatives.
18
+ #
14
19
  module Kernel
15
-
20
+
21
+ # Locate an application command or return nil otherwise.
22
+ #
23
+ # This is used to check for applications, such as Git, so that we may
24
+ # conditionally install packages based upon applications installed.
25
+ #
26
+ # * *Parameters*
27
+ # - [String, Symbol] *command* Command name to locale on system
28
+ #
29
+ # * *Returns*
30
+ # - [nil, String] File path to executable or nil if not found
31
+ #
32
+ # * *Errors*
33
+ #
16
34
  def nucleon_locate(command)
17
35
  command = command.to_s
18
36
  exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
@@ -24,70 +42,208 @@ module Kernel
24
42
  end
25
43
  return nil
26
44
  end
27
-
28
- #---
29
-
45
+
46
+ # Require resource files into Nucleon execution flow.
47
+ #
48
+ # This method auto-requires resources in the following order:
49
+ #
50
+ # 1. *{name}.rb*
51
+ # 2. *{base_dir/name}/**/*.rb
52
+ #
53
+ # If resources within the directory depend on each other those requires should
54
+ # be present in the resource files doing the requiring so we don't get load
55
+ # order conflicts.
56
+ #
57
+ # * *Parameters*
58
+ # - [String, Symbol] *base_dir* Command name to locale on system
59
+ # - [String, Symbol] *name* Command name to locale on system
60
+ #
61
+ # * *Returns*
62
+ # - [Void] This method does not have a return value
63
+ #
64
+ # * *Errors*
65
+ #
30
66
  def nucleon_require(base_dir, name)
31
- name = name.to_s
67
+ base_dir = base_dir.to_s
68
+ name = name.to_s
32
69
  top_level_file = File.join(base_dir, "#{name}.rb")
33
-
34
- require top_level_file if File.exists?(top_level_file)
35
-
70
+
71
+ require top_level_file if File.exists?(top_level_file)
72
+
36
73
  directory = File.join(base_dir, name)
37
-
74
+
38
75
  if File.directory?(directory)
39
76
  Dir.glob(File.join(directory, '**', '*.rb')).each do |sub_file|
40
77
  require sub_file
41
78
  end
42
- end
79
+ end
43
80
  end
44
81
  end
45
82
 
46
- #-------------------------------------------------------------------------------
47
- # Load paths
83
+ #*******************************************************************************
84
+ # Load paths
48
85
 
49
- lib_dir = File.dirname(__FILE__)
50
- core_dir = File.join(lib_dir, 'core')
51
- mixin_dir = File.join(core_dir, 'mixin')
86
+ #
87
+ # The following variables refer to Nucleon file load paths loaded during
88
+ # initialization.
89
+ #
90
+
91
+ #
92
+ # Base library path
93
+ #
94
+ lib_dir = File.dirname(__FILE__)
95
+ #
96
+ # Core class load path
97
+ #
98
+ core_dir = File.join(lib_dir, 'core')
99
+ #
100
+ # Base mixin load path
101
+ #
102
+ mixin_dir = File.join(core_dir, 'mixin')
103
+ #
104
+ # Configuration mixin load path
105
+ #
52
106
  mixin_config_dir = File.join(mixin_dir, 'config')
107
+ #
108
+ # Action mixin load path
109
+ #
53
110
  mixin_action_dir = File.join(mixin_dir, 'action')
54
- macro_dir = File.join(mixin_dir, 'macro')
55
- util_dir = File.join(core_dir, 'util')
56
- mod_dir = File.join(core_dir, 'mod')
57
- plugin_dir = File.join(core_dir, 'plugin')
111
+ #
112
+ # Macro mixin load path
113
+ #
114
+ macro_dir = File.join(mixin_dir, 'macro')
115
+ #
116
+ # Utilities load path
117
+ #
118
+ util_dir = File.join(core_dir, 'util')
119
+ #
120
+ # Mod load path (monkey patches)
121
+ #
122
+ mod_dir = File.join(core_dir, 'mod')
123
+ #
124
+ # Base plugin load path
125
+ #
126
+ plugin_dir = File.join(core_dir, 'plugin')
58
127
 
59
- #-------------------------------------------------------------------------------
128
+ #*******************************************************************************
60
129
  # Environment checks and debugging
61
130
 
131
+ # Nucleon top level module
132
+ #
133
+ # Any methods contained in this file are purely for enabling early checks or
134
+ # operations needed for loading Nucleon effectively?
135
+ #
136
+ # Most methods to the Nucleon module should be loaded via the Nucleon::Facade.
137
+ #
62
138
  module Nucleon
63
-
139
+
140
+ # Get currently loaded versioin of Nucleon
141
+ #
142
+ # This method loads from the VERSION file in the top level directory. This file
143
+ # gets automatically updated as we build and release new versions.
144
+ #
145
+ # See the Rakefile and the Coral Toolbox project at:
146
+ #
147
+ # http://github.com/coralnexus/coral-toolbox
148
+ #
149
+ # *Note*: This process might change in the near future.
150
+ #
151
+ # * *Parameters*
152
+ #
153
+ # * *Returns*
154
+ # - [String] Currently loaded version of Nucleon framework
155
+ #
156
+ # * *Errors*
157
+ #
64
158
  def self.VERSION
65
- File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
159
+ File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
66
160
  end
67
-
68
- #-----------------------------------------------------------------------------
69
-
161
+
162
+ #*****************************************************************************
163
+
164
+ #
165
+ # Global flag that indicate whether or not dumping with dbg() is active
166
+ #
167
+ # Think of this as a global on/off switch in case dbg() statements are
168
+ # accidentally left in code.
169
+ #
70
170
  @@dump_enabled = false
71
-
171
+
172
+ # Enable or disable variable dumping through dbg()
173
+ #
174
+ # * *Parameters*
175
+ # - [Boolean] *dump* Whether or not to enable dumping through dbg()
176
+ #
177
+ # * *Returns*
178
+ # - [Void] This method does not return a value
179
+ #
180
+ # * *Errors*
181
+ #
182
+ # See also:
183
+ # - ::dump_enabled
184
+ #
72
185
  def self.dump_enabled=dump
73
186
  @@dump_enabled = dump
74
187
  end
75
-
188
+
189
+ # Check whether dumping is enabled or disabled through dbg()
190
+ #
191
+ # * *Parameters*
192
+ #
193
+ # * *Returns*
194
+ # - [Boolean] Whether or not to enable dumping through dbg()
195
+ #
196
+ # * *Errors*
197
+ #
198
+ # See also:
199
+ # - ::dump_enabled=
200
+ #
76
201
  def self.dump_enabled
77
202
  @@dump_enabled
78
203
  end
79
-
80
- #-----------------------------------------------------------------------------
81
-
204
+
205
+ #*****************************************************************************
206
+
207
+ # Check if debugging is enabled
208
+ #
209
+ # This uses the environment variable *"NUCLEON_DEBUG"*
210
+ #
211
+ # ENV["NUCLEON_DEBUG"]
212
+ #
213
+ # * *Parameters*
214
+ #
215
+ # * *Returns*
216
+ # - [Boolean] Whether or not debugging is enabled
217
+ #
218
+ # * *Errors*
219
+ #
220
+ # See also:
221
+ # - ::debug_break
222
+ #
82
223
  def self.debugging?
83
- ENV["NUCLEON_DEBUG"] ? true : false
224
+ ENV["NUCLEON_DEBUG"] ? true : false
84
225
  end
85
-
86
- #---
87
-
226
+
227
+ # Set a debug break poing at the line of invocation if debugging is enabled.
228
+ #
229
+ # Nucleon uses Pry to perform stepwise debugging through the code.
230
+ #
231
+ # Note: This is not used very often so it may be buggy in areas.
232
+ #
233
+ # * *Parameters*
234
+ # - [Boolean] *condition* Boolean test to check if the debugging breakpoint should be active
235
+ #
236
+ # * *Returns*
237
+ # - [Void] This method does not return a value
238
+ #
239
+ # * *Errors*
240
+ #
241
+ # See also:
242
+ # - ::debugging?
243
+ #
88
244
  def self.debug_break(condition = true)
89
245
  if debugging?
90
- #-------------------------------------------------------------------------------
246
+ #*******************************************************************************
91
247
  # Nucleon Pry powered development console
92
248
  #
93
249
  # Usage:
@@ -97,15 +253,15 @@ module Nucleon
97
253
  #
98
254
  # :> [ sudo ] NUCLEON_DEBUG=1 nucleon <args>...
99
255
  #
100
- # * Call the debug_break method anywhere in the code to start a debugging
256
+ # * Call the debug_break method anywhere in the code to start a debugging
101
257
  # session.
102
258
  #
103
259
  # :> Nucleon.debug_break or :> Nucleon.debug_break <test?>
104
260
  #
105
- # * Since the debugging tools don't work in parallel, parallel operations are
261
+ # * Since the debugging tools don't work in parallel, parallel operations are
106
262
  # serialized when NUCLEON_DEBUG environment variable is found.
107
263
  #
108
- #-------------------------------------------------------------------------------
264
+ #*******************************************************************************
109
265
  # General information
110
266
  #
111
267
  # For more information on Pry: http://pryrepl.org
@@ -117,14 +273,14 @@ module Nucleon
117
273
  # For available commands and help information: [ help ]
118
274
  # For command specific help: [ <command> --help ]
119
275
  #
120
- #-------------------------------------------------------------------------------
276
+ #*******************************************************************************
121
277
  # General commands:
122
278
  #
123
279
  # :> cd <Class> Change to inspect class (class constant)
124
280
  # :> show-method <method> Show source for class method
125
281
  # :> .<CLI command> <args>... Execute a CLI command (always starts with dot)
126
282
  #
127
- #-------------------------------------------------------------------------------
283
+ #*******************************************************************************
128
284
  # Breakpoints
129
285
  #
130
286
  # :> breakpoints List all defined breakpoints
@@ -143,7 +299,7 @@ module Nucleon
143
299
  #
144
300
  # :> break --show <breakpoint> Show details about breakpoint.
145
301
  #
146
- #-------------------------------------------------------------------------------
302
+ #*******************************************************************************
147
303
  # Stack inspection / traversal
148
304
  #
149
305
  # :> show-stack Show all accessible frames in the call stack.
@@ -151,7 +307,7 @@ module Nucleon
151
307
  # :> up Move up one frame in the call stack.
152
308
  # :> down Move down one frame in the call stack.
153
309
  #
154
- #-------------------------------------------------------------------------------
310
+ #*******************************************************************************
155
311
  # Debugging execution flow:
156
312
  #
157
313
  # :> s = [ step | step <times> ] Step execution into the next line or method.
@@ -160,28 +316,78 @@ module Nucleon
160
316
  # :> c = [ continue ] Continue program execution (end Pry session).
161
317
  #
162
318
  binding.pry if condition
163
- end
319
+ end
164
320
  end
165
-
166
- #-----------------------------------------------------------------------------
167
-
321
+
322
+ #*****************************************************************************
323
+
324
+ # Check if parallel execution is enabled
325
+ #
326
+ # This uses the environment variable *"NUCLEON_NO_PARALLEL"*. Parallelism is
327
+ # enabled by default.
328
+ #
329
+ # ENV["NUCLEON_NO_PARALLEL"]
330
+ #
331
+ # Due to the complications with parallel debugging, parallel is suspended
332
+ # when debugging is enabled
333
+ #
334
+ # * *Parameters*
335
+ #
336
+ # * *Returns*
337
+ # - [Boolean] Whether or not parallel is enabled
338
+ #
339
+ # * *Errors*
340
+ #
341
+ # See also:
342
+ # - ::debugging?
343
+ #
168
344
  def self.parallel?
169
345
  debugging? || ENV['NUCLEON_NO_PARALLEL'] ? false : true
170
346
  end
171
-
172
- #---
173
-
347
+
348
+ #
349
+ # Global console Mutex lock
350
+ #
351
+ # TODO: This may not be needed?
352
+ #
174
353
  @@console_lock = Mutex.new
175
-
354
+
355
+ # Get the global console Mutex for synchronized console operations.
356
+ #
357
+ # * *Parameters*
358
+ #
359
+ # * *Returns*
360
+ # - [Mutex] Console Mutex object
361
+ #
362
+ # * *Errors*
363
+ #
176
364
  def self.console_lock
177
365
  @@console_lock
178
- end
366
+ end
179
367
  end
180
368
 
181
- #-------------------------------------------------------------------------------
369
+ #*******************************************************************************
182
370
 
371
+ #
372
+ # We also define a generic debug dump method that is available in any Nucleon
373
+ # derived class or module.
374
+ #
183
375
  module Kernel
184
-
376
+
377
+ # Dump data to the console with optional label.
378
+ #
379
+ # This must be defined under the definition of Nucleon::dump_enabled
380
+ #
381
+ # * *Parameters*
382
+ # - [ANY] *data* Data to dump to the console
383
+ # - [String] *label* Label to render above data dump
384
+ # - [Boolean] *override_enabled* Whether or not to override override Nucleon::dump_enabled
385
+ #
386
+ # * *Returns*
387
+ # - [Void] This method does not have a return value
388
+ #
389
+ # * *Errors*
390
+ #
185
391
  def dbg(data, label = '', override_enabled = false)
186
392
  # Invocations of this function should NOT be committed to the project
187
393
  if Nucleon.dump_enabled || override_enabled
@@ -196,79 +402,126 @@ module Kernel
196
402
  end
197
403
  end
198
404
  end
199
-
200
- #-------------------------------------------------------------------------------
405
+
406
+ #*******************************************************************************
201
407
  # Coral requirements
202
408
 
409
+ #
410
+ # Initialize Gem load path
411
+ #
203
412
  $:.unshift(lib_dir) unless $:.include?(lib_dir) || $:.include?(File.expand_path(lib_dir))
204
413
 
205
- #---
206
-
414
+ #
415
+ # Only require debugging packages if debugging is enabled
416
+ #
207
417
  if Nucleon.debugging?
208
418
  require 'pry'
209
419
  require 'pry-stack_explorer'
210
- require 'pry-debugger'
420
+ require 'pry-byebug'
211
421
 
212
422
  if defined?(PryDebugger)
213
423
  Pry.commands.alias_command 'c', 'continue'
214
424
  Pry.commands.alias_command 's', 'step'
215
425
  Pry.commands.alias_command 'n', 'next'
216
426
  Pry.commands.alias_command 'f', 'finish'
217
- end
427
+ end
218
428
  end
219
429
 
220
- #---
221
-
430
+ #
431
+ # General requirements
432
+ #
222
433
  # TODO: Reduce the number of dependencies loaded in this load script (for performance).
223
434
  # Decentralize!
224
435
 
436
+ #
437
+ # Allows us to work with Gem objects
438
+ #
439
+ # See:
440
+ # - Nucleon::Gems
441
+ #
225
442
  require 'rubygems'
226
-
443
+ #
444
+ # Basic CLI option parsing
445
+ #
227
446
  require 'optparse'
447
+ #
448
+ # Internationalization
449
+ #
228
450
  require 'i18n'
451
+ #
452
+ # Logging capabilities
453
+ #
229
454
  require 'log4r'
230
455
  require 'log4r/configurator'
456
+ #
457
+ # Data merging
458
+ #
231
459
  require 'deep_merge'
232
-
460
+ #
461
+ # SHA1 identification
462
+ #
233
463
  require 'digest/sha1'
464
+ #
465
+ # Object serialization
466
+ #
234
467
  require 'base64'
235
-
468
+ #
469
+ # YAML parsing / generation
470
+ #
236
471
  require 'yaml'
472
+ #
473
+ # JSON parsing / generation
474
+ #
237
475
  require 'multi_json'
238
-
476
+ #
477
+ # Temp directory access
478
+ #
239
479
  require 'tmpdir'
480
+ #
481
+ # SSH private / public key access and generation
482
+ #
240
483
  require 'sshkey'
241
-
484
+ #
485
+ # Sub process execution
486
+ #
242
487
  require 'childprocess'
488
+ #
489
+ # Basic threading
490
+ #
243
491
  require 'thread'
244
-
492
+ #
493
+ # Celluloid actors
494
+ #
245
495
  if Nucleon.parallel?
246
496
  require 'celluloid'
247
- require 'celluloid/autostart'
497
+ require 'celluloid/autostart'
248
498
  end
249
499
 
250
- #---
251
-
500
+ #
501
+ # I18n settings
502
+ #
252
503
  # TODO: Make this dynamically settable
253
-
504
+ #
254
505
  I18n.enforce_available_locales = false
255
506
  I18n.load_path << File.expand_path(File.join('..', 'locales', 'en.yml'), lib_dir)
256
507
 
257
- #---
258
-
259
- # Make sure logger is at the top of our load order priorities
508
+ #
509
+ # Logger
510
+ #
511
+ # *IMPORTANT* Make sure logger is at the top of our load order priorities
512
+ #
260
513
  nucleon_require(util_dir, :logger)
261
514
 
262
- #---
263
-
515
+ #
264
516
  # Object modifications (100% pure monkey patches)
517
+ #
265
518
  Dir.glob(File.join(mod_dir, '*.rb')).each do |file|
266
519
  require file
267
520
  end
268
521
 
269
- #---
270
-
271
- # Mixins for classes
522
+ #
523
+ # Class mixins
524
+ #
272
525
  Dir.glob(File.join(mixin_dir, '*.rb')).each do |file|
273
526
  require file
274
527
  end
@@ -282,48 +535,53 @@ Dir.glob(File.join(macro_dir, '*.rb')).each do |file|
282
535
  require file
283
536
  end
284
537
 
285
- #---
286
-
538
+ #
539
+ # Nucleon facade
540
+ #
287
541
  nucleon_require(core_dir, :facade)
288
542
 
543
+ #
544
+ # Nucleon::Facade extends Nucleon
545
+ #
289
546
  module Nucleon
290
547
  extend Facade
291
548
  end
292
549
 
293
- #---
294
-
295
- # Include bootstrap classes
550
+ #
551
+ # Bootstrap classes
552
+ #
296
553
  nucleon_require(core_dir, :errors)
297
554
  nucleon_require(core_dir, :codes)
298
555
  nucleon_require(util_dir, :data)
299
556
  nucleon_require(core_dir, :config)
300
- nucleon_require(util_dir, :console)
301
- nucleon_require(core_dir, :core)
302
-
303
- #---
557
+ nucleon_require(util_dir, :console)
558
+ nucleon_require(core_dir, :core)
304
559
 
305
- # Include core utilities
306
- [ :liquid,
307
- :cli,
308
- :disk,
560
+ #
561
+ # Core utilities
562
+ #
563
+ [ :liquid,
564
+ :cli,
565
+ :disk,
309
566
  :package,
310
- :cache,
567
+ :cache,
311
568
  :shell,
312
569
  :ssh
313
- ].each do |name|
570
+ ].each do |name|
314
571
  nucleon_require(util_dir, name)
315
572
  end
316
573
 
317
- #---
318
-
574
+ #
575
+ # Git (if it exists on the system)
576
+ #
319
577
  if nucleon_locate('git')
320
578
  require 'rugged'
321
579
  nucleon_require(util_dir, :git)
322
580
  end
323
581
 
324
- #---
325
-
326
- # Include plugin system
582
+ #
583
+ # Nucleon plugin system
584
+ #
327
585
  nucleon_require(core_dir, :gems)
328
586
  nucleon_require(core_dir, :environment)
329
587
  nucleon_require(core_dir, :manager)