win32-api 1.5.3-universal-mingw32 → 1.6.0-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +174 -169
- data/Gemfile +4 -0
- data/Gemfile.lock +24 -0
- data/README +129 -131
- data/Rakefile +185 -182
- data/appveyor.yml +42 -0
- data/ext/win32/api.c +1092 -1092
- data/lib/win32/api.rb +14 -8
- data/lib/win32/ruby21_32/win32/api.so +0 -0
- data/lib/win32/ruby21_64/win32/api.so +0 -0
- data/lib/win32/ruby22_32/win32/api.so +0 -0
- data/lib/win32/ruby22_64/win32/api.so +0 -0
- data/lib/win32/ruby23_32/win32/api.so +0 -0
- data/lib/win32/ruby23_64/win32/api.so +0 -0
- data/lib/win32/ruby2_32/win32/api.so +0 -0
- data/lib/win32/ruby2_64/win32/api.so +0 -0
- data/test/test_win32_api.rb +145 -145
- data/vendor/bundle/ruby/2.2.0/bin/devkit +23 -0
- data/vendor/bundle/ruby/2.2.0/bin/devkit.bat +6 -0
- data/vendor/bundle/ruby/2.2.0/bin/rake +23 -0
- data/vendor/bundle/ruby/2.2.0/bin/rake.bat +6 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/CHANGELOG +55 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/LICENSE +339 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/README.md +73 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/Rakefile +8 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/colorize.gemspec +35 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize.rb +12 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize/class_methods.rb +116 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/lib/colorize/instance_methods.rb +135 -0
- data/vendor/bundle/ruby/2.2.0/gems/colorize-0.7.7/test/test_colorize.rb +161 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Gemfile +4 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/README.md +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Rakefile +1 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/Rspec-example-matchers.txt +184 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/bin/devkit +87 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/devkit.gemspec +27 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit.rb +18 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/core.rb +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/identity.rb +78 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/ssh_identity.rb +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/lib/devkit/version.rb +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/core_spec.rb +46 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/identity_spec.rb +1 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit/ssh_identity_spec.rb +1 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/devkit_spec.rb +5 -0
- data/vendor/bundle/ruby/2.2.0/gems/devkit-0.1.0/spec/spec_helper.rb +8 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/AUTHORS +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/COPYING +339 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Changelog.md +415 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Gemfile +9 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/INSTALL +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/LICENSE +7 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/README.rdoc +74 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/Rakefile +30 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/TODO +6 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/ansi_colors.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/asking_for_arrays.rb +18 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/basic_usage.rb +75 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/color_scheme.rb +32 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/get_character.rb +12 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/limit.rb +12 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/menus.rb +65 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/overwrite.rb +19 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/page_and_wrap.rb +322 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/password.rb +7 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/repeat_entry.rb +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/trapping_eof.rb +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/using_readline.rb +17 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/highline.gemspec +37 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline.rb +1048 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/color_scheme.rb +134 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/compatibility.rb +16 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/import.rb +41 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/menu.rb +381 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/question.rb +480 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/simulate.rb +48 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/style.rb +192 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/lib/highline/version.rb +4 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/setup.rb +1360 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/site/highline.css +65 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/site/images/logo.png +0 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/site/index.html +58 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/string_methods.rb +32 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_color_scheme.rb +96 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_highline.rb +1402 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_import.rb +52 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_menu.rb +439 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_simulator.rb +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_string_highline.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_style.rb +578 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/BSDL +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/COPYING +57 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/Gemfile +9 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/LEGAL +4 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/README.rdoc +19 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/Rakefile +16 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/benchmarks/bm_yhpg.rb +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/benchmarks/helper.rb +8 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert.rb +338 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert/enable_tracepoint_events.rb +82 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/lib/power_assert/version.rb +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/power_assert.gemspec +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/test/helper.rb +10 -0
- data/vendor/bundle/ruby/2.2.0/gems/power_assert-0.3.0/test/test_power_assert.rb +512 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/CONTRIBUTING.rdoc +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/History.rdoc +719 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/Manifest.txt +154 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/README.rdoc +157 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/Rakefile +82 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/bin/rake +33 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/command_line_usage.rdoc +158 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/glossary.rdoc +42 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rake.1 +141 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rakefile.rdoc +624 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.6.rdoc +37 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.4.rdoc +60 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.5.rdoc +55 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-0.9.6.rdoc +64 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.1.rdoc +58 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.2.rdoc +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake.rb +73 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb +787 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/backtrace.rb +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/clean.rb +76 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/cloneable.rb +16 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/compositepublisher.rb +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/ftptools.rb +137 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/contrib/sshpublisher.rb +60 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/cpu_counter.rb +120 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/default_loader.rb +14 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/dsl_definition.rb +194 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/early_time.rb +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_list.rb +436 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_task.rb +46 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/file_utils.rb +123 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/invocation_chain.rb +56 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/late_time.rb +17 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/linked_list.rb +111 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/loaders/makefile.rb +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/multi_task.rb +13 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/name_space.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/packagetask.rb +199 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/phony.rb +15 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/private_reader.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/promise.rb +99 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/pseudo_status.rb +29 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rake_test_loader.rb +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/scope.rb +42 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task.rb +391 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_arguments.rb +102 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/task_manager.rb +316 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/tasklib.rb +11 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/testtask.rb +204 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/thread_history_display.rb +48 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/thread_pool.rb +163 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/trace_output.rb +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/version.rb +7 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/win32.rb +50 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/rakelib/test_times.rake +25 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/file_creation.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/helper.rb +134 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/support/rakefile_definitions.rb +476 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/support/ruby_runner.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_private_reader.rb +42 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake.rb +40 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_application.rb +659 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_application_options.rb +468 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_backtrace.rb +119 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_clean.rb +61 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_cpu_counter.rb +68 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_definitions.rb +84 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_directory_task.rb +76 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_dsl.rb +40 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_early_time.rb +31 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_creation_task.rb +56 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_list.rb +687 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_list_path_map.rb +15 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_task.rb +197 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_file_utils.rb +318 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_ftp_file.rb +74 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_functional.rb +484 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_invocation_chain.rb +64 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_late_time.rb +18 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_linked_list.rb +84 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_makefile_loader.rb +46 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_multi_task.rb +64 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_name_space.rb +57 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_package_task.rb +79 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map.rb +168 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map_explode.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_path_map_partial.rb +18 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_pseudo_status.rb +21 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_rake_test_loader.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_reduce_compat.rb +26 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_require.rb +40 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_rules.rb +388 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_scope.rb +44 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task.rb +430 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_argument_parsing.rb +119 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_arguments.rb +134 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_manager.rb +178 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_task_with_arguments.rb +172 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_test_task.rb +130 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_thread_pool.rb +145 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_top_level_functions.rb +71 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_rake_win32.rb +72 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_thread_history_display.rb +101 -0
- data/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/test/test_trace_output.rb +52 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/COPYING +64 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/GPL +339 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/LGPL +502 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/PSFL +271 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/README.md +101 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/Rakefile +71 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test-unit.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit.rb +505 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/assertion-failed-error.rb +25 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/assertions.rb +2218 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/attribute-matcher.rb +26 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/attribute.rb +158 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/auto-runner-loader.rb +17 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/autorunner.rb +536 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/code-snippet-fetcher.rb +58 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector.rb +73 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/descendant.rb +19 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/dir.rb +108 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/load.rb +202 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/objectspace.rb +34 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/collector/xml.rb +249 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/color-scheme.rb +198 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/color.rb +134 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/data.rb +262 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/diff.rb +746 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/error.rb +158 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/exception-handler.rb +82 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/failure.rb +169 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/fault-location-detector.rb +100 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/fixture.rb +295 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/notification.rb +136 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/omission.rb +195 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/pending.rb +154 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/priority.rb +192 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/console.rb +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/emacs.rb +8 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/runner/xml.rb +15 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/test-suite-creator.rb +89 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testcase.rb +811 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testresult.rb +132 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/testsuite.rb +175 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/console/outputlevel.rb +15 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/console/testrunner.rb +693 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/emacs/testrunner.rb +49 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunner.rb +53 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunnermediator.rb +114 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/testrunnerutilities.rb +41 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/xml/testrunner.rb +224 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/backtracefilter.rb +59 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/method-owner-finder.rb +28 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/observable.rb +90 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/output.rb +31 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/util/procwrapper.rb +48 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/version.rb +5 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/adder.rb +13 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/subtracter.rb +12 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_adder.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_subtracter.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/sample/test_user.rb +23 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test-descendant.rb +178 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test-load.rb +442 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test_dir.rb +406 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/collector/test_objectspace.rb +100 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header-label.csv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header-label.tsv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header.csv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/header.tsv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/no-header.csv +2 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/no-header.tsv +2 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/fixtures/plus.csv +3 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/run-test.rb +22 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-assertions.rb +2160 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-attribute-matcher.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-attribute.rb +123 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-code-snippet.rb +37 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-color-scheme.rb +82 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-color.rb +47 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-data.rb +303 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-diff.rb +518 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-emacs-runner.rb +60 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-error.rb +26 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-failure.rb +33 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-fault-location-detector.rb +163 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-fixture.rb +713 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-notification.rb +33 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-omission.rb +81 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-pending.rb +70 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-priority.rb +173 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-case.rb +1171 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-result.rb +113 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-suite-creator.rb +97 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/test-test-suite.rb +150 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/testunit-test-util.rb +31 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/ui/test_testrunmediator.rb +20 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test-method-owner-finder.rb +38 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test-output.rb +11 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_backtracefilter.rb +52 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_observable.rb +102 -0
- data/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/test/util/test_procwrapper.rb +36 -0
- data/vendor/bundle/ruby/2.2.0/specifications/colorize-0.7.7.gemspec +38 -0
- data/vendor/bundle/ruby/2.2.0/specifications/devkit-0.1.0.gemspec +46 -0
- data/vendor/bundle/ruby/2.2.0/specifications/highline-1.7.8.gemspec +37 -0
- data/vendor/bundle/ruby/2.2.0/specifications/power_assert-0.3.0.gemspec +41 -0
- data/vendor/bundle/ruby/2.2.0/specifications/rake-11.1.2.gemspec +43 -0
- data/vendor/bundle/ruby/2.2.0/specifications/test-unit-3.1.9.gemspec +47 -0
- data/win32-api.gemspec +27 -27
- metadata +345 -5
- data/lib/win32/ruby18/win32/api.so +0 -0
- data/lib/win32/ruby19/win32/api.so +0 -0
@@ -0,0 +1,134 @@
|
|
1
|
+
# color_scheme.rb
|
2
|
+
#
|
3
|
+
# Created by Jeremy Hinegardner on 2007-01-24
|
4
|
+
# Copyright 2007. All rights reserved
|
5
|
+
#
|
6
|
+
# This is Free Software. See LICENSE and COPYING for details
|
7
|
+
|
8
|
+
class HighLine
|
9
|
+
#
|
10
|
+
# ColorScheme objects encapsulate a named set of colors to be used in the
|
11
|
+
# HighLine.colors() method call. For example, by applying a ColorScheme that
|
12
|
+
# has a <tt>:warning</tt> color then the following could be used:
|
13
|
+
#
|
14
|
+
# colors("This is a warning", :warning)
|
15
|
+
#
|
16
|
+
# A ColorScheme contains named sets of HighLine color constants.
|
17
|
+
#
|
18
|
+
# Example: Instantiating a color scheme, applying it to HighLine,
|
19
|
+
# and using it:
|
20
|
+
#
|
21
|
+
# ft = HighLine::ColorScheme.new do |cs|
|
22
|
+
# cs[:headline] = [ :bold, :yellow, :on_black ]
|
23
|
+
# cs[:horizontal_line] = [ :bold, :white ]
|
24
|
+
# cs[:even_row] = [ :green ]
|
25
|
+
# cs[:odd_row] = [ :magenta ]
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# HighLine.color_scheme = ft
|
29
|
+
# say("<%= color('Headline', :headline) %>")
|
30
|
+
# say("<%= color('-'*20, :horizontal_line) %>")
|
31
|
+
# i = true
|
32
|
+
# ("A".."D").each do |row|
|
33
|
+
# if i then
|
34
|
+
# say("<%= color('#{row}', :even_row ) %>")
|
35
|
+
# else
|
36
|
+
# say("<%= color('#{row}', :odd_row) %>")
|
37
|
+
# end
|
38
|
+
# i = !i
|
39
|
+
# end
|
40
|
+
#
|
41
|
+
#
|
42
|
+
class ColorScheme
|
43
|
+
#
|
44
|
+
# Create an instance of HighLine::ColorScheme. The customization can
|
45
|
+
# happen as a passed in Hash or via the yielded block. Keys are
|
46
|
+
# converted to <tt>:symbols</tt> and values are converted to HighLine
|
47
|
+
# constants.
|
48
|
+
#
|
49
|
+
def initialize( h = nil )
|
50
|
+
@scheme = Hash.new
|
51
|
+
load_from_hash(h) unless h.nil?
|
52
|
+
yield self if block_given?
|
53
|
+
end
|
54
|
+
|
55
|
+
# Load multiple colors from key/value pairs.
|
56
|
+
def load_from_hash( h )
|
57
|
+
h.each_pair do |color_tag, constants|
|
58
|
+
self[color_tag] = constants
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Does this color scheme include the given tag name?
|
63
|
+
def include?( color_tag )
|
64
|
+
@scheme.keys.include?(to_symbol(color_tag))
|
65
|
+
end
|
66
|
+
|
67
|
+
# Allow the scheme to be accessed like a Hash.
|
68
|
+
def []( color_tag )
|
69
|
+
@scheme[to_symbol(color_tag)]
|
70
|
+
end
|
71
|
+
|
72
|
+
# Retrieve the original form of the scheme
|
73
|
+
def definition( color_tag )
|
74
|
+
style = @scheme[to_symbol(color_tag)]
|
75
|
+
style && style.list
|
76
|
+
end
|
77
|
+
|
78
|
+
# Retrieve the keys in the scheme
|
79
|
+
def keys
|
80
|
+
@scheme.keys
|
81
|
+
end
|
82
|
+
|
83
|
+
# Allow the scheme to be set like a Hash.
|
84
|
+
def []=( color_tag, constants )
|
85
|
+
@scheme[to_symbol(color_tag)] = HighLine::Style.new(:name=>color_tag.to_s.downcase.to_sym,
|
86
|
+
:list=>constants, :no_index=>true)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Retrieve the color scheme hash (in original definition format)
|
90
|
+
def to_hash
|
91
|
+
@scheme.inject({}) { |hsh, pair| key, value = pair; hsh[key] = value.list; hsh }
|
92
|
+
end
|
93
|
+
|
94
|
+
|
95
|
+
private
|
96
|
+
|
97
|
+
# Return a normalized representation of a color name.
|
98
|
+
def to_symbol( t )
|
99
|
+
t.to_s.downcase
|
100
|
+
end
|
101
|
+
|
102
|
+
# Return a normalized representation of a color setting.
|
103
|
+
def to_constant( v )
|
104
|
+
v = v.to_s if v.is_a?(Symbol)
|
105
|
+
if v.is_a?(::String) then
|
106
|
+
HighLine.const_get(v.upcase)
|
107
|
+
else
|
108
|
+
v
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# A sample ColorScheme.
|
114
|
+
class SampleColorScheme < ColorScheme
|
115
|
+
#
|
116
|
+
# Builds the sample scheme with settings for <tt>:critical</tt>,
|
117
|
+
# <tt>:error</tt>, <tt>:warning</tt>, <tt>:notice</tt>, <tt>:info</tt>,
|
118
|
+
# <tt>:debug</tt>, <tt>:row_even</tt>, and <tt>:row_odd</tt> colors.
|
119
|
+
#
|
120
|
+
def initialize( h = nil )
|
121
|
+
scheme = {
|
122
|
+
:critical => [ :yellow, :on_red ],
|
123
|
+
:error => [ :bold, :red ],
|
124
|
+
:warning => [ :bold, :yellow ],
|
125
|
+
:notice => [ :bold, :magenta ],
|
126
|
+
:info => [ :bold, :cyan ],
|
127
|
+
:debug => [ :bold, :green ],
|
128
|
+
:row_even => [ :cyan ],
|
129
|
+
:row_odd => [ :magenta ]
|
130
|
+
}
|
131
|
+
super(scheme)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
unless STDIN.respond_to? :getbyte
|
2
|
+
class IO
|
3
|
+
alias_method :getbyte, :getc
|
4
|
+
end
|
5
|
+
|
6
|
+
class StringIO
|
7
|
+
alias_method :getbyte, :getc
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
unless "".respond_to? :each_line
|
12
|
+
# Not a perfect translation, but sufficient for our needs.
|
13
|
+
class String
|
14
|
+
alias_method :each_line, :each
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# import.rb
|
2
|
+
#
|
3
|
+
# Created by James Edward Gray II on 2005-04-26.
|
4
|
+
# Copyright 2005 Gray Productions. All rights reserved.
|
5
|
+
#
|
6
|
+
# This is Free Software. See LICENSE and COPYING for details.
|
7
|
+
|
8
|
+
require "highline"
|
9
|
+
require "forwardable"
|
10
|
+
|
11
|
+
$terminal = HighLine.new
|
12
|
+
|
13
|
+
#
|
14
|
+
# <tt>require "highline/import"</tt> adds shortcut methods to Kernel, making
|
15
|
+
# agree(), ask(), choose() and say() globally available. This is handy for
|
16
|
+
# quick and dirty input and output. These methods use the HighLine object in
|
17
|
+
# the global variable <tt>$terminal</tt>, which is initialized to used
|
18
|
+
# <tt>$stdin</tt> and <tt>$stdout</tt> (you are free to change this).
|
19
|
+
# Otherwise, these methods are identical to their HighLine counterparts, see that
|
20
|
+
# class for detailed explanations.
|
21
|
+
#
|
22
|
+
module Kernel
|
23
|
+
extend Forwardable
|
24
|
+
def_delegators :$terminal, :agree, :ask, :choose, :say
|
25
|
+
end
|
26
|
+
|
27
|
+
class Object
|
28
|
+
#
|
29
|
+
# Tries this object as a _first_answer_ for a HighLine::Question. See that
|
30
|
+
# attribute for details.
|
31
|
+
#
|
32
|
+
# *Warning*: This Object will be passed to String() before set.
|
33
|
+
#
|
34
|
+
def or_ask( *args, &details )
|
35
|
+
ask(*args) do |question|
|
36
|
+
question.first_answer = String(self) unless nil?
|
37
|
+
|
38
|
+
details.call(question) unless details.nil?
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,381 @@
|
|
1
|
+
# menu.rb
|
2
|
+
#
|
3
|
+
# Created by Gregory Thomas Brown on 2005-05-10.
|
4
|
+
# Copyright 2005. All rights reserved.
|
5
|
+
#
|
6
|
+
# This is Free Software. See LICENSE and COPYING for details.
|
7
|
+
|
8
|
+
require "highline/question"
|
9
|
+
|
10
|
+
class HighLine
|
11
|
+
#
|
12
|
+
# Menu objects encapsulate all the details of a call to HighLine.choose().
|
13
|
+
# Using the accessors and Menu.choice() and Menu.choices(), the block passed
|
14
|
+
# to HighLine.choose() can detail all aspects of menu display and control.
|
15
|
+
#
|
16
|
+
class Menu < Question
|
17
|
+
#
|
18
|
+
# Create an instance of HighLine::Menu. All customization is done
|
19
|
+
# through the passed block, which should call accessors and choice() and
|
20
|
+
# choices() as needed to define the Menu. Note that Menus are also
|
21
|
+
# Questions, so all that functionality is available to the block as
|
22
|
+
# well.
|
23
|
+
#
|
24
|
+
def initialize( )
|
25
|
+
#
|
26
|
+
# Initialize Question objects with ignored values, we'll
|
27
|
+
# adjust ours as needed.
|
28
|
+
#
|
29
|
+
super("Ignored", [ ], &nil) # avoiding passing the block along
|
30
|
+
|
31
|
+
@items = [ ]
|
32
|
+
@hidden_items = [ ]
|
33
|
+
@help = Hash.new("There's no help for that topic.")
|
34
|
+
|
35
|
+
@index = :number
|
36
|
+
@index_suffix = ". "
|
37
|
+
@select_by = :index_or_name
|
38
|
+
@flow = :rows
|
39
|
+
@list_option = nil
|
40
|
+
@header = nil
|
41
|
+
@prompt = "? "
|
42
|
+
@layout = :list
|
43
|
+
@shell = false
|
44
|
+
@nil_on_handled = false
|
45
|
+
|
46
|
+
# Override Questions responses, we'll set our own.
|
47
|
+
@responses = { }
|
48
|
+
# Context for action code.
|
49
|
+
@highline = nil
|
50
|
+
|
51
|
+
yield self if block_given?
|
52
|
+
|
53
|
+
init_help if @shell and not @help.empty?
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# An _index_ to append to each menu item in display. See
|
58
|
+
# Menu.index=() for details.
|
59
|
+
#
|
60
|
+
attr_reader :index
|
61
|
+
#
|
62
|
+
# The String placed between an _index_ and a menu item. Defaults to
|
63
|
+
# ". ". Switches to " ", when _index_ is set to a String (like "-").
|
64
|
+
#
|
65
|
+
attr_accessor :index_suffix
|
66
|
+
#
|
67
|
+
# The _select_by_ attribute controls how the user is allowed to pick a
|
68
|
+
# menu item. The available choices are:
|
69
|
+
#
|
70
|
+
# <tt>:index</tt>:: The user is allowed to type the numerical
|
71
|
+
# or alphabetical index for their selection.
|
72
|
+
# <tt>:index_or_name</tt>:: Allows both methods from the
|
73
|
+
# <tt>:index</tt> option and the
|
74
|
+
# <tt>:name</tt> option.
|
75
|
+
# <tt>:name</tt>:: Menu items are selected by typing a portion
|
76
|
+
# of the item name that will be
|
77
|
+
# auto-completed.
|
78
|
+
#
|
79
|
+
attr_accessor :select_by
|
80
|
+
#
|
81
|
+
# This attribute is passed directly on as the mode to HighLine.list() by
|
82
|
+
# all the preset layouts. See that method for appropriate settings.
|
83
|
+
#
|
84
|
+
attr_accessor :flow
|
85
|
+
#
|
86
|
+
# This setting is passed on as the third parameter to HighLine.list()
|
87
|
+
# by all the preset layouts. See that method for details of its
|
88
|
+
# effects. Defaults to +nil+.
|
89
|
+
#
|
90
|
+
attr_accessor :list_option
|
91
|
+
#
|
92
|
+
# Used by all the preset layouts to display title and/or introductory
|
93
|
+
# information, when set. Defaults to +nil+.
|
94
|
+
#
|
95
|
+
attr_accessor :header
|
96
|
+
#
|
97
|
+
# Used by all the preset layouts to ask the actual question to fetch a
|
98
|
+
# menu selection from the user. Defaults to "? ".
|
99
|
+
#
|
100
|
+
attr_accessor :prompt
|
101
|
+
#
|
102
|
+
# An ERb _layout_ to use when displaying this Menu object. See
|
103
|
+
# Menu.layout=() for details.
|
104
|
+
#
|
105
|
+
attr_reader :layout
|
106
|
+
#
|
107
|
+
# When set to +true+, responses are allowed to be an entire line of
|
108
|
+
# input, including details beyond the command itself. Only the first
|
109
|
+
# "word" of input will be matched against the menu choices, but both the
|
110
|
+
# command selected and the rest of the line will be passed to provided
|
111
|
+
# action blocks. Defaults to +false+.
|
112
|
+
#
|
113
|
+
attr_accessor :shell
|
114
|
+
#
|
115
|
+
# When +true+, any selected item handled by provided action code will
|
116
|
+
# return +nil+, instead of the results to the action code. This may
|
117
|
+
# prove handy when dealing with mixed menus where only the names of
|
118
|
+
# items without any code (and +nil+, of course) will be returned.
|
119
|
+
# Defaults to +false+.
|
120
|
+
#
|
121
|
+
attr_accessor :nil_on_handled
|
122
|
+
|
123
|
+
#
|
124
|
+
# Adds _name_ to the list of available menu items. Menu items will be
|
125
|
+
# displayed in the order they are added.
|
126
|
+
#
|
127
|
+
# An optional _action_ can be associated with this name and if provided,
|
128
|
+
# it will be called if the item is selected. The result of the method
|
129
|
+
# will be returned, unless _nil_on_handled_ is set (when you would get
|
130
|
+
# +nil+ instead). In _shell_ mode, a provided block will be passed the
|
131
|
+
# command chosen and any details that followed the command. Otherwise,
|
132
|
+
# just the command is passed. The <tt>@highline</tt> variable is set to
|
133
|
+
# the current HighLine context before the action code is called and can
|
134
|
+
# thus be used for adding output and the like.
|
135
|
+
#
|
136
|
+
def choice( name, help = nil, &action )
|
137
|
+
@items << [name, action]
|
138
|
+
|
139
|
+
@help[name.to_s.downcase] = help unless help.nil?
|
140
|
+
update_responses # rebuild responses based on our settings
|
141
|
+
end
|
142
|
+
|
143
|
+
#
|
144
|
+
# A shortcut for multiple calls to the sister method choice(). <b>Be
|
145
|
+
# warned:</b> An _action_ set here will apply to *all* provided
|
146
|
+
# _names_. This is considered to be a feature, so you can easily
|
147
|
+
# hand-off interface processing to a different chunk of code.
|
148
|
+
#
|
149
|
+
def choices( *names, &action )
|
150
|
+
names.each { |n| choice(n, &action) }
|
151
|
+
end
|
152
|
+
|
153
|
+
# Identical to choice(), but the item will not be listed for the user.
|
154
|
+
def hidden( name, help = nil, &action )
|
155
|
+
@hidden_items << [name, action]
|
156
|
+
|
157
|
+
@help[name.to_s.downcase] = help unless help.nil?
|
158
|
+
end
|
159
|
+
|
160
|
+
#
|
161
|
+
# Sets the indexing style for this Menu object. Indexes are appended to
|
162
|
+
# menu items, when displayed in list form. The available settings are:
|
163
|
+
#
|
164
|
+
# <tt>:number</tt>:: Menu items will be indexed numerically, starting
|
165
|
+
# with 1. This is the default method of indexing.
|
166
|
+
# <tt>:letter</tt>:: Items will be indexed alphabetically, starting
|
167
|
+
# with a.
|
168
|
+
# <tt>:none</tt>:: No index will be appended to menu items.
|
169
|
+
# <i>any String</i>:: Will be used as the literal _index_.
|
170
|
+
#
|
171
|
+
# Setting the _index_ to <tt>:none</tt> or a literal String also adjusts
|
172
|
+
# _index_suffix_ to a single space and _select_by_ to <tt>:name</tt>.
|
173
|
+
# Because of this, you should make a habit of setting the _index_ first.
|
174
|
+
#
|
175
|
+
def index=( style )
|
176
|
+
@index = style
|
177
|
+
|
178
|
+
# Default settings.
|
179
|
+
if @index == :none or @index.is_a?(::String)
|
180
|
+
@index_suffix = " "
|
181
|
+
@select_by = :name
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
#
|
186
|
+
# Initializes the help system by adding a <tt>:help</tt> choice, some
|
187
|
+
# action code, and the default help listing.
|
188
|
+
#
|
189
|
+
def init_help( )
|
190
|
+
return if @items.include?(:help)
|
191
|
+
|
192
|
+
topics = @help.keys.sort
|
193
|
+
help_help = @help.include?("help") ? @help["help"] :
|
194
|
+
"This command will display helpful messages about " +
|
195
|
+
"functionality, like this one. To see the help for " +
|
196
|
+
"a specific topic enter:\n\thelp [TOPIC]\nTry asking " +
|
197
|
+
"for help on any of the following:\n\n" +
|
198
|
+
"<%= list(#{topics.inspect}, :columns_across) %>"
|
199
|
+
choice(:help, help_help) do |command, topic|
|
200
|
+
topic.strip!
|
201
|
+
topic.downcase!
|
202
|
+
if topic.empty?
|
203
|
+
@highline.say(@help["help"])
|
204
|
+
else
|
205
|
+
@highline.say("= #{topic}\n\n#{@help[topic]}")
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
#
|
211
|
+
# Used to set help for arbitrary topics. Use the topic <tt>"help"</tt>
|
212
|
+
# to override the default message.
|
213
|
+
#
|
214
|
+
def help( topic, help )
|
215
|
+
@help[topic] = help
|
216
|
+
end
|
217
|
+
|
218
|
+
#
|
219
|
+
# Setting a _layout_ with this method also adjusts some other attributes
|
220
|
+
# of the Menu object, to ideal defaults for the chosen _layout_. To
|
221
|
+
# account for that, you probably want to set a _layout_ first in your
|
222
|
+
# configuration block, if needed.
|
223
|
+
#
|
224
|
+
# Accepted settings for _layout_ are:
|
225
|
+
#
|
226
|
+
# <tt>:list</tt>:: The default _layout_. The _header_ if set
|
227
|
+
# will appear at the top on its own line with
|
228
|
+
# a trailing colon. Then the list of menu
|
229
|
+
# items will follow. Finally, the _prompt_
|
230
|
+
# will be used as the ask()-like question.
|
231
|
+
# <tt>:one_line</tt>:: A shorter _layout_ that fits on one line.
|
232
|
+
# The _header_ comes first followed by a
|
233
|
+
# colon and spaces, then the _prompt_ with menu
|
234
|
+
# items between trailing parenthesis.
|
235
|
+
# <tt>:menu_only</tt>:: Just the menu items, followed up by a likely
|
236
|
+
# short _prompt_.
|
237
|
+
# <i>any ERb String</i>:: Will be taken as the literal _layout_. This
|
238
|
+
# String can access <tt>@header</tt>,
|
239
|
+
# <tt>@menu</tt> and <tt>@prompt</tt>, but is
|
240
|
+
# otherwise evaluated in the typical HighLine
|
241
|
+
# context, to provide access to utilities like
|
242
|
+
# HighLine.list() primarily.
|
243
|
+
#
|
244
|
+
# If set to either <tt>:one_line</tt>, or <tt>:menu_only</tt>, _index_
|
245
|
+
# will default to <tt>:none</tt> and _flow_ will default to
|
246
|
+
# <tt>:inline</tt>.
|
247
|
+
#
|
248
|
+
def layout=( new_layout )
|
249
|
+
@layout = new_layout
|
250
|
+
|
251
|
+
# Default settings.
|
252
|
+
case @layout
|
253
|
+
when :one_line, :menu_only
|
254
|
+
self.index = :none
|
255
|
+
@flow = :inline
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
#
|
260
|
+
# This method returns all possible options for auto-completion, based
|
261
|
+
# on the settings of _index_ and _select_by_.
|
262
|
+
#
|
263
|
+
def options( )
|
264
|
+
# add in any hidden menu commands
|
265
|
+
@items.concat(@hidden_items)
|
266
|
+
|
267
|
+
by_index = if @index == :letter
|
268
|
+
l_index = "`"
|
269
|
+
@items.map { "#{l_index.succ!}" }
|
270
|
+
else
|
271
|
+
(1 .. @items.size).collect { |s| String(s) }
|
272
|
+
end
|
273
|
+
by_name = @items.collect { |c| c.first }
|
274
|
+
|
275
|
+
case @select_by
|
276
|
+
when :index then
|
277
|
+
by_index
|
278
|
+
when :name
|
279
|
+
by_name
|
280
|
+
else
|
281
|
+
by_index + by_name
|
282
|
+
end
|
283
|
+
ensure
|
284
|
+
# make sure the hidden items are removed, before we return
|
285
|
+
@items.slice!(@items.size - @hidden_items.size, @hidden_items.size)
|
286
|
+
end
|
287
|
+
|
288
|
+
#
|
289
|
+
# This method processes the auto-completed user selection, based on the
|
290
|
+
# rules for this Menu object. If an action was provided for the
|
291
|
+
# selection, it will be executed as described in Menu.choice().
|
292
|
+
#
|
293
|
+
def select( highline_context, selection, details = nil )
|
294
|
+
# add in any hidden menu commands
|
295
|
+
@items.concat(@hidden_items)
|
296
|
+
|
297
|
+
# Find the selected action.
|
298
|
+
name, action = if selection =~ /^\d+$/
|
299
|
+
@items[selection.to_i - 1]
|
300
|
+
else
|
301
|
+
l_index = "`"
|
302
|
+
index = @items.map { "#{l_index.succ!}" }.index(selection)
|
303
|
+
@items.find { |c| c.first == selection } or @items[index]
|
304
|
+
end
|
305
|
+
|
306
|
+
# Run or return it.
|
307
|
+
if not action.nil?
|
308
|
+
@highline = highline_context
|
309
|
+
if @shell
|
310
|
+
result = action.call(name, details)
|
311
|
+
else
|
312
|
+
result = action.call(name)
|
313
|
+
end
|
314
|
+
@nil_on_handled ? nil : result
|
315
|
+
elsif action.nil?
|
316
|
+
name
|
317
|
+
else
|
318
|
+
nil
|
319
|
+
end
|
320
|
+
ensure
|
321
|
+
# make sure the hidden items are removed, before we return
|
322
|
+
@items.slice!(@items.size - @hidden_items.size, @hidden_items.size)
|
323
|
+
end
|
324
|
+
|
325
|
+
#
|
326
|
+
# Allows Menu objects to pass as Arrays, for use with HighLine.list().
|
327
|
+
# This method returns all menu items to be displayed, complete with
|
328
|
+
# indexes.
|
329
|
+
#
|
330
|
+
def to_ary( )
|
331
|
+
case @index
|
332
|
+
when :number
|
333
|
+
@items.map { |c| "#{@items.index(c) + 1}#{@index_suffix}#{c.first}" }
|
334
|
+
when :letter
|
335
|
+
l_index = "`"
|
336
|
+
@items.map { |c| "#{l_index.succ!}#{@index_suffix}#{c.first}" }
|
337
|
+
when :none
|
338
|
+
@items.map { |c| "#{c.first}" }
|
339
|
+
else
|
340
|
+
@items.map { |c| "#{index}#{@index_suffix}#{c.first}" }
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
#
|
345
|
+
# Allows Menu to behave as a String, just like Question. Returns the
|
346
|
+
# _layout_ to be rendered, which is used by HighLine.say().
|
347
|
+
#
|
348
|
+
def to_s( )
|
349
|
+
case @layout
|
350
|
+
when :list
|
351
|
+
'<%= if @header.nil? then '' else "#{@header}:\n" end %>' +
|
352
|
+
"<%= list( @menu, #{@flow.inspect},
|
353
|
+
#{@list_option.inspect} ) %>" +
|
354
|
+
"<%= @prompt %>"
|
355
|
+
when :one_line
|
356
|
+
'<%= if @header.nil? then '' else "#{@header}: " end %>' +
|
357
|
+
"<%= @prompt %>" +
|
358
|
+
"(<%= list( @menu, #{@flow.inspect},
|
359
|
+
#{@list_option.inspect} ) %>)" +
|
360
|
+
"<%= @prompt[/\s*$/] %>"
|
361
|
+
when :menu_only
|
362
|
+
"<%= list( @menu, #{@flow.inspect},
|
363
|
+
#{@list_option.inspect} ) %><%= @prompt %>"
|
364
|
+
else
|
365
|
+
@layout
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
#
|
370
|
+
# This method will update the intelligent responses to account for
|
371
|
+
# Menu specific differences. Calls the superclass' (Question's)
|
372
|
+
# build_responses method, overriding its default arguments to specify
|
373
|
+
# 'options' will be used to populate choice lists, and that
|
374
|
+
# the newly built hash will predominate over the preexisting hash
|
375
|
+
# for any keys that are the same.
|
376
|
+
#
|
377
|
+
def update_responses( )
|
378
|
+
build_responses(options, true)
|
379
|
+
end
|
380
|
+
end
|
381
|
+
end
|