nucleon 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -7
- data/.gitignore +50 -0
- data/ARCHITECTURE.rdoc +12 -11
- data/Gemfile +7 -11
- data/Gemfile.lock +47 -70
- data/Rakefile +22 -20
- data/TODO.rdoc +1 -1
- data/VERSION +1 -1
- data/bin/nucleon +16 -15
- data/lib/core/codes.rb +65 -38
- data/lib/core/config.rb +774 -153
- data/lib/core/config/collection.rb +134 -25
- data/lib/core/config/options.rb +160 -36
- data/lib/core/core.rb +207 -45
- data/lib/core/environment.rb +626 -206
- data/lib/core/facade.rb +211 -185
- data/lib/core/gems.rb +60 -44
- data/lib/core/manager.rb +587 -237
- data/lib/core/mixin/colors.rb +66 -36
- data/lib/core/mixin/config/collection.rb +58 -23
- data/lib/core/mixin/config/options.rb +67 -24
- data/lib/core/mixin/macro/object_interface.rb +129 -135
- data/lib/core/mixin/macro/plugin_interface.rb +118 -124
- data/lib/core/mixin/settings.rb +7 -13
- data/lib/core/mixin/sub_config.rb +37 -43
- data/lib/core/mod/hash.rb +31 -10
- data/lib/core/plugin/action.rb +274 -238
- data/lib/core/plugin/base.rb +140 -132
- data/lib/core/plugin/project.rb +316 -311
- data/lib/core/util/cli.rb +146 -146
- data/lib/core/util/console.rb +567 -124
- data/lib/core/util/data.rb +654 -139
- data/lib/core/util/logger.rb +255 -66
- data/lib/nucleon.rb +6 -8
- data/lib/nucleon_base.rb +364 -106
- data/nucleon.gemspec +40 -389
- data/spec/core/codes_spec.rb +209 -0
- data/spec/core/config_spec.rb +810 -0
- data/spec/core/core_spec.rb +185 -0
- data/spec/core/environment_spec.rb +148 -0
- data/spec/core/util/console_spec.rb +254 -446
- data/spec/nucleon/test.rb +59 -0
- data/spec/nucleon/test/first.rb +28 -0
- data/spec/nucleon/test/second.rb +28 -0
- data/spec/nucleon_codes.rb +98 -0
- data/spec/nucleon_config.rb +523 -0
- data/spec/nucleon_plugin.rb +439 -0
- data/spec/nucleon_test.rb +34 -0
- data/spec/spec_helper.rb +6 -4
- metadata +157 -615
- data/.document +0 -5
- data/rdoc/site/0.1.19/ARCHITECTURE_rdoc.html +0 -634
- data/rdoc/site/0.1.19/Hash.html +0 -347
- data/rdoc/site/0.1.19/Kernel.html +0 -413
- data/rdoc/site/0.1.19/Nucleon.html +0 -570
- data/rdoc/site/0.1.19/Nucleon/Action.html +0 -280
- data/rdoc/site/0.1.19/Nucleon/Action/Add.html +0 -458
- data/rdoc/site/0.1.19/Nucleon/Action/Create.html +0 -415
- data/rdoc/site/0.1.19/Nucleon/Action/Extract.html +0 -413
- data/rdoc/site/0.1.19/Nucleon/Action/Remove.html +0 -461
- data/rdoc/site/0.1.19/Nucleon/Action/Save.html +0 -434
- data/rdoc/site/0.1.19/Nucleon/Action/Update.html +0 -381
- data/rdoc/site/0.1.19/Nucleon/Codes.html +0 -563
- data/rdoc/site/0.1.19/Nucleon/Command.html +0 -275
- data/rdoc/site/0.1.19/Nucleon/Command/Bash.html +0 -544
- data/rdoc/site/0.1.19/Nucleon/Config.html +0 -1623
- data/rdoc/site/0.1.19/Nucleon/Config/Collection.html +0 -509
- data/rdoc/site/0.1.19/Nucleon/Config/Options.html +0 -489
- data/rdoc/site/0.1.19/Nucleon/Core.html +0 -635
- data/rdoc/site/0.1.19/Nucleon/Errors.html +0 -275
- data/rdoc/site/0.1.19/Nucleon/Errors/BatchError.html +0 -281
- data/rdoc/site/0.1.19/Nucleon/Errors/NucleonError.html +0 -657
- data/rdoc/site/0.1.19/Nucleon/Errors/SSHUnavailable.html +0 -281
- data/rdoc/site/0.1.19/Nucleon/Event.html +0 -275
- data/rdoc/site/0.1.19/Nucleon/Event/Regex.html +0 -467
- data/rdoc/site/0.1.19/Nucleon/Facade.html +0 -2336
- data/rdoc/site/0.1.19/Nucleon/Gems.html +0 -635
- data/rdoc/site/0.1.19/Nucleon/Manager.html +0 -1828
- data/rdoc/site/0.1.19/Nucleon/Mixin.html +0 -284
- data/rdoc/site/0.1.19/Nucleon/Mixin/Action.html +0 -277
- data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Commit.html +0 -381
- data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Project.html +0 -395
- data/rdoc/site/0.1.19/Nucleon/Mixin/Action/Push.html +0 -371
- data/rdoc/site/0.1.19/Nucleon/Mixin/Colors.html +0 -545
- data/rdoc/site/0.1.19/Nucleon/Mixin/ConfigCollection.html +0 -481
- data/rdoc/site/0.1.19/Nucleon/Mixin/ConfigOptions.html +0 -449
- data/rdoc/site/0.1.19/Nucleon/Mixin/Macro.html +0 -276
- data/rdoc/site/0.1.19/Nucleon/Mixin/Macro/ObjectInterface.html +0 -695
- data/rdoc/site/0.1.19/Nucleon/Mixin/Macro/PluginInterface.html +0 -682
- data/rdoc/site/0.1.19/Nucleon/Mixin/Settings.html +0 -481
- data/rdoc/site/0.1.19/Nucleon/Mixin/SubConfig.html +0 -887
- data/rdoc/site/0.1.19/Nucleon/Parallel.html +0 -325
- data/rdoc/site/0.1.19/Nucleon/Parallel/ClassMethods.html +0 -325
- data/rdoc/site/0.1.19/Nucleon/Parallel/InstanceMethods.html +0 -334
- data/rdoc/site/0.1.19/Nucleon/Plugin.html +0 -282
- data/rdoc/site/0.1.19/Nucleon/Plugin/Action.html +0 -1368
- data/rdoc/site/0.1.19/Nucleon/Plugin/Action/Option.html +0 -459
- data/rdoc/site/0.1.19/Nucleon/Plugin/Base.html +0 -1737
- data/rdoc/site/0.1.19/Nucleon/Plugin/Command.html +0 -721
- data/rdoc/site/0.1.19/Nucleon/Plugin/Event.html +0 -442
- data/rdoc/site/0.1.19/Nucleon/Plugin/Extension.html +0 -281
- data/rdoc/site/0.1.19/Nucleon/Plugin/Project.html +0 -2864
- data/rdoc/site/0.1.19/Nucleon/Plugin/Template.html +0 -476
- data/rdoc/site/0.1.19/Nucleon/Plugin/Translator.html +0 -371
- data/rdoc/site/0.1.19/Nucleon/Project.html +0 -276
- data/rdoc/site/0.1.19/Nucleon/Project/Git.html +0 -1801
- data/rdoc/site/0.1.19/Nucleon/Project/Github.html +0 -549
- data/rdoc/site/0.1.19/Nucleon/Template.html +0 -277
- data/rdoc/site/0.1.19/Nucleon/Template/Json.html +0 -329
- data/rdoc/site/0.1.19/Nucleon/Template/Wrapper.html +0 -329
- data/rdoc/site/0.1.19/Nucleon/Template/Yaml.html +0 -329
- data/rdoc/site/0.1.19/Nucleon/Translator.html +0 -276
- data/rdoc/site/0.1.19/Nucleon/Translator/Json.html +0 -366
- data/rdoc/site/0.1.19/Nucleon/Translator/Yaml.html +0 -366
- data/rdoc/site/0.1.19/Nucleon/Util.html +0 -285
- data/rdoc/site/0.1.19/Nucleon/Util/CLI.html +0 -388
- data/rdoc/site/0.1.19/Nucleon/Util/CLI/Parser.html +0 -1183
- data/rdoc/site/0.1.19/Nucleon/Util/Cache.html +0 -780
- data/rdoc/site/0.1.19/Nucleon/Util/Console.html +0 -1294
- data/rdoc/site/0.1.19/Nucleon/Util/Data.html +0 -1399
- data/rdoc/site/0.1.19/Nucleon/Util/Disk.html +0 -522
- data/rdoc/site/0.1.19/Nucleon/Util/Git.html +0 -361
- data/rdoc/site/0.1.19/Nucleon/Util/Liquid.html +0 -365
- data/rdoc/site/0.1.19/Nucleon/Util/Logger.html +0 -806
- data/rdoc/site/0.1.19/Nucleon/Util/Package.html +0 -558
- data/rdoc/site/0.1.19/Nucleon/Util/SSH.html +0 -910
- data/rdoc/site/0.1.19/Nucleon/Util/SSH/Keypair.html +0 -453
- data/rdoc/site/0.1.19/Nucleon/Util/Shell.html +0 -686
- data/rdoc/site/0.1.19/Nucleon/Util/Shell/Result.html +0 -497
- data/rdoc/site/0.1.19/README_rdoc.html +0 -312
- data/rdoc/site/0.1.19/TODO_rdoc.html +0 -267
- data/rdoc/site/0.1.19/created.rid +0 -60
- data/rdoc/site/0.1.19/images/add.png +0 -0
- data/rdoc/site/0.1.19/images/brick.png +0 -0
- data/rdoc/site/0.1.19/images/brick_link.png +0 -0
- data/rdoc/site/0.1.19/images/bug.png +0 -0
- data/rdoc/site/0.1.19/images/bullet_black.png +0 -0
- data/rdoc/site/0.1.19/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.1.19/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.1.19/images/date.png +0 -0
- data/rdoc/site/0.1.19/images/delete.png +0 -0
- data/rdoc/site/0.1.19/images/find.png +0 -0
- data/rdoc/site/0.1.19/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.1.19/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.1.19/images/package.png +0 -0
- data/rdoc/site/0.1.19/images/page_green.png +0 -0
- data/rdoc/site/0.1.19/images/page_white_text.png +0 -0
- data/rdoc/site/0.1.19/images/page_white_width.png +0 -0
- data/rdoc/site/0.1.19/images/plugin.png +0 -0
- data/rdoc/site/0.1.19/images/ruby.png +0 -0
- data/rdoc/site/0.1.19/images/tag_blue.png +0 -0
- data/rdoc/site/0.1.19/images/tag_green.png +0 -0
- data/rdoc/site/0.1.19/images/transparent.png +0 -0
- data/rdoc/site/0.1.19/images/wrench.png +0 -0
- data/rdoc/site/0.1.19/images/wrench_orange.png +0 -0
- data/rdoc/site/0.1.19/images/zoom.png +0 -0
- data/rdoc/site/0.1.19/index.html +0 -311
- data/rdoc/site/0.1.19/js/darkfish.js +0 -155
- data/rdoc/site/0.1.19/js/jquery.js +0 -18
- data/rdoc/site/0.1.19/js/navigation.js +0 -142
- data/rdoc/site/0.1.19/js/search.js +0 -94
- data/rdoc/site/0.1.19/js/search_index.js +0 -1
- data/rdoc/site/0.1.19/js/searcher.js +0 -228
- data/rdoc/site/0.1.19/rdoc.css +0 -543
- data/rdoc/site/0.1.19/table_of_contents.html +0 -1541
- data/rdoc/site/0.2.0/ARCHITECTURE_rdoc.html +0 -638
- data/rdoc/site/0.2.0/Hash.html +0 -351
- data/rdoc/site/0.2.0/Kernel.html +0 -416
- data/rdoc/site/0.2.0/Nucleon.html +0 -607
- data/rdoc/site/0.2.0/Nucleon/Action.html +0 -284
- data/rdoc/site/0.2.0/Nucleon/Action/Extract.html +0 -455
- data/rdoc/site/0.2.0/Nucleon/Action/Project.html +0 -283
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Add.html +0 -500
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Create.html +0 -457
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Remove.html +0 -503
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Save.html +0 -476
- data/rdoc/site/0.2.0/Nucleon/Action/Project/Update.html +0 -423
- data/rdoc/site/0.2.0/Nucleon/Codes.html +0 -567
- data/rdoc/site/0.2.0/Nucleon/Command.html +0 -279
- data/rdoc/site/0.2.0/Nucleon/Command/Bash.html +0 -548
- data/rdoc/site/0.2.0/Nucleon/Config.html +0 -1631
- data/rdoc/site/0.2.0/Nucleon/Config/Collection.html +0 -513
- data/rdoc/site/0.2.0/Nucleon/Config/Options.html +0 -493
- data/rdoc/site/0.2.0/Nucleon/Core.html +0 -639
- data/rdoc/site/0.2.0/Nucleon/Environment.html +0 -1208
- data/rdoc/site/0.2.0/Nucleon/Errors.html +0 -279
- data/rdoc/site/0.2.0/Nucleon/Errors/BatchError.html +0 -285
- data/rdoc/site/0.2.0/Nucleon/Errors/NucleonError.html +0 -661
- data/rdoc/site/0.2.0/Nucleon/Errors/SSHUnavailable.html +0 -285
- data/rdoc/site/0.2.0/Nucleon/Event.html +0 -279
- data/rdoc/site/0.2.0/Nucleon/Event/Regex.html +0 -471
- data/rdoc/site/0.2.0/Nucleon/Facade.html +0 -2409
- data/rdoc/site/0.2.0/Nucleon/Gems.html +0 -639
- data/rdoc/site/0.2.0/Nucleon/Manager.html +0 -1860
- data/rdoc/site/0.2.0/Nucleon/Mixin.html +0 -288
- data/rdoc/site/0.2.0/Nucleon/Mixin/Action.html +0 -281
- data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Commit.html +0 -385
- data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Project.html +0 -399
- data/rdoc/site/0.2.0/Nucleon/Mixin/Action/Push.html +0 -375
- data/rdoc/site/0.2.0/Nucleon/Mixin/Colors.html +0 -549
- data/rdoc/site/0.2.0/Nucleon/Mixin/ConfigCollection.html +0 -485
- data/rdoc/site/0.2.0/Nucleon/Mixin/ConfigOptions.html +0 -453
- data/rdoc/site/0.2.0/Nucleon/Mixin/Macro.html +0 -280
- data/rdoc/site/0.2.0/Nucleon/Mixin/Macro/ObjectInterface.html +0 -699
- data/rdoc/site/0.2.0/Nucleon/Mixin/Macro/PluginInterface.html +0 -686
- data/rdoc/site/0.2.0/Nucleon/Mixin/Settings.html +0 -485
- data/rdoc/site/0.2.0/Nucleon/Mixin/SubConfig.html +0 -891
- data/rdoc/site/0.2.0/Nucleon/Parallel.html +0 -330
- data/rdoc/site/0.2.0/Nucleon/Parallel/ClassMethods.html +0 -329
- data/rdoc/site/0.2.0/Nucleon/Parallel/InstanceMethods.html +0 -456
- data/rdoc/site/0.2.0/Nucleon/Plugin.html +0 -286
- data/rdoc/site/0.2.0/Nucleon/Plugin/Action.html +0 -1829
- data/rdoc/site/0.2.0/Nucleon/Plugin/Action/Option.html +0 -463
- data/rdoc/site/0.2.0/Nucleon/Plugin/Base.html +0 -1803
- data/rdoc/site/0.2.0/Nucleon/Plugin/Command.html +0 -725
- data/rdoc/site/0.2.0/Nucleon/Plugin/Event.html +0 -446
- data/rdoc/site/0.2.0/Nucleon/Plugin/Extension.html +0 -285
- data/rdoc/site/0.2.0/Nucleon/Plugin/Project.html +0 -2898
- data/rdoc/site/0.2.0/Nucleon/Plugin/Template.html +0 -480
- data/rdoc/site/0.2.0/Nucleon/Plugin/Translator.html +0 -375
- data/rdoc/site/0.2.0/Nucleon/Project.html +0 -280
- data/rdoc/site/0.2.0/Nucleon/Project/Git.html +0 -1805
- data/rdoc/site/0.2.0/Nucleon/Project/Github.html +0 -553
- data/rdoc/site/0.2.0/Nucleon/Template.html +0 -281
- data/rdoc/site/0.2.0/Nucleon/Template/JSON.html +0 -333
- data/rdoc/site/0.2.0/Nucleon/Template/Wrapper.html +0 -333
- data/rdoc/site/0.2.0/Nucleon/Template/YAML.html +0 -333
- data/rdoc/site/0.2.0/Nucleon/Translator.html +0 -280
- data/rdoc/site/0.2.0/Nucleon/Translator/JSON.html +0 -370
- data/rdoc/site/0.2.0/Nucleon/Translator/YAML.html +0 -370
- data/rdoc/site/0.2.0/Nucleon/Util.html +0 -289
- data/rdoc/site/0.2.0/Nucleon/Util/CLI.html +0 -392
- data/rdoc/site/0.2.0/Nucleon/Util/CLI/Parser.html +0 -1250
- data/rdoc/site/0.2.0/Nucleon/Util/Cache.html +0 -784
- data/rdoc/site/0.2.0/Nucleon/Util/Console.html +0 -1318
- data/rdoc/site/0.2.0/Nucleon/Util/Data.html +0 -1411
- data/rdoc/site/0.2.0/Nucleon/Util/Disk.html +0 -526
- data/rdoc/site/0.2.0/Nucleon/Util/Git.html +0 -365
- data/rdoc/site/0.2.0/Nucleon/Util/Liquid.html +0 -369
- data/rdoc/site/0.2.0/Nucleon/Util/Logger.html +0 -810
- data/rdoc/site/0.2.0/Nucleon/Util/Package.html +0 -562
- data/rdoc/site/0.2.0/Nucleon/Util/SSH.html +0 -1033
- data/rdoc/site/0.2.0/Nucleon/Util/SSH/Keypair.html +0 -605
- data/rdoc/site/0.2.0/Nucleon/Util/Shell.html +0 -693
- data/rdoc/site/0.2.0/Nucleon/Util/Shell/Result.html +0 -501
- data/rdoc/site/0.2.0/README_rdoc.html +0 -316
- data/rdoc/site/0.2.0/TODO_rdoc.html +0 -265
- data/rdoc/site/0.2.0/created.rid +0 -61
- data/rdoc/site/0.2.0/images/add.png +0 -0
- data/rdoc/site/0.2.0/images/brick.png +0 -0
- data/rdoc/site/0.2.0/images/brick_link.png +0 -0
- data/rdoc/site/0.2.0/images/bug.png +0 -0
- data/rdoc/site/0.2.0/images/bullet_black.png +0 -0
- data/rdoc/site/0.2.0/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.2.0/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.2.0/images/date.png +0 -0
- data/rdoc/site/0.2.0/images/delete.png +0 -0
- data/rdoc/site/0.2.0/images/find.png +0 -0
- data/rdoc/site/0.2.0/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.2.0/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.2.0/images/package.png +0 -0
- data/rdoc/site/0.2.0/images/page_green.png +0 -0
- data/rdoc/site/0.2.0/images/page_white_text.png +0 -0
- data/rdoc/site/0.2.0/images/page_white_width.png +0 -0
- data/rdoc/site/0.2.0/images/plugin.png +0 -0
- data/rdoc/site/0.2.0/images/ruby.png +0 -0
- data/rdoc/site/0.2.0/images/tag_blue.png +0 -0
- data/rdoc/site/0.2.0/images/tag_green.png +0 -0
- data/rdoc/site/0.2.0/images/transparent.png +0 -0
- data/rdoc/site/0.2.0/images/wrench.png +0 -0
- data/rdoc/site/0.2.0/images/wrench_orange.png +0 -0
- data/rdoc/site/0.2.0/images/zoom.png +0 -0
- data/rdoc/site/0.2.0/index.html +0 -315
- data/rdoc/site/0.2.0/js/darkfish.js +0 -155
- data/rdoc/site/0.2.0/js/jquery.js +0 -18
- data/rdoc/site/0.2.0/js/navigation.js +0 -142
- data/rdoc/site/0.2.0/js/search.js +0 -94
- data/rdoc/site/0.2.0/js/search_index.js +0 -1
- data/rdoc/site/0.2.0/js/searcher.js +0 -228
- data/rdoc/site/0.2.0/rdoc.css +0 -543
- data/rdoc/site/0.2.0/table_of_contents.html +0 -1657
- data/rdoc/site/0.2.1/ARCHITECTURE_rdoc.html +0 -640
- data/rdoc/site/0.2.1/Hash.html +0 -353
- data/rdoc/site/0.2.1/Kernel.html +0 -420
- data/rdoc/site/0.2.1/Nucleon.html +0 -674
- data/rdoc/site/0.2.1/Nucleon/Action.html +0 -286
- data/rdoc/site/0.2.1/Nucleon/Action/Extract.html +0 -457
- data/rdoc/site/0.2.1/Nucleon/Action/Project.html +0 -285
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Add.html +0 -502
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Create.html +0 -459
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Remove.html +0 -505
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Save.html +0 -478
- data/rdoc/site/0.2.1/Nucleon/Action/Project/Update.html +0 -425
- data/rdoc/site/0.2.1/Nucleon/Codes.html +0 -569
- data/rdoc/site/0.2.1/Nucleon/Command.html +0 -281
- data/rdoc/site/0.2.1/Nucleon/Command/Bash.html +0 -550
- data/rdoc/site/0.2.1/Nucleon/Config.html +0 -1634
- data/rdoc/site/0.2.1/Nucleon/Config/Collection.html +0 -515
- data/rdoc/site/0.2.1/Nucleon/Config/Options.html +0 -495
- data/rdoc/site/0.2.1/Nucleon/Core.html +0 -641
- data/rdoc/site/0.2.1/Nucleon/Environment.html +0 -1210
- data/rdoc/site/0.2.1/Nucleon/Errors.html +0 -281
- data/rdoc/site/0.2.1/Nucleon/Errors/BatchError.html +0 -287
- data/rdoc/site/0.2.1/Nucleon/Errors/NucleonError.html +0 -663
- data/rdoc/site/0.2.1/Nucleon/Errors/SSHUnavailable.html +0 -287
- data/rdoc/site/0.2.1/Nucleon/Event.html +0 -281
- data/rdoc/site/0.2.1/Nucleon/Event/Regex.html +0 -473
- data/rdoc/site/0.2.1/Nucleon/Facade.html +0 -2452
- data/rdoc/site/0.2.1/Nucleon/Gems.html +0 -641
- data/rdoc/site/0.2.1/Nucleon/Manager.html +0 -1862
- data/rdoc/site/0.2.1/Nucleon/Mixin.html +0 -291
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action.html +0 -284
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Commit.html +0 -387
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Project.html +0 -401
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Push.html +0 -377
- data/rdoc/site/0.2.1/Nucleon/Mixin/Action/Registration.html +0 -575
- data/rdoc/site/0.2.1/Nucleon/Mixin/Colors.html +0 -551
- data/rdoc/site/0.2.1/Nucleon/Mixin/ConfigCollection.html +0 -487
- data/rdoc/site/0.2.1/Nucleon/Mixin/ConfigOptions.html +0 -455
- data/rdoc/site/0.2.1/Nucleon/Mixin/Macro.html +0 -282
- data/rdoc/site/0.2.1/Nucleon/Mixin/Macro/ObjectInterface.html +0 -701
- data/rdoc/site/0.2.1/Nucleon/Mixin/Macro/PluginInterface.html +0 -688
- data/rdoc/site/0.2.1/Nucleon/Mixin/Settings.html +0 -487
- data/rdoc/site/0.2.1/Nucleon/Mixin/SubConfig.html +0 -893
- data/rdoc/site/0.2.1/Nucleon/Parallel.html +0 -332
- data/rdoc/site/0.2.1/Nucleon/Parallel/ClassMethods.html +0 -331
- data/rdoc/site/0.2.1/Nucleon/Parallel/InstanceMethods.html +0 -458
- data/rdoc/site/0.2.1/Nucleon/Plugin.html +0 -288
- data/rdoc/site/0.2.1/Nucleon/Plugin/Action.html +0 -2133
- data/rdoc/site/0.2.1/Nucleon/Plugin/Action/Option.html +0 -465
- data/rdoc/site/0.2.1/Nucleon/Plugin/Base.html +0 -1988
- data/rdoc/site/0.2.1/Nucleon/Plugin/Command.html +0 -765
- data/rdoc/site/0.2.1/Nucleon/Plugin/Event.html +0 -448
- data/rdoc/site/0.2.1/Nucleon/Plugin/Extension.html +0 -287
- data/rdoc/site/0.2.1/Nucleon/Plugin/Project.html +0 -2900
- data/rdoc/site/0.2.1/Nucleon/Plugin/Template.html +0 -482
- data/rdoc/site/0.2.1/Nucleon/Plugin/Translator.html +0 -377
- data/rdoc/site/0.2.1/Nucleon/Project.html +0 -282
- data/rdoc/site/0.2.1/Nucleon/Project/Git.html +0 -1807
- data/rdoc/site/0.2.1/Nucleon/Project/Github.html +0 -555
- data/rdoc/site/0.2.1/Nucleon/Template.html +0 -283
- data/rdoc/site/0.2.1/Nucleon/Template/JSON.html +0 -335
- data/rdoc/site/0.2.1/Nucleon/Template/Wrapper.html +0 -335
- data/rdoc/site/0.2.1/Nucleon/Template/YAML.html +0 -335
- data/rdoc/site/0.2.1/Nucleon/Translator.html +0 -282
- data/rdoc/site/0.2.1/Nucleon/Translator/JSON.html +0 -372
- data/rdoc/site/0.2.1/Nucleon/Translator/YAML.html +0 -372
- data/rdoc/site/0.2.1/Nucleon/Util.html +0 -291
- data/rdoc/site/0.2.1/Nucleon/Util/CLI.html +0 -394
- data/rdoc/site/0.2.1/Nucleon/Util/CLI/Parser.html +0 -1404
- data/rdoc/site/0.2.1/Nucleon/Util/Cache.html +0 -824
- data/rdoc/site/0.2.1/Nucleon/Util/Console.html +0 -1330
- data/rdoc/site/0.2.1/Nucleon/Util/Data.html +0 -1423
- data/rdoc/site/0.2.1/Nucleon/Util/Disk.html +0 -528
- data/rdoc/site/0.2.1/Nucleon/Util/Git.html +0 -367
- data/rdoc/site/0.2.1/Nucleon/Util/Liquid.html +0 -371
- data/rdoc/site/0.2.1/Nucleon/Util/Logger.html +0 -822
- data/rdoc/site/0.2.1/Nucleon/Util/Package.html +0 -564
- data/rdoc/site/0.2.1/Nucleon/Util/SSH.html +0 -1036
- data/rdoc/site/0.2.1/Nucleon/Util/SSH/Keypair.html +0 -607
- data/rdoc/site/0.2.1/Nucleon/Util/Shell.html +0 -697
- data/rdoc/site/0.2.1/Nucleon/Util/Shell/Result.html +0 -503
- data/rdoc/site/0.2.1/README_rdoc.html +0 -318
- data/rdoc/site/0.2.1/TODO_rdoc.html +0 -267
- data/rdoc/site/0.2.1/created.rid +0 -62
- data/rdoc/site/0.2.1/images/add.png +0 -0
- data/rdoc/site/0.2.1/images/brick.png +0 -0
- data/rdoc/site/0.2.1/images/brick_link.png +0 -0
- data/rdoc/site/0.2.1/images/bug.png +0 -0
- data/rdoc/site/0.2.1/images/bullet_black.png +0 -0
- data/rdoc/site/0.2.1/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.2.1/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.2.1/images/date.png +0 -0
- data/rdoc/site/0.2.1/images/delete.png +0 -0
- data/rdoc/site/0.2.1/images/find.png +0 -0
- data/rdoc/site/0.2.1/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.2.1/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.2.1/images/package.png +0 -0
- data/rdoc/site/0.2.1/images/page_green.png +0 -0
- data/rdoc/site/0.2.1/images/page_white_text.png +0 -0
- data/rdoc/site/0.2.1/images/page_white_width.png +0 -0
- data/rdoc/site/0.2.1/images/plugin.png +0 -0
- data/rdoc/site/0.2.1/images/ruby.png +0 -0
- data/rdoc/site/0.2.1/images/tag_blue.png +0 -0
- data/rdoc/site/0.2.1/images/tag_green.png +0 -0
- data/rdoc/site/0.2.1/images/transparent.png +0 -0
- data/rdoc/site/0.2.1/images/wrench.png +0 -0
- data/rdoc/site/0.2.1/images/wrench_orange.png +0 -0
- data/rdoc/site/0.2.1/images/zoom.png +0 -0
- data/rdoc/site/0.2.1/index.html +0 -317
- data/rdoc/site/0.2.1/js/darkfish.js +0 -155
- data/rdoc/site/0.2.1/js/jquery.js +0 -18
- data/rdoc/site/0.2.1/js/navigation.js +0 -142
- data/rdoc/site/0.2.1/js/search.js +0 -94
- data/rdoc/site/0.2.1/js/search_index.js +0 -1
- data/rdoc/site/0.2.1/js/searcher.js +0 -228
- data/rdoc/site/0.2.1/rdoc.css +0 -543
- data/rdoc/site/0.2.1/table_of_contents.html +0 -1718
- data/spec/coral_mock_input.rb +0 -29
- data/spec/coral_test_kernel.rb +0 -22
data/lib/core/util/cli.rb
CHANGED
|
@@ -2,61 +2,61 @@
|
|
|
2
2
|
module Nucleon
|
|
3
3
|
module Util
|
|
4
4
|
module CLI
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
#-----------------------------------------------------------------------------
|
|
7
7
|
# Utilities
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
def self.message(name, default = nil)
|
|
10
10
|
if default.nil?
|
|
11
11
|
default = :none
|
|
12
12
|
end
|
|
13
|
-
return I18n.t(name.to_s, :default_value => default.to_s)
|
|
13
|
+
return I18n.t(name.to_s, :default_value => Console.purple(default.to_s))
|
|
14
14
|
end
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
#---
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
def self.encode(data)
|
|
19
19
|
Base64.urlsafe_encode64(Util::Data.to_json(data, false))
|
|
20
20
|
end
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
def self.decode(encoded_string)
|
|
23
|
-
Util::Data.symbol_map(Util::Data.parse_json(Base64.urlsafe_decode64(encoded_string)))
|
|
23
|
+
Util::Data.symbol_map(Util::Data.parse_json(Base64.urlsafe_decode64(encoded_string)))
|
|
24
24
|
end
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
#-------------------------------------------------------------------------
|
|
27
27
|
# Parser
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
class Parser
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
attr_accessor :parser, :options, :arguments, :extra, :processed, :strict
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
#---
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
include Mixin::Colors
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
#---
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
def initialize(args, banner = '', help = '', split_help = false)
|
|
40
40
|
@parser = OptionParser.new
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
self.options = {}
|
|
43
43
|
self.arguments = {}
|
|
44
44
|
self.extra = {}
|
|
45
45
|
self.processed = false
|
|
46
|
-
self.strict = true
|
|
47
|
-
|
|
46
|
+
self.strict = true
|
|
47
|
+
|
|
48
48
|
@arg_settings = []
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
self.banner = banner
|
|
51
51
|
self.help = help
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
yield(self) if block_given?
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
parse_command(args, split_help)
|
|
56
56
|
end
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
#---
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
def self.split(args, banner, separator = '')
|
|
61
61
|
main_args = nil
|
|
62
62
|
sub_command = nil
|
|
@@ -73,64 +73,64 @@ module CLI
|
|
|
73
73
|
|
|
74
74
|
main_args = args.dup if main_args.nil?
|
|
75
75
|
results = [ Parser.new(main_args, banner, separator, true) ]
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
if sub_command
|
|
78
78
|
results << [ sub_command, sub_args ]
|
|
79
79
|
end
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
return results.flatten
|
|
82
82
|
end
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
#---
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
def banner=banner
|
|
87
|
-
parser.banner = banner
|
|
87
|
+
parser.banner = banner
|
|
88
88
|
end
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
#---
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
def help
|
|
93
93
|
return parser.help
|
|
94
94
|
end
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
def help=help
|
|
97
97
|
if help.is_a?(Array)
|
|
98
98
|
help.each do |line|
|
|
99
|
-
parser.separator line
|
|
100
|
-
end
|
|
99
|
+
parser.separator line
|
|
100
|
+
end
|
|
101
101
|
else
|
|
102
102
|
parser.separator help
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
#---
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
def version
|
|
109
109
|
# Override in executable script
|
|
110
110
|
end
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
#---
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
def parse_command(args, split_help = false)
|
|
115
115
|
args = args.dup
|
|
116
116
|
error = false
|
|
117
|
-
|
|
117
|
+
|
|
118
118
|
self.processed = false
|
|
119
|
-
|
|
120
|
-
option_bool(:version, false,
|
|
121
|
-
'--version',
|
|
119
|
+
|
|
120
|
+
option_bool(:version, false,
|
|
121
|
+
'--version',
|
|
122
122
|
'nucleon.core.util.cli.options.version'
|
|
123
123
|
)
|
|
124
|
-
option_bool(:color, true,
|
|
125
|
-
'--[no]-color',
|
|
124
|
+
option_bool(:color, true,
|
|
125
|
+
'--[no]-color',
|
|
126
126
|
'nucleon.core.util.cli.options.color'
|
|
127
127
|
)
|
|
128
|
-
option_str(:log_level, nil,
|
|
129
|
-
'--log_level STR',
|
|
128
|
+
option_str(:log_level, nil,
|
|
129
|
+
'--log_level STR',
|
|
130
130
|
'nucleon.core.util.cli.options.log_level'
|
|
131
131
|
)
|
|
132
|
-
option_str(:encoded_params, false,
|
|
133
|
-
'--encoded STR',
|
|
132
|
+
option_str(:encoded_params, false,
|
|
133
|
+
'--encoded STR',
|
|
134
134
|
'nucleon.core.util.cli.options.encoded'
|
|
135
135
|
)
|
|
136
136
|
if split_help
|
|
@@ -144,35 +144,35 @@ module CLI
|
|
|
144
144
|
else
|
|
145
145
|
parser.on_tail('-h', '--help', CLI.message('nucleon.core.util.cli.options.short_help')) do
|
|
146
146
|
options[:help] = true
|
|
147
|
-
end
|
|
147
|
+
end
|
|
148
148
|
end
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
if strict
|
|
151
151
|
parser.parse!(args)
|
|
152
152
|
extra_args = {}
|
|
153
153
|
else
|
|
154
154
|
args, extra_args = parse_known_args(parser, args)
|
|
155
155
|
end
|
|
156
|
-
|
|
156
|
+
|
|
157
157
|
# Now we can act on options given
|
|
158
158
|
options[:color] = Util::Console.use_colors
|
|
159
|
-
|
|
159
|
+
|
|
160
160
|
if options[:version]
|
|
161
161
|
puts version
|
|
162
162
|
exit 0
|
|
163
163
|
end
|
|
164
|
-
|
|
164
|
+
|
|
165
165
|
return if options[:help]
|
|
166
|
-
|
|
166
|
+
|
|
167
167
|
parse_encoded
|
|
168
|
-
|
|
168
|
+
|
|
169
169
|
Nucleon.log_level = options[:log_level] if options[:log_level]
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
self.extra = normalize_extra_options(extra_args) unless extra_args.empty?
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
remaining_args = args.dup
|
|
174
174
|
arg_messages = []
|
|
175
|
-
|
|
175
|
+
|
|
176
176
|
if arguments.empty?
|
|
177
177
|
@arg_settings.each_with_index do |settings, index|
|
|
178
178
|
if index >= args.length
|
|
@@ -180,7 +180,7 @@ module CLI
|
|
|
180
180
|
else
|
|
181
181
|
value = Util::Data.value(args[index])
|
|
182
182
|
end
|
|
183
|
-
|
|
183
|
+
|
|
184
184
|
if !value.nil? && settings.has_key?(:allowed)
|
|
185
185
|
allowed = settings[:allowed]
|
|
186
186
|
case allowed
|
|
@@ -196,11 +196,11 @@ module CLI
|
|
|
196
196
|
when Array
|
|
197
197
|
unless allowed.include(value)
|
|
198
198
|
arg_messages << CLI.message(settings[:message])
|
|
199
|
-
error = true
|
|
199
|
+
error = true
|
|
200
200
|
end
|
|
201
201
|
end
|
|
202
202
|
end
|
|
203
|
-
|
|
203
|
+
|
|
204
204
|
if value.nil?
|
|
205
205
|
if settings.has_key?(:default)
|
|
206
206
|
value = settings[:default]
|
|
@@ -208,48 +208,48 @@ module CLI
|
|
|
208
208
|
error = true
|
|
209
209
|
end
|
|
210
210
|
end
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
if !value.nil? && settings.has_key?(:block)
|
|
213
213
|
value = settings[:block].call(value)
|
|
214
214
|
error = true if value.nil?
|
|
215
215
|
end
|
|
216
|
-
|
|
216
|
+
|
|
217
217
|
break if error
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
remaining_args.shift unless remaining_args.empty?
|
|
220
220
|
self.arguments[settings[:name]] = value
|
|
221
|
-
end
|
|
221
|
+
end
|
|
222
222
|
end
|
|
223
|
-
|
|
223
|
+
|
|
224
224
|
if error
|
|
225
225
|
if ! arg_messages.empty?
|
|
226
226
|
parser.warn(CLI.message('nucleon.core.util.cli.parse.error') + "\n\n" + arg_messages.join("\n") + "\n\n" + parser.help)
|
|
227
227
|
else
|
|
228
|
-
parser.warn(CLI.message('nucleon.core.util.cli.parse.error') + "\n\n" + parser.help)
|
|
228
|
+
parser.warn(CLI.message('nucleon.core.util.cli.parse.error') + "\n\n" + parser.help)
|
|
229
229
|
end
|
|
230
230
|
else
|
|
231
231
|
self.processed = true
|
|
232
232
|
end
|
|
233
|
-
|
|
233
|
+
|
|
234
234
|
rescue OptionParser::InvalidOption => e
|
|
235
235
|
parser.warn(e.message + "\n\n" + parser.help)
|
|
236
236
|
end
|
|
237
|
-
|
|
237
|
+
|
|
238
238
|
#---
|
|
239
|
-
|
|
239
|
+
|
|
240
240
|
def parse_encoded
|
|
241
241
|
if options[:encoded_params]
|
|
242
242
|
encoded_properties = CLI.decode(options[:encoded_params])
|
|
243
|
-
|
|
243
|
+
|
|
244
244
|
@arg_settings.each do |settings|
|
|
245
245
|
if encoded_properties.has_key?(settings[:name].to_sym)
|
|
246
246
|
self.arguments[settings[:name]] = encoded_properties.delete(settings[:name].to_sym)
|
|
247
247
|
end
|
|
248
248
|
end
|
|
249
|
-
|
|
249
|
+
|
|
250
250
|
encoded_properties.each do |name, value|
|
|
251
251
|
self.options[name] = value
|
|
252
|
-
|
|
252
|
+
|
|
253
253
|
if name == :color
|
|
254
254
|
Util::Console.use_colors = value
|
|
255
255
|
end
|
|
@@ -257,19 +257,19 @@ module CLI
|
|
|
257
257
|
end
|
|
258
258
|
options.delete(:encoded_params)
|
|
259
259
|
end
|
|
260
|
-
|
|
260
|
+
|
|
261
261
|
#---
|
|
262
|
-
|
|
262
|
+
|
|
263
263
|
def parse_known_args(parser, args)
|
|
264
264
|
extra_args = []
|
|
265
|
-
|
|
265
|
+
|
|
266
266
|
parse_args = lambda do |arg_list|
|
|
267
267
|
begin
|
|
268
268
|
original_list = arg_list.clone
|
|
269
|
-
|
|
269
|
+
|
|
270
270
|
parser.parse! arg_list
|
|
271
271
|
args = arg_list
|
|
272
|
-
|
|
272
|
+
|
|
273
273
|
rescue OptionParser::InvalidOption => e
|
|
274
274
|
extra_args += e.args
|
|
275
275
|
while arg_list[0] && arg_list[0][0] != '-'
|
|
@@ -281,55 +281,55 @@ module CLI
|
|
|
281
281
|
parse_args.call args
|
|
282
282
|
[ args, extra_args ]
|
|
283
283
|
end
|
|
284
|
-
|
|
284
|
+
|
|
285
285
|
#---
|
|
286
|
-
|
|
286
|
+
|
|
287
287
|
def normalize_extra_options(arg_list)
|
|
288
|
-
options = {}
|
|
288
|
+
options = {}
|
|
289
289
|
last_option = nil
|
|
290
|
-
|
|
290
|
+
|
|
291
291
|
Util::Data.array(arg_list).each do |arg|
|
|
292
292
|
components = arg.split('=')
|
|
293
|
-
value = nil
|
|
294
|
-
|
|
293
|
+
value = nil
|
|
294
|
+
|
|
295
295
|
if components.size > 1
|
|
296
296
|
arg = components[0]
|
|
297
|
-
value = components[1]
|
|
297
|
+
value = components[1]
|
|
298
298
|
end
|
|
299
|
-
|
|
299
|
+
|
|
300
300
|
if arg[0] == '-'
|
|
301
301
|
last_option = arg.sub(/^\-+/, '').to_sym
|
|
302
|
-
options[last_option] = Util::Data.value(value) if value
|
|
302
|
+
options[last_option] = Util::Data.value(value) if value
|
|
303
303
|
else
|
|
304
304
|
if last_option
|
|
305
305
|
if options[last_option]
|
|
306
306
|
options[last_option] = [ options[last_option] ] unless options[last_option].is_a?(Array)
|
|
307
307
|
options[last_option] << Util::Data.value(arg)
|
|
308
308
|
else
|
|
309
|
-
options[last_option] = Util::Data.value(arg)
|
|
310
|
-
end
|
|
309
|
+
options[last_option] = Util::Data.value(arg)
|
|
310
|
+
end
|
|
311
311
|
else
|
|
312
312
|
parser.warn(CLI.message('nucleon.core.util.cli.parse.error') + "\n\n" + parser.help)
|
|
313
|
-
break
|
|
313
|
+
break
|
|
314
314
|
end
|
|
315
|
-
end
|
|
316
|
-
end
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
317
|
options
|
|
318
318
|
end
|
|
319
319
|
protected :normalize_extra_options
|
|
320
|
-
|
|
320
|
+
|
|
321
321
|
#---
|
|
322
|
-
|
|
322
|
+
|
|
323
323
|
def option(name, default, option_str, allowed_values, message_id, config = {})
|
|
324
324
|
config = Config.ensure(config)
|
|
325
325
|
name = name.to_sym
|
|
326
326
|
options[name] = config.get(name, default)
|
|
327
|
-
|
|
327
|
+
|
|
328
328
|
message_name = name.to_s + '_message'
|
|
329
329
|
message = CLI.message(message_id, options[name])
|
|
330
|
-
|
|
330
|
+
|
|
331
331
|
option_str = Util::Data.array(option_str)
|
|
332
|
-
|
|
332
|
+
|
|
333
333
|
if allowed_values
|
|
334
334
|
parser.on(*option_str, allowed_values, config.get(message_name.to_sym, message)) do |value|
|
|
335
335
|
value = yield(value) if block_given?
|
|
@@ -339,34 +339,34 @@ module CLI
|
|
|
339
339
|
parser.on(*option_str, config.get(message_name.to_sym, message)) do |value|
|
|
340
340
|
value = yield(value) if block_given?
|
|
341
341
|
options[name] = value unless value.nil?
|
|
342
|
-
end
|
|
342
|
+
end
|
|
343
343
|
end
|
|
344
344
|
end
|
|
345
|
-
|
|
345
|
+
|
|
346
346
|
#---
|
|
347
|
-
|
|
347
|
+
|
|
348
348
|
def arg(name, default, allowed_values, message_id, config = {}, &block)
|
|
349
349
|
config = Config.ensure(config)
|
|
350
350
|
name = name.to_sym
|
|
351
|
-
|
|
351
|
+
|
|
352
352
|
message_name = name.to_s + '_message'
|
|
353
353
|
message = CLI.message(message_id, arguments[name])
|
|
354
|
-
|
|
355
|
-
settings = {
|
|
354
|
+
|
|
355
|
+
settings = {
|
|
356
356
|
:name => name,
|
|
357
357
|
:default => config.get(name, default),
|
|
358
|
-
:message => config.get(message_name.to_sym, message)
|
|
358
|
+
:message => config.get(message_name.to_sym, message)
|
|
359
359
|
}
|
|
360
360
|
settings[:allowed] = allowed_values if allowed_values
|
|
361
361
|
settings[:block] = block if block
|
|
362
|
-
|
|
362
|
+
|
|
363
363
|
settings.delete(:default) if settings[:default].nil?
|
|
364
|
-
|
|
365
|
-
@arg_settings << settings
|
|
364
|
+
|
|
365
|
+
@arg_settings << settings
|
|
366
366
|
end
|
|
367
|
-
|
|
367
|
+
|
|
368
368
|
#---
|
|
369
|
-
|
|
369
|
+
|
|
370
370
|
def option_bool(name, default, option_str, message_id, config = {})
|
|
371
371
|
option(name, default, option_str, nil, message_id, config) do |value|
|
|
372
372
|
value = Util::Data.value(value)
|
|
@@ -374,12 +374,12 @@ module CLI
|
|
|
374
374
|
block_given? ? yield(value) : value
|
|
375
375
|
else
|
|
376
376
|
nil
|
|
377
|
-
end
|
|
378
|
-
end
|
|
377
|
+
end
|
|
378
|
+
end
|
|
379
379
|
end
|
|
380
|
-
|
|
380
|
+
|
|
381
381
|
#---
|
|
382
|
-
|
|
382
|
+
|
|
383
383
|
def arg_bool(name, default, message_id, config = {})
|
|
384
384
|
arg(name, default, nil, message_id, config) do |value|
|
|
385
385
|
value = Util::Data.value(value)
|
|
@@ -387,74 +387,74 @@ module CLI
|
|
|
387
387
|
block_given? ? yield(value) : value
|
|
388
388
|
else
|
|
389
389
|
nil
|
|
390
|
-
end
|
|
391
|
-
end
|
|
390
|
+
end
|
|
391
|
+
end
|
|
392
392
|
end
|
|
393
|
-
|
|
393
|
+
|
|
394
394
|
#---
|
|
395
|
-
|
|
395
|
+
|
|
396
396
|
def option_int(name, default, option_str, message_id, config = {})
|
|
397
397
|
option(name, default, option_str, Integer, message_id, config) do |value|
|
|
398
|
-
block_given? ? yield(value) : value
|
|
399
|
-
end
|
|
398
|
+
block_given? ? yield(value) : value
|
|
399
|
+
end
|
|
400
400
|
end
|
|
401
|
-
|
|
401
|
+
|
|
402
402
|
#---
|
|
403
|
-
|
|
403
|
+
|
|
404
404
|
def arg_int(name, default, message_id, config = {})
|
|
405
405
|
arg(name, default, Integer, message_id, config) do |value|
|
|
406
|
-
block_given? ? yield(value) : value
|
|
407
|
-
end
|
|
406
|
+
block_given? ? yield(value) : value
|
|
407
|
+
end
|
|
408
408
|
end
|
|
409
|
-
|
|
409
|
+
|
|
410
410
|
#---
|
|
411
|
-
|
|
411
|
+
|
|
412
412
|
def option_float(name, default, option_str, message_id, config = {})
|
|
413
413
|
option(name, default, option_str, Float, message_id, config) do |value|
|
|
414
|
-
block_given? ? yield(value) : value
|
|
415
|
-
end
|
|
414
|
+
block_given? ? yield(value) : value
|
|
415
|
+
end
|
|
416
416
|
end
|
|
417
|
-
|
|
417
|
+
|
|
418
418
|
#---
|
|
419
|
-
|
|
419
|
+
|
|
420
420
|
def arg_float(name, default, message_id, config = {})
|
|
421
421
|
arg(name, default, Float, message_id, config) do |value|
|
|
422
|
-
block_given? ? yield(value) : value
|
|
423
|
-
end
|
|
422
|
+
block_given? ? yield(value) : value
|
|
423
|
+
end
|
|
424
424
|
end
|
|
425
|
-
|
|
425
|
+
|
|
426
426
|
#---
|
|
427
|
-
|
|
427
|
+
|
|
428
428
|
def option_str(name, default, option_str, message_id, config = {})
|
|
429
429
|
option(name, default, option_str, nil, message_id, config) do |value|
|
|
430
|
-
block_given? ? yield(value) : value
|
|
431
|
-
end
|
|
430
|
+
block_given? ? yield(value) : value
|
|
431
|
+
end
|
|
432
432
|
end
|
|
433
|
-
|
|
433
|
+
|
|
434
434
|
#---
|
|
435
|
-
|
|
435
|
+
|
|
436
436
|
def arg_str(name, default, message_id, config = {})
|
|
437
437
|
arg(name, default, nil, message_id, config) do |value|
|
|
438
|
-
block_given? ? yield(value) : value
|
|
439
|
-
end
|
|
438
|
+
block_given? ? yield(value) : value
|
|
439
|
+
end
|
|
440
440
|
end
|
|
441
|
-
|
|
441
|
+
|
|
442
442
|
#---
|
|
443
|
-
|
|
443
|
+
|
|
444
444
|
def option_array(name, default, option_str, message_id, config = {})
|
|
445
445
|
option(name, default, option_str, Array, message_id, config) do |value|
|
|
446
|
-
block_given? ? yield(value) : value
|
|
447
|
-
end
|
|
446
|
+
block_given? ? yield(value) : value
|
|
447
|
+
end
|
|
448
448
|
end
|
|
449
|
-
|
|
449
|
+
|
|
450
450
|
#---
|
|
451
|
-
|
|
451
|
+
|
|
452
452
|
def arg_array(name, default, message_id, config = {})
|
|
453
453
|
arg(name, default, Array, message_id, config) do |value|
|
|
454
|
-
block_given? ? yield(value) : value
|
|
455
|
-
end
|
|
454
|
+
block_given? ? yield(value) : value
|
|
455
|
+
end
|
|
456
456
|
end
|
|
457
|
-
end
|
|
457
|
+
end
|
|
458
458
|
end
|
|
459
459
|
end
|
|
460
460
|
end
|