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,57 +1,87 @@
1
-
2
- # Should be included via include
3
- #
4
- # include Mixin::Colors
5
- #
6
-
7
1
  module Nucleon
8
2
  module Mixin
3
+ #
4
+ # == Console colors
5
+ #
6
+ # The Nucleon::Mixin::Colors module extends a class or instance to include
7
+ # methods for wrapping strings in colored text markers.
8
+ #
9
+ # For usage and definition:
10
+ #
11
+ # - See Nucleon::Util::Console
12
+ #
9
13
  module Colors
10
-
14
+
15
+ # Return a given string wrapped in black text markers.
16
+ #
17
+ # See:
18
+ # - Nucleon::Util::Console::black
19
+ #
11
20
  def black(string)
12
- ::Nucleon::Util::Console.black(string)
21
+ ::Nucleon::Util::Console.black(string)
13
22
  end
14
-
15
- #---
16
-
23
+
24
+ # Return a given string wrapped in red text markers.
25
+ #
26
+ # See:
27
+ # - Nucleon::Util::Console::red
28
+ #
17
29
  def red(string)
18
- ::Nucleon::Util::Console.red(string)
30
+ ::Nucleon::Util::Console.red(string)
19
31
  end
20
-
21
- #---
22
-
32
+
33
+ # Return a given string wrapped in green text markers.
34
+ #
35
+ # See:
36
+ # - Nucleon::Util::Console::green
37
+ #
23
38
  def green(string)
24
- ::Nucleon::Util::Console.green(string)
39
+ ::Nucleon::Util::Console.green(string)
25
40
  end
26
-
27
- #---
28
-
41
+
42
+ # Return a given string wrapped in yellow text markers.
43
+ #
44
+ # See:
45
+ # - Nucleon::Util::Console::yellow
46
+ #
29
47
  def yellow(string)
30
- ::Nucleon::Util::Console.yellow(string)
48
+ ::Nucleon::Util::Console.yellow(string)
31
49
  end
32
-
33
- #---
34
-
50
+
51
+ # Return a given string wrapped in blue text markers.
52
+ #
53
+ # See:
54
+ # - Nucleon::Util::Console::blue
55
+ #
35
56
  def blue(string)
36
- ::Nucleon::Util::Console.blue(string)
57
+ ::Nucleon::Util::Console.blue(string)
37
58
  end
38
-
39
- #---
40
-
59
+
60
+ # Return a given string wrapped in purple text markers.
61
+ #
62
+ # See:
63
+ # - Nucleon::Util::Console::purple
64
+ #
41
65
  def purple(string)
42
- ::Nucleon::Util::Console.purple(string)
66
+ ::Nucleon::Util::Console.purple(string)
43
67
  end
44
-
45
- #---
46
-
68
+
69
+ # Return a given string wrapped in cyan text markers.
70
+ #
71
+ # See:
72
+ # - Nucleon::Util::Console::cyan
73
+ #
47
74
  def cyan(string)
48
- ::Nucleon::Util::Console.cyan(string)
75
+ ::Nucleon::Util::Console.cyan(string)
49
76
  end
50
-
51
- #---
52
-
77
+
78
+ # Return a given string wrapped in grey text markers.
79
+ #
80
+ # See:
81
+ # - Nucleon::Util::Console::grey
82
+ #
53
83
  def grey(string)
54
- ::Nucleon::Util::Console.grey(string)
84
+ ::Nucleon::Util::Console.grey(string)
55
85
  end
56
86
  end
57
87
  end
@@ -1,46 +1,81 @@
1
-
2
- # Should be included via extend
3
- #
4
- # extend Mixin::ConfigCollection
5
- #
6
-
7
1
  module Nucleon
8
2
  module Mixin
3
+ #
4
+ # == Configuration collection
5
+ #
6
+ # The Nucleon::Mixin::ConfigCollection module extends a class to include methods
7
+ # for working with the global property collection.
8
+ #
9
+ # Right now, largely for historical reasons, the Nucleon::Config::Collection
10
+ # class is structured as a global interface and collection for grouping all of
11
+ # the defined options. It was originally contained within Nucleon::Config as
12
+ # part of the global configuration interface. In the future, the class and
13
+ # this mixin will be refactored to support multiple property logs and will
14
+ # have more fully refined persistence methods.
15
+ #
16
+ #
17
+ # For usage and definition:
18
+ #
19
+ # - See core configuration object Nucleon::Config
20
+ # - See collection Nucleon::Config::Collection
21
+ #
9
22
  module ConfigCollection
