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
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
# Should be included via extend
|
|
3
|
-
#
|
|
4
|
-
# extend Mixin::Macro::PluginInterface
|
|
5
|
-
#
|
|
6
|
-
|
|
7
1
|
nucleon_require(File.dirname(__FILE__), :object_interface)
|
|
8
2
|
|
|
9
3
|
#---
|
|
@@ -12,109 +6,109 @@ module Nucleon
|
|
|
12
6
|
module Mixin
|
|
13
7
|
module Macro
|
|
14
8
|
module PluginInterface
|
|
15
|
-
|
|
9
|
+
|
|
16
10
|
include Macro::ObjectInterface
|
|
17
|
-
|
|
11
|
+
|
|
18
12
|
#-----------------------------------------------------------------------------
|
|
19
13
|
# Plugin collections
|
|
20
|
-
|
|
14
|
+
|
|
21
15
|
def plugin_collection(_namespace, _type, _method_options = {})
|
|
22
16
|
_method_config = Config.ensure(_method_options)
|
|
23
17
|
_method_config.set(:plugin, true)
|
|
24
|
-
|
|
18
|
+
|
|
25
19
|
_plural = _method_config.init(:plural, "#{_type}s").get(:plural)
|
|
26
20
|
_search_proc = _method_config.get(:search_proc)
|
|
27
21
|
_single_instance = _method_config.get(:single_instance, false)
|
|
28
22
|
_plugin_type = _method_config.get(:plugin_type, _type)
|
|
29
|
-
|
|
23
|
+
|
|
30
24
|
@@object_types[_type] = _method_config
|
|
31
|
-
|
|
25
|
+
|
|
32
26
|
logger.debug("Creating new plugin collection #{_namespace} #{_type}")
|
|
33
|
-
|
|
27
|
+
|
|
34
28
|
#---------------------------------------------------------------------------
|
|
35
|
-
|
|
29
|
+
|
|
36
30
|
object_utilities
|
|
37
|
-
|
|
31
|
+
|
|
38
32
|
#---
|
|
39
|
-
|
|
33
|
+
|
|
40
34
|
unless respond_to? :each_plugin
|
|
41
35
|
logger.debug("Defining plugin interface method: each_plugin")
|
|
42
|
-
|
|
36
|
+
|
|
43
37
|
define_method :each_plugin do |plugin_types = nil, providers = nil, &code|
|
|
44
38
|
providers = [ providers ] if providers && ! providers.is_a?(Array)
|
|
45
|
-
|
|
39
|
+
|
|
46
40
|
filter_proc = Proc.new {|type, config| config[:plugin] }
|
|
47
41
|
each_object_type(plugin_types, filter_proc) do |type, plural, options|
|
|
48
42
|
logger.debug("Processing plugin type #{type}/#{plural} with: #{options.inspect}")
|
|
49
|
-
|
|
43
|
+
|
|
50
44
|
send(plural).each do |provider, plugins|
|
|
51
45
|
logger.debug("Processing plugin provider: #{provider}")
|
|
52
|
-
|
|
46
|
+
|
|
53
47
|
unless providers && ! providers.include?(provider)
|
|
54
48
|
if plugins.is_a?(Hash)
|
|
55
49
|
plugins.each do |name, plugin|
|
|
56
50
|
logger.debug("Processing plugin: #{name}")
|
|
57
|
-
code.call(type, provider, name, plugin)
|
|
51
|
+
code.call(type, provider, name, plugin)
|
|
58
52
|
end
|
|
59
53
|
else
|
|
60
54
|
logger.debug("Processing plugin: #{plugin.plugin_name}")
|
|
61
55
|
code.call(type, provider, plugin.plugin_name, plugin)
|
|
62
56
|
end
|
|
63
57
|
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
66
60
|
end
|
|
67
61
|
end
|
|
68
|
-
|
|
62
|
+
|
|
69
63
|
#---
|
|
70
|
-
|
|
64
|
+
|
|
71
65
|
logger.debug("Defining plugin interface method: each_#{_type}")
|
|
72
|
-
|
|
66
|
+
|
|
73
67
|
define_method "each_#{_type}" do |providers = nil, &code|
|
|
74
68
|
each_plugin(_type, providers) do |type, provider, name, plugin|
|
|
75
|
-
code.call(provider, name, plugin)
|
|
69
|
+
code.call(provider, name, plugin)
|
|
76
70
|
end
|
|
77
71
|
end
|
|
78
|
-
|
|
72
|
+
|
|
79
73
|
#---------------------------------------------------------------------------
|
|
80
|
-
|
|
74
|
+
|
|
81
75
|
logger.debug("Defining plugin interface method: #{_plural}")
|
|
82
|
-
|
|
76
|
+
|
|
83
77
|
define_method "#{_plural}" do |provider = nil, reset = false|
|
|
84
78
|
keys = ( provider ? [ _plural, provider ] : _plural )
|
|
85
79
|
send("init_#{_plural}", provider) if reset || _get(keys, {}).empty?
|
|
86
80
|
_get(keys, {})
|
|
87
81
|
end
|
|
88
|
-
|
|
82
|
+
|
|
89
83
|
#---
|
|
90
|
-
|
|
84
|
+
|
|
91
85
|
logger.debug("Defining plugin interface method: init_#{_plural}")
|
|
92
|
-
|
|
86
|
+
|
|
93
87
|
define_method "init_#{_plural}" do |providers = nil|
|
|
94
88
|
data = hash(_search_proc.call) if _search_proc
|
|
95
89
|
data = get_hash(_plural) unless data
|
|
96
|
-
|
|
90
|
+
|
|
97
91
|
providers = [ providers ] if providers && ! providers.is_a?(Array)
|
|
98
92
|
providers.collect! { |elem| elem.to_sym } if providers
|
|
99
|
-
|
|
93
|
+
|
|
100
94
|
logger.debug("Initializing #{_plugin_type} plugin data: #{data.inspect}")
|
|
101
95
|
logger.debug("Providers: #{providers.inspect}")
|
|
102
|
-
|
|
96
|
+
|
|
103
97
|
symbol_map(data).each do |provider, instance_settings|
|
|
104
98
|
if ! providers || providers.include?(provider)
|
|
105
99
|
if _single_instance
|
|
106
100
|
logger.debug("Initializing single instance plugin: #{instance_settings.inspect}")
|
|
107
|
-
|
|
101
|
+
|
|
108
102
|
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(instance_settings).import({ :meta => { :parent => myself }, :new => true }))
|
|
109
|
-
|
|
103
|
+
|
|
110
104
|
_set([ _plural, provider ], plugin)
|
|
111
105
|
else
|
|
112
106
|
instance_settings.each do |name, options|
|
|
113
107
|
if name != :settings
|
|
114
108
|
logger.debug("Initializing plugin #{_plugin_type} #{name}: #{options.inspect}")
|
|
115
|
-
|
|
109
|
+
|
|
116
110
|
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(options).import({ :name => name, :meta => { :parent => myself }, :new => true }))
|
|
117
|
-
|
|
111
|
+
|
|
118
112
|
_set([ _plural, provider, name ], plugin)
|
|
119
113
|
end
|
|
120
114
|
end
|
|
@@ -122,46 +116,46 @@ module PluginInterface
|
|
|
122
116
|
end
|
|
123
117
|
end
|
|
124
118
|
end
|
|
125
|
-
|
|
119
|
+
|
|
126
120
|
#---
|
|
127
|
-
|
|
121
|
+
|
|
128
122
|
logger.debug("Defining plugin interface method: set_#{_plural}")
|
|
129
123
|
|
|
130
124
|
define_method "set_#{_plural}" do |data = {}|
|
|
131
125
|
data = Config.ensure(data).export
|
|
132
|
-
|
|
126
|
+
|
|
133
127
|
send("clear_#{_plural}")
|
|
134
128
|
set(_plural, data)
|
|
135
|
-
|
|
129
|
+
|
|
136
130
|
logger.debug("Setting #{_plural}")
|
|
137
|
-
|
|
131
|
+
|
|
138
132
|
data.each do |provider, instance_settings|
|
|
139
133
|
if _single_instance
|
|
140
134
|
logger.debug("Setting single #{_plugin_type} #{provider}: #{instance_settings.inspect}")
|
|
141
|
-
|
|
142
|
-
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(instance_settings).import({ :meta => { :parent => myself }, :new => true }))
|
|
143
|
-
|
|
144
|
-
_set([ _plural, provider ], plugin)
|
|
135
|
+
|
|
136
|
+
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(instance_settings).import({ :meta => { :parent => myself }, :new => true }))
|
|
137
|
+
|
|
138
|
+
_set([ _plural, provider ], plugin)
|
|
145
139
|
else
|
|
146
140
|
instance_settings.each do |name, options|
|
|
147
141
|
logger.debug("Setting #{_plugin_type} #{provider} #{name}: #{options.inspect}")
|
|
148
|
-
|
|
142
|
+
|
|
149
143
|
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(options).import({ :name => name, :meta => { :parent => myself }, :new => true }))
|
|
150
|
-
|
|
151
|
-
_set([ _plural, provider, name ], plugin)
|
|
144
|
+
|
|
145
|
+
_set([ _plural, provider, name ], plugin)
|
|
152
146
|
end
|
|
153
147
|
end
|
|
154
148
|
end
|
|
155
149
|
end
|
|
156
|
-
|
|
150
|
+
|
|
157
151
|
#---
|
|
158
|
-
|
|
152
|
+
|
|
159
153
|
logger.debug("Defining plugin interface method: clear_#{_plural}")
|
|
160
|
-
|
|
154
|
+
|
|
161
155
|
define_method "clear_#{_plural}" do
|
|
162
156
|
get(_plural).keys.each do |provider|
|
|
163
157
|
logger.debug("Clearing #{_type} #{provider}")
|
|
164
|
-
|
|
158
|
+
|
|
165
159
|
if _single_instance
|
|
166
160
|
send("delete_#{_type}", provider)
|
|
167
161
|
else
|
|
@@ -173,202 +167,202 @@ module PluginInterface
|
|
|
173
167
|
end
|
|
174
168
|
|
|
175
169
|
#---------------------------------------------------------------------------
|
|
176
|
-
|
|
170
|
+
|
|
177
171
|
if _single_instance
|
|
178
172
|
logger.debug("Defining single instance plugin interface method: #{_type}_config")
|
|
179
|
-
|
|
173
|
+
|
|
180
174
|
define_method "#{_type}_config" do |provider = nil|
|
|
181
175
|
keys = [ _plural ]
|
|
182
176
|
keys << provider unless provider.nil?
|
|
183
177
|
Config.new(get(keys, {}))
|
|
184
178
|
end
|
|
185
|
-
|
|
179
|
+
|
|
186
180
|
#---
|
|
187
|
-
|
|
181
|
+
|
|
188
182
|
logger.debug("Defining single instance plugin interface method: #{_type}_setting")
|
|
189
|
-
|
|
183
|
+
|
|
190
184
|
define_method "#{_type}_setting" do |provider, property, default = nil, format = false|
|
|
191
185
|
get([ _plural, provider, property ], default, format)
|
|
192
186
|
end
|
|
193
|
-
|
|
187
|
+
|
|
194
188
|
#---
|
|
195
|
-
|
|
189
|
+
|
|
196
190
|
logger.debug("Defining single instance plugin interface method: #{_type}")
|
|
197
|
-
|
|
191
|
+
|
|
198
192
|
define_method "#{_type}" do |provider, reset = false|
|
|
199
|
-
if reset || _get([ _plural, provider ], nil).nil?
|
|
193
|
+
if reset || _get([ _plural, provider ], nil).nil?
|
|
200
194
|
options = get([ _plural, provider ], nil)
|
|
201
|
-
|
|
195
|
+
|
|
202
196
|
unless options.nil?
|
|
203
197
|
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(options).import({ :meta => { :parent => myself }, :new => true }))
|
|
204
|
-
|
|
198
|
+
|
|
205
199
|
logger.debug("Initializing plugin #{_plugin_type} #{provider}: #{options.inspect}")
|
|
206
|
-
|
|
200
|
+
|
|
207
201
|
_set([ _plural, provider ], plugin)
|
|
208
202
|
end
|
|
209
203
|
end
|
|
210
204
|
_get([ _plural, provider ])
|
|
211
205
|
end
|
|
212
|
-
|
|
206
|
+
|
|
213
207
|
#---
|
|
214
|
-
|
|
208
|
+
|
|
215
209
|
logger.debug("Defining single instance plugin interface method: set_#{_type}")
|
|
216
|
-
|
|
210
|
+
|
|
217
211
|
define_method "set_#{_type}" do |provider, options = {}|
|
|
218
212
|
options = Config.ensure(options).export
|
|
219
|
-
|
|
213
|
+
|
|
220
214
|
set([ _plural, provider ], options)
|
|
221
|
-
|
|
215
|
+
|
|
222
216
|
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(options).import({ :meta => { :parent => myself }, :new => true }))
|
|
223
|
-
|
|
217
|
+
|
|
224
218
|
logger.debug("Setting single #{_plugin_type} #{provider}: #{options.inspect}")
|
|
225
|
-
|
|
219
|
+
|
|
226
220
|
_set([ _plural, provider ], plugin)
|
|
227
221
|
plugin
|
|
228
222
|
end
|
|
229
|
-
|
|
223
|
+
|
|
230
224
|
#---
|
|
231
|
-
|
|
225
|
+
|
|
232
226
|
logger.debug("Defining single instance plugin interface method: set_#{_type}_setting")
|
|
233
227
|
|
|
234
228
|
define_method "set_#{_type}_setting" do |provider, property, value = nil|
|
|
235
229
|
logger.debug("Setting single #{provider} property #{property} to #{value.inspect}")
|
|
236
230
|
set([ _plural, provider, property ], value)
|
|
237
231
|
end
|
|
238
|
-
|
|
232
|
+
|
|
239
233
|
#---
|
|
240
|
-
|
|
234
|
+
|
|
241
235
|
logger.debug("Defining single instance plugin interface method: delete_#{_type}")
|
|
242
236
|
|
|
243
237
|
define_method "delete_#{_type}" do |provider, remove_plugin = true|
|
|
244
238
|
plugin = send(_type, provider)
|
|
245
|
-
|
|
239
|
+
|
|
246
240
|
logger.debug("Deleting single #{_type} #{provider}")
|
|
247
|
-
|
|
241
|
+
|
|
248
242
|
delete([ _plural, provider ])
|
|
249
243
|
_delete([ _plural, provider ])
|
|
250
|
-
|
|
244
|
+
|
|
251
245
|
Nucleon.remove_plugin(plugin) if remove_plugin && ! plugin.nil?
|
|
252
246
|
end
|
|
253
|
-
|
|
247
|
+
|
|
254
248
|
#---
|
|
255
|
-
|
|
249
|
+
|
|
256
250
|
logger.debug("Defining single instance plugin interface method: delete_#{_type}_setting")
|
|
257
|
-
|
|
251
|
+
|
|
258
252
|
define_method "delete_#{_type}_setting" do |provider, property|
|
|
259
253
|
logger.debug("Deleting single #{provider} property: #{property}")
|
|
260
254
|
delete([ _plural, provider, property ])
|
|
261
255
|
end
|
|
262
|
-
|
|
256
|
+
|
|
263
257
|
#---
|
|
264
|
-
|
|
258
|
+
|
|
265
259
|
logger.debug("Defining single instance plugin interface method: search_#{_type}")
|
|
266
|
-
|
|
260
|
+
|
|
267
261
|
define_method "search_#{_type}" do |provider, keys, default = '', format = false, extra_groups = []|
|
|
268
262
|
plugin_config = send("#{_type}_config", provider)
|
|
269
263
|
logger.debug("Searching single #{_type} #{provider}: #{plugin_config.inspect}")
|
|
270
|
-
|
|
271
|
-
search_object(plugin_config, keys, default, format, extra_groups)
|
|
264
|
+
|
|
265
|
+
search_object(plugin_config, keys, default, format, extra_groups)
|
|
272
266
|
end
|
|
273
|
-
|
|
267
|
+
|
|
274
268
|
#---------------------------------------------------------------------------
|
|
275
269
|
else
|
|
276
270
|
logger.debug("Defining multi instance plugin interface method: #{_type}_config")
|
|
277
|
-
|
|
271
|
+
|
|
278
272
|
define_method "#{_type}_config" do |provider = nil, name = nil|
|
|
279
273
|
keys = [ _plural ]
|
|
280
274
|
keys << provider unless provider.nil?
|
|
281
275
|
keys << name unless name.nil?
|
|
282
276
|
Config.new(get(keys, {}))
|
|
283
277
|
end
|
|
284
|
-
|
|
278
|
+
|
|
285
279
|
#---
|
|
286
|
-
|
|
280
|
+
|
|
287
281
|
logger.debug("Defining multi instance plugin interface method: #{_type}_setting")
|
|
288
|
-
|
|
282
|
+
|
|
289
283
|
define_method "#{_type}_setting" do |provider, name, property, default = nil, format = false|
|
|
290
284
|
get([ _plural, provider, name, property ], default, format)
|
|
291
285
|
end
|
|
292
|
-
|
|
286
|
+
|
|
293
287
|
#---
|
|
294
|
-
|
|
288
|
+
|
|
295
289
|
logger.debug("Defining multi instance plugin interface method: #{_type}")
|
|
296
|
-
|
|
290
|
+
|
|
297
291
|
define_method "#{_type}" do |provider, name, reset = false|
|
|
298
|
-
if reset || _get([ _plural, provider, name ], nil).nil?
|
|
292
|
+
if reset || _get([ _plural, provider, name ], nil).nil?
|
|
299
293
|
options = get([ _plural, provider, name ], nil)
|
|
300
|
-
|
|
294
|
+
|
|
301
295
|
unless options.nil?
|
|
302
296
|
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(options).import({ :name => name, :meta => { :parent => myself }, :new => true }))
|
|
303
|
-
|
|
297
|
+
|
|
304
298
|
logger.debug("Initializing plugin #{_plugin_type} #{provider}: #{options.inspect}")
|
|
305
|
-
|
|
299
|
+
|
|
306
300
|
_set([ _plural, provider, name ], plugin)
|
|
307
301
|
end
|
|
308
302
|
end
|
|
309
303
|
_get([ _plural, provider, name ])
|
|
310
304
|
end
|
|
311
|
-
|
|
305
|
+
|
|
312
306
|
#---
|
|
313
|
-
|
|
307
|
+
|
|
314
308
|
logger.debug("Defining multi instance plugin interface method: set_#{_type}")
|
|
315
|
-
|
|
309
|
+
|
|
316
310
|
define_method "set_#{_type}" do |provider, name, options = {}|
|
|
317
311
|
options = Config.ensure(options).export
|
|
318
|
-
|
|
312
|
+
|
|
319
313
|
set([ _plural, provider, name ], options)
|
|
320
314
|
plugin = Nucleon.plugin(_namespace, _plugin_type, provider, Config.ensure(options).import({ :name => name, :meta => { :parent => myself }, :new => true }))
|
|
321
|
-
|
|
315
|
+
|
|
322
316
|
logger.debug("Setting #{_plugin_type} #{provider} #{name}: #{options.inspect}")
|
|
323
|
-
|
|
317
|
+
|
|
324
318
|
_set([ _plural, provider, name ], plugin)
|
|
325
319
|
plugin
|
|
326
320
|
end
|
|
327
|
-
|
|
321
|
+
|
|
328
322
|
#---
|
|
329
|
-
|
|
323
|
+
|
|
330
324
|
logger.debug("Defining multi instance plugin interface method: set_#{_type}_setting")
|
|
331
325
|
|
|
332
326
|
define_method "set_#{_type}_setting" do |provider, name, property, value = nil|
|
|
333
327
|
logger.debug("Setting #{provider} #{name} property #{property} to #{value.inspect}")
|
|
334
328
|
set([ _plural, provider, name, property ], value)
|
|
335
329
|
end
|
|
336
|
-
|
|
330
|
+
|
|
337
331
|
#---
|
|
338
|
-
|
|
332
|
+
|
|
339
333
|
logger.debug("Defining multi instance plugin interface method: delete_#{_type}")
|
|
340
334
|
|
|
341
335
|
define_method "delete_#{_type}" do |provider, name, remove_plugin = true|
|
|
342
336
|
plugin = send(_type, provider, name)
|
|
343
|
-
|
|
337
|
+
|
|
344
338
|
logger.debug("Deleting #{_type} #{provider} #{name}")
|
|
345
|
-
|
|
339
|
+
|
|
346
340
|
delete([ _plural, provider, name ])
|
|
347
341
|
_delete([ _plural, provider, name ])
|
|
348
|
-
|
|
342
|
+
|
|
349
343
|
Nucleon.remove_plugin(plugin) if remove_plugin && ! plugin.nil?
|
|
350
344
|
end
|
|
351
|
-
|
|
345
|
+
|
|
352
346
|
#---
|
|
353
|
-
|
|
347
|
+
|
|
354
348
|
logger.debug("Defining multi instance plugin interface method: delete_#{_type}_setting")
|
|
355
|
-
|
|
349
|
+
|
|
356
350
|
define_method "delete_#{_type}_setting" do |provider, name, property|
|
|
357
351
|
logger.debug("Deleting #{provider} #{name} property: #{property}")
|
|
358
352
|
delete([ _plural, provider, name, property ])
|
|
359
353
|
end
|
|
360
|
-
|
|
354
|
+
|
|
361
355
|
#---
|
|
362
|
-
|
|
356
|
+
|
|
363
357
|
logger.debug("Defining multi instance plugin interface method: search_#{_type}")
|
|
364
|
-
|
|
358
|
+
|
|
365
359
|
define_method "search_#{_type}" do |provider, name, keys, default = '', format = false, extra_groups = []|
|
|
366
360
|
plugin_config = send("#{_type}_config", provider, name)
|
|
367
361
|
logger.debug("Searching #{_type} #{provider} #{name}: #{plugin_config.inspect}")
|
|
368
|
-
|
|
369
|
-
search_object(plugin_config, keys, default, format, extra_groups)
|
|
362
|
+
|
|
363
|
+
search_object(plugin_config, keys, default, format, extra_groups)
|
|
370
364
|
end
|
|
371
|
-
end
|
|
365
|
+
end
|
|
372
366
|
end
|
|
373
367
|
end
|
|
374
368
|
end
|