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,59 @@
|
|
|
1
|
+
module Nucleon
|
|
2
|
+
module Plugin
|
|
3
|
+
class Test < Nucleon.plugin_class(:nucleon, :base)
|
|
4
|
+
|
|
5
|
+
#*****************************************************************************
|
|
6
|
+
# Initialization
|
|
7
|
+
|
|
8
|
+
def normalize(reset)
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
#*****************************************************************************
|
|
13
|
+
# Plugin accessors / modifiers
|
|
14
|
+
|
|
15
|
+
def test1
|
|
16
|
+
get(:test1, 1)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def test1=test
|
|
20
|
+
set(:test1, test)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test2
|
|
25
|
+
get(:test2, 2)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def test2=test
|
|
29
|
+
set(:test2, test)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#*****************************************************************************
|
|
34
|
+
# Plugin test interface
|
|
35
|
+
|
|
36
|
+
def say_hello(to_who)
|
|
37
|
+
logger.info('executing say_hello')
|
|
38
|
+
yield if block_given?
|
|
39
|
+
logger.info('goodbye')
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def math(a, b)
|
|
43
|
+
result = 0
|
|
44
|
+
logger.info('executing math')
|
|
45
|
+
result = yield if block_given?
|
|
46
|
+
logger.info('goodbye')
|
|
47
|
+
result
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def exec_block(a, b, &code)
|
|
51
|
+
result = nil
|
|
52
|
+
logger.info('executing exec_block')
|
|
53
|
+
result = yield if block_given?
|
|
54
|
+
logger.info('goodbye')
|
|
55
|
+
result
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Nucleon
|
|
2
|
+
module Test
|
|
3
|
+
class First < Nucleon.plugin_class(:nucleon, :test)
|
|
4
|
+
|
|
5
|
+
#*****************************************************************************
|
|
6
|
+
# Plugin test interface
|
|
7
|
+
|
|
8
|
+
def say_hello(to_who)
|
|
9
|
+
super do
|
|
10
|
+
info("Hello there #{to_who}", { :i18n => false })
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def math(a, b)
|
|
15
|
+
super do
|
|
16
|
+
a * b * test1 * test2
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def exec_block(a, b, &code)
|
|
21
|
+
super do
|
|
22
|
+
z = -1
|
|
23
|
+
z = code.call(test1, test2, a, b, z) if code
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Nucleon
|
|
2
|
+
module Test
|
|
3
|
+
class Second < Nucleon.plugin_class(:nucleon, :test)
|
|
4
|
+
|
|
5
|
+
#*****************************************************************************
|
|
6
|
+
# Plugin test interface
|
|
7
|
+
|
|
8
|
+
def say_hello(to_who)
|
|
9
|
+
super do
|
|
10
|
+
info("Greetings #{to_who}", { :i18n => false })
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def math(a, b)
|
|
15
|
+
super do
|
|
16
|
+
a + b + test1 + test2
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def exec_block(a, b, &code)
|
|
21
|
+
super do
|
|
22
|
+
z = -20
|
|
23
|
+
z = code.call(test1, test2, a, b, z) if code
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
|
|
2
|
+
RSpec.shared_context "nucleon_codes" do
|
|
3
|
+
|
|
4
|
+
#*****************************************************************************
|
|
5
|
+
# Code initialization
|
|
6
|
+
|
|
7
|
+
let(:codes_registry_clean) do {
|
|
8
|
+
:success => 0,
|
|
9
|
+
:help_wanted => 1,
|
|
10
|
+
:unknown_status => 2,
|
|
11
|
+
:action_unprocessed => 3,
|
|
12
|
+
:batch_error => 4,
|
|
13
|
+
:validation_failed => 5,
|
|
14
|
+
:access_denied => 6
|
|
15
|
+
}
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
let(:codes_status_index_clean) do {
|
|
19
|
+
0 => "success",
|
|
20
|
+
1 => "help_wanted",
|
|
21
|
+
2 => "unknown_status",
|
|
22
|
+
3 => "action_unprocessed",
|
|
23
|
+
4 => "batch_error",
|
|
24
|
+
5 => "validation_failed",
|
|
25
|
+
6 => "access_denied"
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
let(:codes_registry_custom) do {
|
|
31
|
+
:success => 0,
|
|
32
|
+
:help_wanted => 1,
|
|
33
|
+
:unknown_status => 2,
|
|
34
|
+
:action_unprocessed => 3,
|
|
35
|
+
:batch_error => 4,
|
|
36
|
+
:validation_failed => 5,
|
|
37
|
+
:access_denied => 6,
|
|
38
|
+
:good => 7,
|
|
39
|
+
:bad => 8,
|
|
40
|
+
:ok => 9,
|
|
41
|
+
:wow => 10,
|
|
42
|
+
:whew => 11
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
let(:codes_status_index_custom) do {
|
|
47
|
+
0 => "success",
|
|
48
|
+
1 => "help_wanted",
|
|
49
|
+
2 => "unknown_status",
|
|
50
|
+
3 => "action_unprocessed",
|
|
51
|
+
4 => "batch_error",
|
|
52
|
+
5 => "validation_failed",
|
|
53
|
+
6 => "access_denied",
|
|
54
|
+
7 => "good",
|
|
55
|
+
8 => "bad",
|
|
56
|
+
9 => "ok",
|
|
57
|
+
10 => "wow",
|
|
58
|
+
11 => "whew"
|
|
59
|
+
}
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
before(:each) do
|
|
64
|
+
# Set custom codes before every test
|
|
65
|
+
Nucleon::Codes.reset # 0 - 6 reserved
|
|
66
|
+
Nucleon::Codes.codes(:good, :bad, :ok, :wow, :whew) # 7 - ?
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
#*****************************************************************************
|
|
71
|
+
# Code test utilities
|
|
72
|
+
|
|
73
|
+
def codes_rendered_status(status_code = nil)
|
|
74
|
+
# Basically copied from the Codes class to ensure parity over time.
|
|
75
|
+
if ! status_code.nil? && codes_status_index_custom.has_key?(status_code)
|
|
76
|
+
status_name = codes_status_index_custom[status_code]
|
|
77
|
+
else
|
|
78
|
+
status_name = codes_status_index_custom[codes_registry_custom[:unknown_status]]
|
|
79
|
+
end
|
|
80
|
+
sprintf(" [ %3i ] - %s\n", status_code, status_name.gsub(/_/, ' ').capitalize)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def codes_rendered_index(status_code = nil)
|
|
84
|
+
# Basically copied from the Codes class to ensure parity over time.
|
|
85
|
+
output = "Status index:\n"
|
|
86
|
+
codes_status_index_custom.each do |code, name|
|
|
87
|
+
name = name.gsub(/_/, ' ').capitalize
|
|
88
|
+
|
|
89
|
+
if ! status_code.nil? && status_code == code
|
|
90
|
+
output << sprintf(" [ %3i ] - %s\n", code, name)
|
|
91
|
+
else
|
|
92
|
+
output << sprintf(" %3i - %s\n", code, name)
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
output << "\n"
|
|
96
|
+
output
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
|
|
2
|
+
RSpec.shared_context "nucleon_config" do
|
|
3
|
+
|
|
4
|
+
#*****************************************************************************
|
|
5
|
+
# Context test data
|
|
6
|
+
|
|
7
|
+
let(:config_context_data) do {
|
|
8
|
+
:context1 => {
|
|
9
|
+
:greeting => "hello",
|
|
10
|
+
:nestedkey => {
|
|
11
|
+
:a => {
|
|
12
|
+
:test1 => 'yes',
|
|
13
|
+
:test2 => [ 'please' ]
|
|
14
|
+
},
|
|
15
|
+
:x => 'goodbye'
|
|
16
|
+
},
|
|
17
|
+
:other => "Something else",
|
|
18
|
+
:array => [ 128 ]
|
|
19
|
+
},
|
|
20
|
+
:context2 => {
|
|
21
|
+
:greeting => "hello world",
|
|
22
|
+
:something => "test",
|
|
23
|
+
:nestedkey => {
|
|
24
|
+
:a => {
|
|
25
|
+
:test1 => [ 23, 55 ]
|
|
26
|
+
},
|
|
27
|
+
:b => 'oddball'
|
|
28
|
+
},
|
|
29
|
+
:array => [ 128, 1024 ]
|
|
30
|
+
},
|
|
31
|
+
:prefix1_context1 => {
|
|
32
|
+
:greeting => "how are you",
|
|
33
|
+
:something => "test5"
|
|
34
|
+
},
|
|
35
|
+
:prefix2_context3 => {
|
|
36
|
+
:thought => "hope this test passes"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
let(:config_context_default_data) do {
|
|
42
|
+
:greeting => 'howdy',
|
|
43
|
+
:array => [ 4545, :hello ],
|
|
44
|
+
:extra => 'this should not be set'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
let(:config_contexts1) { [ :context1, "context3" ] }
|
|
49
|
+
let(:config_context_hierarchy1) { :prefix2 }
|
|
50
|
+
|
|
51
|
+
let(:config_context_options1) do {
|
|
52
|
+
:greeting => "hello",
|
|
53
|
+
:nestedkey => {
|
|
54
|
+
:a => {
|
|
55
|
+
:test1 => 'yes',
|
|
56
|
+
:test2 => [ 'please' ]
|
|
57
|
+
},
|
|
58
|
+
:x => 'goodbye'
|
|
59
|
+
},
|
|
60
|
+
:other => "Something else",
|
|
61
|
+
:array => [ 128 ],
|
|
62
|
+
:thought => "hope this test passes"
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
let(:config_flat_contexts1) { [ :context1, "context2" ] }
|
|
67
|
+
|
|
68
|
+
let(:config_flat_context_options1) do {
|
|
69
|
+
:greeting => "hello world",
|
|
70
|
+
:nestedkey => {
|
|
71
|
+
:a => {
|
|
72
|
+
:test1 => [ 23, 55 ],
|
|
73
|
+
:test2 => [ 'please' ]
|
|
74
|
+
},
|
|
75
|
+
:x => 'goodbye',
|
|
76
|
+
:b => 'oddball'
|
|
77
|
+
},
|
|
78
|
+
:other => "Something else",
|
|
79
|
+
:array => [ 128, 1024 ],
|
|
80
|
+
:something => "test"
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
let(:config_contexts2) { [ "context1", :context2, :context3 ] }
|
|
85
|
+
let(:config_context_hierarchy2) { [ :prefix1, "prefix2" ] }
|
|
86
|
+
|
|
87
|
+
let(:config_context_options2) do {
|
|
88
|
+
:greeting => "how are you",
|
|
89
|
+
:nestedkey => {
|
|
90
|
+
:a => {
|
|
91
|
+
:test1 => [ 23, 55 ],
|
|
92
|
+
:test2 => [ 'please' ]
|
|
93
|
+
},
|
|
94
|
+
:b => 'oddball',
|
|
95
|
+
:x => 'goodbye'
|
|
96
|
+
},
|
|
97
|
+
:other => "Something else",
|
|
98
|
+
:array => [ 128, 1024 ],
|
|
99
|
+
:something => "test5",
|
|
100
|
+
:thought => "hope this test passes"
|
|
101
|
+
}
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
let(:config_contexts3) { :context1 }
|
|
105
|
+
let(:config_context_hierarchy3) { [ :prefix1, "prefix2" ] }
|
|
106
|
+
|
|
107
|
+
let(:config_context_options3) do {
|
|
108
|
+
:greeting => "how are you",
|
|
109
|
+
:nestedkey => {
|
|
110
|
+
:a => {
|
|
111
|
+
:test1 => "yes",
|
|
112
|
+
:test2 => [ 'please' ]
|
|
113
|
+
},
|
|
114
|
+
:x => 'goodbye'
|
|
115
|
+
},
|
|
116
|
+
:other => "Something else",
|
|
117
|
+
:array => [ 128 ],
|
|
118
|
+
:something => "test5"
|
|
119
|
+
}
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
let(:config_flat_contexts2) { "context2" }
|
|
123
|
+
|
|
124
|
+
let(:config_flat_context_options2) do {
|
|
125
|
+
:greeting => "hello world",
|
|
126
|
+
:something => "test",
|
|
127
|
+
:nestedkey => {
|
|
128
|
+
:a => {
|
|
129
|
+
:test1 => [ 23, 55 ]
|
|
130
|
+
},
|
|
131
|
+
:b => 'oddball'
|
|
132
|
+
},
|
|
133
|
+
:array => [ 128, 1024 ]
|
|
134
|
+
}
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
before(:each) do
|
|
139
|
+
Nucleon::Config.clear_options
|
|
140
|
+
config_context_data.each do |context, options|
|
|
141
|
+
Nucleon::Config.set_options(context, options)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
#*****************************************************************************
|
|
147
|
+
# Source hashes
|
|
148
|
+
|
|
149
|
+
let(:config_hash1) do {
|
|
150
|
+
:testkey => 'testval',
|
|
151
|
+
:nestedkey => {
|
|
152
|
+
:a => {
|
|
153
|
+
:test1 => 'oh',
|
|
154
|
+
:test2 => [ 'no' ]
|
|
155
|
+
},
|
|
156
|
+
:x => 'hello',
|
|
157
|
+
:y => 'again',
|
|
158
|
+
:z => 'im done now'
|
|
159
|
+
},
|
|
160
|
+
:other => [ 1, 2, 3, 4 ],
|
|
161
|
+
:array => [ 3, 6, 9 ]
|
|
162
|
+
}
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
let(:config_hash2) do {
|
|
166
|
+
:testkey1 => 'testval1',
|
|
167
|
+
:nestedkey => {
|
|
168
|
+
:a => {
|
|
169
|
+
:test1 => 'oh',
|
|
170
|
+
:test2 => [ 'yes' ],
|
|
171
|
+
:test3 => true
|
|
172
|
+
},
|
|
173
|
+
:z => 'whew'
|
|
174
|
+
},
|
|
175
|
+
:other => 56,
|
|
176
|
+
:array => [ 12 ]
|
|
177
|
+
}
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
#*****************************************************************************
|
|
181
|
+
# Data hashes (symbolization and stingification)
|
|
182
|
+
|
|
183
|
+
let(:config_mixed_hash) do {
|
|
184
|
+
"stringkey" => true,
|
|
185
|
+
:symbolkey => true,
|
|
186
|
+
"inner" => {
|
|
187
|
+
:good => "almost",
|
|
188
|
+
"bad" => "maybe sometimes"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
let(:config_symbolized_hash) do {
|
|
194
|
+
:stringkey => true,
|
|
195
|
+
:symbolkey => true,
|
|
196
|
+
:inner => {
|
|
197
|
+
:good => "almost",
|
|
198
|
+
:bad => "maybe sometimes"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
let(:config_stringified_hash) do {
|
|
204
|
+
"stringkey" => true,
|
|
205
|
+
"symbolkey" => true,
|
|
206
|
+
"inner" => {
|
|
207
|
+
"good" => "almost",
|
|
208
|
+
"bad" => "maybe sometimes"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
#*****************************************************************************
|
|
214
|
+
# Merge results (hash1 overrides context options)
|
|
215
|
+
|
|
216
|
+
let(:config_hash_context1_force_basic_merge) do {
|
|
217
|
+
:greeting => "hello",
|
|
218
|
+
:thought => "hope this test passes",
|
|
219
|
+
:testkey => 'testval',
|
|
220
|
+
:nestedkey => {
|
|
221
|
+
:a => {
|
|
222
|
+
:test1 => 'oh',
|
|
223
|
+
:test2 => [ 'no' ]
|
|
224
|
+
},
|
|
225
|
+
:x => 'hello',
|
|
226
|
+
:y => 'again',
|
|
227
|
+
:z => 'im done now'
|
|
228
|
+
},
|
|
229
|
+
:other => [ 1, 2, 3, 4 ],
|
|
230
|
+
:array => [ 3, 6, 9 ],
|
|
231
|
+
:extra => 'this should not be set'
|
|
232
|
+
}
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
let(:config_hash_context1_force_deep_merge) do {
|
|
236
|
+
:greeting => "hello",
|
|
237
|
+
:thought => "hope this test passes",
|
|
238
|
+
:testkey => 'testval',
|
|
239
|
+
:nestedkey => {
|
|
240
|
+
:a => {
|
|
241
|
+
:test1 => 'oh',
|
|
242
|
+
:test2 => [ "please", "no" ]
|
|
243
|
+
},
|
|
244
|
+
:x => 'hello',
|
|
245
|
+
:y => 'again',
|
|
246
|
+
:z => 'im done now'
|
|
247
|
+
},
|
|
248
|
+
:other => [ 1, 2, 3, 4 ],
|
|
249
|
+
:array => [ 4545, :hello, 128, 3, 6, 9 ],
|
|
250
|
+
:extra => 'this should not be set'
|
|
251
|
+
}
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
let(:config_hash_context1_no_force_basic_merge) do {
|
|
255
|
+
:greeting => "hello",
|
|
256
|
+
:thought => "hope this test passes",
|
|
257
|
+
:testkey => 'testval',
|
|
258
|
+
:nestedkey => {
|
|
259
|
+
:a => {
|
|
260
|
+
:test1 => 'oh',
|
|
261
|
+
:test2 => [ 'no' ]
|
|
262
|
+
},
|
|
263
|
+
:x => 'hello',
|
|
264
|
+
:y => 'again',
|
|
265
|
+
:z => 'im done now'
|
|
266
|
+
},
|
|
267
|
+
:other => [ 1, 2, 3, 4 ],
|
|
268
|
+
:array => [ 3, 6, 9 ],
|
|
269
|
+
:extra => 'this should not be set'
|
|
270
|
+
}
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
let(:config_hash_context1_no_force_deep_merge) do {
|
|
274
|
+
:greeting => "howdy",
|
|
275
|
+
:thought => "hope this test passes",
|
|
276
|
+
:testkey => 'testval',
|
|
277
|
+
:nestedkey => {
|
|
278
|
+
:a => {
|
|
279
|
+
:test1 => 'yes',
|
|
280
|
+
:test2 => [ 'please', 'no' ]
|
|
281
|
+
},
|
|
282
|
+
:x => 'goodbye',
|
|
283
|
+
:y => 'again',
|
|
284
|
+
:z => 'im done now'
|
|
285
|
+
},
|
|
286
|
+
:other => "Something else",
|
|
287
|
+
:array => [ 4545, :hello, 128, 3, 6, 9 ],
|
|
288
|
+
:extra => 'this should not be set'
|
|
289
|
+
}
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
let(:config_hash_context2_force_basic_merge) do {
|
|
294
|
+
:greeting => "how are you",
|
|
295
|
+
:something => "test5",
|
|
296
|
+
:thought => "hope this test passes",
|
|
297
|
+
:testkey => 'testval',
|
|
298
|
+
:nestedkey => {
|
|
299
|
+
:a => {
|
|
300
|
+
:test1 => 'oh',
|
|
301
|
+
:test2 => [ 'no' ]
|
|
302
|
+
},
|
|
303
|
+
:x => 'hello',
|
|
304
|
+
:y => 'again',
|
|
305
|
+
:z => 'im done now'
|
|
306
|
+
},
|
|
307
|
+
:other => [ 1, 2, 3, 4 ],
|
|
308
|
+
:array => [ 3, 6, 9 ],
|
|
309
|
+
:extra => 'this should not be set'
|
|
310
|
+
}
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
let(:config_hash_context2_force_deep_merge) do {
|
|
314
|
+
:greeting => "how are you",
|
|
315
|
+
:something => "test5",
|
|
316
|
+
:thought => "hope this test passes",
|
|
317
|
+
:testkey => 'testval',
|
|
318
|
+
:nestedkey => {
|
|
319
|
+
:a => {
|
|
320
|
+
:test1 => 'oh',
|
|
321
|
+
:test2 => ["please", "no"]
|
|
322
|
+
},
|
|
323
|
+
:x => 'hello',
|
|
324
|
+
:b => "oddball",
|
|
325
|
+
:y => 'again',
|
|
326
|
+
:z => 'im done now'
|
|
327
|
+
},
|
|
328
|
+
:other => [ 1, 2, 3, 4 ],
|
|
329
|
+
:array => [ 4545, :hello, 128, 1024, 3, 6, 9 ],
|
|
330
|
+
:extra => 'this should not be set'
|
|
331
|
+
}
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
let(:config_hash_context2_no_force_basic_merge) do {
|
|
335
|
+
:greeting => "how are you",
|
|
336
|
+
:something => "test5",
|
|
337
|
+
:thought => "hope this test passes",
|
|
338
|
+
:testkey => 'testval',
|
|
339
|
+
:nestedkey => {
|
|
340
|
+
:a => {
|
|
341
|
+
:test1 => 'oh',
|
|
342
|
+
:test2 => [ 'no' ]
|
|
343
|
+
},
|
|
344
|
+
:x => 'hello',
|
|
345
|
+
:y => 'again',
|
|
346
|
+
:z => 'im done now'
|
|
347
|
+
},
|
|
348
|
+
:other => [ 1, 2, 3, 4 ],
|
|
349
|
+
:array => [ 3, 6, 9 ],
|
|
350
|
+
:extra => 'this should not be set'
|
|
351
|
+
}
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
let(:config_hash_context2_no_force_deep_merge) do {
|
|
355
|
+
:greeting => "howdy",
|
|
356
|
+
:something => "test5",
|
|
357
|
+
:thought => "hope this test passes",
|
|
358
|
+
:testkey => 'testval',
|
|
359
|
+
:nestedkey => {
|
|
360
|
+
:a => {
|
|
361
|
+
:test1 => [ 23, 55 ],
|
|
362
|
+
:test2 => [ "please", "no" ]
|
|
363
|
+
},
|
|
364
|
+
:x => 'goodbye',
|
|
365
|
+
:b => "oddball",
|
|
366
|
+
:y => 'again',
|
|
367
|
+
:z => 'im done now'
|
|
368
|
+
},
|
|
369
|
+
:other => "Something else",
|
|
370
|
+
:array => [ 4545, :hello, 128, 1024, 3, 6, 9 ],
|
|
371
|
+
:extra => 'this should not be set'
|
|
372
|
+
}
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
let(:config_hash_context3_force_basic_merge) do {
|
|
377
|
+
:testkey => 'testval',
|
|
378
|
+
:nestedkey => {
|
|
379
|
+
:a => {
|
|
380
|
+
:test1 => 'oh',
|
|
381
|
+
:test2 => [ 'no' ]
|
|
382
|
+
},
|
|
383
|
+
:x => 'hello',
|
|
384
|
+
:y => 'again',
|
|
385
|
+
:z => 'im done now'
|
|
386
|
+
},
|
|
387
|
+
:other => [ 1, 2, 3, 4 ],
|
|
388
|
+
:array => [ 3, 6, 9 ],
|
|
389
|
+
:greeting => "how are you",
|
|
390
|
+
:something => "test5",
|
|
391
|
+
:extra => 'this should not be set'
|
|
392
|
+
}
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
let(:config_hash_context3_force_deep_merge) do {
|
|
396
|
+
:testkey => 'testval',
|
|
397
|
+
:nestedkey => {
|
|
398
|
+
:a => {
|
|
399
|
+
:test1 => 'oh',
|
|
400
|
+
:test2 => [ 'please', 'no' ]
|
|
401
|
+
},
|
|
402
|
+
:x => 'hello',
|
|
403
|
+
:y => 'again',
|
|
404
|
+
:z => 'im done now'
|
|
405
|
+
},
|
|
406
|
+
:other => [ 1, 2, 3, 4 ],
|
|
407
|
+
:array => [ 4545, :hello, 128, 3, 6, 9 ],
|
|
408
|
+
:greeting => "how are you",
|
|
409
|
+
:something => "test5",
|
|
410
|
+
:extra => 'this should not be set'
|
|
411
|
+
}
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
let(:config_hash_context3_no_force_basic_merge) do {
|
|
415
|
+
:testkey => 'testval',
|
|
416
|
+
:nestedkey => {
|
|
417
|
+
:a => {
|
|
418
|
+
:test1 => 'oh',
|
|
419
|
+
:test2 => [ 'no' ]
|
|
420
|
+
},
|
|
421
|
+
:x => 'hello',
|
|
422
|
+
:y => 'again',
|
|
423
|
+
:z => 'im done now'
|
|
424
|
+
},
|
|
425
|
+
:other => [ 1, 2, 3, 4 ],
|
|
426
|
+
:array => [ 3, 6, 9 ],
|
|
427
|
+
:greeting => "how are you",
|
|
428
|
+
:something => "test5",
|
|
429
|
+
:extra => 'this should not be set'
|
|
430
|
+
}
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
let(:config_hash_context3_no_force_deep_merge) do {
|
|
434
|
+
:testkey => 'testval',
|
|
435
|
+
:nestedkey => {
|
|
436
|
+
:a => {
|
|
437
|
+
:test1 => 'yes',
|
|
438
|
+
:test2 => [ 'please', 'no' ]
|
|
439
|
+
},
|
|
440
|
+
:x => 'goodbye',
|
|
441
|
+
:y => 'again',
|
|
442
|
+
:z => 'im done now'
|
|
443
|
+
},
|
|
444
|
+
:other => "Something else",
|
|
445
|
+
:array => [ 4545, :hello, 128, 3, 6, 9 ],
|
|
446
|
+
:greeting => "howdy",
|
|
447
|
+
:something => "test5",
|
|
448
|
+
:extra => 'this should not be set'
|
|
449
|
+
}
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
#*****************************************************************************
|
|
454
|
+
# Merge results (hash2 overrides hash1)
|
|
455
|
+
|
|
456
|
+
let(:config_hash_no_force_basic_merge) do {
|
|
457
|
+
:testkey => 'testval',
|
|
458
|
+
:nestedkey => {
|
|
459
|
+
:a => {
|
|
460
|
+
:test1 => 'oh',
|
|
461
|
+
:test2 => [ 'yes' ],
|
|
462
|
+
:test3 => true
|
|
463
|
+
},
|
|
464
|
+
:z => 'whew'
|
|
465
|
+
},
|
|
466
|
+
:other => 56,
|
|
467
|
+
:array => [ 12 ],
|
|
468
|
+
:testkey1 => 'testval1'
|
|
469
|
+
}
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
let(:config_hash_force_basic_merge) do {
|
|
473
|
+
:testkey => 'testval',
|
|
474
|
+
:nestedkey => {
|
|
475
|
+
:a => {
|
|
476
|
+
:test1 => 'oh',
|
|
477
|
+
:test2 => [ 'yes' ],
|
|
478
|
+
:test3 => true
|
|
479
|
+
},
|
|
480
|
+
:z => 'whew'
|
|
481
|
+
},
|
|
482
|
+
:other => 56,
|
|
483
|
+
:array => [ 12 ],
|
|
484
|
+
:testkey1 => 'testval1'
|
|
485
|
+
}
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
let(:config_hash_no_force_deep_merge) do {
|
|
489
|
+
:testkey => 'testval',
|
|
490
|
+
:nestedkey => {
|
|
491
|
+
:a => {
|
|
492
|
+
:test1 => 'oh',
|
|
493
|
+
:test2 => [ 'no', 'yes' ],
|
|
494
|
+
:test3 => true
|
|
495
|
+
},
|
|
496
|
+
:x => 'hello',
|
|
497
|
+
:y => 'again',
|
|
498
|
+
:z => 'im done now'
|
|
499
|
+
},
|
|
500
|
+
:other => [ 1, 2, 3, 4 ],
|
|
501
|
+
:array => [ 3, 6, 9, 12 ],
|
|
502
|
+
:testkey1 => 'testval1'
|
|
503
|
+
}
|
|
504
|
+
end
|
|
505
|
+
|
|
506
|
+
let(:config_hash_force_deep_merge) do {
|
|
507
|
+
:testkey => 'testval',
|
|
508
|
+
:nestedkey => {
|
|
509
|
+
:a => {
|
|
510
|
+
:test1 => 'oh',
|
|
511
|
+
:test2 => [ 'no', 'yes' ],
|
|
512
|
+
:test3 => true
|
|
513
|
+
},
|
|
514
|
+
:x => 'hello',
|
|
515
|
+
:y => 'again',
|
|
516
|
+
:z => 'whew'
|
|
517
|
+
},
|
|
518
|
+
:other => 56,
|
|
519
|
+
:array => [ 3, 6, 9, 12 ],
|
|
520
|
+
:testkey1 => 'testval1'
|
|
521
|
+
}
|
|
522
|
+
end
|
|
523
|
+
end
|