10
23
 
11
- #-----------------------------------------------------------------------------
24
+ #*****************************************************************************
12
25
  # Configuration collection interface
13
-
26
+
27
+ # Return a reference to all of the globally defined properties.
28
+ #
29
+ # This method generally should not be used in favor of the ::get method.
30
+ #
31
+ # See:
32
+ # - Nucleon::Config::Collection::all
33
+ #
14
34
  def all_properties
15
35
  Config::Collection.all
16
36
  end
17
-
18
- #---
19
-
37
+
38
+ # Return specified property value.
39
+ #
40
+ # See:
41
+ # - Nucleon::Config::Collection::get
42
+ #
20
43
  def get_property(name)
21
44
  Config::Collection.get(name)
22
45
  end
23
-
24
- #---
25
-
46
+
47
+ # Set property value.
48
+ #
49
+ # See:
50
+ # - Nucleon::Config::Collection::set
51
+ #
26
52
  def set_property(name, value)
27
53
  Config::Collection.set(name, value)
28
54
  end
29
-
30
- #---
31
-
55
+
56
+ # Delete property from collection.
57
+ #
58
+ # See:
59
+ # - Nucleon::Config::Collection::delete
60
+ #
32
61
  def delete_property(name)
33
62
  Config::Collection.delete(name)
34
63
  end
35
-
36
- #---
37
-
64
+
65
+ # Clear all properties from the collection.
66
+ #
67
+ # See:
68
+ # - Nucleon::Config::Collection::clear
69
+ #
38
70
  def clear_properties
39
71
  Config::Collection.clear
40
72
  end
41
-
42
- #---
43
-
73
+
74
+ # Dump properties to disk.
75
+ #
76
+ # See:
77
+ # - Nucleon::Config::Collection::save
78
+ #
44
79
  def save_properties(options = {})
45
80
  Config::Collection.save(options)
46
81
  end
@@ -1,41 +1,84 @@
1
-
2
- # Should be included via extend
3
- #
4
- # extend Mixin::ConfigOptions
5
- #
6
-
7
1
  module Nucleon
8
2
  module Mixin
3
+ #
4
+ # == Contextualized option collection
5
+ #
6
+ # The Nucleon::Mixin::ConfigOptions module extends a class to include methods
7
+ # for working with the central option collection.
8
+ #
9
+ # Right now, largely for historical reasons, the Nucleon::Config::Options class
10
+ # is structured as a global interface and collection for grouping all of the
11
+ # defined options. It was originally contained within Nucleon::Config as part
12
+ # of the global configuration interface. In the future, the class and this
13
+ # mixin will be refactored to support multiple collections of contextualized
14
+ # properties.
15
+ #
16
+ #
17
+ # For usage and definition:
18
+ #
19
+ # - See core configuration object Nucleon::Config
20
+ # - See collection Nucleon::Config::Options
21
+ #
9
22
  module ConfigOptions
10
-
11
- #-----------------------------------------------------------------------------
23
+
24
+ #*****************************************************************************
12
25
  # Configuration options interface
13
-
26
+
27
+ # Return an array of context names based on given contexts and an optional
28
+ # hierarchy path.
29
+ #
30
+ # This method mainly exists to allow us to create cascading context groups
31
+ # for the properties based on a hierarchical list. We use it to create
32
+ # contextual property lookups for configuring Puppet in the corl gem.
33
+ #
34
+ # See:
35
+ # - Nucleon::Config::Options::contexts
36
+ #
14
37
  def contexts(contexts = [], hierarchy = [])
15
- Config::Options.contexts(contexts, hierarchy)
38
+ Config::Options.contexts(contexts, hierarchy)
16
39
  end
17
-
18
- #---
19
-
40
+
41
+ # Return a reference to all of the globally defined context properties.
42
+ #
43
+ # This method generally should not be used in favor of the ::get method.
44
+ #
45
+ # See:
46
+ # - Nucleon::Config::Options::all
47
+ #
20
48
  def all_options
