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
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
|
|
2
|
+
#
|
|
3
|
+
# Require test plugin type
|
|
4
|
+
#
|
|
5
|
+
require File.join(File.dirname(__FILE__), 'nucleon', 'test.rb')
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
RSpec.shared_context "nucleon_plugin" do
|
|
9
|
+
|
|
10
|
+
include_context "nucleon_test"
|
|
11
|
+
|
|
12
|
+
#*****************************************************************************
|
|
13
|
+
# Plugin environment data
|
|
14
|
+
|
|
15
|
+
let(:plugin_environment_empty) do {
|
|
16
|
+
:plugin_types => {},
|
|
17
|
+
:load_info => {},
|
|
18
|
+
:active_info => {}
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
let(:plugin_registry) do {
|
|
24
|
+
:nucleon => {
|
|
25
|
+
:extension => nil,
|
|
26
|
+
:action => :project_update,
|
|
27
|
+
:project => :git,
|
|
28
|
+
:command => :bash,
|
|
29
|
+
:event => :regex,
|
|
30
|
+
:template => :json,
|
|
31
|
+
:translator => :json
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
let(:plugin_base_path) do
|
|
37
|
+
File.expand_path('..', File.dirname(__FILE__))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
let(:plugin_loaded_plugins) do
|
|
41
|
+
plugin_directory = File.join(plugin_base_path, 'lib', 'nucleon')
|
|
42
|
+
project_directory = File.join(plugin_directory, 'project')
|
|
43
|
+
event_directory = File.join(plugin_directory, 'event')
|
|
44
|
+
extension_directory = File.join(plugin_directory, 'extension')
|
|
45
|
+
command_directory = File.join(plugin_directory, 'command')
|
|
46
|
+
translator_directory = File.join(plugin_directory, 'translator')
|
|
47
|
+
action_directory = File.join(plugin_directory, 'action')
|
|
48
|
+
action_project_directory = File.join(action_directory, 'project')
|
|
49
|
+
template_directory = File.join(plugin_directory, 'template')
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
:nucleon => {
|
|
53
|
+
:project => {
|
|
54
|
+
:github => {
|
|
55
|
+
:namespace => :nucleon,
|
|
56
|
+
:type => :project,
|
|
57
|
+
:base_path => project_directory,
|
|
58
|
+
:file => File.join(project_directory, 'github.rb'),
|
|
59
|
+
:provider => :github,
|
|
60
|
+
:directory => project_directory,
|
|
61
|
+
:class_components => [ "Nucleon", "Project", "Github" ]
|
|
62
|
+
},
|
|
63
|
+
:git => {
|
|
64
|
+
:namespace => :nucleon,
|
|
65
|
+
:type => :project,
|
|
66
|
+
:base_path => project_directory,
|
|
67
|
+
:file => File.join(project_directory, 'git.rb'),
|
|
68
|
+
:provider => :git,
|
|
69
|
+
:directory => project_directory,
|
|
70
|
+
:class_components => [ "Nucleon", "Project", "Git" ]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
:event => {
|
|
74
|
+
:regex => {
|
|
75
|
+
:namespace => :nucleon,
|
|
76
|
+
:type => :event,
|
|
77
|
+
:base_path => event_directory,
|
|
78
|
+
:file => File.join(event_directory, 'regex.rb'),
|
|
79
|
+
:provider => :regex,
|
|
80
|
+
:directory => event_directory,
|
|
81
|
+
:class_components => ["Nucleon", "Event", "Regex"]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
:extension => {
|
|
85
|
+
:project => {
|
|
86
|
+
:namespace => :nucleon,
|
|
87
|
+
:type => :extension,
|
|
88
|
+
:base_path => extension_directory,
|
|
89
|
+
:file => File.join(extension_directory, 'project.rb'),
|
|
90
|
+
:provider => :project,
|
|
91
|
+
:directory => extension_directory,
|
|
92
|
+
:class_components => ["Nucleon", "Extension", "Project"]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
:command => {
|
|
96
|
+
:bash => {
|
|
97
|
+
:namespace => :nucleon,
|
|
98
|
+
:type => :command,
|
|
99
|
+
:base_path => command_directory,
|
|
100
|
+
:file => File.join(command_directory, 'bash.rb'),
|
|
101
|
+
:provider => :bash,
|
|
102
|
+
:directory => command_directory,
|
|
103
|
+
:class_components => ["Nucleon", "Command", "Bash"]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
:translator => {
|
|
107
|
+
:json => {
|
|
108
|
+
:namespace => :nucleon,
|
|
109
|
+
:type => :translator,
|
|
110
|
+
:base_path => translator_directory,
|
|
111
|
+
:file => File.join(translator_directory, 'JSON.rb'),
|
|
112
|
+
:provider => :json,
|
|
113
|
+
:directory => translator_directory,
|
|
114
|
+
:class_components => [ "Nucleon", "Translator", "JSON" ]
|
|
115
|
+
},
|
|
116
|
+
:yaml => {
|
|
117
|
+
:namespace => :nucleon,
|
|
118
|
+
:type => :translator,
|
|
119
|
+
:base_path => translator_directory,
|
|
120
|
+
:file => File.join(translator_directory, 'YAML.rb'),
|
|
121
|
+
:provider => :yaml,
|
|
122
|
+
:directory => translator_directory,
|
|
123
|
+
:class_components => [ "Nucleon", "Translator", "YAML" ]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
:action => {
|
|
127
|
+
:project_update => {
|
|
128
|
+
:namespace => :nucleon,
|
|
129
|
+
:type => :action,
|
|
130
|
+
:base_path => action_directory,
|
|
131
|
+
:file => File.join(action_project_directory, 'update.rb'),
|
|
132
|
+
:provider => :project_update,
|
|
133
|
+
:directory => action_project_directory,
|
|
134
|
+
:class_components => [ "Nucleon", "Action", "Project", "Update" ],
|
|
135
|
+
:description => {
|
|
136
|
+
:namespace => :nucleon,
|
|
137
|
+
:weight => 900,
|
|
138
|
+
:group => :project,
|
|
139
|
+
:action => :update,
|
|
140
|
+
:description => "Update this project from a remote",
|
|
141
|
+
:help => "translation missing: en.nucleon.action.project.update.help"
|
|
142
|
+
},
|
|
143
|
+
:_weight => 900
|
|
144
|
+
},
|
|
145
|
+
:project_create => {
|
|
146
|
+
:namespace => :nucleon,
|
|
147
|
+
:type => :action,
|
|
148
|
+
:base_path => action_directory,
|
|
149
|
+
:file => File.join(action_project_directory, 'create.rb'),
|
|
150
|
+
:provider => :project_create,
|
|
151
|
+
:directory => action_project_directory,
|
|
152
|
+
:class_components => [ "Nucleon", "Action", "Project", "Create" ],
|
|
153
|
+
:description => {
|
|
154
|
+
:namespace => :nucleon,
|
|
155
|
+
:weight => 1000,
|
|
156
|
+
:group => :project,
|
|
157
|
+
:action => :create,
|
|
158
|
+
:description => "Create a new project",
|
|
159
|
+
:help => "translation missing: en.nucleon.action.project.create.help"
|
|
160
|
+
},
|
|
161
|
+
:_weight => 1000
|
|
162
|
+
},
|
|
163
|
+
:project_save => {
|
|
164
|
+
:namespace => :nucleon,
|
|
165
|
+
:type => :action,
|
|
166
|
+
:base_path => action_directory,
|
|
167
|
+
:file => File.join(action_project_directory, 'save.rb'),
|
|
168
|
+
:provider => :project_save,
|
|
169
|
+
:directory => action_project_directory,
|
|
170
|
+
:class_components => [ "Nucleon", "Action", "Project", "Save" ],
|
|
171
|
+
:description => {
|
|
172
|
+
:namespace => :nucleon,
|
|
173
|
+
:weight => 800,
|
|
174
|
+
:group => :project,
|
|
175
|
+
:action => :save,
|
|
176
|
+
:description => "Save changes to files in this project",
|
|
177
|
+
:help => "translation missing: en.nucleon.action.project.save.help"
|
|
178
|
+
},
|
|
179
|
+
:_weight => 800
|
|
180
|
+
},
|
|
181
|
+
:project_remove => {
|
|
182
|
+
:namespace => :nucleon,
|
|
183
|
+
:type => :action,
|
|
184
|
+
:base_path => action_directory,
|
|
185
|
+
:file => File.join(action_project_directory, 'remove.rb'),
|
|
186
|
+
:provider => :project_remove,
|
|
187
|
+
:directory => action_project_directory,
|
|
188
|
+
:class_components => [ "Nucleon", "Action", "Project", "Remove" ],
|
|
189
|
+
:description => {
|
|
190
|
+
:namespace => :nucleon,
|
|
191
|
+
:weight => 600,
|
|
192
|
+
:group => :project,
|
|
193
|
+
:action => :remove,
|
|
194
|
+
:description => "Remove an existing sub-project from this project",
|
|
195
|
+
:help => "translation missing: en.nucleon.action.project.remove.help"
|
|
196
|
+
},
|
|
197
|
+
:_weight => 600
|
|
198
|
+
},
|
|
199
|
+
:project_add => {
|
|
200
|
+
:namespace => :nucleon,
|
|
201
|
+
:type => :action,
|
|
202
|
+
:base_path => action_directory,
|
|
203
|
+
:file => File.join(action_project_directory, 'add.rb'),
|
|
204
|
+
:provider => :project_add,
|
|
205
|
+
:directory => action_project_directory,
|
|
206
|
+
:class_components => [ "Nucleon", "Action", "Project", "Add" ],
|
|
207
|
+
:description => {
|
|
208
|
+
:namespace => :nucleon,
|
|
209
|
+
:weight => 700,
|
|
210
|
+
:group => :project,
|
|
211
|
+
:action => :add,
|
|
212
|
+
:description => "Add a new sub-project to this project",
|
|
213
|
+
:help => "translation missing: en.nucleon.action.project.add.help"
|
|
214
|
+
},
|
|
215
|
+
:_weight => 700
|
|
216
|
+
},
|
|
217
|
+
:extract => {
|
|
218
|
+
:namespace => :nucleon,
|
|
219
|
+
:type => :action,
|
|
220
|
+
:base_path => action_directory,
|
|
221
|
+
:file => File.join(action_directory, 'extract.rb'),
|
|
222
|
+
:provider => :extract,
|
|
223
|
+
:directory => action_directory,
|
|
224
|
+
:class_components => [ "Nucleon", "Action", "Extract" ],
|
|
225
|
+
:description => {
|
|
226
|
+
:namespace => :nucleon,
|
|
227
|
+
:weight => -50,
|
|
228
|
+
:group => nil,
|
|
229
|
+
:action => :extract,
|
|
230
|
+
:description => "Extract an encoded package into a directory",
|
|
231
|
+
:help => "translation missing: en.nucleon.action.extract.help"
|
|
232
|
+
},
|
|
233
|
+
:_weight => -50
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
:template => {
|
|
237
|
+
:json => {
|
|
238
|
+
:namespace => :nucleon,
|
|
239
|
+
:type => :template,
|
|
240
|
+
:base_path => template_directory,
|
|
241
|
+
:file => File.join(template_directory, 'JSON.rb'),
|
|
242
|
+
:provider => :json,
|
|
243
|
+
:directory => template_directory,
|
|
244
|
+
:class_components => [ "Nucleon", "Template", "JSON" ]
|
|
245
|
+
},
|
|
246
|
+
:yaml => {
|
|
247
|
+
:namespace => :nucleon,
|
|
248
|
+
:type => :template,
|
|
249
|
+
:base_path => template_directory,
|
|
250
|
+
:file => File.join(template_directory, 'YAML.rb'),
|
|
251
|
+
:provider => :yaml,
|
|
252
|
+
:directory => template_directory,
|
|
253
|
+
:class_components => [ "Nucleon", "Template", "YAML" ]
|
|
254
|
+
},
|
|
255
|
+
:wrapper => {
|
|
256
|
+
:namespace => :nucleon,
|
|
257
|
+
:type => :template,
|
|
258
|
+
:base_path => template_directory,
|
|
259
|
+
:file => File.join(template_directory, 'wrapper.rb'),
|
|
260
|
+
:provider => :wrapper,
|
|
261
|
+
:directory => template_directory,
|
|
262
|
+
:class_components => [ "Nucleon", "Template", "Wrapper" ]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
def plugin_define_plugins(environment, plugin_type, provider_map, &code)
|
|
270
|
+
plugin_type = plugin_type.to_sym
|
|
271
|
+
plugin_path = File.join(plugin_base_path, 'lib', 'nucleon', plugin_type.to_s)
|
|
272
|
+
|
|
273
|
+
provider_map.each do |provider, file_name|
|
|
274
|
+
provider = provider.to_sym
|
|
275
|
+
|
|
276
|
+
if file_name.is_a?(Array)
|
|
277
|
+
file_name = File.join(*file_name)
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
environment.define_plugin(:nucleon, plugin_type, plugin_path, File.join(plugin_path, "#{file_name}.rb"))
|
|
281
|
+
code.call(plugin_type, provider) if code
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
let(:plugin_autoload_plugins) do
|
|
287
|
+
loaded_plugins = Nucleon::Util::Data.clone(plugin_loaded_plugins)
|
|
288
|
+
|
|
289
|
+
# Simulate autoloading of defined plugins
|
|
290
|
+
|
|
291
|
+
require loaded_plugins[:nucleon][:project][:github][:file]
|
|
292
|
+
loaded_plugins[:nucleon][:project][:github][:class] = Nucleon::Project::Github
|
|
293
|
+
|
|
294
|
+
require loaded_plugins[:nucleon][:project][:git][:file]
|
|
295
|
+
loaded_plugins[:nucleon][:project][:git][:class] = Nucleon::Project::Git
|
|
296
|
+
|
|
297
|
+
require loaded_plugins[:nucleon][:event][:regex][:file]
|
|
298
|
+
loaded_plugins[:nucleon][:event][:regex][:class] = Nucleon::Event::Regex
|
|
299
|
+
|
|
300
|
+
require loaded_plugins[:nucleon][:extension][:project][:file]
|
|
301
|
+
loaded_plugins[:nucleon][:extension][:project][:class] = Nucleon::Extension::Project
|
|
302
|
+
|
|
303
|
+
require loaded_plugins[:nucleon][:command][:bash][:file]
|
|
304
|
+
loaded_plugins[:nucleon][:command][:bash][:class] = Nucleon::Command::Bash
|
|
305
|
+
|
|
306
|
+
require loaded_plugins[:nucleon][:translator][:json][:file]
|
|
307
|
+
loaded_plugins[:nucleon][:translator][:json][:class] = Nucleon::Translator::JSON
|
|
308
|
+
|
|
309
|
+
require loaded_plugins[:nucleon][:translator][:yaml][:file]
|
|
310
|
+
loaded_plugins[:nucleon][:translator][:yaml][:class] = Nucleon::Translator::YAML
|
|
311
|
+
|
|
312
|
+
require loaded_plugins[:nucleon][:action][:project_update][:file]
|
|
313
|
+
loaded_plugins[:nucleon][:action][:project_update][:class] = Nucleon::Action::Project::Update
|
|
314
|
+
|
|
315
|
+
require loaded_plugins[:nucleon][:action][:project_create][:file]
|
|
316
|
+
loaded_plugins[:nucleon][:action][:project_create][:class] = Nucleon::Action::Project::Create
|
|
317
|
+
|
|
318
|
+
require loaded_plugins[:nucleon][:action][:project_save][:file]
|
|
319
|
+
loaded_plugins[:nucleon][:action][:project_save][:class] = Nucleon::Action::Project::Save
|
|
320
|
+
|
|
321
|
+
require loaded_plugins[:nucleon][:action][:project_remove][:file]
|
|
322
|
+
loaded_plugins[:nucleon][:action][:project_remove][:class] = Nucleon::Action::Project::Remove
|
|
323
|
+
|
|
324
|
+
require loaded_plugins[:nucleon][:action][:project_add][:file]
|
|
325
|
+
loaded_plugins[:nucleon][:action][:project_add][:class] = Nucleon::Action::Project::Add
|
|
326
|
+
|
|
327
|
+
require loaded_plugins[:nucleon][:action][:extract][:file]
|
|
328
|
+
loaded_plugins[:nucleon][:action][:extract][:class] = Nucleon::Action::Extract
|
|
329
|
+
|
|
330
|
+
require loaded_plugins[:nucleon][:template][:json][:file]
|
|
331
|
+
loaded_plugins[:nucleon][:template][:json][:class] = Nucleon::Template::JSON
|
|
332
|
+
|
|
333
|
+
require loaded_plugins[:nucleon][:template][:yaml][:file]
|
|
334
|
+
loaded_plugins[:nucleon][:template][:yaml][:class] = Nucleon::Template::YAML
|
|
335
|
+
|
|
336
|
+
require loaded_plugins[:nucleon][:template][:wrapper][:file]
|
|
337
|
+
loaded_plugins[:nucleon][:template][:wrapper][:class] = Nucleon::Template::Wrapper
|
|
338
|
+
|
|
339
|
+
loaded_plugins
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
let(:plugin_test_environment) do
|
|
344
|
+
plugin_directory = File.join(plugin_base_path, 'spec', 'nucleon')
|
|
345
|
+
test_directory = File.join(plugin_directory, 'test')
|
|
346
|
+
|
|
347
|
+
{
|
|
348
|
+
:plugin_types => {
|
|
349
|
+
:nucleon => { :test => :first }
|
|
350
|
+
},
|
|
351
|
+
:load_info => {
|
|
352
|
+
:nucleon => {
|
|
353
|
+
:test => {
|
|
354
|
+
:first => {
|
|
355
|
+
:namespace => :nucleon,
|
|
356
|
+
:type => :test,
|
|
357
|
+
:base_path => test_directory,
|
|
358
|
+
:file => File.join(test_directory, 'first.rb'),
|
|
359
|
+
:provider => :first,
|
|
360
|
+
:directory => test_directory,
|
|
361
|
+
:class_components => [ "Nucleon", "Test", "First" ]
|
|
362
|
+
},
|
|
363
|
+
:second => {
|
|
364
|
+
:namespace => :nucleon,
|
|
365
|
+
:type => :test,
|
|
366
|
+
:base_path => test_directory,
|
|
367
|
+
:file => File.join(test_directory, 'second.rb'),
|
|
368
|
+
:provider => :second,
|
|
369
|
+
:directory => test_directory,
|
|
370
|
+
:class_components => [ "Nucleon", "Test", "Second" ]
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
:active_info => {}
|
|
376
|
+
}
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
let(:plugin_environment_test1) do {
|
|
380
|
+
:plugin_types => {
|
|
381
|
+
:nucleon => {
|
|
382
|
+
:test => :first
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
:load_info => {},
|
|
386
|
+
:active_info => {}
|
|
387
|
+
}
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
let(:plugin_environment_test2) do {
|
|
391
|
+
:plugin_types => {
|
|
392
|
+
:nucleon => {
|
|
393
|
+
:test1 => "test2",
|
|
394
|
+
:test3 => "test4"
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
:load_info => {},
|
|
398
|
+
:active_info => {}
|
|
399
|
+
}
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
def plugin_define_test_environment(environment)
|
|
404
|
+
plugin_path = File.join(plugin_base_path, 'spec', 'nucleon', 'test')
|
|
405
|
+
|
|
406
|
+
environment.define_plugin_type(:nucleon, :test, :first)
|
|
407
|
+
environment.define_plugin(:nucleon, :test, plugin_path, File.join(plugin_path, "first.rb"))
|
|
408
|
+
environment.define_plugin(:nucleon, :test, plugin_path, File.join(plugin_path, "second.rb"))
|
|
409
|
+
|
|
410
|
+
test_config environment, plugin_test_environment
|
|
411
|
+
environment
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
let(:plugin_test_autoload_environment) do
|
|
416
|
+
test_plugins = Nucleon::Util::Data.clone(plugin_test_environment)
|
|
417
|
+
|
|
418
|
+
require test_plugins[:load_info][:nucleon][:test][:first][:file]
|
|
419
|
+
test_plugins[:load_info][:nucleon][:test][:first][:class] = Nucleon::Test::First
|
|
420
|
+
|
|
421
|
+
require test_plugins[:load_info][:nucleon][:test][:second][:file]
|
|
422
|
+
test_plugins[:load_info][:nucleon][:test][:second][:class] = Nucleon::Test::Second
|
|
423
|
+
|
|
424
|
+
test_plugins
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
def plugin_autoload_test_environment(environment)
|
|
428
|
+
plugin_define_test_environment(environment)
|
|
429
|
+
environment.autoload
|
|
430
|
+
|
|
431
|
+
test_config environment, plugin_test_autoload_environment
|
|
432
|
+
environment
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
let(:plugin_active_plugins) do
|
|
437
|
+
|
|
438
|
+
end
|
|
439
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
RSpec.shared_context "nucleon_test" do
|
|
3
|
+
|
|
4
|
+
#*****************************************************************************
|
|
5
|
+
# Reusable Nucleon tests
|
|
6
|
+
|
|
7
|
+
def test_type(this, klass)
|
|
8
|
+
expect(this).to be_kind_of(klass)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_eq(this, that)
|
|
13
|
+
expect(this).to eq(that)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def test_config(config, state)
|
|
17
|
+
test_eq(config.export, state)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def test_output(message, printer = :puts)
|
|
22
|
+
handle = double('output')
|
|
23
|
+
expect(handle).to receive(printer).with(message)
|
|
24
|
+
yield(handle) if block_given?
|
|
25
|
+
handle
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_object(klass, *args)
|
|
30
|
+
object = klass.new(*args)
|
|
31
|
+
yield(object) if block_given?
|
|
32
|
+
object
|
|
33
|
+
end
|
|
34
|
+
end
|