boxcar 0.10005.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +48 -0
- data/.gitsetup.yml +6 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +696 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +40 -0
- data/LICENSE +21 -0
- data/README.md +91 -0
- data/Rakefile +18 -0
- data/VERSION +1 -0
- data/bin/_bump +126 -0
- data/bin/_jason +172 -0
- data/bin/_log4sh +3840 -0
- data/bin/_meat +172 -0
- data/bin/_prime +8 -0
- data/bin/_shflags +1012 -0
- data/bin/_shunit +1048 -0
- data/bin/_sub +37 -0
- data/bin/_treadstone +8 -0
- data/bin/_versions +174 -0
- data/bin/build +15 -0
- data/bin/bump +15 -0
- data/bin/edit +15 -0
- data/bin/publish +15 -0
- data/bin/stub +15 -0
- data/bin/vagrant +60 -0
- data/boxcar.gemspec +32 -0
- data/config/default.rb +30 -0
- data/contrib/README.md +12 -0
- data/contrib/emacs/vagrant.el +8 -0
- data/contrib/vim/vagrantfile.vim +9 -0
- data/keys/README.md +17 -0
- data/keys/vagrant +27 -0
- data/keys/vagrant.pub +1 -0
- data/lib/development.rb +25 -0
- data/lib/vagrant.rb +197 -0
- data/lib/vagrant/action.rb +63 -0
- data/lib/vagrant/action/box/destroy.rb +25 -0
- data/lib/vagrant/action/box/download.rb +84 -0
- data/lib/vagrant/action/box/package.rb +19 -0
- data/lib/vagrant/action/box/unpackage.rb +61 -0
- data/lib/vagrant/action/box/verify.rb +23 -0
- data/lib/vagrant/action/builder.rb +128 -0
- data/lib/vagrant/action/builtin.rb +171 -0
- data/lib/vagrant/action/env/set.rb +21 -0
- data/lib/vagrant/action/environment.rb +12 -0
- data/lib/vagrant/action/general/check_virtualbox.rb +28 -0
- data/lib/vagrant/action/general/package.rb +101 -0
- data/lib/vagrant/action/general/validate.rb +18 -0
- data/lib/vagrant/action/runner.rb +53 -0
- data/lib/vagrant/action/vm/boot.rb +53 -0
- data/lib/vagrant/action/vm/check_accessible.rb +23 -0
- data/lib/vagrant/action/vm/check_box.rb +33 -0
- data/lib/vagrant/action/vm/check_guest_additions.rb +38 -0
- data/lib/vagrant/action/vm/check_port_collisions.rb +89 -0
- data/lib/vagrant/action/vm/clean_machine_folder.rb +43 -0
- data/lib/vagrant/action/vm/clear_forwarded_ports.rb +18 -0
- data/lib/vagrant/action/vm/clear_network_interfaces.rb +31 -0
- data/lib/vagrant/action/vm/clear_shared_folders.rb +18 -0
- data/lib/vagrant/action/vm/customize.rb +36 -0
- data/lib/vagrant/action/vm/default_name.rb +22 -0
- data/lib/vagrant/action/vm/destroy.rb +19 -0
- data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +20 -0
- data/lib/vagrant/action/vm/discard_state.rb +22 -0
- data/lib/vagrant/action/vm/export.rb +57 -0
- data/lib/vagrant/action/vm/forward_ports.rb +92 -0
- data/lib/vagrant/action/vm/halt.rb +32 -0
- data/lib/vagrant/action/vm/host_name.rb +21 -0
- data/lib/vagrant/action/vm/import.rb +48 -0
- data/lib/vagrant/action/vm/match_mac_address.rb +21 -0
- data/lib/vagrant/action/vm/network.rb +403 -0
- data/lib/vagrant/action/vm/nfs.rb +196 -0
- data/lib/vagrant/action/vm/package.rb +23 -0
- data/lib/vagrant/action/vm/package_vagrantfile.rb +36 -0
- data/lib/vagrant/action/vm/provision.rb +61 -0
- data/lib/vagrant/action/vm/provisioner_cleanup.rb +26 -0
- data/lib/vagrant/action/vm/prune_nfs_exports.rb +20 -0
- data/lib/vagrant/action/vm/resume.rb +20 -0
- data/lib/vagrant/action/vm/sane_defaults.rb +78 -0
- data/lib/vagrant/action/vm/setup_package_files.rb +54 -0
- data/lib/vagrant/action/vm/share_folders.rb +114 -0
- data/lib/vagrant/action/vm/suspend.rb +20 -0
- data/lib/vagrant/action/warden.rb +92 -0
- data/lib/vagrant/box.rb +44 -0
- data/lib/vagrant/box_collection.rb +58 -0
- data/lib/vagrant/cli.rb +76 -0
- data/lib/vagrant/command.rb +24 -0
- data/lib/vagrant/command/base.rb +167 -0
- data/lib/vagrant/command/box.rb +58 -0
- data/lib/vagrant/command/box_add.rb +37 -0
- data/lib/vagrant/command/box_list.rb +28 -0
- data/lib/vagrant/command/box_remove.rb +27 -0
- data/lib/vagrant/command/box_repackage.rb +27 -0
- data/lib/vagrant/command/destroy.rb +64 -0
- data/lib/vagrant/command/gem.rb +39 -0
- data/lib/vagrant/command/halt.rb +39 -0
- data/lib/vagrant/command/init.rb +40 -0
- data/lib/vagrant/command/package.rb +75 -0
- data/lib/vagrant/command/provision.rb +40 -0
- data/lib/vagrant/command/reload.rb +39 -0
- data/lib/vagrant/command/resume.rb +33 -0
- data/lib/vagrant/command/ssh.rb +90 -0
- data/lib/vagrant/command/ssh_config.rb +51 -0
- data/lib/vagrant/command/start_mixins.rb +26 -0
- data/lib/vagrant/command/status.rb +36 -0
- data/lib/vagrant/command/suspend.rb +33 -0
- data/lib/vagrant/command/up.rb +40 -0
- data/lib/vagrant/communication.rb +7 -0
- data/lib/vagrant/communication/base.rb +56 -0
- data/lib/vagrant/communication/ssh.rb +229 -0
- data/lib/vagrant/config.rb +49 -0
- data/lib/vagrant/config/base.rb +82 -0
- data/lib/vagrant/config/container.rb +37 -0
- data/lib/vagrant/config/error_recorder.rb +19 -0
- data/lib/vagrant/config/loader.rb +127 -0
- data/lib/vagrant/config/nfs.rb +8 -0
- data/lib/vagrant/config/package.rb +7 -0
- data/lib/vagrant/config/ssh.rb +27 -0
- data/lib/vagrant/config/top.rb +72 -0
- data/lib/vagrant/config/vagrant.rb +14 -0
- data/lib/vagrant/config/vm.rb +168 -0
- data/lib/vagrant/config/vm/provisioner.rb +52 -0
- data/lib/vagrant/config/vm/sub_vm.rb +17 -0
- data/lib/vagrant/data_store.rb +92 -0
- data/lib/vagrant/downloaders.rb +7 -0
- data/lib/vagrant/downloaders/base.rb +25 -0
- data/lib/vagrant/downloaders/file.rb +22 -0
- data/lib/vagrant/downloaders/http.rb +97 -0
- data/lib/vagrant/driver.rb +8 -0
- data/lib/vagrant/driver/virtualbox.rb +134 -0
- data/lib/vagrant/driver/virtualbox_4_0.rb +459 -0
- data/lib/vagrant/driver/virtualbox_4_1.rb +459 -0
- data/lib/vagrant/driver/virtualbox_4_2.rb +606 -0
- data/lib/vagrant/driver/virtualbox_base.rb +309 -0
- data/lib/vagrant/environment.rb +517 -0
- data/lib/vagrant/errors.rb +441 -0
- data/lib/vagrant/guest.rb +18 -0
- data/lib/vagrant/guest/arch.rb +56 -0
- data/lib/vagrant/guest/base.rb +99 -0
- data/lib/vagrant/guest/debian.rb +64 -0
- data/lib/vagrant/guest/fedora.rb +66 -0
- data/lib/vagrant/guest/freebsd.rb +86 -0
- data/lib/vagrant/guest/gentoo.rb +46 -0
- data/lib/vagrant/guest/linux.rb +118 -0
- data/lib/vagrant/guest/linux/config.rb +19 -0
- data/lib/vagrant/guest/linux/error.rb +9 -0
- data/lib/vagrant/guest/openbsd.rb +20 -0
- data/lib/vagrant/guest/redhat.rb +67 -0
- data/lib/vagrant/guest/solaris.rb +118 -0
- data/lib/vagrant/guest/suse.rb +9 -0
- data/lib/vagrant/guest/ubuntu.rb +23 -0
- data/lib/vagrant/hosts.rb +37 -0
- data/lib/vagrant/hosts/arch.rb +55 -0
- data/lib/vagrant/hosts/base.rb +66 -0
- data/lib/vagrant/hosts/bsd.rb +97 -0
- data/lib/vagrant/hosts/fedora.rb +47 -0
- data/lib/vagrant/hosts/freebsd.rb +41 -0
- data/lib/vagrant/hosts/gentoo.rb +20 -0
- data/lib/vagrant/hosts/linux.rb +94 -0
- data/lib/vagrant/hosts/opensuse.rb +30 -0
- data/lib/vagrant/hosts/windows.rb +16 -0
- data/lib/vagrant/plugin.rb +81 -0
- data/lib/vagrant/provisioners.rb +12 -0
- data/lib/vagrant/provisioners/base.rb +44 -0
- data/lib/vagrant/provisioners/chef.rb +168 -0
- data/lib/vagrant/provisioners/chef_client.rb +132 -0
- data/lib/vagrant/provisioners/chef_solo.rb +234 -0
- data/lib/vagrant/provisioners/puppet.rb +175 -0
- data/lib/vagrant/provisioners/puppet_server.rb +78 -0
- data/lib/vagrant/provisioners/shell.rb +96 -0
- data/lib/vagrant/registry.rb +52 -0
- data/lib/vagrant/ssh.rb +126 -0
- data/lib/vagrant/test_helpers.rb +154 -0
- data/lib/vagrant/ui.rb +168 -0
- data/lib/vagrant/util.rb +12 -0
- data/lib/vagrant/util/ansi_escape_code_remover.rb +34 -0
- data/lib/vagrant/util/busy.rb +59 -0
- data/lib/vagrant/util/counter.rb +24 -0
- data/lib/vagrant/util/file_checksum.rb +38 -0
- data/lib/vagrant/util/file_mode.rb +12 -0
- data/lib/vagrant/util/hash_with_indifferent_access.rb +63 -0
- data/lib/vagrant/util/is_port_open.rb +38 -0
- data/lib/vagrant/util/line_ending_helpers.rb +14 -0
- data/lib/vagrant/util/network_ip.rb +28 -0
- data/lib/vagrant/util/platform.rb +68 -0
- data/lib/vagrant/util/retryable.rb +25 -0
- data/lib/vagrant/util/safe_exec.rb +36 -0
- data/lib/vagrant/util/safe_puts.rb +31 -0
- data/lib/vagrant/util/stacked_proc_runner.rb +35 -0
- data/lib/vagrant/util/subprocess.rb +247 -0
- data/lib/vagrant/util/template_renderer.rb +83 -0
- data/lib/vagrant/version.rb +7 -0
- data/lib/vagrant/vm.rb +195 -0
- data/libexec/build +30 -0
- data/libexec/build-gem +30 -0
- data/libexec/bump +32 -0
- data/libexec/edit-gem +81 -0
- data/libexec/publish +58 -0
- data/libexec/publish-gem +58 -0
- data/libexec/stub-prepare +37 -0
- data/tasks/acceptance.rake +113 -0
- data/tasks/bundler.rake +3 -0
- data/tasks/test.rake +20 -0
- data/templates/commands/init/Vagrantfile.erb +99 -0
- data/templates/commands/ssh_config/config.erb +15 -0
- data/templates/config/validation_failed.erb +7 -0
- data/templates/guests/arch/network_dhcp.erb +7 -0
- data/templates/guests/arch/network_static.erb +7 -0
- data/templates/guests/debian/network_dhcp.erb +6 -0
- data/templates/guests/debian/network_static.erb +7 -0
- data/templates/guests/fedora/network_dhcp.erb +6 -0
- data/templates/guests/fedora/network_static.erb +13 -0
- data/templates/guests/freebsd/network_dhcp.erb +3 -0
- data/templates/guests/freebsd/network_static.erb +3 -0
- data/templates/guests/gentoo/network_dhcp.erb +4 -0
- data/templates/guests/gentoo/network_static.erb +4 -0
- data/templates/guests/redhat/network_dhcp.erb +6 -0
- data/templates/guests/redhat/network_static.erb +7 -0
- data/templates/locales/en.yml +747 -0
- data/templates/nfs/exports.erb +5 -0
- data/templates/nfs/exports_freebsd.erb +5 -0
- data/templates/nfs/exports_linux.erb +5 -0
- data/templates/package_Vagrantfile.erb +11 -0
- data/templates/provisioners/chef_client/client.erb +32 -0
- data/templates/provisioners/chef_solo/solo.erb +25 -0
- data/test/acceptance/base.rb +48 -0
- data/test/acceptance/box_test.rb +99 -0
- data/test/acceptance/destroy_test.rb +37 -0
- data/test/acceptance/halt_test.rb +72 -0
- data/test/acceptance/init_test.rb +33 -0
- data/test/acceptance/networking/host_only_test.rb +37 -0
- data/test/acceptance/networking/port_forward_test.rb +125 -0
- data/test/acceptance/package_test.rb +46 -0
- data/test/acceptance/provisioning/basic_test.rb +61 -0
- data/test/acceptance/provisioning/chef_solo_test.rb +37 -0
- data/test/acceptance/provisioning/shell_test.rb +53 -0
- data/test/acceptance/resume_test.rb +17 -0
- data/test/acceptance/shared_folders_test.rb +84 -0
- data/test/acceptance/skeletons/chef_solo_basic/README.md +3 -0
- data/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +5 -0
- data/test/acceptance/skeletons/chef_solo_json/README.md +3 -0
- data/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +6 -0
- data/test/acceptance/skeletons/provisioner_multi/README.md +3 -0
- data/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +5 -0
- data/test/acceptance/ssh_test.rb +46 -0
- data/test/acceptance/support/config.rb +42 -0
- data/test/acceptance/support/isolated_environment.rb +117 -0
- data/test/acceptance/support/matchers/have_color.rb +9 -0
- data/test/acceptance/support/matchers/match_output.rb +14 -0
- data/test/acceptance/support/matchers/succeed.rb +14 -0
- data/test/acceptance/support/network_tests.rb +29 -0
- data/test/acceptance/support/output.rb +95 -0
- data/test/acceptance/support/shared/base_context.rb +72 -0
- data/test/acceptance/support/shared/command_examples.rb +33 -0
- data/test/acceptance/support/virtualbox.rb +36 -0
- data/test/acceptance/suspend_test.rb +56 -0
- data/test/acceptance/up_basic_test.rb +33 -0
- data/test/acceptance/up_with_box_url.rb +40 -0
- data/test/acceptance/vagrant_test.rb +47 -0
- data/test/acceptance/version_test.rb +15 -0
- data/test/buildbot/README.md +72 -0
- data/test/buildbot/buildbot_config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/loader.py +24 -0
- data/test/buildbot/buildbot_config/config/master.py +24 -0
- data/test/buildbot/buildbot_config/config/slave.py +22 -0
- data/test/buildbot/buildbot_config/master/__init__.py +6 -0
- data/test/buildbot/buildbot_config/master/builders.py +78 -0
- data/test/buildbot/buildbot_config/master/buildsteps.py +100 -0
- data/test/buildbot/buildbot_config/master/change_sources.py +8 -0
- data/test/buildbot/buildbot_config/master/schedulers.py +32 -0
- data/test/buildbot/buildbot_config/master/slaves.py +60 -0
- data/test/buildbot/buildbot_config/master/status.py +52 -0
- data/test/buildbot/master/Makefile.sample +28 -0
- data/test/buildbot/master/buildbot.tac +36 -0
- data/test/buildbot/master/master.cfg +67 -0
- data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
- data/test/buildbot/master/public_html/default.css +545 -0
- data/test/buildbot/master/public_html/favicon.ico +0 -0
- data/test/buildbot/master/public_html/robots.txt +10 -0
- data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +356 -0
- data/test/buildbot/master/public_html/static/css/prettify.css +97 -0
- data/test/buildbot/master/public_html/static/css/syntax.css +60 -0
- data/test/buildbot/master/public_html/static/css/vagrant.base.css +205 -0
- data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
- data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
- data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +80 -0
- data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +4 -0
- data/test/buildbot/master/templates/authfail.html +9 -0
- data/test/buildbot/master/templates/build.html +205 -0
- data/test/buildbot/master/templates/builder.html +118 -0
- data/test/buildbot/master/templates/builders.html +33 -0
- data/test/buildbot/master/templates/buildslave.html +72 -0
- data/test/buildbot/master/templates/buildslaves.html +70 -0
- data/test/buildbot/master/templates/change.html +15 -0
- data/test/buildbot/master/templates/layouts/base.html +58 -0
- data/test/buildbot/master/templates/macros/box.html +37 -0
- data/test/buildbot/master/templates/macros/build_line.html +50 -0
- data/test/buildbot/master/templates/macros/change.html +81 -0
- data/test/buildbot/master/templates/macros/forms.html +300 -0
- data/test/buildbot/master/templates/root.html +42 -0
- data/test/buildbot/master/templates/waterfall.html +53 -0
- data/test/buildbot/requirements.txt +4 -0
- data/test/buildbot/scripts/deploy.sh +38 -0
- data/test/buildbot/scripts/setup.sh +107 -0
- data/test/buildbot/slave/buildbot.tac +43 -0
- data/test/buildbot/slave/info/admin +1 -0
- data/test/buildbot/slave/info/host +1 -0
- data/test/buildbot/tests/__init__.py +0 -0
- data/test/buildbot/tests/master/__init__.py +0 -0
- data/test/buildbot/tests/master/test_slaves.py +41 -0
- data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
- data/test/config/acceptance_boxes.yml +7 -0
- data/test/support/isolated_environment.rb +46 -0
- data/test/support/tempdir.rb +34 -0
- data/test/unit/base.rb +21 -0
- data/test/unit/support/isolated_environment.rb +47 -0
- data/test/unit/support/shared/base_context.rb +30 -0
- data/test/unit/vagrant/action/builder_test.rb +156 -0
- data/test/unit/vagrant/action/environment_test.rb +16 -0
- data/test/unit/vagrant/action/runner_test.rb +65 -0
- data/test/unit/vagrant/action/warden_test.rb +92 -0
- data/test/unit/vagrant/box_collection_test.rb +56 -0
- data/test/unit/vagrant/box_test.rb +34 -0
- data/test/unit/vagrant/command/base_test.rb +150 -0
- data/test/unit/vagrant/config/base_test.rb +48 -0
- data/test/unit/vagrant/config/loader_test.rb +79 -0
- data/test/unit/vagrant/config/ssh_test.rb +17 -0
- data/test/unit/vagrant/config/top_test.rb +69 -0
- data/test/unit/vagrant/config/vm_test.rb +71 -0
- data/test/unit/vagrant/config_test.rb +27 -0
- data/test/unit/vagrant/data_store_test.rb +79 -0
- data/test/unit/vagrant/downloaders/base_test.rb +18 -0
- data/test/unit/vagrant/downloaders/file_test.rb +75 -0
- data/test/unit/vagrant/downloaders/http_test.rb +19 -0
- data/test/unit/vagrant/environment_test.rb +212 -0
- data/test/unit/vagrant/hosts_test.rb +36 -0
- data/test/unit/vagrant/registry_test.rb +74 -0
- data/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +16 -0
- data/test/unit/vagrant/util/file_checksum_test.rb +23 -0
- data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +38 -0
- data/test/unit/vagrant/util/is_port_open_test.rb +53 -0
- data/test/unit/vagrant/util/line_endings_helper_test.rb +16 -0
- data/test/unit/vagrant/util/network_ip_test.rb +17 -0
- data/test/unit/vagrant/util/retryable_test.rb +106 -0
- data/test/unit/vagrant_test.rb +27 -0
- data/test/unit_legacy/locales/en.yml +8 -0
- data/test/unit_legacy/test_helper.rb +32 -0
- data/test/unit_legacy/vagrant/action/box/destroy_test.rb +18 -0
- data/test/unit_legacy/vagrant/action/box/download_test.rb +125 -0
- data/test/unit_legacy/vagrant/action/box/package_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/box/unpackage_test.rb +84 -0
- data/test/unit_legacy/vagrant/action/box/verify_test.rb +30 -0
- data/test/unit_legacy/vagrant/action/env/set_test.rb +24 -0
- data/test/unit_legacy/vagrant/action/general/package_test.rb +268 -0
- data/test/unit_legacy/vagrant/action/general/validate_test.rb +31 -0
- data/test/unit_legacy/vagrant/action/vm/boot_test.rb +66 -0
- data/test/unit_legacy/vagrant/action/vm/check_accessible_test.rb +61 -0
- data/test/unit_legacy/vagrant/action/vm/check_box_test.rb +61 -0
- data/test/unit_legacy/vagrant/action/vm/check_guest_additions_test.rb +9 -0
- data/test/unit_legacy/vagrant/action/vm/clean_machine_folder_test.rb +84 -0
- data/test/unit_legacy/vagrant/action/vm/clear_forwarded_ports_test.rb +52 -0
- data/test/unit_legacy/vagrant/action/vm/clear_nfs_exports_test.rb +22 -0
- data/test/unit_legacy/vagrant/action/vm/clear_shared_folders_test.rb +40 -0
- data/test/unit_legacy/vagrant/action/vm/customize_test.rb +37 -0
- data/test/unit_legacy/vagrant/action/vm/destroy_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +49 -0
- data/test/unit_legacy/vagrant/action/vm/discard_state_test.rb +45 -0
- data/test/unit_legacy/vagrant/action/vm/export_test.rb +107 -0
- data/test/unit_legacy/vagrant/action/vm/forward_ports_helpers_test.rb +77 -0
- data/test/unit_legacy/vagrant/action/vm/forward_ports_test.rb +197 -0
- data/test/unit_legacy/vagrant/action/vm/halt_test.rb +79 -0
- data/test/unit_legacy/vagrant/action/vm/host_name_test.rb +36 -0
- data/test/unit_legacy/vagrant/action/vm/import_test.rb +66 -0
- data/test/unit_legacy/vagrant/action/vm/match_mac_address_test.rb +40 -0
- data/test/unit_legacy/vagrant/action/vm/modify_test.rb +38 -0
- data/test/unit_legacy/vagrant/action/vm/network_test.rb +286 -0
- data/test/unit_legacy/vagrant/action/vm/nfs_helpers_test.rb +26 -0
- data/test/unit_legacy/vagrant/action/vm/nfs_test.rb +260 -0
- data/test/unit_legacy/vagrant/action/vm/package_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/vm/package_vagrantfile_test.rb +46 -0
- data/test/unit_legacy/vagrant/action/vm/provision_test.rb +65 -0
- data/test/unit_legacy/vagrant/action/vm/provisioner_cleanup_test.rb +56 -0
- data/test/unit_legacy/vagrant/action/vm/resume_test.rb +35 -0
- data/test/unit_legacy/vagrant/action/vm/share_folders_test.rb +144 -0
- data/test/unit_legacy/vagrant/action/vm/suspend_test.rb +35 -0
- data/test/unit_legacy/vagrant/action_test.rb +89 -0
- data/test/unit_legacy/vagrant/box_collection_test.rb +45 -0
- data/test/unit_legacy/vagrant/box_test.rb +74 -0
- data/test/unit_legacy/vagrant/cli_test.rb +35 -0
- data/test/unit_legacy/vagrant/command/base_test.rb +23 -0
- data/test/unit_legacy/vagrant/command/group_base_test.rb +15 -0
- data/test/unit_legacy/vagrant/command/helpers_test.rb +88 -0
- data/test/unit_legacy/vagrant/command/init_test.rb +10 -0
- data/test/unit_legacy/vagrant/command/package_test.rb +27 -0
- data/test/unit_legacy/vagrant/config/base_test.rb +52 -0
- data/test/unit_legacy/vagrant/config/error_recorder_test.rb +18 -0
- data/test/unit_legacy/vagrant/config/ssh_test.rb +12 -0
- data/test/unit_legacy/vagrant/config/vagrant_test.rb +35 -0
- data/test/unit_legacy/vagrant/config/vm/provisioner_test.rb +92 -0
- data/test/unit_legacy/vagrant/config/vm_test.rb +47 -0
- data/test/unit_legacy/vagrant/config_test.rb +148 -0
- data/test/unit_legacy/vagrant/downloaders/http_test.rb +93 -0
- data/test/unit_legacy/vagrant/environment_test.rb +539 -0
- data/test/unit_legacy/vagrant/errors_test.rb +42 -0
- data/test/unit_legacy/vagrant/hosts/base_test.rb +46 -0
- data/test/unit_legacy/vagrant/hosts/bsd_test.rb +53 -0
- data/test/unit_legacy/vagrant/hosts/linux_test.rb +54 -0
- data/test/unit_legacy/vagrant/plugin_test.rb +9 -0
- data/test/unit_legacy/vagrant/provisioners/base_test.rb +63 -0
- data/test/unit_legacy/vagrant/provisioners/chef_client_test.rb +190 -0
- data/test/unit_legacy/vagrant/provisioners/chef_solo_test.rb +115 -0
- data/test/unit_legacy/vagrant/provisioners/chef_test.rb +209 -0
- data/test/unit_legacy/vagrant/provisioners/puppet_server_test.rb +68 -0
- data/test/unit_legacy/vagrant/provisioners/puppet_test.rb +182 -0
- data/test/unit_legacy/vagrant/provisioners/shell_test.rb +79 -0
- data/test/unit_legacy/vagrant/ssh/session_test.rb +40 -0
- data/test/unit_legacy/vagrant/ssh_test.rb +304 -0
- data/test/unit_legacy/vagrant/systems/base_test.rb +18 -0
- data/test/unit_legacy/vagrant/systems/linux_test.rb +104 -0
- data/test/unit_legacy/vagrant/util/busy_test.rb +106 -0
- data/test/unit_legacy/vagrant/util/counter_test.rb +29 -0
- data/test/unit_legacy/vagrant/util/platform_test.rb +18 -0
- data/test/unit_legacy/vagrant/util/stacked_proc_runner_test.rb +43 -0
- data/test/unit_legacy/vagrant/util/template_renderer_test.rb +145 -0
- data/test/unit_legacy/vagrant/vm_test.rb +300 -0
- data/vagrant.gemspec +39 -0
- data/vendor/cache/contest-0.1.3.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.3.gem +0 -0
- data/vendor/cache/erubis-2.7.0.gem +0 -0
- data/vendor/cache/i18n-0.6.1.gem +0 -0
- data/vendor/cache/json-1.5.4.gem +0 -0
- data/vendor/cache/log4r-1.1.10.gem +0 -0
- data/vendor/cache/metaclass-0.0.1.gem +0 -0
- data/vendor/cache/minitest-2.5.1.gem +0 -0
- data/vendor/cache/mocha-0.13.1.gem +0 -0
- data/vendor/cache/rake-10.0.2.gem +0 -0
- data/vendor/cache/rspec-core-2.8.0.gem +0 -0
- data/vendor/cache/rspec-expectations-2.8.0.gem +0 -0
- data/vendor/cache/rspec-mocks-2.8.0.gem +0 -0
- metadata +676 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
boxcar (0.10005.1)
|
5
|
+
erubis (~> 2.7.0)
|
6
|
+
i18n (~> 0.6.0)
|
7
|
+
json (~> 1.5.1)
|
8
|
+
log4r (~> 1.1.9)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: http://rubygems.org/
|
12
|
+
specs:
|
13
|
+
contest (0.1.3)
|
14
|
+
diff-lcs (1.1.3)
|
15
|
+
erubis (2.7.0)
|
16
|
+
i18n (0.6.1)
|
17
|
+
json (1.5.4)
|
18
|
+
log4r (1.1.10)
|
19
|
+
metaclass (0.0.1)
|
20
|
+
minitest (2.5.1)
|
21
|
+
mocha (0.13.1)
|
22
|
+
metaclass (~> 0.0.1)
|
23
|
+
rake (10.0.2)
|
24
|
+
rspec-core (2.8.0)
|
25
|
+
rspec-expectations (2.8.0)
|
26
|
+
diff-lcs (~> 1.1.2)
|
27
|
+
rspec-mocks (2.8.0)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
boxcar!
|
34
|
+
contest (>= 0.1.2)
|
35
|
+
minitest (~> 2.5.1)
|
36
|
+
mocha
|
37
|
+
rake
|
38
|
+
rspec-core (~> 2.8.0)
|
39
|
+
rspec-expectations (~> 2.8.0)
|
40
|
+
rspec-mocks (~> 2.8.0)
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2010-2012Mitchell Hashimoto and John Bender
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
# Vagrant
|
2
|
+
|
3
|
+
* Website: [http://vagrantup.com](http://vagrantup.com)
|
4
|
+
* Source: [https://github.com/mitchellh/vagrant](https://github.com/mitchellh/vagrant)
|
5
|
+
* IRC: `#vagrant` on Freenode
|
6
|
+
* Mailing list: [Google Groups](http://groups.google.com/group/vagrant-up)
|
7
|
+
|
8
|
+
Vagrant is a tool for building and distributing virtualized development environments.
|
9
|
+
|
10
|
+
By providing automated creation and provisioning of virtual machines using [Oracle’s VirtualBox](http://www.virtualbox.org),
|
11
|
+
Vagrant provides the tools to create and configure lightweight, reproducible, and portable
|
12
|
+
virtual environments. For more information, see the part of the getting started guide
|
13
|
+
on “[Why Vagrant?](http://vagrantup.com/docs/getting-started/why.html)”
|
14
|
+
|
15
|
+
## Quick Start
|
16
|
+
|
17
|
+
First, make sure your development machine has [VirtualBox](http://www.virtualbox.org)
|
18
|
+
installed. The setup from that point forward is very easy, since Vagrant is simply
|
19
|
+
a rubygem.
|
20
|
+
|
21
|
+
gem install vagrant
|
22
|
+
|
23
|
+
To build your first virtual environment:
|
24
|
+
|
25
|
+
vagrant init lucid32 http://files.vagrantup.com/lucid32.box
|
26
|
+
vagrant up
|
27
|
+
|
28
|
+
Note: The above `vagrant up` command will also trigger Vagrant to download the
|
29
|
+
`lucid32` box via the specified URL. Vagrant only does this if it detects that
|
30
|
+
the box doesn't already exist on your system.
|
31
|
+
|
32
|
+
## Getting Started Guide
|
33
|
+
|
34
|
+
To learn how to build a fully functional rails development environment, view the
|
35
|
+
[getting started guide](http://vagrantup.com/docs/getting-started/index.html).
|
36
|
+
|
37
|
+
## Installing the Gem from Git
|
38
|
+
|
39
|
+
If you want the bleeding edge version of Vagrant, we try to keep master pretty stable
|
40
|
+
and you're welcome to give it a shot. The following is an example showing how to do this:
|
41
|
+
|
42
|
+
rake install
|
43
|
+
|
44
|
+
## Contributing to Vagrant
|
45
|
+
|
46
|
+
### Dependencies and Unit Tests
|
47
|
+
|
48
|
+
To hack on vagrant, you'll need [bundler](http://github.com/carlhuda/bundler) which can
|
49
|
+
be installed with a simple `gem install bundler`. Afterwords, do the following:
|
50
|
+
|
51
|
+
bundle install
|
52
|
+
rake
|
53
|
+
|
54
|
+
This will run the unit test suite, which should come back all green! Then you're good to go!
|
55
|
+
|
56
|
+
If you want to run Vagrant without having to install the gem, you may use `bundle exec`,
|
57
|
+
like so:
|
58
|
+
|
59
|
+
bundle exec bin/vagrant help
|
60
|
+
|
61
|
+
### Acceptance Tests
|
62
|
+
|
63
|
+
Vagrant also comes with an acceptance test suite which runs the system
|
64
|
+
end-to-end, without mocking out any dependencies. Note that this test
|
65
|
+
suite is **extremely slow**, with the test suite taking hours on even
|
66
|
+
a decent system. A CI will be setup in due time to run these tests
|
67
|
+
automatically. However, it is still useful to know how to run these
|
68
|
+
tests since it is often useful to run a single test if you're working
|
69
|
+
on a specific feature.
|
70
|
+
|
71
|
+
The acceptance tests have absolutely _zero_ dependence on the Vagrant
|
72
|
+
source. Instead, an external configuration file must be used to give
|
73
|
+
the acceptance tests some parameters (such as what Vagrant version is
|
74
|
+
running, where the Vagrant `vagrant` binary is, etc.). If you want to
|
75
|
+
run acceptance tests against source, or just want to see an example of
|
76
|
+
this file, you can generate it automatically for the source code:
|
77
|
+
|
78
|
+
rake acceptance:config
|
79
|
+
|
80
|
+
This will drop an `acceptance_config.yml` file in your working directory.
|
81
|
+
You can then run a specific acceptance test like so:
|
82
|
+
|
83
|
+
ACCEPTANCE_CONFIG=./acceptance_config.yml ruby test/acceptance/version_test.rb
|
84
|
+
|
85
|
+
That's it!
|
86
|
+
|
87
|
+
If you're developing an acceptance test and you're unsure why things
|
88
|
+
might be failing, you can also view log output for the acceptance tests,
|
89
|
+
which can be very verbose but are a great help in finding bugs:
|
90
|
+
|
91
|
+
ACCEPTANCE_LOGGING=debug ACCEPTANCE_CONFIG=./acceptance_config.yml ruby test/acceptance/version_test.rb
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
# Immediately sync all stdout so that tools like buildbot can
|
5
|
+
# immediately load in the output.
|
6
|
+
$stdout.sync = true
|
7
|
+
$stderr.sync = true
|
8
|
+
|
9
|
+
# Load all the rake tasks from the "tasks" folder. This folder
|
10
|
+
# allows us to nicely separate rake tasks into individual files
|
11
|
+
# based on their role, which makes development and debugging easier
|
12
|
+
# than one monolithic file.
|
13
|
+
task_dir = File.expand_path("../tasks", __FILE__)
|
14
|
+
Dir["#{task_dir}/**/*.rake"].each do |task_file|
|
15
|
+
load task_file
|
16
|
+
end
|
17
|
+
|
18
|
+
task :default => "test:unit"
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.10005.1
|
data/bin/_bump
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
function bump_version {
|
4
|
+
local dirty="$1"; shift
|
5
|
+
|
6
|
+
if [[ "$dirty" = "$FLAGS_FALSE" ]]; then
|
7
|
+
ensure_clean_git_status
|
8
|
+
fi
|
9
|
+
|
10
|
+
local_file=
|
11
|
+
if [[ -f VERSION || -L VERSION ]]; then
|
12
|
+
local_file=1
|
13
|
+
if [[ ! -e VERSION ]]; then
|
14
|
+
logger_fatal "cannot write to VERSION file"
|
15
|
+
exit 1
|
16
|
+
fi
|
17
|
+
fi
|
18
|
+
|
19
|
+
tmp_version=$(mktemp -t XXXXXXXXX)
|
20
|
+
if [[ -n $local_file ]]; then
|
21
|
+
cat VERSION | perl -ne 'm{^\s*v?(\d+)\.(\d+)\.(\d+)\s*$} && printf("%03d.%03d.%03d %d.%d.%d\n",$1,$2,$3,$1,$2,$3)' | sort -r | head -1 | awk '{print $2}' > $tmp_version
|
22
|
+
else
|
23
|
+
git tag | perl -ne 'm{^v(\d+)\.(\d+)\.(\d+)$} && printf("%03d.%03d.%03d %d.%d.%d\n",$1,$2,$3,$1,$2,$3)' | sort -r | head -1 | awk '{print $2}' > $tmp_version
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [[ ! -s "$tmp_version" ]]; then
|
27
|
+
logger_fatal "need at least one git tag (in the form v0.0.0) or a version in file VERSION (in the form 0.0.0)"
|
28
|
+
exit 1
|
29
|
+
fi
|
30
|
+
|
31
|
+
case "$1" in
|
32
|
+
patch|minor|major)
|
33
|
+
bump=$1; shift
|
34
|
+
set -- $(cat $tmp_version | sed 's#\.# #g')
|
35
|
+
case "$bump" in
|
36
|
+
patch)
|
37
|
+
echo "$1.$2.$(($3 + 1))"
|
38
|
+
;;
|
39
|
+
minor)
|
40
|
+
echo "$1.$(($2 + 1)).0"
|
41
|
+
;;
|
42
|
+
major)
|
43
|
+
echo "$(($1 + 1)).0.0"
|
44
|
+
;;
|
45
|
+
esac > $tmp_version
|
46
|
+
;;
|
47
|
+
*)
|
48
|
+
ver_new=$1; shift
|
49
|
+
ver_new=${ver_new#v}
|
50
|
+
echo $ver_new > $tmp_version
|
51
|
+
;;
|
52
|
+
esac
|
53
|
+
|
54
|
+
ver_new=$(cat $tmp_version)
|
55
|
+
set -- $(echo "$ver_new" | sed 's#\.# #g') 0
|
56
|
+
M=$1; shift
|
57
|
+
m=$1; shift
|
58
|
+
p=$1; shift
|
59
|
+
|
60
|
+
(echo "$(($M+0)).$(($m+0)).$(($p+0))" > $tmp_version) 2>&-
|
61
|
+
ver_new_same=$(cat $tmp_version)
|
62
|
+
|
63
|
+
if [[ $ver_new != $ver_new_same ]]; then
|
64
|
+
logger_fatal "invalid version: $ver_new"
|
65
|
+
exit 1
|
66
|
+
fi
|
67
|
+
|
68
|
+
ver_bumped="v$(cat $tmp_version)"
|
69
|
+
rm -f $tmp_version
|
70
|
+
ensure_git_tag_available $ver_bumped
|
71
|
+
|
72
|
+
if [[ -n $local_file ]]; then
|
73
|
+
echo ${ver_bumped#v} > VERSION
|
74
|
+
git add VERSION
|
75
|
+
if [[ -f Gemfile ]]; then
|
76
|
+
bundle check 2>&1 >/dev/null || { bundle --quiet install --local --path vendor/bundle || bundle check > /dev/null; }
|
77
|
+
git add Gemfile.lock
|
78
|
+
fi
|
79
|
+
|
80
|
+
git commit -m "bump: $ver_bumped"
|
81
|
+
git push
|
82
|
+
fi
|
83
|
+
|
84
|
+
git_tag "$ver_bumped"
|
85
|
+
echo $ver_bumped
|
86
|
+
}
|
87
|
+
|
88
|
+
function ensure_git_tag_available {
|
89
|
+
version=$1; shift
|
90
|
+
git fetch --tags
|
91
|
+
remote_sha=$(git ls-remote origin $version | awk '{print $1}')
|
92
|
+
if [[ -n $remote_sha ]]; then
|
93
|
+
logger_fatal "already a remote tag $version, bump again"
|
94
|
+
exit 1
|
95
|
+
fi
|
96
|
+
|
97
|
+
local_sha=$(git show-ref $version | awk '{print $1}')
|
98
|
+
if [[ -n $local_sha ]]; then
|
99
|
+
logger_fatal "already a local tag $version"
|
100
|
+
exit 1
|
101
|
+
fi
|
102
|
+
}
|
103
|
+
|
104
|
+
function git_tag {
|
105
|
+
local version=$1; shift
|
106
|
+
|
107
|
+
ensure_git_tag_available "$version"
|
108
|
+
|
109
|
+
git tag $version
|
110
|
+
git push origin tag $version
|
111
|
+
remote_sha=$(git ls-remote origin $version | awk '{print $1}')
|
112
|
+
local_sha=$(git show-ref $version | awk '{print $1}')
|
113
|
+
if [[ $remote_sha != $local_sha ]]; then
|
114
|
+
logger_fatal "remote tag $version does not match local SHA"
|
115
|
+
exit 1
|
116
|
+
fi
|
117
|
+
}
|
118
|
+
|
119
|
+
function ensure_clean_git_status {
|
120
|
+
local lines=$(git status -s -uno | wc -l | awk '{print $1}')
|
121
|
+
if [[ $lines != "0" ]]; then
|
122
|
+
logger_fatal "git status is not clean, cannot tag"
|
123
|
+
git status -s -uno
|
124
|
+
exit 1
|
125
|
+
fi
|
126
|
+
}
|
data/bin/_jason
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
: ${__meat__:=x}
|
4
|
+
if [[ "$__meat__" != 'x' ]]; then
|
5
|
+
return 0
|
6
|
+
fi
|
7
|
+
__meat__='y'
|
8
|
+
|
9
|
+
if [[ -z "${shome:-}" ]]; then
|
10
|
+
shome="$(cd -P -- "$(dirname -- "${BASH_SOURCE}")/.." && pwd -P)"
|
11
|
+
fi
|
12
|
+
|
13
|
+
function get_started {
|
14
|
+
# if getting-started bootstrap is detected, put this in the path
|
15
|
+
# mainly useful for getopt on os x
|
16
|
+
if [[ -d "$HOME/.getting-started/bootstrap" ]]; then
|
17
|
+
PATH="$HOME/.getting-started/bootstrap:$PATH"
|
18
|
+
hash -r
|
19
|
+
fi
|
20
|
+
}
|
21
|
+
|
22
|
+
function check_help {
|
23
|
+
# taken from shocco
|
24
|
+
if expr -- "$*" : ".*--help" >/dev/null; then
|
25
|
+
display_help
|
26
|
+
exit 0
|
27
|
+
fi
|
28
|
+
}
|
29
|
+
|
30
|
+
function display_help {
|
31
|
+
flags_help
|
32
|
+
echo
|
33
|
+
|
34
|
+
# taken from shocco
|
35
|
+
grep '^#/' <"$shome/$(basename $(dirname -- "$0"))/$(basename -- "$0")" | cut -c4-
|
36
|
+
}
|
37
|
+
|
38
|
+
# Exits the script with the last error code. Servers as a marker in $0 to
|
39
|
+
# begin ronn documentation until end of file.
|
40
|
+
function __MAN__ {
|
41
|
+
exit "$!"
|
42
|
+
}
|
43
|
+
|
44
|
+
# Extracts ronn-style Markdown after __MAN__ to stdout. If a line is "MAN", it
|
45
|
+
# is assumed that a here document is used (for syntactical reasons).
|
46
|
+
#
|
47
|
+
# A limitation of detecting "MAN" will truncate the Markdown if "MAN" is a
|
48
|
+
# legimate text.
|
49
|
+
#
|
50
|
+
# __MAN__ << "MAN"
|
51
|
+
# raw ronn-style Markdown
|
52
|
+
# MAN
|
53
|
+
function display_man {
|
54
|
+
awk '/^__MAN__/,/^MAN$/ {print}' <"$shome/bin/$(basename -- "$0")" | tail -n +2 | egrep -v '^MAN$'
|
55
|
+
}
|
56
|
+
|
57
|
+
function display_synopsis {
|
58
|
+
awk '/^#/ && !/^#!/ { print } /^[^#]/ || /^$/ { exit }' <"$shome/bin/$(basename -- "$0")" | cut -c3-
|
59
|
+
}
|
60
|
+
|
61
|
+
function which_library {
|
62
|
+
local library="$1"; shift
|
63
|
+
if [[ -r "$shome/bin/_$library" ]]; then
|
64
|
+
echo "$shome/bin/_$library"
|
65
|
+
elif [[ -r "$shome/.$library/bin/_profile" ]]; then
|
66
|
+
echo "$shome/.$library/bin/_profile"
|
67
|
+
elif [[ -r "$shome/.$library/.profile" ]]; then
|
68
|
+
echo "$shome/.$library/.profile"
|
69
|
+
else
|
70
|
+
local nm_library="${library%%/*}"
|
71
|
+
if [[ "$nm_library" != "$library" ]]; then
|
72
|
+
local nm_right="${library##*/}"
|
73
|
+
if [[ -r "$shome/.$nm_library/bin/_$nm_right" ]]; then
|
74
|
+
echo "$shome/.$nm_library/bin/_$nm_right"
|
75
|
+
fi
|
76
|
+
fi
|
77
|
+
fi
|
78
|
+
}
|
79
|
+
|
80
|
+
function require {
|
81
|
+
local nm_library="$1"; shift
|
82
|
+
local pth_lib="$(which_library "$nm_library")"
|
83
|
+
if [[ -r "$pth_lib" ]]; then
|
84
|
+
if [[ "$#" == 0 ]]; then
|
85
|
+
set --
|
86
|
+
fi
|
87
|
+
source "$pth_lib" "$@"
|
88
|
+
fi
|
89
|
+
}
|
90
|
+
|
91
|
+
function parse_command_line {
|
92
|
+
if [[ "$FLAGS_SUB" = "$FLAGS_TRUE" && "$@" > 0 ]]; then
|
93
|
+
local argv
|
94
|
+
declare -a argv
|
95
|
+
|
96
|
+
local argc="0"
|
97
|
+
local arg
|
98
|
+
local passthrough=
|
99
|
+
for arg in "$@"; do
|
100
|
+
if [[ -z "$passthrough" && ! "$arg" =~ ^- ]]; then
|
101
|
+
argv[argc]="--"
|
102
|
+
argc="$((argc + 1))"
|
103
|
+
passthrough=1
|
104
|
+
fi
|
105
|
+
|
106
|
+
argv[argc]="$arg"
|
107
|
+
argc="$((argc + 1))"
|
108
|
+
done
|
109
|
+
|
110
|
+
set -- "${argv[@]}"
|
111
|
+
fi
|
112
|
+
|
113
|
+
if ! FLAGS "$@"; then
|
114
|
+
if [[ "$flags_error" = "help requested" ]]; then
|
115
|
+
echo ""
|
116
|
+
display_help
|
117
|
+
exit 0
|
118
|
+
fi
|
119
|
+
|
120
|
+
return 4
|
121
|
+
fi
|
122
|
+
return 0
|
123
|
+
}
|
124
|
+
|
125
|
+
function configure_logging {
|
126
|
+
# load log4sh (disabling properties file warning) and clear the default
|
127
|
+
# configuration
|
128
|
+
LOG4SH_CONFIGURATION='none' require 'log4sh'
|
129
|
+
log4sh_resetConfiguration
|
130
|
+
|
131
|
+
# set the global logging level to INFO
|
132
|
+
logger_setLevel INFO
|
133
|
+
|
134
|
+
# add and configure a FileAppender that outputs to STDERR, and activate the
|
135
|
+
# configuration
|
136
|
+
logger_addAppender stderr
|
137
|
+
appender_setType stderr FileAppender
|
138
|
+
appender_file_setFile stderr STDERR
|
139
|
+
appender_activateOptions stderr
|
140
|
+
}
|
141
|
+
|
142
|
+
function ryaml {
|
143
|
+
ruby -ryaml -e 'def ps x; unless x.nil?; puts x; end; end; ps ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@" 2>&-
|
144
|
+
}
|
145
|
+
|
146
|
+
function random_str {
|
147
|
+
echo "$(date +%s).$$.$RANDOM"
|
148
|
+
}
|
149
|
+
|
150
|
+
function runmany {
|
151
|
+
local cpu="$1"; shift
|
152
|
+
local args="$1"; shift
|
153
|
+
if [[ "$#" = 0 ]]; then
|
154
|
+
cat
|
155
|
+
else
|
156
|
+
echo "$@"
|
157
|
+
fi | xargs -P $cpu -n $args -- bash -c "$*" ""
|
158
|
+
}
|
159
|
+
|
160
|
+
function _main {
|
161
|
+
if [[ -z "$shome" ]]; then
|
162
|
+
shome="$(cd -P -- "$(dirname -- "${BASH_SOURCE}")/.." && pwd -P)"
|
163
|
+
fi
|
164
|
+
|
165
|
+
require 'shflags'
|
166
|
+
|
167
|
+
configure_logging
|
168
|
+
|
169
|
+
PATH="$shome/bin:$PATH"
|
170
|
+
}
|
171
|
+
|
172
|
+
_main "$@"
|