21
49
  Config::Options.all
22
50
  end
23
-
24
- #---
25
-
51
+
52
+ # Return merged option groups for given context names.
53
+ #
54
+ # This method allows us to easily request combinations of properties.
55
+ #
56
+ # See:
57
+ # - Nucleon::Config::Options::get
58
+ #
26
59
  def get_options(contexts, force = true)
27
- Config::Options.get(contexts, force)
60
+ Config::Options.get(contexts, force)
28
61
  end
29
-
30
- #---
31
-
62
+
63
+ # Assign property values to specified context identifiers.
64
+ #
65
+ # This method allows us to easily merge properties across various contexts.
66
+ #
67
+ # See:
68
+ # - Nucleon::Config::Options::set
69
+ #
32
70
  def set_options(contexts, options, force = true)
33
71
  Config::Options.set(contexts, options, force)
34
72
  end
35
-
36
- #---
37
-
38
- def clear_options(contexts)
73
+
74
+ # Clear all properties for specified contexts.
75
+ #
76
+ # Contexts are entirely removed, even the name itself.
77
+ #
78
+ # See:
79
+ # - Nucleon::Config::Options::clear
80
+ #
81
+ def clear_options(contexts = nil)
39
82
  Config::Options.clear(contexts)
40
83
  end
41
84
  end
@@ -1,199 +1,193 @@
1
-
2
- # Should be included via extend
3
- #
4
- # extend Mixin::Macro::ObjectInterface
5
- #
6
-
7
1
  module Nucleon
8
2
  module Mixin
9
3
  module Macro
10
4
  module ObjectInterface
11
-
5
+
12
6
  # requires Mixin::SubConfig
13
7
  # requires Mixin::Settings
14
8
 
15
9
  #-----------------------------------------------------------------------------
16
10
  # Object collections
17
-
11
+
18
12
  @@object_types = {}
19
13
 
20
14
  #---
21
-
15
+
22
16
  def object_collection(_type, _method_options = {})
23
17
  _method_config = Config.ensure(_method_options)
24
-
18
+
25
19
  _plural = _method_config.init(:plural, "#{_type}s").get(:plural)
26
-
20
+
27
21
  unless _ensure_proc = _method_config.get(:ensure_proc, false)
28
22
  _ensure_proc = Proc.new {|name, options = {}| options }
29
23
  end
30
24
  _delete_proc = _method_config.get(:delete_proc)
31
25
  _search_proc = _method_config.get(:search_proc)
32
-
26
+
33
27
  @@object_types[_type] = _method_config
34
-
28
+
35
29
  logger.debug("Creating new object collection #{_type} with: #{_method_config.inspect}")
36
-
30
+
37
31
  #---------------------------------------------------------------------------
38
-
32
+
39
33
  object_utilities
40
-
34
+
41
35
  #---------------------------------------------------------------------------
42
-
36
+
43
37
  logger.debug("Defining object interface method: #{_type}_config")
44
-
38
+
45
39
  define_method "#{_type}_config" do |name = nil|
46
40
  Config.new( name ? get([ _plural, name ], {}) : get(_plural, {}) )
47
41
  end
48
-
42
+
49
43
  #---
50
-
44
+
51
45
  logger.debug("Defining object interface method: #{_type}_setting")
52
-
46
+
53
47
  define_method "#{_type}_setting" do |name, property, default = nil, format = false|
54
48
  get([ _plural, name, property ], default, format)
55
49
  end
56
-
50
+
57
51
  #---
58
-
52
+
59
53
  logger.debug("Defining object interface method: #{_plural}")
60
-
54
+
61
55
  define_method "#{_plural}" do |reset = false|
62
56
  send("init_#{_plural}") if reset || _get(_plural, {}).empty?
63
57
  _get(_plural, {})
64
58
  end
65
-
59
+
66
60
  #---
67
-
61
+
68
62
  logger.debug("Defining object interface method: init_#{_plural}")
69
-
63
+
70
64
  define_method "init_#{_plural}" do
71
65
  data = hash(_search_proc.call) if _search_proc
