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.
- checksums.yaml +7 -7
- data/.gitignore +50 -0
- data/ARCHITECTURE.rdoc +12 -11
- data/Gemfile +7 -11
- data/Gemfile.lock +47 -70
- data/Rakefile +22 -20
- data/TODO.rdoc +1 -1
- data/VERSION +1 -1
- data/bin/nucleon +16 -15
- data/lib/core/codes.rb +65 -38
- data/lib/core/config.rb +774 -153
- data/lib/core/config/collection.rb +134 -25
- data/lib/core/config/options.rb +160 -36
- data/lib/core/core.rb +207 -45
- data/lib/core/environment.rb +626 -206
- data/lib/core/facade.rb +211 -185
- data/lib/core/gems.rb +60 -44
- data/lib/core/manager.rb +587 -237
- data/lib/core/mixin/colors.rb +66 -36
- data/lib/core/mixin/config/collection.rb +58 -23
- data/lib/core/mixin/config/options.rb +67 -24
- data/lib/core/mixin/macro/object_interface.rb +129 -135
- data/lib/core/mixin/macro/plugin_interface.rb +118 -124
- data/lib/core/mixin/settings.rb +7 -13
- data/lib/core/mixin/sub_config.rb +37 -43
- data/lib/core/mod/hash.rb +31 -10
- data/lib/core/plugin/action.rb +274 -238
- data/lib/core/plugin/base.rb +140 -132
- data/lib/core/plugin/project.rb +316 -311
- data/lib/core/util/cli.rb +146 -146
- data/lib/core/util/console.rb +567 -124
- data/lib/core/util/data.rb +654 -139
- data/lib/core/util/logger.rb +255 -66
- data/lib/nucleon.rb +6 -8
- data/lib/nucleon_base.rb +364 -106
- data/nucleon.gemspec +40 -389
- data/spec/core/codes_spec.rb +209 -0
- data/spec/core/config_spec.rb +810 -0
- data/spec/core/core_spec.rb +185 -0
- data/spec/core/environment_spec.rb +148 -0
- data/spec/core/util/console_spec.rb +254 -446
- data/spec/nucleon/test.rb +59 -0
- data/spec/nucleon/test/first.rb +28 -0
- data/spec/nucleon/test/second.rb +28 -0
- data/spec/nucleon_codes.rb +98 -0
- data/spec/nucleon_config.rb +523 -0
- data/spec/nucleon_plugin.rb +439 -0
- data/spec/nucleon_test.rb +34 -0
- data/spec/spec_helper.rb +6 -4
- metadata +157 -615
- data/.document +0 -5
- data/rdoc/site/0.1.19/ARCHITECTURE_rdoc.html +0 -634
- data/rdoc/site/0.1.19/Hash.html +0 -347
- data/rdoc/site/0.1.19/Kernel.html +0 -413
- data/rdoc/site/0.1.19/Nucleon.html +0 -570
- data/rdoc/site/0.1.19/Nucleon/Action.html +0 -280
- data/rdoc/site/0.1.19/Nucleon/Action/Add.html +0 -458
- data/rdoc/site/0.1.19/Nucleon/Action/Create.html +0 -415
- data/rdoc/site/0.1.19/Nucleon/Action/Extract.html +0 -413
- data/rdoc/site/0.1.19/Nucleon/Action/Remove.html +0 -461
- data/rdoc/site/0.1.19/Nucleon/Action/Save.html +0 -434
- data/rdoc/site/0.1.19/Nucleon/Action/Update.html +0 -381
- data/rdoc/site/0.1.19/Nucleon/Codes.html +0 -563
- data/rdoc/site/0.1.19/Nucleon/Command.html +0 -275
- data/rdoc/site/0.1.19/Nucleon/Command/Bash.html +0 -544
- data/rdoc/site/0.1.19/Nucleon/Config.html +0 -1623
- data/rdoc/site/0.1.19/Nucleon/Config/Collection.html +0 -509
- data/rdoc/site/0.1.19/Nucleon/Config/Options.html +0 -489
- data/rdoc/site/0.1.19/Nucleon/Core.html +0 -635
- data/rdoc/site/0.1.19/Nucleon/Errors.html +0 -275
- data/rdoc/site/0.1.19/Nucleon/Errors/BatchError.html +0 -281
- data/rdoc/site/0.1.19/Nucleon/Errors/NucleonError.html +0 -657
- data/rdoc/site/0.1.19/Nucleon/Errors/SSHUnavailable.html +0 -281
- data/rdoc/site/0.1.19/Nucleon/Event.html +0 -275
- data/rdoc/site/0.1.19/Nucleon/Event/Regex.html +0 -467
- data/rdoc/site/0.1.19/Nucleon/Facade.html +0 -2336
- data/rdoc/site/0.1.19/Nucleon/Gems.html +0 -635
- data/rdoc/site/0.1.19/Nucleon/Manager.html +0 -1828
- data/rdoc/site/0.1.19/Nucleon/Mixin.html +0 -284
- data/rdoc/site/0.1.19/Nucleon/Mixin/Action.html +0 -277
- data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Commit.html +0 -381
- data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Project.html +0 -395
- data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Push.html +0 -371
- data/rdoc/site/0.1.19/Nucleon/Mixin/Colors.html +0 -545
- data/rdoc/site/0.1.19/Nucleon/Mixin/ConfigCollection.html +0 -481
- data/rdoc/site/0.1.19/Nucleon/Mixin/ConfigOptions.html +0 -449
- data/rdoc/site/0.1.19/Nucleon/Mixin/Macro.html +0 -276
- data/rdoc/site/0.1.19/Nucleon/Mixin/Macro/ObjectInterface.html +0 -695
- data/rdoc/site/0.1.19/Nucleon/Mixin/Macro/PluginInterface.html +0 -682
- data/rdoc/site/0.1.19/Nucleon/Mixin/Settings.html +0 -481
- data/rdoc/site/0.1.19/Nucleon/Mixin/SubConfig.html +0 -887
- data/rdoc/site/0.1.19/Nucleon/Parallel.html +0 -325
- data/rdoc/site/0.1.19/Nucleon/Parallel/ClassMethods.html +0 -325
- data/rdoc/site/0.1.19/Nucleon/Parallel/InstanceMethods.html +0 -334
- data/rdoc/site/0.1.19/Nucleon/Plugin.html +0 -282
- data/rdoc/site/0.1.19/Nucleon/Plugin/Action.html +0 -1368
- data/rdoc/site/0.1.19/Nucleon/Plugin/Action/Option.html +0 -459
- data/rdoc/site/0.1.19/Nucleon/Plugin/Base.html +0 -1737
- data/rdoc/site/0.1.19/Nucleon/Plugin/Command.html +0 -721
- data/rdoc/site/0.1.19/Nucleon/Plugin/Event.html +0 -442
- data/rdoc/site/0.1.19/Nucleon/Plugin/Extension.html +0 -281
- data/rdoc/site/0.1.19/Nucleon/Plugin/Project.html +0 -2864
- data/rdoc/site/0.1.19/Nucleon/Plugin/Template.html +0 -476
- data/rdoc/site/0.1.19/Nucleon/Plugin/Translator.html +0 -371
- data/rdoc/site/0.1.19/Nucleon/Project.html +0 -276
- data/rdoc/site/0.1.19/Nucleon/Project/Git.html +0 -1801
- data/rdoc/site/0.1.19/Nucleon/Project/Github.html +0 -549
- data/rdoc/site/0.1.19/Nucleon/Template.html +0 -277
- data/rdoc/site/0.1.19/Nucleon/Template/Json.html +0 -329
- data/rdoc/site/0.1.19/Nucleon/Template/Wrapper.html +0 -329
- data/rdoc/site/0.1.19/Nucleon/Template/Yaml.html +0 -329
- data/rdoc/site/0.1.19/Nucleon/Translator.html +0 -276
- data/rdoc/site/0.1.19/Nucleon/Translator/Json.html +0 -366
- data/rdoc/site/0.1.19/Nucleon/Translator/Yaml.html +0 -366
- data/rdoc/site/0.1.19/Nucleon/Util.html +0 -285
- data/rdoc/site/0.1.19/Nucleon/Util/CLI.html +0 -388
- data/rdoc/site/0.1.19/Nucleon/Util/CLI/Parser.html +0 -1183
- data/rdoc/site/0.1.19/Nucleon/Util/Cache.html +0 -780
- data/rdoc/site/0.1.19/Nucleon/Util/Console.html +0 -1294
- data/rdoc/site/0.1.19/Nucleon/Util/Data.html +0 -1399
- data/rdoc/site/0.1.19/Nucleon/Util/Disk.html +0 -522
- data/rdoc/site/0.1.19/Nucleon/Util/Git.html +0 -361
- data/rdoc/site/0.1.19/Nucleon/Util/Liquid.html +0 -365
- data/rdoc/site/0.1.19/Nucleon/Util/Logger.html +0 -806
- data/rdoc/site/0.1.19/Nucleon/Util/Package.html +0 -558
- data/rdoc/site/0.1.19/Nucleon/Util/SSH.html +0 -910
- data/rdoc/site/0.1.19/Nucleon/Util/SSH/Keypair.html +0 -453
- data/rdoc/site/0.1.19/Nucleon/Util/Shell.html +0 -686
- data/rdoc/site/0.1.19/Nucleon/Util/Shell/Result.html +0 -497
- data/rdoc/site/0.1.19/README_rdoc.html +0 -312
- data/rdoc/site/0.1.19/TODO_rdoc.html +0 -267
- data/rdoc/site/0.1.19/created.rid +0 -60
- data/rdoc/site/0.1.19/images/add.png +0 -0
- data/rdoc/site/0.1.19/images/brick.png +0 -0
- data/rdoc/site/0.1.19/images/brick_link.png +0 -0
- data/rdoc/site/0.1.19/images/bug.png +0 -0
- data/rdoc/site/0.1.19/images/bullet_black.png +0 -0
- data/rdoc/site/0.1.19/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.1.19/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.1.19/images/date.png +0 -0
- data/rdoc/site/0.1.19/images/delete.png +0 -0
- data/rdoc/site/0.1.19/images/find.png +0 -0
- data/rdoc/site/0.1.19/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.1.19/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.1.19/images/package.png +0 -0
- data/rdoc/site/0.1.19/images/page_green.png +0 -0
- data/rdoc/site/0.1.19/images/page_white_text.png +0 -0
- data/rdoc/site/0.1.19/images/page_white_width.png +0 -0
- data/rdoc/site/0.1.19/images/plugin.png +0 -0
- data/rdoc/site/0.1.19/images/ruby.png +0 -0
- data/rdoc/site/0.1.19/images/tag_blue.png +0 -0
- data/rdoc/site/0.1.19/images/tag_green.png +0 -0
- data/rdoc/site/0.1.19/images/transparent.png +0 -0
- data/rdoc/site/0.1.19/images/wrench.png +0 -0
- data/rdoc/site/0.1.19/images/wrench_orange.png +0 -0
- data/rdoc/site/0.1.19/images/zoom.png +0 -0
- data/rdoc/site/0.1.19/index.html +0 -311
- data/rdoc/site/0.1.19/js/darkfish.js +0 -155
- data/rdoc/site/0.1.19/js/jquery.js +0 -18
- data/rdoc/site/0.1.19/js/navigation.js +0 -142
- data/rdoc/site/0.1.19/js/search.js +0 -94
- data/rdoc/site/0.1.19/js/search_index.js +0 -1
- data/rdoc/site/0.1.19/js/searcher.js +0 -228
- data/rdoc/site/0.1.19/rdoc.css +0 -543
- data/rdoc/site/0.1.19/table_of_contents.html +0 -1541
- data/rdoc/site/0.2.0/ARCHITECTURE_rdoc.html +0 -638
- data/rdoc/site/0.2.0/Hash.html +0 -351
- data/rdoc/site/0.2.0/Kernel.html +0 -416
- data/rdoc/site/0.2.0/Nucleon.html +0 -607
- data/rdoc/site/0.2.0/Nucleon/Action.html +0 -284
- data/rdoc/site/0.2.0/Nucleon/Action/Extract.html +0 -455
- data/rdoc/site/0.2.0/Nucleon/Action/Project.html +0 -283
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Add.html +0 -500
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Create.html +0 -457
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Remove.html +0 -503
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Save.html +0 -476
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Update.html +0 -423
- data/rdoc/site/0.2.0/Nucleon/Codes.html +0 -567
- data/rdoc/site/0.2.0/Nucleon/Command.html +0 -279
- data/rdoc/site/0.2.0/Nucleon/Command/Bash.html +0 -548
- data/rdoc/site/0.2.0/Nucleon/Config.html +0 -1631
- data/rdoc/site/0.2.0/Nucleon/Config/Collection.html +0 -513
- data/rdoc/site/0.2.0/Nucleon/Config/Options.html +0 -493
- data/rdoc/site/0.2.0/Nucleon/Core.html +0 -639
- data/rdoc/site/0.2.0/Nucleon/Environment.html +0 -1208
- data/rdoc/site/0.2.0/Nucleon/Errors.html +0 -279
- data/rdoc/site/0.2.0/Nucleon/Errors/BatchError.html +0 -285
- data/rdoc/site/0.2.0/Nucleon/Errors/NucleonError.html +0 -661
- data/rdoc/site/0.2.0/Nucleon/Errors/SSHUnavailable.html +0 -285
- data/rdoc/site/0.2.0/Nucleon/Event.html +0 -279
- data/rdoc/site/0.2.0/Nucleon/Event/Regex.html +0 -471
- data/rdoc/site/0.2.0/Nucleon/Facade.html +0 -2409
- data/rdoc/site/0.2.0/Nucleon/Gems.html +0 -639
- data/rdoc/site/0.2.0/Nucleon/Manager.html +0 -1860
- data/rdoc/site/0.2.0/Nucleon/Mixin.html +0 -288
- data/rdoc/site/0.2.0/Nucleon/Mixin/Action.html +0 -281
- data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Commit.html +0 -385
- data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Project.html +0 -399
- data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Push.html +0 -375
- data/rdoc/site/0.2.0/Nucleon/Mixin/Colors.html +0 -549
- data/rdoc/site/0.2.0/Nucleon/Mixin/ConfigCollection.html +0 -485
- data/rdoc/site/0.2.0/Nucleon/Mixin/ConfigOptions.html +0 -453
- data/rdoc/site/0.2.0/Nucleon/Mixin/Macro.html +0 -280
- data/rdoc/site/0.2.0/Nucleon/Mixin/Macro/ObjectInterface.html +0 -699
- data/rdoc/site/0.2.0/Nucleon/Mixin/Macro/PluginInterface.html +0 -686
- data/rdoc/site/0.2.0/Nucleon/Mixin/Settings.html +0 -485
- data/rdoc/site/0.2.0/Nucleon/Mixin/SubConfig.html +0 -891
- data/rdoc/site/0.2.0/Nucleon/Parallel.html +0 -330
- data/rdoc/site/0.2.0/Nucleon/Parallel/ClassMethods.html +0 -329
- data/rdoc/site/0.2.0/Nucleon/Parallel/InstanceMethods.html +0 -456
- data/rdoc/site/0.2.0/Nucleon/Plugin.html +0 -286
- data/rdoc/site/0.2.0/Nucleon/Plugin/Action.html +0 -1829
- data/rdoc/site/0.2.0/Nucleon/Plugin/Action/Option.html +0 -463
- data/rdoc/site/0.2.0/Nucleon/Plugin/Base.html +0 -1803
- data/rdoc/site/0.2.0/Nucleon/Plugin/Command.html +0 -725
- data/rdoc/site/0.2.0/Nucleon/Plugin/Event.html +0 -446
- data/rdoc/site/0.2.0/Nucleon/Plugin/Extension.html +0 -285
- data/rdoc/site/0.2.0/Nucleon/Plugin/Project.html +0 -2898
- data/rdoc/site/0.2.0/Nucleon/Plugin/Template.html +0 -480
- data/rdoc/site/0.2.0/Nucleon/Plugin/Translator.html +0 -375
- data/rdoc/site/0.2.0/Nucleon/Project.html +0 -280
- data/rdoc/site/0.2.0/Nucleon/Project/Git.html +0 -1805
- data/rdoc/site/0.2.0/Nucleon/Project/Github.html +0 -553
- data/rdoc/site/0.2.0/Nucleon/Template.html +0 -281
- data/rdoc/site/0.2.0/Nucleon/Template/JSON.html +0 -333
- data/rdoc/site/0.2.0/Nucleon/Template/Wrapper.html +0 -333
- data/rdoc/site/0.2.0/Nucleon/Template/YAML.html +0 -333
- data/rdoc/site/0.2.0/Nucleon/Translator.html +0 -280
- data/rdoc/site/0.2.0/Nucleon/Translator/JSON.html +0 -370
- data/rdoc/site/0.2.0/Nucleon/Translator/YAML.html +0 -370
- data/rdoc/site/0.2.0/Nucleon/Util.html +0 -289
- data/rdoc/site/0.2.0/Nucleon/Util/CLI.html +0 -392
- data/rdoc/site/0.2.0/Nucleon/Util/CLI/Parser.html +0 -1250
- data/rdoc/site/0.2.0/Nucleon/Util/Cache.html +0 -784
- data/rdoc/site/0.2.0/Nucleon/Util/Console.html +0 -1318
- data/rdoc/site/0.2.0/Nucleon/Util/Data.html +0 -1411
- data/rdoc/site/0.2.0/Nucleon/Util/Disk.html +0 -526
- data/rdoc/site/0.2.0/Nucleon/Util/Git.html +0 -365
- data/rdoc/site/0.2.0/Nucleon/Util/Liquid.html +0 -369
- data/rdoc/site/0.2.0/Nucleon/Util/Logger.html +0 -810
- data/rdoc/site/0.2.0/Nucleon/Util/Package.html +0 -562
- data/rdoc/site/0.2.0/Nucleon/Util/SSH.html +0 -1033
- data/rdoc/site/0.2.0/Nucleon/Util/SSH/Keypair.html +0 -605
- data/rdoc/site/0.2.0/Nucleon/Util/Shell.html +0 -693
- data/rdoc/site/0.2.0/Nucleon/Util/Shell/Result.html +0 -501
- data/rdoc/site/0.2.0/README_rdoc.html +0 -316
- data/rdoc/site/0.2.0/TODO_rdoc.html +0 -265
- data/rdoc/site/0.2.0/created.rid +0 -61
- data/rdoc/site/0.2.0/images/add.png +0 -0
- data/rdoc/site/0.2.0/images/brick.png +0 -0
- data/rdoc/site/0.2.0/images/brick_link.png +0 -0
- data/rdoc/site/0.2.0/images/bug.png +0 -0
- data/rdoc/site/0.2.0/images/bullet_black.png +0 -0
- data/rdoc/site/0.2.0/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.2.0/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.2.0/images/date.png +0 -0
- data/rdoc/site/0.2.0/images/delete.png +0 -0
- data/rdoc/site/0.2.0/images/find.png +0 -0
- data/rdoc/site/0.2.0/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.2.0/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.2.0/images/package.png +0 -0
- data/rdoc/site/0.2.0/images/page_green.png +0 -0
- data/rdoc/site/0.2.0/images/page_white_text.png +0 -0
- data/rdoc/site/0.2.0/images/page_white_width.png +0 -0
- data/rdoc/site/0.2.0/images/plugin.png +0 -0
- data/rdoc/site/0.2.0/images/ruby.png +0 -0
- data/rdoc/site/0.2.0/images/tag_blue.png +0 -0
- data/rdoc/site/0.2.0/images/tag_green.png +0 -0
- data/rdoc/site/0.2.0/images/transparent.png +0 -0
- data/rdoc/site/0.2.0/images/wrench.png +0 -0
- data/rdoc/site/0.2.0/images/wrench_orange.png +0 -0
- data/rdoc/site/0.2.0/images/zoom.png +0 -0
- data/rdoc/site/0.2.0/index.html +0 -315
- data/rdoc/site/0.2.0/js/darkfish.js +0 -155
- data/rdoc/site/0.2.0/js/jquery.js +0 -18
- data/rdoc/site/0.2.0/js/navigation.js +0 -142
- data/rdoc/site/0.2.0/js/search.js +0 -94
- data/rdoc/site/0.2.0/js/search_index.js +0 -1
- data/rdoc/site/0.2.0/js/searcher.js +0 -228
- data/rdoc/site/0.2.0/rdoc.css +0 -543
- data/rdoc/site/0.2.0/table_of_contents.html +0 -1657
- data/rdoc/site/0.2.1/ARCHITECTURE_rdoc.html +0 -640
- data/rdoc/site/0.2.1/Hash.html +0 -353
- data/rdoc/site/0.2.1/Kernel.html +0 -420
- data/rdoc/site/0.2.1/Nucleon.html +0 -674
- data/rdoc/site/0.2.1/Nucleon/Action.html +0 -286
- data/rdoc/site/0.2.1/Nucleon/Action/Extract.html +0 -457
- data/rdoc/site/0.2.1/Nucleon/Action/Project.html +0 -285
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Add.html +0 -502
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Create.html +0 -459
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Remove.html +0 -505
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Save.html +0 -478
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Update.html +0 -425
- data/rdoc/site/0.2.1/Nucleon/Codes.html +0 -569
- data/rdoc/site/0.2.1/Nucleon/Command.html +0 -281
- data/rdoc/site/0.2.1/Nucleon/Command/Bash.html +0 -550
- data/rdoc/site/0.2.1/Nucleon/Config.html +0 -1634
- data/rdoc/site/0.2.1/Nucleon/Config/Collection.html +0 -515
- data/rdoc/site/0.2.1/Nucleon/Config/Options.html +0 -495
- data/rdoc/site/0.2.1/Nucleon/Core.html +0 -641
- data/rdoc/site/0.2.1/Nucleon/Environment.html +0 -1210
- data/rdoc/site/0.2.1/Nucleon/Errors.html +0 -281
- data/rdoc/site/0.2.1/Nucleon/Errors/BatchError.html +0 -287
- data/rdoc/site/0.2.1/Nucleon/Errors/NucleonError.html +0 -663
- data/rdoc/site/0.2.1/Nucleon/Errors/SSHUnavailable.html +0 -287
- data/rdoc/site/0.2.1/Nucleon/Event.html +0 -281
- data/rdoc/site/0.2.1/Nucleon/Event/Regex.html +0 -473
- data/rdoc/site/0.2.1/Nucleon/Facade.html +0 -2452
- data/rdoc/site/0.2.1/Nucleon/Gems.html +0 -641
- data/rdoc/site/0.2.1/Nucleon/Manager.html +0 -1862
- data/rdoc/site/0.2.1/Nucleon/Mixin.html +0 -291
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action.html +0 -284
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Commit.html +0 -387
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Project.html +0 -401
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Push.html +0 -377
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Registration.html +0 -575
- data/rdoc/site/0.2.1/Nucleon/Mixin/Colors.html +0 -551
- data/rdoc/site/0.2.1/Nucleon/Mixin/ConfigCollection.html +0 -487
- data/rdoc/site/0.2.1/Nucleon/Mixin/ConfigOptions.html +0 -455
- data/rdoc/site/0.2.1/Nucleon/Mixin/Macro.html +0 -282
- data/rdoc/site/0.2.1/Nucleon/Mixin/Macro/ObjectInterface.html +0 -701
- data/rdoc/site/0.2.1/Nucleon/Mixin/Macro/PluginInterface.html +0 -688
- data/rdoc/site/0.2.1/Nucleon/Mixin/Settings.html +0 -487
- data/rdoc/site/0.2.1/Nucleon/Mixin/SubConfig.html +0 -893
- data/rdoc/site/0.2.1/Nucleon/Parallel.html +0 -332
- data/rdoc/site/0.2.1/Nucleon/Parallel/ClassMethods.html +0 -331
- data/rdoc/site/0.2.1/Nucleon/Parallel/InstanceMethods.html +0 -458
- data/rdoc/site/0.2.1/Nucleon/Plugin.html +0 -288
- data/rdoc/site/0.2.1/Nucleon/Plugin/Action.html +0 -2133
- data/rdoc/site/0.2.1/Nucleon/Plugin/Action/Option.html +0 -465
- data/rdoc/site/0.2.1/Nucleon/Plugin/Base.html +0 -1988
- data/rdoc/site/0.2.1/Nucleon/Plugin/Command.html +0 -765
- data/rdoc/site/0.2.1/Nucleon/Plugin/Event.html +0 -448
- data/rdoc/site/0.2.1/Nucleon/Plugin/Extension.html +0 -287
- data/rdoc/site/0.2.1/Nucleon/Plugin/Project.html +0 -2900
- data/rdoc/site/0.2.1/Nucleon/Plugin/Template.html +0 -482
- data/rdoc/site/0.2.1/Nucleon/Plugin/Translator.html +0 -377
- data/rdoc/site/0.2.1/Nucleon/Project.html +0 -282
- data/rdoc/site/0.2.1/Nucleon/Project/Git.html +0 -1807
- data/rdoc/site/0.2.1/Nucleon/Project/Github.html +0 -555
- data/rdoc/site/0.2.1/Nucleon/Template.html +0 -283
- data/rdoc/site/0.2.1/Nucleon/Template/JSON.html +0 -335
- data/rdoc/site/0.2.1/Nucleon/Template/Wrapper.html +0 -335
- data/rdoc/site/0.2.1/Nucleon/Template/YAML.html +0 -335
- data/rdoc/site/0.2.1/Nucleon/Translator.html +0 -282
- data/rdoc/site/0.2.1/Nucleon/Translator/JSON.html +0 -372
- data/rdoc/site/0.2.1/Nucleon/Translator/YAML.html +0 -372
- data/rdoc/site/0.2.1/Nucleon/Util.html +0 -291
- data/rdoc/site/0.2.1/Nucleon/Util/CLI.html +0 -394
- data/rdoc/site/0.2.1/Nucleon/Util/CLI/Parser.html +0 -1404
- data/rdoc/site/0.2.1/Nucleon/Util/Cache.html +0 -824
- data/rdoc/site/0.2.1/Nucleon/Util/Console.html +0 -1330
- data/rdoc/site/0.2.1/Nucleon/Util/Data.html +0 -1423
- data/rdoc/site/0.2.1/Nucleon/Util/Disk.html +0 -528
- data/rdoc/site/0.2.1/Nucleon/Util/Git.html +0 -367
- data/rdoc/site/0.2.1/Nucleon/Util/Liquid.html +0 -371
- data/rdoc/site/0.2.1/Nucleon/Util/Logger.html +0 -822
- data/rdoc/site/0.2.1/Nucleon/Util/Package.html +0 -564
- data/rdoc/site/0.2.1/Nucleon/Util/SSH.html +0 -1036
- data/rdoc/site/0.2.1/Nucleon/Util/SSH/Keypair.html +0 -607
- data/rdoc/site/0.2.1/Nucleon/Util/Shell.html +0 -697
- data/rdoc/site/0.2.1/Nucleon/Util/Shell/Result.html +0 -503
- data/rdoc/site/0.2.1/README_rdoc.html +0 -318
- data/rdoc/site/0.2.1/TODO_rdoc.html +0 -267
- data/rdoc/site/0.2.1/created.rid +0 -62
- data/rdoc/site/0.2.1/images/add.png +0 -0
- data/rdoc/site/0.2.1/images/brick.png +0 -0
- data/rdoc/site/0.2.1/images/brick_link.png +0 -0
- data/rdoc/site/0.2.1/images/bug.png +0 -0
- data/rdoc/site/0.2.1/images/bullet_black.png +0 -0
- data/rdoc/site/0.2.1/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.2.1/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.2.1/images/date.png +0 -0
- data/rdoc/site/0.2.1/images/delete.png +0 -0
- data/rdoc/site/0.2.1/images/find.png +0 -0
- data/rdoc/site/0.2.1/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.2.1/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.2.1/images/package.png +0 -0
- data/rdoc/site/0.2.1/images/page_green.png +0 -0
- data/rdoc/site/0.2.1/images/page_white_text.png +0 -0
- data/rdoc/site/0.2.1/images/page_white_width.png +0 -0
- data/rdoc/site/0.2.1/images/plugin.png +0 -0
- data/rdoc/site/0.2.1/images/ruby.png +0 -0
- data/rdoc/site/0.2.1/images/tag_blue.png +0 -0
- data/rdoc/site/0.2.1/images/tag_green.png +0 -0
- data/rdoc/site/0.2.1/images/transparent.png +0 -0
- data/rdoc/site/0.2.1/images/wrench.png +0 -0
- data/rdoc/site/0.2.1/images/wrench_orange.png +0 -0
- data/rdoc/site/0.2.1/images/zoom.png +0 -0
- data/rdoc/site/0.2.1/index.html +0 -317
- data/rdoc/site/0.2.1/js/darkfish.js +0 -155
- data/rdoc/site/0.2.1/js/jquery.js +0 -18
- data/rdoc/site/0.2.1/js/navigation.js +0 -142
- data/rdoc/site/0.2.1/js/search.js +0 -94
- data/rdoc/site/0.2.1/js/search_index.js +0 -1
- data/rdoc/site/0.2.1/js/searcher.js +0 -228
- data/rdoc/site/0.2.1/rdoc.css +0 -543
- data/rdoc/site/0.2.1/table_of_contents.html +0 -1718
- data/spec/coral_mock_input.rb +0 -29
- data/spec/coral_test_kernel.rb +0 -22
data/lib/core/plugin/base.rb
CHANGED
|
@@ -2,437 +2,445 @@
|
|
|
2
2
|
module Nucleon
|
|
3
3
|
module Plugin
|
|
4
4
|
class Base < Core
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
def self.register_ids
|
|
7
7
|
[ :plugin_name, :name ]
|
|
8
8
|
end
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
# All Plugin classes should directly or indirectly extend Base
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
def initialize(namespace, plugin_type, provider, options)
|
|
13
13
|
@actor = Nucleon.handle(self)
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
config = Util::Data.clean(Config.ensure(options), false)
|
|
16
16
|
name = Util::Data.ensure_value(config.delete(:plugin_name), config.delete(:name, provider))
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
@quiet = config.delete(:quiet, false)
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
set_meta(config.delete(:meta, Config.new))
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
# No logging statements above this line!!
|
|
23
23
|
super(config.import({ :logger => "#{namespace}->#{plugin_type}->#{plugin_provider}" }), {}, true, false, false)
|
|
24
24
|
myself.plugin_name = name
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
logger.debug("Normalizing #{namespace} #{plugin_type} plugin #{plugin_name}")
|
|
27
27
|
normalize(false)
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
@initialized = true
|
|
30
30
|
end
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
#---
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
def parallel_finalize
|
|
35
35
|
remove_plugin
|
|
36
36
|
end
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
#---
|
|
39
|
-
|
|
40
|
-
def method_missing(method, *args, &block)
|
|
41
|
-
return nil
|
|
39
|
+
|
|
40
|
+
def method_missing(method, *args, &block)
|
|
41
|
+
return nil
|
|
42
42
|
end
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
#---
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
def remove_plugin
|
|
47
47
|
# Implement in sub classes if needed for cleanup
|
|
48
48
|
end
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
#-----------------------------------------------------------------------------
|
|
51
51
|
# Checks
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
def quiet?
|
|
54
54
|
@quiet
|
|
55
55
|
end
|
|
56
|
-
|
|
56
|
+
|
|
57
57
|
#-----------------------------------------------------------------------------
|
|
58
58
|
# Property accessor / modifiers
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
def myself
|
|
61
61
|
@actor
|
|
62
62
|
end
|
|
63
63
|
alias_method :me, :myself
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
#---
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
def quiet=quiet
|
|
68
68
|
@quiet = quiet
|
|
69
69
|
end
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
#---
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
def meta
|
|
74
74
|
return @meta
|
|
75
75
|
end
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
#---
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
def set_meta(meta)
|
|
80
80
|
@meta = Config.ensure(meta)
|
|
81
81
|
end
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
#---
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
def plugin_namespace
|
|
86
86
|
return meta.get(:namespace)
|
|
87
87
|
end
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
#---
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
def plugin_type
|
|
92
92
|
return meta.get(:type)
|
|
93
93
|
end
|
|
94
|
-
|
|
94
|
+
|
|
95
95
|
#---
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
def plugin_provider
|
|
98
98
|
return meta.get(:provider)
|
|
99
99
|
end
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
#---
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
def plugin_name
|
|
104
104
|
return meta.get(:name)
|
|
105
105
|
end
|
|
106
|
-
|
|
106
|
+
|
|
107
107
|
def plugin_name=plugin_name
|
|
108
108
|
meta.set(:name, string(plugin_name))
|
|
109
109
|
end
|
|
110
|
-
|
|
110
|
+
|
|
111
111
|
#---
|
|
112
|
-
|
|
112
|
+
|
|
113
113
|
def plugin_directory
|
|
114
114
|
return meta.get(:directory)
|
|
115
115
|
end
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
#---
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
def plugin_file
|
|
120
120
|
return meta.get(:file)
|
|
121
121
|
end
|
|
122
|
-
|
|
122
|
+
|
|
123
123
|
#---
|
|
124
|
-
|
|
124
|
+
|
|
125
125
|
def plugin_instance_name
|
|
126
126
|
return meta.get(:instance_name)
|
|
127
127
|
end
|
|
128
|
-
|
|
128
|
+
|
|
129
129
|
#---
|
|
130
|
-
|
|
130
|
+
|
|
131
131
|
def plugin_parent=parent
|
|
132
132
|
meta.set(:parent, parent) if parent.is_a?(Nucleon::Plugin::Base)
|
|
133
133
|
end
|
|
134
|
-
|
|
134
|
+
|
|
135
135
|
def plugin_parent
|
|
136
136
|
return meta.get(:parent)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
#-----------------------------------------------------------------------------
|
|
140
140
|
# Status codes
|
|
141
|
-
|
|
142
|
-
def code
|
|
141
|
+
|
|
142
|
+
def self.code
|
|
143
143
|
Nucleon.code
|
|
144
144
|
end
|
|
145
|
-
|
|
146
|
-
def
|
|
145
|
+
|
|
146
|
+
def code
|
|
147
|
+
self.class.code
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def self.codes(*codes)
|
|
147
151
|
Nucleon.codes(*codes)
|
|
148
152
|
end
|
|
149
153
|
|
|
154
|
+
def codes(*codes)
|
|
155
|
+
self.class.codes(*codes)
|
|
156
|
+
end
|
|
157
|
+
|
|
150
158
|
#---
|
|
151
|
-
|
|
159
|
+
|
|
152
160
|
def status=status
|
|
153
161
|
meta.set(:status, status)
|
|
154
162
|
end
|
|
155
|
-
|
|
163
|
+
|
|
156
164
|
def status
|
|
157
165
|
meta.get(:status, code.unknown_status)
|
|
158
166
|
end
|
|
159
167
|
|
|
160
168
|
#-----------------------------------------------------------------------------
|
|
161
169
|
# Plugin operations
|
|
162
|
-
|
|
170
|
+
|
|
163
171
|
def normalize(reload)
|
|
164
172
|
# Implement in sub classes
|
|
165
173
|
end
|
|
166
|
-
|
|
174
|
+
|
|
167
175
|
#-----------------------------------------------------------------------------
|
|
168
176
|
# Extensions
|
|
169
|
-
|
|
177
|
+
|
|
170
178
|
def hook_method(hook)
|
|
171
|
-
"#{plugin_type}_#{plugin_provider}_#{hook}"
|
|
179
|
+
"#{plugin_type}_#{plugin_provider}_#{hook}"
|
|
172
180
|
end
|
|
173
|
-
|
|
181
|
+
|
|
174
182
|
#---
|
|
175
|
-
|
|
183
|
+
|
|
176
184
|
def extension(hook, options = {}, &code)
|
|
177
185
|
Nucleon.exec(hook_method(hook), Config.ensure(options).import({ :plugin => myself }), &code)
|
|
178
186
|
end
|
|
179
|
-
|
|
187
|
+
|
|
180
188
|
#---
|
|
181
|
-
|
|
189
|
+
|
|
182
190
|
def extended_config(type, options = {})
|
|
183
191
|
config = Nucleon.config(type, Config.ensure(options).import({ :plugin => myself }))
|
|
184
192
|
config.delete(:plugin)
|
|
185
193
|
config
|
|
186
194
|
end
|
|
187
|
-
|
|
195
|
+
|
|
188
196
|
#---
|
|
189
|
-
|
|
197
|
+
|
|
190
198
|
def extension_check(hook, options = {})
|
|
191
199
|
Nucleon.check(hook_method(hook), Config.ensure(options).import({ :plugin => myself }))
|
|
192
200
|
end
|
|
193
|
-
|
|
201
|
+
|
|
194
202
|
#---
|
|
195
|
-
|
|
203
|
+
|
|
196
204
|
def extension_set(hook, value, options = {})
|
|
197
205
|
Nucleon.value(hook_method(hook), value, Config.ensure(options).import({ :plugin => myself }))
|
|
198
206
|
end
|
|
199
|
-
|
|
207
|
+
|
|
200
208
|
#---
|
|
201
|
-
|
|
209
|
+
|
|
202
210
|
def extension_collect(hook, options = {})
|
|
203
211
|
Nucleon.collect(hook_method(hook), Config.ensure(options).import({ :plugin => myself }))
|
|
204
212
|
end
|
|
205
|
-
|
|
213
|
+
|
|
206
214
|
#-----------------------------------------------------------------------------
|
|
207
215
|
# Input
|
|
208
|
-
|
|
216
|
+
|
|
209
217
|
def ask(message, options = {})
|
|
210
218
|
ui.ask(message, options)
|
|
211
219
|
end
|
|
212
|
-
|
|
220
|
+
|
|
213
221
|
#---
|
|
214
|
-
|
|
222
|
+
|
|
215
223
|
def password(type, options = {})
|
|
216
224
|
ui.password(type, options)
|
|
217
225
|
end
|
|
218
|
-
|
|
226
|
+
|
|
219
227
|
#-----------------------------------------------------------------------------
|
|
220
228
|
# Output
|
|
221
|
-
|
|
229
|
+
|
|
222
230
|
def render_provider
|
|
223
231
|
plugin_provider
|
|
224
232
|
end
|
|
225
233
|
protected :render_provider
|
|
226
|
-
|
|
234
|
+
|
|
227
235
|
#---
|
|
228
|
-
|
|
236
|
+
|
|
229
237
|
def render_options
|
|
230
|
-
export.merge({
|
|
231
|
-
:plugin_namespace => self.class.respond_to?(:namespace) ? self.class.namespace : plugin_namespace,
|
|
232
|
-
:plugin_type => plugin_type,
|
|
233
|
-
:plugin_provider => render_provider
|
|
234
|
-
})
|
|
238
|
+
export.merge({
|
|
239
|
+
:plugin_namespace => self.class.respond_to?(:namespace) ? self.class.namespace : plugin_namespace,
|
|
240
|
+
:plugin_type => plugin_type,
|
|
241
|
+
:plugin_provider => render_provider
|
|
242
|
+
})
|
|
235
243
|
end
|
|
236
244
|
protected :render_options
|
|
237
|
-
|
|
245
|
+
|
|
238
246
|
#---
|
|
239
|
-
|
|
247
|
+
|
|
240
248
|
def render_message(message, options = {})
|
|
241
249
|
config = Config.ensure(options)
|
|
242
250
|
use_prefix = true
|
|
243
|
-
|
|
251
|
+
|
|
244
252
|
if config.delete(:i18n, true)
|
|
245
253
|
Nucleon.namespaces.each do |namespace|
|
|
246
254
|
if message =~ /^#{namespace.to_s.downcase}\./
|
|
247
255
|
use_prefix = false
|
|
248
256
|
break
|
|
249
257
|
end
|
|
250
|
-
end
|
|
251
|
-
|
|
258
|
+
end
|
|
259
|
+
|
|
252
260
|
if use_prefix
|
|
253
261
|
plugin_namespace = self.class.namespace if self.class.respond_to?(:namespace)
|
|
254
262
|
operation_id = config.has_key?(:operation) ? config[:operation] : ''
|
|
255
263
|
prefix = "#{plugin_namespace}.#{plugin_type}.#{render_provider.to_s.gsub('_', '.')}."
|
|
256
|
-
|
|
264
|
+
|
|
257
265
|
message = prefix + ( operation_id.empty? ? '' : "#{operation_id}." ) + message.sub(/^#{prefix}/, '')
|
|
258
266
|
end
|
|
259
267
|
message = I18n.t(message, Util::Data.merge([ Config.ensure(render_options).export, config.export ], true))
|
|
260
268
|
end
|
|
261
|
-
message
|
|
269
|
+
message
|
|
262
270
|
end
|
|
263
271
|
protected :render_message
|
|
264
|
-
|
|
272
|
+
|
|
265
273
|
#---
|
|
266
|
-
|
|
274
|
+
|
|
267
275
|
def render(data, options = {})
|
|
268
276
|
config = Config.ensure(options)
|
|
269
|
-
|
|
277
|
+
|
|
270
278
|
if ! quiet? || config[:silent]
|
|
271
279
|
translator = nil
|
|
272
|
-
translator =
|
|
280
|
+
translator = Nucleon.translator({}, config[:format]) if config[:format]
|
|
273
281
|
data = translator.generate(data) if translator
|
|
274
|
-
|
|
282
|
+
|
|
275
283
|
ui.dump(data, options) unless data.strip.empty? || config[:silent]
|
|
276
284
|
end
|
|
277
285
|
data
|
|
278
286
|
end
|
|
279
|
-
|
|
287
|
+
|
|
280
288
|
#---
|
|
281
|
-
|
|
289
|
+
|
|
282
290
|
def info(message, options = {})
|
|
283
291
|
config = Config.new(options).import({ :operation => :info })
|
|
284
|
-
|
|
292
|
+
|
|
285
293
|
unless quiet?
|
|
286
294
|
message = render_message(message, config)
|
|
287
295
|
ui.info(message, config.export)
|
|
288
296
|
end
|
|
289
297
|
message
|
|
290
298
|
end
|
|
291
|
-
|
|
299
|
+
|
|
292
300
|
#---
|
|
293
|
-
|
|
301
|
+
|
|
294
302
|
def warn(message, options = {})
|
|
295
303
|
config = Config.new(options).import({ :operation => :warn })
|
|
296
|
-
|
|
304
|
+
|
|
297
305
|
unless quiet?
|
|
298
306
|
message = render_message(message, config)
|
|
299
307
|
ui.warn(message, config.export)
|
|
300
308
|
end
|
|
301
309
|
message
|
|
302
310
|
end
|
|
303
|
-
|
|
311
|
+
|
|
304
312
|
#---
|
|
305
|
-
|
|
313
|
+
|
|
306
314
|
def error(message, options = {})
|
|
307
315
|
config = Config.new(options).import({ :operation => :error })
|
|
308
|
-
|
|
316
|
+
|
|
309
317
|
unless quiet?
|
|
310
318
|
message = render_message(message, config)
|
|
311
319
|
ui.error(message, config.export)
|
|
312
320
|
end
|
|
313
321
|
message
|
|
314
322
|
end
|
|
315
|
-
|
|
323
|
+
|
|
316
324
|
#---
|
|
317
|
-
|
|
325
|
+
|
|
318
326
|
def success(message, options = {})
|
|
319
327
|
config = Config.new(options).import({ :operation => :success })
|
|
320
|
-
|
|
328
|
+
|
|
321
329
|
unless quiet?
|
|
322
330
|
message = render_message(message, config)
|
|
323
331
|
ui.success(message, config.export)
|
|
324
332
|
end
|
|
325
333
|
message
|
|
326
334
|
end
|
|
327
|
-
|
|
335
|
+
|
|
328
336
|
#---
|
|
329
|
-
|
|
337
|
+
|
|
330
338
|
def prefixed_message(type, prefix, message, options = {})
|
|
331
339
|
return unless [ :info, :warn, :error, :success ].include?(type.to_sym)
|
|
332
340
|
send(type, prefix.to_s + render_message(message, Config.new(options).import({ :prefix => false, :operation => type.to_sym }).export), Config.new(options).import({ :i18n => false }).export)
|
|
333
341
|
end
|
|
334
|
-
|
|
342
|
+
|
|
335
343
|
#-----------------------------------------------------------------------------
|
|
336
344
|
# Utilities
|
|
337
|
-
|
|
338
|
-
def self.build_info(namespace, plugin_type, data)
|
|
345
|
+
|
|
346
|
+
def self.build_info(namespace, plugin_type, data)
|
|
339
347
|
plugins = []
|
|
340
|
-
|
|
348
|
+
|
|
341
349
|
if data.is_a?(Hash)
|
|
342
350
|
data = [ data ]
|
|
343
351
|
end
|
|
344
|
-
|
|
352
|
+
|
|
345
353
|
logger.debug("Building plugin list of #{plugin_type}")
|
|
346
|
-
|
|
354
|
+
|
|
347
355
|
if data.is_a?(Array)
|
|
348
356
|
data.each do |info|
|
|
349
357
|
unless Util::Data.empty?(info)
|
|
350
358
|
info = translate(info)
|
|
351
|
-
|
|
359
|
+
|
|
352
360
|
if Util::Data.empty?(info[:provider])
|
|
353
361
|
info[:provider] = Nucleon.type_default(namespace, plugin_type)
|
|
354
362
|
end
|
|
355
|
-
|
|
363
|
+
|
|
356
364
|
plugins << info
|
|
357
365
|
end
|
|
358
366
|
end
|
|
359
367
|
end
|
|
360
368
|
return plugins
|
|
361
369
|
end
|
|
362
|
-
|
|
370
|
+
|
|
363
371
|
#---
|
|
364
372
|
|
|
365
373
|
def self.translate(data)
|
|
366
374
|
logger.debug("Translating input data to internal plugin structure")
|
|
367
375
|
return ( data.is_a?(Hash) ? symbol_map(data) : data )
|
|
368
376
|
end
|
|
369
|
-
|
|
377
|
+
|
|
370
378
|
#---
|
|
371
|
-
|
|
379
|
+
|
|
372
380
|
def self.translate_reference(reference, editable = false)
|
|
373
381
|
# ex: provider:::name
|
|
374
382
|
if reference && reference.match(/^\s*([a-zA-Z0-9_-]+)(?::::)?(.*)?\s*$/)
|
|
375
383
|
provider = $1
|
|
376
384
|
name = $2
|
|
377
|
-
|
|
385
|
+
|
|
378
386
|
logger.debug("Translating plugin reference: #{provider} #{name}")
|
|
379
|
-
|
|
387
|
+
|
|
380
388
|
info = {
|
|
381
389
|
:provider => provider,
|
|
382
390
|
:name => name
|
|
383
391
|
}
|
|
384
|
-
|
|
392
|
+
|
|
385
393
|
logger.debug("Plugin reference info: #{info.inspect}")
|
|
386
394
|
return info
|
|
387
395
|
end
|
|
388
396
|
nil
|
|
389
397
|
end
|
|
390
|
-
|
|
398
|
+
|
|
391
399
|
#---
|
|
392
|
-
|
|
400
|
+
|
|
393
401
|
def translate_reference(reference, editable = false)
|
|
394
402
|
myself.class.translate_reference(reference, editable)
|
|
395
403
|
end
|
|
396
|
-
|
|
404
|
+
|
|
397
405
|
#---
|
|
398
|
-
|
|
406
|
+
|
|
399
407
|
def self.init_plugin_collection(*external_block_methods)
|
|
400
408
|
logger.debug("Initializing plugin collection interface at #{Time.now}")
|
|
401
|
-
|
|
409
|
+
|
|
402
410
|
include Parallel
|
|
403
411
|
external_block_exec(*external_block_methods)
|
|
404
|
-
|
|
412
|
+
|
|
405
413
|
include Mixin::Settings
|
|
406
414
|
include Mixin::SubConfig
|
|
407
|
-
|
|
415
|
+
|
|
408
416
|
extend Mixin::Macro::PluginInterface
|
|
409
417
|
end
|
|
410
|
-
|
|
418
|
+
|
|
411
419
|
#---
|
|
412
|
-
|
|
420
|
+
|
|
413
421
|
def safe_exec(return_result = true, &code)
|
|
414
422
|
begin
|
|
415
423
|
result = code.call
|
|
416
424
|
return result if return_result
|
|
417
425
|
return true
|
|
418
|
-
|
|
426
|
+
|
|
419
427
|
rescue => error
|
|
420
428
|
logger.error(error.inspect)
|
|
421
429
|
logger.error(error.message)
|
|
422
|
-
|
|
430
|
+
|
|
423
431
|
error(error.message, { :prefix => false, :i18n => false }) if error.message
|
|
424
432
|
end
|
|
425
433
|
return false
|
|
426
434
|
end
|
|
427
|
-
|
|
435
|
+
|
|
428
436
|
#---
|
|
429
|
-
|
|
437
|
+
|
|
430
438
|
def admin_exec(return_result = true, &block)
|
|
431
439
|
if Nucleon.admin?
|
|
432
440
|
safe_exec(return_result, &block)
|
|
433
441
|
else
|
|
434
442
|
warn("The #{plugin_provider} action must be run as a machine administrator", { :i18n => false })
|
|
435
|
-
myself.status = code.access_denied
|
|
443
|
+
myself.status = code.access_denied
|
|
436
444
|
end
|
|
437
445
|
end
|
|
438
446
|
end
|