vagrant-unbundled 1.9.7.1 → 1.9.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/Gemfile.lock +10 -6
- data/contrib/bash/completion.sh +1 -1
- data/contrib/sudoers/linux-ubuntu +3 -4
- data/lib/vagrant/errors.rb +8 -0
- data/lib/vagrant/machine.rb +2 -0
- data/lib/vagrant/util/platform.rb +1 -1
- data/lib/vagrant/util/powershell.rb +42 -13
- data/lib/vagrant/util/safe_exec.rb +13 -2
- data/lib/vagrant/util/ssh.rb +11 -1
- data/plugins/commands/box/command/update.rb +12 -7
- data/plugins/commands/login/client.rb +15 -6
- data/plugins/commands/login/command.rb +13 -3
- data/plugins/commands/up/command.rb +9 -0
- data/plugins/commands/validate/command.rb +4 -4
- data/plugins/guests/darwin/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/freebsd/cap/configure_networks.rb +1 -1
- data/plugins/guests/freebsd/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/linux/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/netbsd/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/openbsd/cap/shell_expand_guest_path.rb +2 -2
- data/plugins/guests/windows/cap/public_key.rb +21 -45
- data/plugins/kernel_v2/config/ssh_connect.rb +3 -0
- data/plugins/providers/docker/config.rb +4 -0
- data/plugins/providers/docker/driver/compose.rb +11 -4
- data/plugins/providers/hyperv/action/wait_for_ip_address.rb +15 -11
- data/plugins/providers/hyperv/scripts/get_network_config.ps1 +24 -9
- data/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +18 -0
- data/plugins/provisioners/ansible/provisioner/host.rb +1 -1
- data/plugins/provisioners/chef/cap/debian/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/freebsd/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/omnios/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/redhat/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/suse/chef_install.rb +2 -2
- data/plugins/provisioners/chef/cap/windows/chef_install.rb +2 -2
- data/plugins/provisioners/chef/config/base.rb +17 -0
- data/plugins/provisioners/chef/config/chef_zero.rb +7 -0
- data/plugins/provisioners/chef/installer.rb +8 -7
- data/plugins/provisioners/chef/omnibus.rb +4 -6
- data/plugins/provisioners/chef/provisioner/base.rb +1 -0
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +2 -1
- data/plugins/provisioners/file/provisioner.rb +18 -2
- data/plugins/provisioners/puppet/provisioner/puppet.rb +0 -2
- data/plugins/provisioners/salt/bootstrap-salt.sh +9 -5
- data/plugins/provisioners/shell/provisioner.rb +1 -1
- data/plugins/synced_folders/rsync/command/rsync_auto.rb +6 -1
- data/plugins/synced_folders/rsync/helper.rb +10 -0
- data/templates/locales/en.yml +27 -1
- data/templates/locales/providers_docker.yml +2 -0
- data/test/unit/base.rb +1 -3
- data/test/unit/plugins/commands/box/command/add_test.rb +3 -3
- data/test/unit/plugins/commands/box/command/remove_test.rb +6 -6
- data/test/unit/plugins/commands/box/command/repackage_test.rb +2 -4
- data/test/unit/plugins/commands/box/command/update_test.rb +36 -14
- data/test/unit/plugins/commands/init/command_test.rb +1 -1
- data/test/unit/plugins/commands/list-commands/command_test.rb +2 -2
- data/test/unit/plugins/commands/login/client_test.rb +5 -1
- data/test/unit/plugins/commands/package/command_test.rb +1 -1
- data/test/unit/plugins/commands/plugin/action/expunge_plugins_test.rb +1 -1
- data/test/unit/plugins/commands/plugin/action/install_gem_test.rb +3 -3
- data/test/unit/plugins/commands/plugin/action/plugin_exists_check_test.rb +3 -3
- data/test/unit/plugins/commands/plugin/action/uninstall_plugin_test.rb +1 -1
- data/test/unit/plugins/commands/plugin/action/update_gems_test.rb +2 -2
- data/test/unit/plugins/commands/port/command_test.rb +3 -3
- data/test/unit/plugins/commands/push/command_test.rb +1 -1
- data/test/unit/plugins/commands/snapshot/command/list_test.rb +2 -3
- data/test/unit/plugins/commands/ssh_config/command_test.rb +1 -1
- data/test/unit/plugins/commands/up/command_test.rb +69 -2
- data/test/unit/plugins/commands/validate/command_test.rb +47 -1
- data/test/unit/plugins/communicators/ssh/communicator_test.rb +5 -5
- data/test/unit/plugins/communicators/winrm/communicator_test.rb +6 -6
- data/test/unit/plugins/communicators/winrm/helper_test.rb +24 -23
- data/test/unit/plugins/communicators/winssh/communicator_test.rb +5 -5
- data/test/unit/plugins/guests/darwin/cap/shell_expand_guest_path_test.rb +43 -0
- data/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb +1 -1
- data/test/unit/plugins/guests/freebsd/cap/shell_expand_guest_path_test.rb +44 -0
- data/test/unit/plugins/guests/linux/cap/shell_expand_guest_path_test.rb +43 -0
- data/test/unit/plugins/guests/netbsd/cap/shell_expand_guest_path_test.rb +43 -0
- data/test/unit/plugins/guests/omnios/cap/mount_nfs_folder_test.rb +1 -3
- data/test/unit/plugins/guests/openbsd/cap/shell_expand_guest_path_test.rb +43 -0
- data/test/unit/plugins/guests/smartos/cap/change_host_name_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/configure_networks_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/halt_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/insert_public_key_test.rb +1 -1
- data/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/rsync_test.rb +2 -2
- data/test/unit/plugins/guests/windows/cap/insert_public_key_test.rb +2 -2
- data/test/unit/plugins/guests/windows/cap/remove_public_key_test.rb +4 -3
- data/test/unit/plugins/guests/windows/config_test.rb +1 -1
- data/test/unit/plugins/guests/windows/guest_network_test.rb +2 -2
- data/test/unit/plugins/hosts/linux/cap/nfs_test.rb +2 -0
- data/test/unit/plugins/kernel_v2/config/push_test.rb +1 -1
- data/test/unit/plugins/kernel_v2/config/vm_test.rb +7 -7
- data/test/unit/plugins/providers/docker/action/create_test.rb +1 -1
- data/test/unit/plugins/providers/docker/command/exec_test.rb +1 -1
- data/test/unit/plugins/providers/docker/config_test.rb +23 -4
- data/test/unit/plugins/providers/docker/driver_compose_test.rb +60 -30
- data/test/unit/plugins/providers/docker/driver_test.rb +31 -31
- data/test/unit/plugins/providers/docker/synced_folder_test.rb +3 -3
- data/test/unit/plugins/providers/hyperv/provider_test.rb +19 -19
- data/test/unit/plugins/providers/virtualbox/action/network_fix_ipv6_test.rb +2 -2
- data/test/unit/plugins/providers/virtualbox/action/network_test.rb +1 -1
- data/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb +34 -8
- data/test/unit/plugins/providers/virtualbox/action/prepare_nfs_valid_ids_test.rb +3 -3
- data/test/unit/plugins/providers/virtualbox/cap_test.rb +2 -2
- data/test/unit/plugins/providers/virtualbox/config_test.rb +6 -6
- data/test/unit/plugins/providers/virtualbox/synced_folder_test.rb +6 -8
- data/test/unit/plugins/provisioners/ansible/config/guest_test.rb +1 -1
- data/test/unit/plugins/provisioners/ansible/config/host_test.rb +4 -4
- data/test/unit/plugins/provisioners/ansible/config/shared.rb +2 -2
- data/test/unit/plugins/provisioners/ansible/provisioner_test.rb +165 -157
- data/test/unit/plugins/provisioners/chef/command_builder_test.rb +2 -2
- data/test/unit/plugins/provisioners/chef/config/base_test.rb +13 -0
- data/test/unit/plugins/provisioners/chef/config/chef_zero_test.rb +11 -0
- data/test/unit/plugins/provisioners/chef/omnibus_test.rb +17 -7
- data/test/unit/plugins/provisioners/docker/config_test.rb +2 -1
- data/test/unit/plugins/provisioners/docker/provisioner_test.rb +13 -13
- data/test/unit/plugins/provisioners/file/provisioner_test.rb +32 -14
- data/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb +51 -0
- data/test/unit/plugins/provisioners/salt/provisioner_test.rb +5 -5
- data/test/unit/plugins/provisioners/shell/provisioner_test.rb +35 -4
- data/test/unit/plugins/pushes/ftp/adapter_test.rb +1 -0
- data/test/unit/plugins/synced_folders/nfs/action_cleanup_test.rb +1 -1
- data/test/unit/plugins/synced_folders/nfs/config_test.rb +1 -1
- data/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb +44 -12
- data/test/unit/plugins/synced_folders/rsync/command/rsync_test.rb +5 -5
- data/test/unit/plugins/synced_folders/rsync/helper_test.rb +47 -29
- data/test/unit/plugins/synced_folders/rsync/synced_folder_test.rb +5 -5
- data/test/unit/vagrant/action/builtin/box_add_test.rb +27 -27
- data/test/unit/vagrant/action/builtin/box_check_outdated_test.rb +10 -10
- data/test/unit/vagrant/action/builtin/box_remove_test.rb +15 -15
- data/test/unit/vagrant/action/builtin/confirm_test.rb +1 -1
- data/test/unit/vagrant/action/builtin/graceful_halt_test.rb +2 -2
- data/test/unit/vagrant/action/builtin/handle_box_test.rb +8 -8
- data/test/unit/vagrant/action/builtin/handle_forwarded_port_collisions_test.rb +1 -1
- data/test/unit/vagrant/action/builtin/is_env_set_test.rb +2 -2
- data/test/unit/vagrant/action/builtin/is_state_test.rb +6 -6
- data/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb +6 -6
- data/test/unit/vagrant/action/builtin/provision_test.rb +1 -1
- data/test/unit/vagrant/action/builtin/provisioner_cleanup_test.rb +1 -1
- data/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb +6 -6
- data/test/unit/vagrant/action/builtin/synced_folders_test.rb +3 -3
- data/test/unit/vagrant/batch_action_test.rb +2 -2
- data/test/unit/vagrant/box_collection_test.rb +1 -1
- data/test/unit/vagrant/box_test.rb +6 -6
- data/test/unit/vagrant/capability_host_test.rb +3 -3
- data/test/unit/vagrant/cli_test.rb +3 -3
- data/test/unit/vagrant/environment_test.rb +21 -20
- data/test/unit/vagrant/guest_test.rb +7 -7
- data/test/unit/vagrant/machine_index_test.rb +4 -4
- data/test/unit/vagrant/machine_test.rb +28 -17
- data/test/unit/vagrant/plugin/manager_test.rb +12 -12
- data/test/unit/vagrant/plugin/state_file_test.rb +2 -2
- data/test/unit/vagrant/plugin/v1/command_test.rb +9 -8
- data/test/unit/vagrant/plugin/v2/command_test.rb +54 -43
- data/test/unit/vagrant/plugin/v2/plugin_test.rb +4 -3
- data/test/unit/vagrant/plugin/v2/provider_test.rb +3 -3
- data/test/unit/vagrant/shared_helpers_test.rb +6 -6
- data/test/unit/vagrant/ui_test.rb +21 -21
- data/test/unit/vagrant/util/downloader_test.rb +7 -7
- data/test/unit/vagrant/util/ssh_test.rb +41 -5
- data/test/unit/vagrant/util/subprocess_test.rb +7 -7
- data/test/unit/vagrant_test.rb +9 -9
- data/vagrant.gemspec +3 -2
- data/vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/vagrant-spec.gemspec +1 -1
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.gitignore +7 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.rspec +2 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.travis.yml +5 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/CONTRIBUTORS.md +19 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Gemfile +12 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Gemfile.lock +44 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Guardfile +10 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/README.md +134 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Rakefile +10 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/fake_ftp.gemspec +22 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp.rb +5 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/file.rb +34 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/server.rb +340 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/version.rb +3 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/fixtures/invisible_bike.jpg +0 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/fixtures/text_file.txt +1 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/functional/server_spec.rb +468 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/integration/server_spec.rb +81 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/models/fake_ftp/file_spec.rb +102 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/models/fake_ftp/server_spec.rb +76 -0
- data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/spec_helper.rb +18 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.gitignore +14 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.rubocop.yml +57 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.travis.yml +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/CONTRIBUTING.rdoc +36 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/Gemfile +3 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/History.rdoc +2247 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/README.rdoc +156 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/Rakefile +38 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/appveyor.yml +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/bin/console +7 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/bin/setup +6 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/command_line_usage.rdoc +158 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/glossary.rdoc +42 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rake.1 +156 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rakefile.rdoc +622 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake +27 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake.rb +70 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/application.rb +785 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/backtrace.rb +23 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/clean.rb +77 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/cloneable.rb +16 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/cpu_counter.rb +106 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/default_loader.rb +14 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/dsl_definition.rb +194 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/early_time.rb +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/ext/core.rb +25 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/ext/string.rb +175 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_list.rb +434 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_task.rb +46 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb +136 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_utils_ext.rb +144 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/invocation_chain.rb +56 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/late_time.rb +17 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/linked_list.rb +111 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/loaders/makefile.rb +53 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/multi_task.rb +49 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/name_space.rb +37 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/packagetask.rb +210 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/phony.rb +15 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/private_reader.rb +20 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/promise.rb +99 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/pseudo_status.rb +29 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rake_module.rb +38 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rule_recursion_overflow_error.rb +19 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/scope.rb +42 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb +390 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_arguments.rb +108 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_manager.rb +303 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/tasklib.rb +11 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/testtask.rb +222 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/thread_history_display.rb +48 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/thread_pool.rb +162 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/trace_output.rb +22 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/version.rb +9 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/win32.rb +50 -0
- data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/rake.gemspec +39 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.gitignore +19 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.rspec +3 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.travis.yml +24 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Changelog.md +49 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Gemfile +26 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/README.md +72 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Rakefile +16 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/cucumber.yml +2 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/its.feature +125 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/step_definitions/additional_cli_steps.rb +21 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/support/env.rb +23 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/lib/rspec/its.rb +149 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/lib/rspec/its/version.rb +5 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/rspec-its.gemspec +28 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/script/test_all +20 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/spec/rspec/its_spec.rb +237 -0
- data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/spec/spec_helper.rb +15 -0
- data/vendor/bundle/ruby/2.4.0/specifications/fake_ftp-0.1.1.gemspec +20 -0
- data/vendor/bundle/ruby/2.4.0/specifications/rake-12.0.0.gemspec +43 -0
- data/vendor/bundle/ruby/2.4.0/specifications/rspec-its-1.2.0.gemspec +47 -0
- data/version.txt +1 -1
- metadata +137 -7
- data/2.14.0 +0 -5
@@ -0,0 +1,108 @@
|
|
1
|
+
module Rake
|
2
|
+
|
3
|
+
##
|
4
|
+
# TaskArguments manage the arguments passed to a task.
|
5
|
+
#
|
6
|
+
class TaskArguments
|
7
|
+
include Enumerable
|
8
|
+
|
9
|
+
# Argument names
|
10
|
+
attr_reader :names
|
11
|
+
|
12
|
+
# Create a TaskArgument object with a list of argument +names+ and a set
|
13
|
+
# of associated +values+. +parent+ is the parent argument object.
|
14
|
+
def initialize(names, values, parent=nil)
|
15
|
+
@names = names
|
16
|
+
@parent = parent
|
17
|
+
@hash = {}
|
18
|
+
@values = values
|
19
|
+
names.each_with_index { |name, i|
|
20
|
+
next if values[i].nil? || values[i] == ""
|
21
|
+
@hash[name.to_sym] = values[i]
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Retrieve the complete array of sequential values
|
26
|
+
def to_a
|
27
|
+
@values.dup
|
28
|
+
end
|
29
|
+
|
30
|
+
# Retrieve the list of values not associated with named arguments
|
31
|
+
def extras
|
32
|
+
@values[@names.length..-1] || []
|
33
|
+
end
|
34
|
+
|
35
|
+
# Create a new argument scope using the prerequisite argument
|
36
|
+
# names.
|
37
|
+
def new_scope(names)
|
38
|
+
values = names.map { |n| self[n] }
|
39
|
+
self.class.new(names, values + extras, self)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Find an argument value by name or index.
|
43
|
+
def [](index)
|
44
|
+
lookup(index.to_sym)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Specify a hash of default values for task arguments. Use the
|
48
|
+
# defaults only if there is no specific value for the given
|
49
|
+
# argument.
|
50
|
+
def with_defaults(defaults)
|
51
|
+
@hash = defaults.merge(@hash)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Enumerates the arguments and their values
|
55
|
+
def each(&block)
|
56
|
+
@hash.each(&block)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Extracts the argument values at +keys+
|
60
|
+
def values_at(*keys)
|
61
|
+
keys.map { |k| lookup(k) }
|
62
|
+
end
|
63
|
+
|
64
|
+
# Returns the value of the given argument via method_missing
|
65
|
+
def method_missing(sym, *args)
|
66
|
+
lookup(sym.to_sym)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Returns a Hash of arguments and their values
|
70
|
+
def to_hash
|
71
|
+
@hash.dup
|
72
|
+
end
|
73
|
+
|
74
|
+
def to_s # :nodoc:
|
75
|
+
inspect
|
76
|
+
end
|
77
|
+
|
78
|
+
def inspect # :nodoc:
|
79
|
+
inspection = @hash.map do |k,v|
|
80
|
+
"#{k.to_s}: #{v.to_s}"
|
81
|
+
end.join(", ")
|
82
|
+
|
83
|
+
"#<#{self.class} #{inspection}>"
|
84
|
+
end
|
85
|
+
|
86
|
+
# Returns true if +key+ is one of the arguments
|
87
|
+
def has_key?(key)
|
88
|
+
@hash.has_key?(key)
|
89
|
+
end
|
90
|
+
alias key? has_key?
|
91
|
+
|
92
|
+
def fetch(*args, &block)
|
93
|
+
@hash.fetch(*args, &block)
|
94
|
+
end
|
95
|
+
|
96
|
+
protected
|
97
|
+
|
98
|
+
def lookup(name) # :nodoc:
|
99
|
+
if @hash.has_key?(name)
|
100
|
+
@hash[name]
|
101
|
+
elsif @parent
|
102
|
+
@parent.lookup(name)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
EMPTY_TASK_ARGS = TaskArguments.new([], []) # :nodoc:
|
108
|
+
end
|
@@ -0,0 +1,303 @@
|
|
1
|
+
module Rake
|
2
|
+
|
3
|
+
# The TaskManager module is a mixin for managing tasks.
|
4
|
+
module TaskManager
|
5
|
+
# Track the last comment made in the Rakefile.
|
6
|
+
attr_accessor :last_description
|
7
|
+
|
8
|
+
def initialize # :nodoc:
|
9
|
+
super
|
10
|
+
@tasks = Hash.new
|
11
|
+
@rules = Array.new
|
12
|
+
@scope = Scope.make
|
13
|
+
@last_description = nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_rule(*args, &block) # :nodoc:
|
17
|
+
pattern, args, deps = resolve_args(args)
|
18
|
+
pattern = Regexp.new(Regexp.quote(pattern) + "$") if String === pattern
|
19
|
+
@rules << [pattern, args, deps, block]
|
20
|
+
end
|
21
|
+
|
22
|
+
def define_task(task_class, *args, &block) # :nodoc:
|
23
|
+
task_name, arg_names, deps = resolve_args(args)
|
24
|
+
|
25
|
+
original_scope = @scope
|
26
|
+
if String === task_name and
|
27
|
+
not task_class.ancestors.include? Rake::FileTask
|
28
|
+
task_name, *definition_scope = *(task_name.split(":").reverse)
|
29
|
+
@scope = Scope.make(*(definition_scope + @scope.to_a))
|
30
|
+
end
|
31
|
+
|
32
|
+
task_name = task_class.scope_name(@scope, task_name)
|
33
|
+
deps = [deps] unless deps.respond_to?(:to_ary)
|
34
|
+
deps = deps.map { |d| Rake.from_pathname(d).to_s }
|
35
|
+
task = intern(task_class, task_name)
|
36
|
+
task.set_arg_names(arg_names) unless arg_names.empty?
|
37
|
+
if Rake::TaskManager.record_task_metadata
|
38
|
+
add_location(task)
|
39
|
+
task.add_description(get_description(task))
|
40
|
+
end
|
41
|
+
task.enhance(deps, &block)
|
42
|
+
ensure
|
43
|
+
@scope = original_scope
|
44
|
+
end
|
45
|
+
|
46
|
+
# Lookup a task. Return an existing task if found, otherwise
|
47
|
+
# create a task of the current type.
|
48
|
+
def intern(task_class, task_name)
|
49
|
+
@tasks[task_name.to_s] ||= task_class.new(task_name, self)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Find a matching task for +task_name+.
|
53
|
+
def [](task_name, scopes=nil)
|
54
|
+
task_name = task_name.to_s
|
55
|
+
self.lookup(task_name, scopes) or
|
56
|
+
enhance_with_matching_rule(task_name) or
|
57
|
+
synthesize_file_task(task_name) or
|
58
|
+
fail "Don't know how to build task '#{task_name}' (see --tasks)"
|
59
|
+
end
|
60
|
+
|
61
|
+
def synthesize_file_task(task_name) # :nodoc:
|
62
|
+
return nil unless File.exist?(task_name)
|
63
|
+
define_task(Rake::FileTask, task_name)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Resolve the arguments for a task/rule. Returns a triplet of
|
67
|
+
# [task_name, arg_name_list, prerequisites].
|
68
|
+
def resolve_args(args)
|
69
|
+
if args.last.is_a?(Hash)
|
70
|
+
deps = args.pop
|
71
|
+
resolve_args_with_dependencies(args, deps)
|
72
|
+
else
|
73
|
+
resolve_args_without_dependencies(args)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Resolve task arguments for a task or rule when there are no
|
78
|
+
# dependencies declared.
|
79
|
+
#
|
80
|
+
# The patterns recognized by this argument resolving function are:
|
81
|
+
#
|
82
|
+
# task :t
|
83
|
+
# task :t, [:a]
|
84
|
+
#
|
85
|
+
def resolve_args_without_dependencies(args)
|
86
|
+
task_name = args.shift
|
87
|
+
if args.size == 1 && args.first.respond_to?(:to_ary)
|
88
|
+
arg_names = args.first.to_ary
|
89
|
+
else
|
90
|
+
arg_names = args
|
91
|
+
end
|
92
|
+
[task_name, arg_names, []]
|
93
|
+
end
|
94
|
+
private :resolve_args_without_dependencies
|
95
|
+
|
96
|
+
# Resolve task arguments for a task or rule when there are
|
97
|
+
# dependencies declared.
|
98
|
+
#
|
99
|
+
# The patterns recognized by this argument resolving function are:
|
100
|
+
#
|
101
|
+
# task :t => [:d]
|
102
|
+
# task :t, [a] => [:d]
|
103
|
+
#
|
104
|
+
def resolve_args_with_dependencies(args, hash) # :nodoc:
|
105
|
+
fail "Task Argument Error" if hash.size != 1
|
106
|
+
key, value = hash.map { |k, v| [k, v] }.first
|
107
|
+
if args.empty?
|
108
|
+
task_name = key
|
109
|
+
arg_names = []
|
110
|
+
deps = value || []
|
111
|
+
else
|
112
|
+
task_name = args.shift
|
113
|
+
arg_names = key
|
114
|
+
deps = value
|
115
|
+
end
|
116
|
+
deps = [deps] unless deps.respond_to?(:to_ary)
|
117
|
+
[task_name, arg_names, deps]
|
118
|
+
end
|
119
|
+
private :resolve_args_with_dependencies
|
120
|
+
|
121
|
+
# If a rule can be found that matches the task name, enhance the
|
122
|
+
# task with the prerequisites and actions from the rule. Set the
|
123
|
+
# source attribute of the task appropriately for the rule. Return
|
124
|
+
# the enhanced task or nil of no rule was found.
|
125
|
+
def enhance_with_matching_rule(task_name, level=0)
|
126
|
+
fail Rake::RuleRecursionOverflowError,
|
127
|
+
"Rule Recursion Too Deep" if level >= 16
|
128
|
+
@rules.each do |pattern, args, extensions, block|
|
129
|
+
if pattern.match(task_name)
|
130
|
+
task = attempt_rule(task_name, args, extensions, block, level)
|
131
|
+
return task if task
|
132
|
+
end
|
133
|
+
end
|
134
|
+
nil
|
135
|
+
rescue Rake::RuleRecursionOverflowError => ex
|
136
|
+
ex.add_target(task_name)
|
137
|
+
fail ex
|
138
|
+
end
|
139
|
+
|
140
|
+
# List of all defined tasks in this application.
|
141
|
+
def tasks
|
142
|
+
@tasks.values.sort_by { |t| t.name }
|
143
|
+
end
|
144
|
+
|
145
|
+
# List of all the tasks defined in the given scope (and its
|
146
|
+
# sub-scopes).
|
147
|
+
def tasks_in_scope(scope)
|
148
|
+
prefix = scope.path
|
149
|
+
tasks.select { |t|
|
150
|
+
/^#{prefix}:/ =~ t.name
|
151
|
+
}
|
152
|
+
end
|
153
|
+
|
154
|
+
# Clear all tasks in this application.
|
155
|
+
def clear
|
156
|
+
@tasks.clear
|
157
|
+
@rules.clear
|
158
|
+
end
|
159
|
+
|
160
|
+
# Lookup a task, using scope and the scope hints in the task name.
|
161
|
+
# This method performs straight lookups without trying to
|
162
|
+
# synthesize file tasks or rules. Special scope names (e.g. '^')
|
163
|
+
# are recognized. If no scope argument is supplied, use the
|
164
|
+
# current scope. Return nil if the task cannot be found.
|
165
|
+
def lookup(task_name, initial_scope=nil)
|
166
|
+
initial_scope ||= @scope
|
167
|
+
task_name = task_name.to_s
|
168
|
+
if task_name =~ /^rake:/
|
169
|
+
scopes = Scope.make
|
170
|
+
task_name = task_name.sub(/^rake:/, "")
|
171
|
+
elsif task_name =~ /^(\^+)/
|
172
|
+
scopes = initial_scope.trim($1.size)
|
173
|
+
task_name = task_name.sub(/^(\^+)/, "")
|
174
|
+
else
|
175
|
+
scopes = initial_scope
|
176
|
+
end
|
177
|
+
lookup_in_scope(task_name, scopes)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Lookup the task name
|
181
|
+
def lookup_in_scope(name, scope)
|
182
|
+
loop do
|
183
|
+
tn = scope.path_with_task_name(name)
|
184
|
+
task = @tasks[tn]
|
185
|
+
return task if task
|
186
|
+
break if scope.empty?
|
187
|
+
scope = scope.tail
|
188
|
+
end
|
189
|
+
nil
|
190
|
+
end
|
191
|
+
private :lookup_in_scope
|
192
|
+
|
193
|
+
# Return the list of scope names currently active in the task
|
194
|
+
# manager.
|
195
|
+
def current_scope
|
196
|
+
@scope
|
197
|
+
end
|
198
|
+
|
199
|
+
# Evaluate the block in a nested namespace named +name+. Create
|
200
|
+
# an anonymous namespace if +name+ is nil.
|
201
|
+
def in_namespace(name)
|
202
|
+
name ||= generate_name
|
203
|
+
@scope = Scope.new(name, @scope)
|
204
|
+
ns = NameSpace.new(self, @scope)
|
205
|
+
yield(ns)
|
206
|
+
ns
|
207
|
+
ensure
|
208
|
+
@scope = @scope.tail
|
209
|
+
end
|
210
|
+
|
211
|
+
private
|
212
|
+
|
213
|
+
# Add a location to the locations field of the given task.
|
214
|
+
def add_location(task)
|
215
|
+
loc = find_location
|
216
|
+
task.locations << loc if loc
|
217
|
+
task
|
218
|
+
end
|
219
|
+
|
220
|
+
# Find the location that called into the dsl layer.
|
221
|
+
def find_location
|
222
|
+
locations = caller
|
223
|
+
i = 0
|
224
|
+
while locations[i]
|
225
|
+
return locations[i + 1] if locations[i] =~ /rake\/dsl_definition.rb/
|
226
|
+
i += 1
|
227
|
+
end
|
228
|
+
nil
|
229
|
+
end
|
230
|
+
|
231
|
+
# Generate an anonymous namespace name.
|
232
|
+
def generate_name
|
233
|
+
@seed ||= 0
|
234
|
+
@seed += 1
|
235
|
+
"_anon_#{@seed}"
|
236
|
+
end
|
237
|
+
|
238
|
+
def trace_rule(level, message) # :nodoc:
|
239
|
+
options.trace_output.puts "#{" " * level}#{message}" if
|
240
|
+
Rake.application.options.trace_rules
|
241
|
+
end
|
242
|
+
|
243
|
+
# Attempt to create a rule given the list of prerequisites.
|
244
|
+
def attempt_rule(task_name, args, extensions, block, level)
|
245
|
+
sources = make_sources(task_name, extensions)
|
246
|
+
prereqs = sources.map { |source|
|
247
|
+
trace_rule level, "Attempting Rule #{task_name} => #{source}"
|
248
|
+
if File.exist?(source) || Rake::Task.task_defined?(source)
|
249
|
+
trace_rule level, "(#{task_name} => #{source} ... EXIST)"
|
250
|
+
source
|
251
|
+
elsif parent = enhance_with_matching_rule(source, level + 1)
|
252
|
+
trace_rule level, "(#{task_name} => #{source} ... ENHANCE)"
|
253
|
+
parent.name
|
254
|
+
else
|
255
|
+
trace_rule level, "(#{task_name} => #{source} ... FAIL)"
|
256
|
+
return nil
|
257
|
+
end
|
258
|
+
}
|
259
|
+
task = FileTask.define_task(task_name, { args => prereqs }, &block)
|
260
|
+
task.sources = prereqs
|
261
|
+
task
|
262
|
+
end
|
263
|
+
|
264
|
+
# Make a list of sources from the list of file name extensions /
|
265
|
+
# translation procs.
|
266
|
+
def make_sources(task_name, extensions)
|
267
|
+
result = extensions.map { |ext|
|
268
|
+
case ext
|
269
|
+
when /%/
|
270
|
+
task_name.pathmap(ext)
|
271
|
+
when %r{/}
|
272
|
+
ext
|
273
|
+
when /^\./
|
274
|
+
task_name.ext(ext)
|
275
|
+
when String
|
276
|
+
ext
|
277
|
+
when Proc, Method
|
278
|
+
if ext.arity == 1
|
279
|
+
ext.call(task_name)
|
280
|
+
else
|
281
|
+
ext.call
|
282
|
+
end
|
283
|
+
else
|
284
|
+
fail "Don't know how to handle rule dependent: #{ext.inspect}"
|
285
|
+
end
|
286
|
+
}
|
287
|
+
result.flatten
|
288
|
+
end
|
289
|
+
|
290
|
+
# Return the current description, clearing it in the process.
|
291
|
+
def get_description(task)
|
292
|
+
desc = @last_description
|
293
|
+
@last_description = nil
|
294
|
+
desc
|
295
|
+
end
|
296
|
+
|
297
|
+
class << self
|
298
|
+
attr_accessor :record_task_metadata # :nodoc:
|
299
|
+
TaskManager.record_task_metadata = false
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
end
|
@@ -0,0 +1,222 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "rake/tasklib"
|
3
|
+
|
4
|
+
module Rake
|
5
|
+
|
6
|
+
# Create a task that runs a set of tests.
|
7
|
+
#
|
8
|
+
# Example:
|
9
|
+
# require "rake/testtask"
|
10
|
+
#
|
11
|
+
# Rake::TestTask.new do |t|
|
12
|
+
# t.libs << "test"
|
13
|
+
# t.test_files = FileList['test/test*.rb']
|
14
|
+
# t.verbose = true
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# If rake is invoked with a "TEST=filename" command line option,
|
18
|
+
# then the list of test files will be overridden to include only the
|
19
|
+
# filename specified on the command line. This provides an easy way
|
20
|
+
# to run just one test.
|
21
|
+
#
|
22
|
+
# If rake is invoked with a "TESTOPTS=options" command line option,
|
23
|
+
# then the given options are passed to the test process after a
|
24
|
+
# '--'. This allows Test::Unit options to be passed to the test
|
25
|
+
# suite.
|
26
|
+
#
|
27
|
+
# Examples:
|
28
|
+
#
|
29
|
+
# rake test # run tests normally
|
30
|
+
# rake test TEST=just_one_file.rb # run just one test file.
|
31
|
+
# rake test TESTOPTS="-v" # run in verbose mode
|
32
|
+
# rake test TESTOPTS="--runner=fox" # use the fox test runner
|
33
|
+
#
|
34
|
+
class TestTask < TaskLib
|
35
|
+
|
36
|
+
# Name of test task. (default is :test)
|
37
|
+
attr_accessor :name
|
38
|
+
|
39
|
+
# List of directories added to $LOAD_PATH before running the
|
40
|
+
# tests. (default is 'lib')
|
41
|
+
attr_accessor :libs
|
42
|
+
|
43
|
+
# True if verbose test output desired. (default is false)
|
44
|
+
attr_accessor :verbose
|
45
|
+
|
46
|
+
# Test options passed to the test suite. An explicit
|
47
|
+
# TESTOPTS=opts on the command line will override this. (default
|
48
|
+
# is NONE)
|
49
|
+
attr_accessor :options
|
50
|
+
|
51
|
+
# Request that the tests be run with the warning flag set.
|
52
|
+
# E.g. warning=true implies "ruby -w" used to run the tests.
|
53
|
+
attr_accessor :warning
|
54
|
+
|
55
|
+
# Glob pattern to match test files. (default is 'test/test*.rb')
|
56
|
+
attr_accessor :pattern
|
57
|
+
|
58
|
+
# Style of test loader to use. Options are:
|
59
|
+
#
|
60
|
+
# * :rake -- Rake provided test loading script (default).
|
61
|
+
# * :testrb -- Ruby provided test loading script.
|
62
|
+
# * :direct -- Load tests using command line loader.
|
63
|
+
#
|
64
|
+
attr_accessor :loader
|
65
|
+
|
66
|
+
# Array of command line options to pass to ruby when running test loader.
|
67
|
+
attr_accessor :ruby_opts
|
68
|
+
|
69
|
+
# Description of the test task. (default is 'Run tests')
|
70
|
+
attr_accessor :description
|
71
|
+
|
72
|
+
# Task prerequisites.
|
73
|
+
attr_accessor :deps
|
74
|
+
|
75
|
+
# Explicitly define the list of test files to be included in a
|
76
|
+
# test. +list+ is expected to be an array of file names (a
|
77
|
+
# FileList is acceptable). If both +pattern+ and +test_files+ are
|
78
|
+
# used, then the list of test files is the union of the two.
|
79
|
+
def test_files=(list)
|
80
|
+
@test_files = list
|
81
|
+
end
|
82
|
+
|
83
|
+
# Create a testing task.
|
84
|
+
def initialize(name=:test)
|
85
|
+
@name = name
|
86
|
+
@libs = ["lib"]
|
87
|
+
@pattern = nil
|
88
|
+
@options = nil
|
89
|
+
@test_files = nil
|
90
|
+
@verbose = false
|
91
|
+
@warning = true
|
92
|
+
@loader = :rake
|
93
|
+
@ruby_opts = []
|
94
|
+
@description = "Run tests" + (@name == :test ? "" : " for #{@name}")
|
95
|
+
@deps = []
|
96
|
+
if @name.is_a?(Hash)
|
97
|
+
@deps = @name.values.first
|
98
|
+
@name = @name.keys.first
|
99
|
+
end
|
100
|
+
yield self if block_given?
|
101
|
+
@pattern = "test/test*.rb" if @pattern.nil? && @test_files.nil?
|
102
|
+
define
|
103
|
+
end
|
104
|
+
|
105
|
+
# Create the tasks defined by this task lib.
|
106
|
+
def define
|
107
|
+
desc @description
|
108
|
+
task @name => Array(deps) do
|
109
|
+
FileUtilsExt.verbose(@verbose) do
|
110
|
+
puts "Use TESTOPTS=\"--verbose\" to pass --verbose" \
|
111
|
+
", etc. to runners." if ARGV.include? "--verbose"
|
112
|
+
args =
|
113
|
+
"#{ruby_opts_string} #{run_code} " +
|
114
|
+
"#{file_list_string} #{option_list}"
|
115
|
+
ruby args do |ok, status|
|
116
|
+
if !ok && status.respond_to?(:signaled?) && status.signaled?
|
117
|
+
raise SignalException.new(status.termsig)
|
118
|
+
elsif !ok
|
119
|
+
status = "Command failed with status (#{status.exitstatus})"
|
120
|
+
details = ": [ruby #{args}]"
|
121
|
+
message =
|
122
|
+
if Rake.application.options.trace or @verbose
|
123
|
+
status + details
|
124
|
+
else
|
125
|
+
status
|
126
|
+
end
|
127
|
+
|
128
|
+
fail message
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
self
|
134
|
+
end
|
135
|
+
|
136
|
+
def option_list # :nodoc:
|
137
|
+
(ENV["TESTOPTS"] ||
|
138
|
+
ENV["TESTOPT"] ||
|
139
|
+
ENV["TEST_OPTS"] ||
|
140
|
+
ENV["TEST_OPT"] ||
|
141
|
+
@options ||
|
142
|
+
"")
|
143
|
+
end
|
144
|
+
|
145
|
+
def ruby_opts_string # :nodoc:
|
146
|
+
opts = @ruby_opts.dup
|
147
|
+
opts.unshift("-I\"#{lib_path}\"") unless @libs.empty?
|
148
|
+
opts.unshift("-w") if @warning
|
149
|
+
opts.join(" ")
|
150
|
+
end
|
151
|
+
|
152
|
+
def lib_path # :nodoc:
|
153
|
+
@libs.join(File::PATH_SEPARATOR)
|
154
|
+
end
|
155
|
+
|
156
|
+
def file_list_string # :nodoc:
|
157
|
+
file_list.map { |fn| "\"#{fn}\"" }.join(" ")
|
158
|
+
end
|
159
|
+
|
160
|
+
def file_list # :nodoc:
|
161
|
+
if ENV["TEST"]
|
162
|
+
FileList[ENV["TEST"]]
|
163
|
+
else
|
164
|
+
result = []
|
165
|
+
result += @test_files.to_a if @test_files
|
166
|
+
result += FileList[@pattern].to_a if @pattern
|
167
|
+
result
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
def ruby_version # :nodoc:
|
172
|
+
RUBY_VERSION
|
173
|
+
end
|
174
|
+
|
175
|
+
def run_code # :nodoc:
|
176
|
+
case @loader
|
177
|
+
when :direct
|
178
|
+
"-e \"ARGV.each{|f| require f}\""
|
179
|
+
when :testrb
|
180
|
+
"-S testrb"
|
181
|
+
when :rake
|
182
|
+
"#{rake_include_arg} \"#{rake_loader}\""
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def rake_loader # :nodoc:
|
187
|
+
find_file("rake/rake_test_loader") or
|
188
|
+
fail "unable to find rake test loader"
|
189
|
+
end
|
190
|
+
|
191
|
+
def find_file(fn) # :nodoc:
|
192
|
+
$LOAD_PATH.each do |path|
|
193
|
+
file_path = File.join(path, "#{fn}.rb")
|
194
|
+
return file_path if File.exist? file_path
|
195
|
+
end
|
196
|
+
nil
|
197
|
+
end
|
198
|
+
|
199
|
+
def rake_include_arg # :nodoc:
|
200
|
+
spec = Gem.loaded_specs["rake"]
|
201
|
+
if spec.respond_to?(:default_gem?) && spec.default_gem?
|
202
|
+
""
|
203
|
+
else
|
204
|
+
"-I\"#{rake_lib_dir}\""
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
def rake_lib_dir # :nodoc:
|
209
|
+
find_dir("rake") or
|
210
|
+
fail "unable to find rake lib"
|
211
|
+
end
|
212
|
+
|
213
|
+
def find_dir(fn) # :nodoc:
|
214
|
+
$LOAD_PATH.each do |path|
|
215
|
+
file_path = File.join(path, "#{fn}.rb")
|
216
|
+
return path if File.exist? file_path
|
217
|
+
end
|
218
|
+
nil
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
end
|