72
66
  data = get_hash(_plural) unless data
73
-
67
+
74
68
  logger.debug("Initializing object data: #{data.inspect}")
75
-
69
+
76
70
  symbol_map(data).each do |name, options|
77
71
  if name != :settings
78
72
  options[:object_container] = myself
79
-
73
+
80
74
  logger.debug("Initializing object: #{name}")
81
-
75
+
82
76
  obj = _ensure_proc.call(name, options)
83
77
  _set([ _plural, name ], obj)
84
78
  end
85
79
  end
86
80
  end
87
-
81
+
88
82
  #---
89
-
83
+
90
84
  logger.debug("Defining object interface method: set_#{_plural}")
91
85
 
92
86
  define_method "set_#{_plural}" do |data = {}|
93
87
  data = Config.ensure(data).export
94
-
88
+
95
89
  send("clear_#{_plural}")
96
90
  set(_plural, data)
97
-
91
+
98
92
  logger.debug("Setting #{_plural}")
99
-
93
+
100
94
  data.each do |name, options|
101
95
  options[:object_container] = myself
102
-
96
+
103
97
  logger.debug("Setting #{_type} #{name}: #{options.inspect}")
104
-
98
+
105
99
  obj = _ensure_proc.call(name, options)
106
100
  _set([ _plural, name ], obj)
107
101
  end
108
102
  end
109
103
 
110
104
  #---
111
-
105
+
112
106
  logger.debug("Defining object interface method: #{_type}")
113
-
107
+
114
108
  define_method "#{_type}" do |name, reset = false|
115
- if reset || _get([ _plural, name ], nil).nil?
109
+ if reset || _get([ _plural, name ], nil).nil?
116
110
  options = get([ _plural, name ], nil)
117
-
111
+
118
112
  unless options.nil?
119
113
  options[:object_container] = myself
120
-
114
+
121
115
  logger.debug("Initializing object: #{name}")
122
-
116
+
123
117
  obj = _ensure_proc.call(name, options)
124
118
  _set([ _plural, name ], obj)
125
119
  end
126
120
  end
127
121
  _get([ _plural, name ])
128
122
  end
129
-
123
+
130
124
  #---
131
-
125
+
132
126
  logger.debug("Defining object interface method: set_#{_type}")
133
127
 
134
128
  define_method "set_#{_type}" do |name, options = {}|
135
129
  options = Config.ensure(options).export
136
-
130
+
137
131
  set([ _plural, name ], options)
138
-
132
+
139
133
  options[:object_container] = myself
140
-
134
+
141
135
  logger.debug("Setting #{_type} #{_name}: #{options.inspect}")
142
-
143
- obj = _ensure_proc.call(name, options)
136
+
137
+ obj = _ensure_proc.call(name, options)
144
138
  _set([ _plural, name ], obj)
145
139
  end
146
-
140
+
147
141
  #---
148
-
142
+
149
143
  logger.debug("Defining object interface method: set_#{_type}_setting")
150
-
144
+
151
145
  define_method "set_#{_type}_setting" do |name, property, value = nil|
152
146
  logger.debug("Setting #{name} property #{property} to #{value.inspect}")
153
147
  set([ _plural, name, property ], value)
154
148
  end
155
-
149
+
156
150
  #---
157
-
151
+
158
152
  logger.debug("Defining object interface method: delete_#{_type}")
159
153
 
160
154
  define_method "delete_#{_type}" do |name|
161
155
  obj = send(_type, name)
162
-
156
+
163
157
  logger.debug("Deleting #{_type} #{name}")
164
-
158
+
165
159
  delete([ _plural, name ])
166
160
  _delete([ _plural, name ])
167
-
161
+
168
162
  _delete_proc.call(obj) if _delete_proc && ! obj.nil?
169
163
  end
170
-
164
+
171
165
  #---
172
-
166
+
173
167
  logger.debug("Defining object interface method: delete_#{_type}_setting")
174
-
168
+
175
169
  define_method "delete_#{_type}_setting" do |name, property|
176
170
  logger.debug("Deleting #{name} property: #{property}")
177
-
171
+
178
172
  delete([ _plural, name, property ])
179
173
  end
180
-
174
+
181
175
  #---
182
-
176
+
183
177
  logger.debug("Defining object interface method: clear_#{_plural}")
184
-
178
+
185
179
  define_method "clear_#{_plural}" do
186
180
  get(_plural).keys.each do |name|
187
181
  logger.debug("Clearing #{_type} #{name}")
188
-
182
+
189
183
  send("delete_#{_type}", name)
190
184
  end
191
- end
192
-
185
+ end
186
+
193
187
  #---------------------------------------------------------------------------
194
-
188
+
195
189
  logger.debug("Defining object interface method: search_#{_type}")
196
-
190
+
197
191
  define_method "search_#{_type}" do |name, keys, default = '', format = false, extra_groups = []|
198
192
  obj_config = send("#{_type}_config", name)
199
193
  search_object(obj_config, keys, default, format, extra_groups)
@@ -202,87 +196,87 @@ module ObjectInterface
202
196
 
203
197
  #-----------------------------------------------------------------------------
204
198
  # Utilities
205
-
199
+
206
200
  def object_utilities
207
-
201
+
208
202
  unless respond_to? :each_object_type
209
203
  logger.debug("Defining object utility method: each_object_type")
210
-
204
+
211
205
  define_method :each_object_type do |object_types = nil, filter_proc = nil, &code|
212
206
  object_types = @@object_types.keys unless object_types
213
207
  object_types = [ object_types ] unless object_types.is_a?(Array)
214
-
208
+
215
209
  object_types.each do |type|
216
210
  logger.debug("Processing object type: #{type}")
217
-
211
+
218
212
  unless filter_proc && ! filter_proc.call(type, @@object_types[type])
219
213
  plural = @@object_types[type][:plural]
220
-
214
+
221
215
  logger.debug("Passing: #{@@object_types[type].inspect}")
222
216
  code.call(type, plural, @@object_types[type])
223
217
  end
224
- end
218
+ end
225
219
  end
226
220
  end
227
-
221
+
228
222
  #---
229
-
223
+
230
224
  unless respond_to? :each_object
231
225
  logger.debug("Defining object utility method: each_object")
232
-
226
+
233
227
  define_method :each_object do |object_types = nil, &code|
234
228
  each_object_type(object_types) do |type, plural, options|
235
229
  logger.debug("Processing object type #{type}/#{plural} with: #{options.inspect}")
236
-
230
+
237
231
  send(plural).each do |name, obj|
238
232
  logger.debug("Processing object: #{name}")
239
- code.call(type, name, obj)
240
- end
241
- end
233
+ code.call(type, name, obj)
234
+ end
235
+ end
242
236
  end
243
237
  end
244
-
238
+
245
239
  #---
246
-
240
+
247
241
  unless respond_to? :init_objects
248
242
  logger.debug("Defining object utility method: init_objects")
249
-
243
+
250
244
  define_method :init_objects do |object_types = nil, filter_proc = nil|
251
245
  logger.debug("Initializing object collection")
252
-
246
+
253
247
  each_object_type(object_types, filter_proc) do |type, plural, options|
254
- send("init_#{plural}")
255
- end
248
+ send("init_#{plural}")
249
+ end
256
250
  end
257
251
  end
258
-
252
+
259
253
  #---
260
-
254
+
261
255
  unless respond_to? :clear_objects
262
256
  logger.debug("Defining object utility method: clear_objects")
263
-
257
+
264
258
  define_method :clear_objects do |object_types = nil, filter_proc = nil|
265
259
  logger.debug("Clearing object collection")
266
-
260
+
267
261
  each_object_type(object_types, filter_proc) do |type, plural, options|
268
- send("clear_#{plural}")
262
+ send("clear_#{plural}")
269
263
  end
270
264
  end
271
265
  end
272
-
266
+
273
267
  #---------------------------------------------------------------------------
274
-
268
+
275
269
  unless respond_to? :search_object
276
270
  logger.debug("Defining object utility method: search_object")
277
-
271
+
278
272
  define_method :search_object do |obj_config, keys, default = nil, format = false, extra_groups = []|
279
273
  obj_config = Marshal.load(Marshal.dump(obj_config))
280
-
274
+
281
275
  logger.debug("Searching object properties: #{obj_config.inspect}")
282
-
276
+
283
277
  # TODO: Figure out a way to effectively cache this search operation
284
278
  #------------------------------------------------------------------
285
-
279
+
286
280
  add_settings = lambda do |final_options, groups|
287
281
  if groups
288
282
  local_options = {}
@@ -291,85 +285,85 @@ module ObjectInterface
291
285
  if group_options.has_key?(:settings)
292
286
  group_options = add_settings.call(group_options, group_options[:settings])
293
287
  end
294
- local_options = Util::Data.merge([ local_options, group_options ], true, false)
288
+ local_options = Util::Data.merge([ local_options, group_options ], true, false)
295
289
  end
296
290
  end
297
291
  unless local_options.empty?
298
- final_options = Util::Data.merge([ local_options, final_options ], true, false)
292
+ final_options = Util::Data.merge([ local_options, final_options ], true, false)
299
293
  end
300
294
  end
301
295
  final_options
302
296
  end
303
-
297
+
304
298
  #---
305
-
299
+
306
300
  settings = {}
307
-
301
+
308
302
  keys = [ keys ] unless keys.is_a?(Array)
309
303
  temp = keys.dup
310
-
304
+
311
305
  logger.debug("Searching object keys: #{keys.inspect}")
312
-
313
- logger.debug("Searching specialized settings")
306
+
307
+ logger.debug("Searching specialized settings")
314
308
  until temp.empty? do
315
309
  settings = add_settings.call(settings, obj_config.get([ temp, :settings ]))
316
310
  temp.pop
317
311
  end
318
-
319
- logger.debug("Specialized settings found: #{settings.inspect}")
320
- logger.debug("Searching general settings")
321
-
312
+
313
+ logger.debug("Specialized settings found: #{settings.inspect}")
314
+ logger.debug("Searching general settings")
315
+
322
316
  settings = add_settings.call(settings, [ obj_config.get_array(:settings), extra_groups ].flatten)
323
-
317
+
324
318
  #------------------------------------------------------------------
325
- # TODO: Cache the above!!!
326
-
319
+ # TODO: Cache the above!!!
320
+
327
321
  logger.debug("Final settings found: #{settings.inspect}")
328
-
322
+
329
323
  if settings.empty?
330
- value = obj_config.get(keys)
324
+ value = obj_config.get(keys)
331
325
  else
332
- final_config = Config.new(Util::Data.merge([
333
- Util::Data.clean(settings),
334
- Util::Data.clean(obj_config.export)
326
+ final_config = Config.new(Util::Data.merge([
327
+ Util::Data.clean(settings),
328
+ Util::Data.clean(obj_config.export)
335
329
  ], true, false))
336
330
  value = final_config.get(keys)
337
-
331
+
338
332
  logger.debug("Final configuration: #{final_config.export.inspect}")
339
333
  end
340
-
334
+
341
335
  value = default if Util::Data.undef?(value)
342
-
336
+
343
337
  logger.debug("Final value found (format: #{format.inspect}): #{value.inspect}")
344
338
  filter(value, format)
345
339
  end
346
340
  end
347
-
341
+
348
342
  #---------------------------------------------------------------------------
349
343
  # Configuration loading saving
350
-
344
+
351
345
  unless respond_to? :load
352
346
  logger.debug("Defining object utility method: load")
353
-
347
+
354
348
  define_method :load do |options = {}|
355
- logger.debug("Loading configuration if possible")
349
+ logger.debug("Loading configuration if possible")
356
350
  if config.respond_to?(:load)
357
- clear_objects
351
+ clear_objects
358
352
  config.load(options)
359
353
  end
360
354
  end
361
355
  end
362
-
356
+
363
357
  #---
364
-
358
+
365
359
  unless respond_to? :save
366
360
  logger.debug("Defining object utility method: save")
367
-
361
+
368
362
  define_method :save do |options = {}|
369
- logger.debug("Saving configuration if possible")
363
+ logger.debug("Saving configuration if possible")
370
364
  config.save(options) if config.respond_to?(:save)
371
365
  end
372
- end
366
+ end
373
367
  end
374
368
  end
375
369
  end