[
  {
    "path": ".gitignore",
    "content": "*.gem\n*.rbc\n.bundle\n.config\n.yardoc\nGemfile.lock\nInstalledFiles\n_yardoc\ncoverage\ndoc/\nlib/bundler/man\npkg\nrdoc\nspec/reports\ntest/tmp\ntest/version_tmp\ntmp\nbin/\n.vagrant/\n"
  },
  {
    "path": ".rspec",
    "content": "--default-path test/unit\n"
  },
  {
    "path": ".travis.yml",
    "content": "rvm:\n  - 2.2.10\n  - 2.3.7\n  - 2.4.4\n  - 2.5.1\n\nbranches:\n  only:\n    - master\n\nbundler_args: --jobs 7 --without=acceptance\n\nscript:\n  - bundle exec rake travis:ci\n"
  },
  {
    "path": ".yardopts",
    "content": "--markup=markdown\n--markup-provider=redcarpet\n--readme=README.md\n-\nCHANGELOG.md\nLICENSE\nTODO.md\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Change Log\n\n## [1.5.0](https://github.com/chef/vagrant-omnibus/tree/1.5.0) (2016-08-31)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.4.1...1.5.0)\n\n**Merged pull requests:**\n\n- Convert specs to rspec 3 format [\\#138](https://github.com/chef/vagrant-omnibus/pull/138) ([tas50](https://github.com/tas50))\n- Testing improvements, dep bumps, and fixes [\\#137](https://github.com/chef/vagrant-omnibus/pull/137) ([tas50](https://github.com/tas50))\n- Fix installing chef on windows in vagrant 1.8.3 and up [\\#135](https://github.com/chef/vagrant-omnibus/pull/135) ([mwrock](https://github.com/mwrock))\n- Fixed Travis CI image and link. [\\#115](https://github.com/chef/vagrant-omnibus/pull/115) ([mbrukman](https://github.com/mbrukman))\n- Update README.md to point to current Travis location [\\#101](https://github.com/chef/vagrant-omnibus/pull/101) ([petems](https://github.com/petems))\n- Change :latest to not hit rubygems [\\#97](https://github.com/chef/vagrant-omnibus/pull/97) ([lamont-granquist](https://github.com/lamont-granquist))\n- README: added info about Windows support [\\#94](https://github.com/chef/vagrant-omnibus/pull/94) ([docwhat](https://github.com/docwhat))\n- Fix string to use Ruby variables in tests [\\#93](https://github.com/chef/vagrant-omnibus/pull/93) ([petems](https://github.com/petems))\n- Add plugin spec [\\#92](https://github.com/chef/vagrant-omnibus/pull/92) ([petems](https://github.com/petems))\n\n## [v1.4.1](https://github.com/chef/vagrant-omnibus/tree/v1.4.1) (2014-04-26)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.4.0...v1.4.1)\n\n## [v1.4.0](https://github.com/chef/vagrant-omnibus/tree/v1.4.0) (2014-04-25)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.3.1...v1.4.0)\n\n**Merged pull requests:**\n\n- Cache omnibus download, expose config options [\\#73](https://github.com/chef/vagrant-omnibus/pull/73) ([tknerr](https://github.com/tknerr))\n- Fix not specified chef version without internet connection [\\#67](https://github.com/chef/vagrant-omnibus/pull/67) ([skv-headless](https://github.com/skv-headless))\n\n## [v1.3.1](https://github.com/chef/vagrant-omnibus/tree/v1.3.1) (2014-03-12)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.3.0...v1.3.1)\n\n**Merged pull requests:**\n\n- run install.sh with `sh` rather than `bash`... [\\#66](https://github.com/chef/vagrant-omnibus/pull/66) ([tknerr](https://github.com/tknerr))\n- make unlinking the install.sh reliably work on windows hosts [\\#65](https://github.com/chef/vagrant-omnibus/pull/65) ([tknerr](https://github.com/tknerr))\n\n## [v1.3.0](https://github.com/chef/vagrant-omnibus/tree/v1.3.0) (2014-02-24)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.2.1...v1.3.0)\n\n**Merged pull requests:**\n\n- Make detection of currently installed Chef version more robust [\\#61](https://github.com/chef/vagrant-omnibus/pull/61) ([ampedandwired](https://github.com/ampedandwired))\n- Windows Support Part Deux [\\#60](https://github.com/chef/vagrant-omnibus/pull/60) ([schisamo](https://github.com/schisamo))\n\n## [v1.2.1](https://github.com/chef/vagrant-omnibus/tree/v1.2.1) (2013-12-18)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.2.0...v1.2.1)\n\n**Merged pull requests:**\n\n- filder 'stdin is not a tty' when trying to figure installed Chef version [\\#57](https://github.com/chef/vagrant-omnibus/pull/57) ([scalp42](https://github.com/scalp42))\n\n## [v1.2.0](https://github.com/chef/vagrant-omnibus/tree/v1.2.0) (2013-12-17)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.1.2...v1.2.0)\n\n**Merged pull requests:**\n\n- Ruby linting with Rubocop [\\#56](https://github.com/chef/vagrant-omnibus/pull/56) ([schisamo](https://github.com/schisamo))\n- Fix installed version check to be more robust [\\#53](https://github.com/chef/vagrant-omnibus/pull/53) ([comutt](https://github.com/comutt))\n- Change plugin name to correspond gem name [\\#52](https://github.com/chef/vagrant-omnibus/pull/52) ([tmatilai](https://github.com/tmatilai))\n- Update README.md with vagrant-parallels compatibility [\\#50](https://github.com/chef/vagrant-omnibus/pull/50) ([wizonesolutions](https://github.com/wizonesolutions))\n- Don't install Chef if `--no-provision` is specified [\\#48](https://github.com/chef/vagrant-omnibus/pull/48) ([tmatilai](https://github.com/tmatilai))\n\n## [v1.1.2](https://github.com/chef/vagrant-omnibus/tree/v1.1.2) (2013-10-17)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.1.1...v1.1.2)\n\n**Merged pull requests:**\n\n- Compatibility with vagrant-aws v0.4.0 [\\#45](https://github.com/chef/vagrant-omnibus/pull/45) ([tmatilai](https://github.com/tmatilai))\n- Fix development dependencies and Travis tests [\\#43](https://github.com/chef/vagrant-omnibus/pull/43) ([tmatilai](https://github.com/tmatilai))\n- Add vagrant-digitalocean to the list of supported providers [\\#41](https://github.com/chef/vagrant-omnibus/pull/41) ([tmatilai](https://github.com/tmatilai))\n\n## [v1.1.1](https://github.com/chef/vagrant-omnibus/tree/v1.1.1) (2013-09-04)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.1.0...v1.1.1)\n\n**Merged pull requests:**\n\n- Document that newer than v1.1.x Vagrant is fine, too [\\#37](https://github.com/chef/vagrant-omnibus/pull/37) ([tmatilai](https://github.com/tmatilai))\n- Fix the curl line to install the requested Chef version [\\#32](https://github.com/chef/vagrant-omnibus/pull/32) ([tmatilai](https://github.com/tmatilai))\n- no need to do sudo in sudo [\\#31](https://github.com/chef/vagrant-omnibus/pull/31) ([matsu911](https://github.com/matsu911))\n- include OpenStack provider into the list of working providers [\\#28](https://github.com/chef/vagrant-omnibus/pull/28) ([srenatus](https://github.com/srenatus))\n\n## [v1.1.0](https://github.com/chef/vagrant-omnibus/tree/v1.1.0) (2013-06-21)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.0.2...v1.1.0)\n\n**Merged pull requests:**\n\n- add support for vmware\\_fusion [\\#17](https://github.com/chef/vagrant-omnibus/pull/17) ([rjocoleman](https://github.com/rjocoleman))\n\n## [v1.0.2](https://github.com/chef/vagrant-omnibus/tree/v1.0.2) (2013-04-20)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.0.1...v1.0.2)\n\n## [v1.0.1](https://github.com/chef/vagrant-omnibus/tree/v1.0.1) (2013-04-18)\n[Full Changelog](https://github.com/chef/vagrant-omnibus/compare/v1.0.0...v1.0.1)\n\n## [v1.0.0](https://github.com/chef/vagrant-omnibus/tree/v1.0.0) (2013-04-02)\n\n\n\\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*"
  },
  {
    "path": "Gemfile",
    "content": "source \"https://rubygems.org\"\n\ngemspec\n\ngroup :development do\n  # We depend on Vagrant for development, but we don't add it as a\n  # gem dependency because we expect to be installed within the\n  # Vagrant environment itself using `vagrant plugin`.\n  gem \"vagrant\", git: \"https://github.com/hashicorp/vagrant.git\", tag: \"v2.1.1\"\nend\n\ngroup :acceptance do\n  gem \"vagrant-digitalocean\", \"~> 0.5\"\n  gem \"vagrant-aws\", \"~> 0.4\"\n  gem \"vagrant-rackspace\", \"~> 0.1\"\n  gem \"vagrant-linode\", \"~> 0.4\"\nend\n\ngroup :docs do\n  gem \"yard\", \"~> 0.9.11\"\n  gem \"redcarpet\", \"~> 2.2\"\n  gem \"github-markup\", \"~> 0.7\"\nend\n"
  },
  {
    "path": "LICENSE",
    "content": "                              Apache License\n                        Version 2.0, January 2004\n                     http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n   \"License\" shall mean the terms and conditions for use, reproduction,\n   and distribution as defined by Sections 1 through 9 of this document.\n\n   \"Licensor\" shall mean the copyright owner or entity authorized by\n   the copyright owner that is granting the License.\n\n   \"Legal Entity\" shall mean the union of the acting entity and all\n   other entities that control, are controlled by, or are under common\n   control with that entity. For the purposes of this definition,\n   \"control\" means (i) the power, direct or indirect, to cause the\n   direction or management of such entity, whether by contract or\n   otherwise, or (ii) ownership of fifty percent (50%) or more of the\n   outstanding shares, or (iii) beneficial ownership of such entity.\n\n   \"You\" (or \"Your\") shall mean an individual or Legal Entity\n   exercising permissions granted by this License.\n\n   \"Source\" form shall mean the preferred form for making modifications,\n   including but not limited to software source code, documentation\n   source, and configuration files.\n\n   \"Object\" form shall mean any form resulting from mechanical\n   transformation or translation of a Source form, including but\n   not limited to compiled object code, generated documentation,\n   and conversions to other media types.\n\n   \"Work\" shall mean the work of authorship, whether in Source or\n   Object form, made available under the License, as indicated by a\n   copyright notice that is included in or attached to the work\n   (an example is provided in the Appendix below).\n\n   \"Derivative Works\" shall mean any work, whether in Source or Object\n   form, that is based on (or derived from) the Work and for which the\n   editorial revisions, annotations, elaborations, or other modifications\n   represent, as a whole, an original work of authorship. For the purposes\n   of this License, Derivative Works shall not include works that remain\n   separable from, or merely link (or bind by name) to the interfaces of,\n   the Work and Derivative Works thereof.\n\n   \"Contribution\" shall mean any work of authorship, including\n   the original version of the Work and any modifications or additions\n   to that Work or Derivative Works thereof, that is intentionally\n   submitted to Licensor for inclusion in the Work by the copyright owner\n   or by an individual or Legal Entity authorized to submit on behalf of\n   the copyright owner. For the purposes of this definition, \"submitted\"\n   means any form of electronic, verbal, or written communication sent\n   to the Licensor or its representatives, including but not limited to\n   communication on electronic mailing lists, source code control systems,\n   and issue tracking systems that are managed by, or on behalf of, the\n   Licensor for the purpose of discussing and improving the Work, but\n   excluding communication that is conspicuously marked or otherwise\n   designated in writing by the copyright owner as \"Not a Contribution.\"\n\n   \"Contributor\" shall mean Licensor and any individual or Legal Entity\n   on behalf of whom a Contribution has been received by Licensor and\n   subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   copyright license to reproduce, prepare Derivative Works of,\n   publicly display, publicly perform, sublicense, and distribute the\n   Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   (except as stated in this section) patent license to make, have made,\n   use, offer to sell, sell, import, and otherwise transfer the Work,\n   where such license applies only to those patent claims licensable\n   by such Contributor that are necessarily infringed by their\n   Contribution(s) alone or by combination of their Contribution(s)\n   with the Work to which such Contribution(s) was submitted. If You\n   institute patent litigation against any entity (including a\n   cross-claim or counterclaim in a lawsuit) alleging that the Work\n   or a Contribution incorporated within the Work constitutes direct\n   or contributory patent infringement, then any patent licenses\n   granted to You under this License for that Work shall terminate\n   as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n   Work or Derivative Works thereof in any medium, with or without\n   modifications, and in Source or Object form, provided that You\n   meet the following conditions:\n\n   (a) You must give any other recipients of the Work or\n       Derivative Works a copy of this License; and\n\n   (b) You must cause any modified files to carry prominent notices\n       stating that You changed the files; and\n\n   (c) You must retain, in the Source form of any Derivative Works\n       that You distribute, all copyright, patent, trademark, and\n       attribution notices from the Source form of the Work,\n       excluding those notices that do not pertain to any part of\n       the Derivative Works; and\n\n   (d) If the Work includes a \"NOTICE\" text file as part of its\n       distribution, then any Derivative Works that You distribute must\n       include a readable copy of the attribution notices contained\n       within such NOTICE file, excluding those notices that do not\n       pertain to any part of the Derivative Works, in at least one\n       of the following places: within a NOTICE text file distributed\n       as part of the Derivative Works; within the Source form or\n       documentation, if provided along with the Derivative Works; or,\n       within a display generated by the Derivative Works, if and\n       wherever such third-party notices normally appear. The contents\n       of the NOTICE file are for informational purposes only and\n       do not modify the License. You may add Your own attribution\n       notices within Derivative Works that You distribute, alongside\n       or as an addendum to the NOTICE text from the Work, provided\n       that such additional attribution notices cannot be construed\n       as modifying the License.\n\n   You may add Your own copyright statement to Your modifications and\n   may provide additional or different license terms and conditions\n   for use, reproduction, or distribution of Your modifications, or\n   for any such Derivative Works as a whole, provided Your use,\n   reproduction, and distribution of the Work otherwise complies with\n   the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n   any Contribution intentionally submitted for inclusion in the Work\n   by You to the Licensor shall be under the terms and conditions of\n   this License, without any additional terms or conditions.\n   Notwithstanding the above, nothing herein shall supersede or modify\n   the terms of any separate license agreement you may have executed\n   with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n   names, trademarks, service marks, or product names of the Licensor,\n   except as required for reasonable and customary use in describing the\n   origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n   agreed to in writing, Licensor provides the Work (and each\n   Contributor provides its Contributions) on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n   implied, including, without limitation, any warranties or conditions\n   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n   PARTICULAR PURPOSE. You are solely responsible for determining the\n   appropriateness of using or redistributing the Work and assume any\n   risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n   whether in tort (including negligence), contract, or otherwise,\n   unless required by applicable law (such as deliberate and grossly\n   negligent acts) or agreed to in writing, shall any Contributor be\n   liable to You for damages, including any direct, indirect, special,\n   incidental, or consequential damages of any character arising as a\n   result of this License or out of the use or inability to use the\n   Work (including but not limited to damages for loss of goodwill,\n   work stoppage, computer failure or malfunction, or any and all\n   other commercial damages or losses), even if such Contributor\n   has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n   the Work or Derivative Works thereof, You may choose to offer,\n   and charge a fee for, acceptance of support, warranty, indemnity,\n   or other liability obligations and/or rights consistent with this\n   License. However, in accepting such obligations, You may act only\n   on Your own behalf and on Your sole responsibility, not on behalf\n   of any other Contributor, and only if You agree to indemnify,\n   defend, and hold each Contributor harmless for any liability\n   incurred by, or claims asserted against, such Contributor by reason\n   of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n   To apply the Apache License to your work, attach the following\n   boilerplate notice, with the fields enclosed by brackets \"[]\"\n   replaced with your own identifying information. (Don't include\n   the brackets!)  The text should be enclosed in the appropriate\n   comment syntax for the file format. We also recommend that a\n   file or class name and description of purpose be included on the\n   same \"printed page\" as the copyright notice for easier\n   identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# vagrant-omnibus\n\n## Deprecation Warning\n\nThis is no longer an actively maintained Chef project. We believe that Test Kitchen offers a far superior development and testing experience as it allows fine grained control of versions, better platform support, and and overall better experience. If this project works for you that's great, but we'd highly suggest using https://kitchen.ci/ instead.\n\n---\n\n[![Gem Version](https://badge.fury.io/rb/vagrant-omnibus.svg)](https://rubygems.org/gems/vagrant-omnibus) [![Build Status](https://travis-ci.org/chef/vagrant-omnibus.svg?branch=master)](https://travis-ci.org/chef/vagrant-omnibus) [![Code Climate](https://codeclimate.com/github/chef/vagrant-omnibus.svg)](https://codeclimate.com/github/chef/vagrant-omnibus)\n\nA Vagrant plugin that ensures the desired version of Chef is installed via the platform-specific Omnibus packages. This proves very useful when using Vagrant with provisioner-less baseboxes OR cloud images.\n\nThe plugin should work correctly with most all providers that hook into `Vagrant::Action::Builtin::Provision` for provisioning and is known to work with the following [Vagrant providers](https://www.vagrantup.com/docs/providers/index.html):\n\n- VirtualBox (part of core)\n- AWS (ships in [vagrant-aws](https://github.com/mitchellh/vagrant-aws) plugin)\n- Rackspace (ships in [vagrant-rackspace](https://github.com/mitchellh/vagrant-rackspace) plugin)\n- VMWare Fusion (can be [purchased from Hashicorp](https://www.vagrantup.com/vmware/))\n- LXC (ships in [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc))\n- OpenStack (ships in [vagrant-openstack-plugin](https://github.com/cloudbau/vagrant-openstack-plugin))\n- DigitalOcean (ships in [vagrant-digitalocean](https://github.com/smdahlen/vagrant-digitalocean))\n- Parallels Desktop (ships in [vagrant-parallels](https://github.com/yshahin/vagrant-parallels))\n- Linode (ships in [vagrant-linode](https://github.com/displague/vagrant-linode))\n\n## Installation\n\nEnsure you have downloaded and installed Vagrant 1.1 or newer from the [Vagrant downloads page](https://www.vagrantup.com/downloads.html). If you require Windows support then Vagrant 1.6.1 or newer is needed.\n\nInstallation is performed in the prescribed manner for Vagrant 1.1 plugins.\n\n```\n$ vagrant plugin install vagrant-omnibus\n```\n\n## Usage\n\nThe Omnibus Vagrant plugin automatically hooks into the Vagrant provisioning middleware. You specify the version of the Chef Omnibus package you want installed using the `omnibus.chef_version` config key. The version string should be a valid Chef release version or `:latest`.\n\nInstall the latest version of Chef:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n\n  config.omnibus.chef_version = :latest\n\n  ...\n\nend\n```\n\nInstall a specific version of Chef:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n\n  config.omnibus.chef_version = \"14.2.0\"\n\n  ...\n\nend\n```\n\nSpecify a custom install script:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n\n  config.omnibus.install_url = 'http://acme.com/install.sh'\n  # config.omnibus.install_url = 'http://acme.com/install.msi'\n  # config.omnibus.install_url = '/some/path/on/the/host'\n\n  ...\n\nend\n```\n\nIf [vagrant-cachier](https://github.com/fgrehm/vagrant-cachier) is present and `config.cache.auto_detect` enabled the downloaded omnibus packages will be cached by vagrant-cachier. In case you want to turn caching off:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n\n  config.omnibus.cache_packages = false\n\n  ...\n\nend\n```\n\nThis plugin is also multi-vm aware so it would possible to say install a different version of Chef on each VM:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n\n  config.vm.define :new_chef do |new_chef_config|\n\n    ...\n\n    new_chef_config.omnibus.chef_version = :latest\n\n    ...\n\n  end\n\n  config.vm.define :old_chef do |old_chef_config|\n\n    ...\n\n    old_chef_config.omnibus.chef_version = \"13.9.1\"\n\n    ...\n\n  end\nend\n```\n\n## Tests\n\n### Unit\n\nThe unit tests can be run with:\n\n```\nrake test:unit\n```\n\nThe test are also executed by Travis CI every time code is pushed to GitHub.\n\n### Acceptance\n\nCurrently this repo ships with a set of basic acceptance tests that will:\n\n- Provision a Vagrant instance.\n- Attempt to install Chef using this plugin.\n- Perform a very basic chef-solo run to ensure Chef is in fact installed.\n\nThe acceptance tests can be run against a subset of the Vagrant providers listed above. The acceptance tests can be run with:\n\n```\nrake test:acceptance:PROVIDER_NAME\n```\n\nAnd as expected, all acceptance tests only uses provisioner-less baseboxes and cloud images!\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Authors\n\nSeth Chisamore (schisamo@chef.io)\n"
  },
  {
    "path": "Rakefile",
    "content": "require \"bundler/setup\"\nrequire \"bundler/gem_tasks\"\nrequire \"rspec/core/rake_task\"\nrequire \"chefstyle\"\nrequire \"rubocop/rake_task\"\nrequire \"yard\"\n\n# rubocop:disable LineLength\n\ndef run_acceptance_tests(provider = \"virtualbox\")\n  puts \"==================================================================\"\n  puts \"Running acceptance tests against '#{provider}' provider...\"\n  puts \"==================================================================\"\n\n  Dir.chdir(\"test/acceptance/#{provider}\") do\n    system(\"vagrant destroy -f\")\n    system(\"vagrant up --provider=#{provider}\")\n    system(\"vagrant destroy -f\")\n  end\nend\n\nYARD::Rake::YardocTask.new\n\nnamespace :style do\n  desc \"Run Ruby style checks\"\n  RuboCop::RakeTask.new(:ruby) do |task|\n    task.patterns = [\n      \"**/*.rb\",\n      \"**/Vagrantfile\",\n      \"*.gemspec\",\n      \"Gemfile\",\n      \"Rakefile\",\n    ]\n  end\nend\n\nnamespace :test do\n\n  RSpec::Core::RakeTask.new(:unit) do |t|\n    t.pattern = \"test/unit/**/*_spec.rb\"\n  end\n\n  namespace :acceptance do\n    desc \"Run acceptance tests with AWS provider\"\n    task :aws do\n      unless system(\"vagrant box list | grep 'dummy\\s*(aws)' &>/dev/null\")\n        system(\"vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box\")\n      end\n      run_acceptance_tests(\"aws\")\n    end\n\n    desc \"Run acceptance tests with Digital Ocean provider\"\n    task \"digital_ocean\" do\n      unless system(\"vagrant box list | grep 'digital_ocean' &>/dev/null\")\n        system(\"vagrant box add digital_ocean https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box\")\n      end\n      run_acceptance_tests(\"digital_ocean\")\n    end\n\n    desc \"Run acceptance tests with Rackspace provider\"\n    task :rackspace do\n      unless system(\"vagrant box list | grep 'dummy\\s*(rackspace)' &>/dev/null\")\n        system(\"vagrant box add dummy https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box\")\n      end\n      run_acceptance_tests(\"rackspace\")\n    end\n\n    desc \"Run acceptance tests with Linode provider\"\n    task \":linode\" do\n      unless system(\"vagrant box list | grep 'linode' &>/dev/null\")\n        system(\"vagrant box add linode https://github.com/displague/vagrant-linode/raw/master/box/linode.box\")\n      end\n      run_acceptance_tests(\"linode\")\n    end\n\n    desc \"Run acceptance tests with VirtualBox provider\"\n    task :virtualbox do\n      run_acceptance_tests(\"virtualbox\")\n    end\n\n    desc \"Run acceptance tests with VMware provider\"\n    task :vmware_fusion do\n      run_acceptance_tests(\"vmware_fusion\")\n    end\n  end\nend\n\n# We cannot run Test Kitchen on Travis CI yet...\nnamespace :travis do\n  desc \"Run tests on Travis\"\n  task ci: [\"style:ruby\", \"test:unit\"]\nend\n\nrequire \"vagrant-omnibus/version\"\n\n# The default rake task should just run it all\ntask default: [\"style:ruby\", \"test:unit\", \"test:acceptance:virtualbox\"]\n"
  },
  {
    "path": "lib/vagrant-omnibus/action/install_chef.rb",
    "content": "#\n# Copyright (c) 2013, Seth Chisamore\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nrequire \"log4r\"\nrequire \"shellwords\"\n\nrequire \"vagrant/util/downloader\"\n\nmodule VagrantPlugins\n  module Omnibus\n    module Action\n      # @author Seth Chisamore <schisamo@chef.io>\n      #\n      # This action installs Chef Omnibus packages at the desired version.\n      class InstallChef\n        def initialize(app, env)\n          @app = app\n          @logger =\n            Log4r::Logger.new(\"vagrantplugins::omnibus::action::installchef\")\n          @machine = env[:machine]\n          @install_script = find_install_script\n        end\n\n        def call(env)\n          @app.call(env)\n\n          return unless @machine.communicate.ready? && provision_enabled?(env)\n\n          # Perform delayed validation\n          @machine.config.omnibus.validate!(@machine)\n\n          desired_version = @machine.config.omnibus.chef_version\n          unless desired_version.nil?\n            if installed_version == desired_version\n              env[:ui].info I18n.t(\n                \"vagrant-omnibus.action.installed\",\n                version: desired_version\n              )\n            else\n              fetch_or_create_install_script(env)\n              env[:ui].info I18n.t(\n                \"vagrant-omnibus.action.installing\",\n                version: desired_version\n              )\n              install(desired_version, env)\n              recover(env)\n            end\n          end\n        end\n\n        private\n\n        # Determines which install script should be used to install the\n        # Omnibus Chef package. Order of precedence:\n        # 1. from config\n        # 2. from env var\n        # 3. default\n        def find_install_script\n          config_install_url || env_install_url || default_install_url\n        end\n\n        def default_install_url\n          if windows_guest?\n            \"http://www.chef.io/chef/install.msi\"\n          else\n            \"https://www.chef.io/chef/install.sh\"\n          end\n        end\n\n        def config_install_url\n          @machine.config.omnibus.install_url\n        end\n\n        def env_install_url\n          ENV[\"OMNIBUS_INSTALL_URL\"]\n        end\n\n        def cached_omnibus_download_dir\n          \"/tmp/vagrant-cache/vagrant_omnibus\"\n        end\n\n        def cache_packages?\n          @machine.config.omnibus.cache_packages\n        end\n\n        def cachier_present?\n          defined?(VagrantPlugins::Cachier::Plugin)\n        end\n\n        def cachier_autodetect_enabled?\n          @machine.config.cache.auto_detect\n        end\n\n        def download_to_cached_dir?\n          cache_packages? && cachier_present? && cachier_autodetect_enabled?\n        end\n\n        def install_script_name\n          if windows_guest?\n            \"install.bat\"\n          else\n            \"install.sh\"\n          end\n        end\n\n        def install_script_folder\n          if windows_guest?\n            \"$env:temp/vagrant-omnibus\"\n          else\n            \"/tmp/vagrant-omnibus\"\n          end\n        end\n\n        def install_script_path\n          File.join(install_script_folder, install_script_name)\n        end\n\n        def windows_guest?\n          @machine.config.vm.guest.eql?(:windows)\n        end\n\n        def provision_enabled?(env)\n          env.fetch(:provision_enabled, true)\n        end\n\n        def communication_opts\n          if windows_guest?\n            { shell: \"powershell\" }\n          else\n            { shell: \"sh\" }\n          end\n        end\n\n        def installed_version\n          version = nil\n          opts = communication_opts\n          opts[:error_check] = false if windows_guest?\n          command = \"echo $(chef-solo -v)\"\n          @machine.communicate.sudo(command, opts) do |type, data|\n            if [:stderr, :stdout].include?(type)\n              version_match = data.match(/^Chef: (.+)/)\n              version = version_match.captures[0].strip if version_match\n            end\n          end\n          version\n        end\n\n        #\n        # Upload install script from Host's Vagrant TMP directory to guest\n        # and executes.\n        #\n        def install(version, env)\n          shell_escaped_version = Shellwords.escape(version)\n\n          @machine.communicate.tap do |comm|\n            unless windows_guest?\n              comm.execute(\"mkdir -p #{install_script_folder}\")\n            end\n\n            comm.upload(@script_tmp_path, install_script_path)\n\n            if windows_guest?\n              install_cmd = \"& #{install_script_path} #{version}\"\n            else\n              install_cmd = \"sh #{install_script_path}\"\n              install_cmd << \" -v #{shell_escaped_version}\"\n              if download_to_cached_dir?\n                install_cmd << \" -d #{cached_omnibus_download_dir}\"\n              end\n              install_cmd << \" 2>&1\"\n            end\n            comm.sudo(install_cmd, communication_opts) do |type, data|\n              if [:stderr, :stdout].include?(type)\n                next if data =~ /stdin: is not a tty/\n                env[:ui].info(data)\n              end\n            end\n          end\n        end\n\n        #\n        # Fetches or creates a platform specific install script to the Host's\n        # Vagrant TMP directory.\n        #\n        def fetch_or_create_install_script(env)\n          @script_tmp_path = env[:tmp_path].join(\n            \"#{Time.now.to_i}-#{install_script_name}\"\n          ).to_s\n\n          @logger.info(\"Generating install script at: #{@script_tmp_path}\")\n\n          url = @install_script\n\n          if File.file?(url) || url !~ /^[a-z0-9]+:.*$/i\n            @logger.info(\"Assuming URL is a file.\")\n            file_path = File.expand_path(url)\n            file_path = Vagrant::Util::Platform.cygwin_windows_path(file_path)\n            url = \"file:#{file_path}\"\n          end\n\n          # Download the install.sh or create install.bat file to a temporary\n          # path. We store the temporary path as an instance variable so that\n          # the `#recover` method can access it.\n          begin\n            if windows_guest?\n              # generate a install.bat file at the `@script_tmp_path` location\n              #\n              # We'll also disable Rubocop for this embedded PowerShell code:\n              #\n              # rubocop:disable LineLength, SpaceAroundBlockBraces\n              #\n              File.open(@script_tmp_path, \"w\") do |f|\n                f.puts <<-EOH.gsub(/^\\s{18}/, \"\")\n                  @echo off\n                  set version=%1\n                  set dest=%~dp0chef-client-%version%-1.windows.msi\n                  echo Downloading Chef %version% for Windows...\n                  powershell -command \"(New-Object System.Net.WebClient).DownloadFile('#{url}?v=%version%', '%dest%')\"\n                  echo Installing Chef %version%\n                  msiexec /q /i \"%dest%\"\n                EOH\n              end\n              # rubocop:enable LineLength, SpaceAroundBlockBraces\n            else\n              downloader = Vagrant::Util::Downloader.new(\n                url,\n                @script_tmp_path,\n                {}\n              )\n              downloader.download!\n            end\n          rescue Vagrant::Errors::DownloaderInterrupted\n            # The downloader was interrupted, so just return, because that\n            # means we were interrupted as well.\n            env[:ui].info(I18n.t(\"vagrant-omnibus.download.interrupted\"))\n            return\n          end\n        end\n\n        def recover(env)\n          if @script_tmp_path && File.exist?(@script_tmp_path)\n            # Try extra hard to unlink the file so that it reliably works\n            # on Windows hosts as well, see:\n            # http://alx.github.io/2009/01/27/ruby-wundows-unlink.html\n            file_deleted = false\n            until file_deleted\n              begin\n                File.unlink(@script_tmp_path)\n                file_deleted = true\n              rescue Errno::EACCES\n                @logger.debug(\"failed to unlink #{@script_tmp_path}. retry...\")\n              end\n            end\n          end\n        end\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/vagrant-omnibus/config.rb",
    "content": "#\n# Copyright (c) 2013, Seth Chisamore\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nrequire \"rubygems/dependency\"\nrequire \"rubygems/dependency_installer\"\nrequire \"vagrant\"\nrequire \"vagrant/errors\"\nrequire \"vagrant/util/template_renderer\"\n\nmodule VagrantPlugins\n  #\n  module Omnibus\n    # @author Seth Chisamore <schisamo@chef.io>\n    class Config < Vagrant.plugin(\"2\", :config)\n      # @return [String]\n      #   The version of Chef to install.\n      attr_accessor :chef_version, :install_url, :cache_packages\n\n      def initialize\n        @chef_version = UNSET_VALUE\n        @install_url = UNSET_VALUE\n        @cache_packages = UNSET_VALUE\n        @logger = Log4r::Logger.new(\"vagrantplugins::omnibus::config\")\n      end\n\n      def finalize!\n        if @chef_version == UNSET_VALUE\n          @chef_version = nil\n        end\n        # enable caching by default\n        @cache_packages = true if @cache_packages == UNSET_VALUE\n        # nil means default install.sh|msi\n        @install_url = nil if @install_url == UNSET_VALUE\n      end\n\n      #\n      # Performs validation and immediately raises an exception for any\n      # detected errors.\n      #\n      # @raise [Vagrant::Errors::ConfigInvalid]\n      #   if validation fails\n      #\n      def validate!(machine)\n        finalize!\n        errors = []\n\n        if !chef_version.nil? && !valid_chef_version?(chef_version)\n          msg = <<-EOH\n'#{chef_version}' is not a valid version of Chef.\n\nA list of valid versions can be found at: https://downloads.chef.io/chef-client/\n          EOH\n          errors << msg\n        end\n\n        if errors.any?\n          rendered_errors = Vagrant::Util::TemplateRenderer.render(\n                              \"config/validation_failed\",\n                              errors: { \"vagrant-omnibus\" => errors }\n                            )\n          raise Vagrant::Errors::ConfigInvalid, errors: rendered_errors\n        end\n      end\n\n      private\n\n      # Query RubyGems.org's Ruby API to see if the user-provided Chef version\n      # is in fact a real Chef version!\n      def valid_chef_version?(version)\n        return true if version.to_s == \"latest\"\n        begin\n          available = dependency_installer.find_gems_with_sources(\n            chef_gem_dependency(version)\n          )\n        rescue ArgumentError => e\n          @logger.debug(\"#{version} is not a valid Chef version: #{e}\")\n          return false\n        end\n        !available.empty?\n      end\n\n      def dependency_installer\n        @dependency_installer ||= Gem::DependencyInstaller.new\n      end\n\n      def chef_gem_dependency(version = nil)\n        Gem::Dependency.new(\"chef\", version)\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/vagrant-omnibus/plugin.rb",
    "content": "#\n# Copyright (c) 2013, Seth Chisamore\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nmodule VagrantPlugins\n  #\n  module Omnibus\n    # @author Seth Chisamore <schisamo@chef.io>\n    class Plugin < Vagrant.plugin(\"2\")\n      name \"vagrant-omnibus\"\n      description <<-DESC\n      This plugin ensures the desired version of Chef is installed\n      via the platform-specific Omnibus packages.\n      DESC\n\n      VAGRANT_VERSION_REQUIREMENT = \">= 1.1.0\"\n\n      # Returns true if the Vagrant version fulfills the requirements\n      #\n      # @param requirements [String, Array<String>] the version requirement\n      # @return [Boolean]\n      def self.check_vagrant_version(*requirements)\n        Gem::Requirement.new(*requirements).satisfied_by?(\n          Gem::Version.new(Vagrant::VERSION)\n        )\n      end\n\n      # Verifies that the Vagrant version fulfills the requirements\n      #\n      # @raise [VagrantPlugins::Omnibus::VagrantVersionError] if this plugin\n      # is incompatible with the Vagrant version\n      def self.check_vagrant_version!\n        unless check_vagrant_version(VAGRANT_VERSION_REQUIREMENT)\n          msg = I18n.t(\n            \"vagrant-omnibus.errors.vagrant_version\",\n            requirement: VAGRANT_VERSION_REQUIREMENT.inspect\n          )\n          $stderr.puts(msg)\n          raise msg\n        end\n      end\n\n      action_hook(:install_chef, Plugin::ALL_ACTIONS) do |hook|\n        require_relative \"action/install_chef\"\n        hook.after(Vagrant::Action::Builtin::Provision, Action::InstallChef)\n\n        # The AWS provider < v0.4.0 uses a non-standard Provision action\n        # on initial creation:\n        #\n        # mitchellh/vagrant-aws/blob/v0.3.0/lib/vagrant-aws/action.rb#L105\n        #\n        if defined? VagrantPlugins::AWS::Action::TimedProvision\n          hook.after(\n            VagrantPlugins::AWS::Action::TimedProvision,\n            Action::InstallChef\n          )\n        end\n      end\n\n      config(:omnibus) do\n        require_relative \"config\"\n        Config\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/vagrant-omnibus/version.rb",
    "content": "#\n# Copyright (c) 2013, Seth Chisamore\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nmodule VagrantPlugins\n  #\n  module Omnibus\n    VERSION = \"1.5.0\"\n  end\nend\n"
  },
  {
    "path": "lib/vagrant-omnibus.rb",
    "content": "#\n# Copyright (c) 2013, Seth Chisamore\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nrequire \"vagrant\"\nrequire \"vagrant-omnibus/plugin\"\nrequire \"vagrant-omnibus/config\"\n\nmodule VagrantPlugins\n  #\n  module Omnibus\n    def self.source_root\n      @source_root ||= Pathname.new(File.expand_path(\"../../\", __FILE__))\n    end\n\n    I18n.load_path << File.expand_path(\"locales/en.yml\", source_root)\n    I18n.reload!\n  end\nend\n"
  },
  {
    "path": "locales/en.yml",
    "content": "en:\n  vagrant-omnibus:\n    action:\n      installed: \"Chef %{version} Omnibus package is already installed.\"\n      installing: \"Installing Chef %{version} Omnibus package...\"\n    download:\n      downloading: \"Downloading or copying install.sh...\"\n      interrupted: \"Install.sh download was interrupted. Exiting.\"\n    errors:\n      vagrant_version: |-\n        vagrant-omnibus plugin requires Vagrant version %{requirement}\n"
  },
  {
    "path": "test/acceptance/aws/Vagrantfile",
    "content": "# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n# plugins don't seem to be auto-loaded from the bundle\nrequire \"vagrant-omnibus\"\nrequire \"vagrant-aws\"\n\nVagrant.configure(\"2\") do |config|\n  config.omnibus.chef_version = \"11.4.0\"\n\n  config.vm.box = \"dummy\"\n  config.vm.provider :aws do |aws, override|\n    aws.access_key_id = ENV[\"DEV_AWS_ACCESS_KEY_ID\"]\n    aws.secret_access_key = ENV[\"DEV_AWS_SECRET_ACCESS_KEY\"]\n    aws.keypair_name = ENV[\"USER\"]\n\n    aws.instance_type = \"m1.large\"\n    aws.ami = \"ami-2efa9d47\" # Ubuntu 12.04 LTS 64-bit instance root store\n\n    override.ssh.username = \"ubuntu\"\n    override.ssh.private_key_path = \"~/.ssh/id_rsa\"\n  end\n\n  config.vm.provision :chef_solo do |chef|\n    chef.cookbooks_path =\n      File.expand_path(\"../../../support/cookbooks\", __FILE__)\n    chef.add_recipe \"chef-inator\"\n  end\nend\n"
  },
  {
    "path": "test/acceptance/digital_ocean/Vagrantfile",
    "content": "Vagrant.require_plugin(\"vagrant-omnibus\")\nVagrant.require_plugin(\"vagrant-digitalocean\")\n\nVagrant.configure(\"2\") do |config|\n  config.omnibus.chef_version = :latest\n\n  config.vm.box = \"digital_ocean\"\n  config.vm.synced_folder \".\", \"/vagrant\", disabled: true\n\n  config.vm.provider :digital_ocean do |provider, override|\n    provider.client_id = ENV[\"DO_CLIENT_ID\"]\n    provider.api_key = ENV[\"DO_API_KEY\"]\n    provider.region = \"New York 1\"\n    provider.size = \"512MB\"\n    provider.image = \"Ubuntu 12.04 x64 Server\"\n    override.ssh.private_key_path = \"~/.ssh/id_rsa\"\n  end\n\n  config.vm.provision :chef_solo do |chef|\n    chef.cookbooks_path =\n      File.expand_path(\"../../../support/cookbooks\", __FILE__)\n    chef.add_recipe \"chef-inator\"\n  end\nend\n"
  },
  {
    "path": "test/acceptance/linode/Vagrantfile",
    "content": "Vagrant.require_plugin(\"vagrant-omnibus\")\nVagrant.require_plugin(\"vagrant-linode\")\n\nVagrant.configure(\"2\") do |config|\n  config.omnibus.chef_version = :latest\n\n  config.vm.box = \"linode\"\n  config.vm.synced_folder \".\", \"/vagrant\", disabled: true\n\n  config.vm.provider :linode do |provider, override|\n    provider.token = ENV[\"LINODE_API_KEY\"]\n    provider.datacenter = \"newark\"\n    provider.planid = 1\n    provider.distribution = \"Ubuntu 18.04 LTS\"\n    override.ssh.private_key_path = \"~/.ssh/id_rsa\"\n  end\n\n  config.vm.provision :chef_solo do |chef|\n    chef.cookbooks_path =\n      File.expand_path(\"../../../support/cookbooks\", __FILE__)\n    chef.add_recipe \"chef-inator\"\n  end\nend\n"
  },
  {
    "path": "test/acceptance/rackspace/Vagrantfile",
    "content": "# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n# plugins don't seem to be auto-loaded from the bundle\nrequire \"vagrant-omnibus\"\nrequire \"vagrant-rackspace\"\n\nVagrant.configure(\"2\") do |config|\n  config.omnibus.chef_version = \"11.4.0\"\n\n  config.vm.box = \"dummy\"\n  config.vm.provider :rackspace do |rackspace|\n    rackspace.username = ENV[\"DEV_RACKSPACE_USERNAME\"]\n    rackspace.api_key = ENV[\"DEV_RACKSPACE_API_KEY\"]\n    rackspace.flavor = /512MB/\n    rackspace.image = /Ubuntu 12.04/\n    rackspace.public_key_path = \"~/.ssh/id_rsa.pub\"\n    # TODO: switch this to the `override.ssh.private_key_path` syntax once\n    # `vagrant-rackspace` is updated.\n    config.ssh.private_key_path = \"~/.ssh/id_rsa\"\n  end\n\n  config.vm.provision :chef_solo do |chef|\n    chef.cookbooks_path =\n      File.expand_path(\"../../../support/cookbooks\", __FILE__)\n    chef.add_recipe \"chef-inator\"\n  end\nend\n"
  },
  {
    "path": "test/acceptance/virtualbox/Vagrantfile",
    "content": "# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n# rubocop:disable LineLength\n\n# plugins don't seem to be auto-loaded from the bundle\nrequire \"vagrant-omnibus\"\n\ndef box_type\n  @box_type ||= begin\n    # Returns `/Users/schisamo/dev/code/schisamo/vagrant-omnibus/test/acceptance/vmware_fusion`\n    full_dir = File.dirname(File.expand_path(__FILE__))\n    # Returns `vmware_fusion`\n    base_dir = full_dir.split(\"/\").last\n    base_dir.split(\"_\").first\n  end\nend\n\nVagrant.configure(\"2\") do |config|\n\n  config.vm.define :new_chef do |new_chef_config|\n    new_chef_config.vm.box = \"opscode-ubuntu-12.04\"\n    new_chef_config.vm.box_url = \"http://opscode-vm-bento.s3.amazonaws.com/vagrant/#{box_type}/opscode_ubuntu-12.04_chef-provisionerless.box\"\n\n    new_chef_config.omnibus.chef_version = :latest\n\n    new_chef_config.vm.provision :chef_solo do |chef|\n      chef.cookbooks_path = File.expand_path(\"../../../support/cookbooks\", __FILE__)\n      chef.add_recipe \"chef-inator\"\n    end\n  end\n\n  config.vm.define :old_chef do |old_chef_config|\n    old_chef_config.vm.box = \"opscode-centos-6.5\"\n    old_chef_config.vm.box_url = \"http://opscode-vm-bento.s3.amazonaws.com/vagrant/#{box_type}/opscode_centos-6.5_chef-provisionerless.box\"\n\n    old_chef_config.omnibus.chef_version = \"10.24.0\"\n\n    old_chef_config.vm.provision :chef_solo do |chef|\n      chef.cookbooks_path = File.expand_path(\"../../../support/cookbooks\", __FILE__)\n      chef.add_recipe \"chef-inator\"\n    end\n  end\n\n  # We don't have legacy VMware boxes\n  unless box_type == \"vmware\"\n    config.vm.define :chef_already_installed do |installed_config|\n      installed_config.vm.box = \"opscode-ubuntu-12.04-chef-11.4.4\"\n      installed_config.vm.box_url = \"https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_chef-11.4.4.box\"\n\n      installed_config.omnibus.chef_version = \"11.4.4\"\n\n      installed_config.vm.provision :chef_solo do |chef|\n        chef.cookbooks_path = File.expand_path(\"../../../support/cookbooks\", __FILE__)\n        chef.add_recipe \"chef-inator\"\n      end\n    end\n  end\n\n  config.vm.define :chef_on_windows do |win_config|\n    # win_config.vm.guest             = :windows\n    win_config.vm.box               = \"win7x64-pro\"\n    # build this yourself https://github.com/misheska/basebox-packer\n    # win_config.vm.box_url           = ''\n    win_config.vm.boot_timeout      = 500\n\n    win_config.omnibus.chef_version = :latest\n\n    win_config.vm.provision :chef_solo do |chef|\n      chef.cookbooks_path = File.expand_path(\"../../../support/cookbooks\", __FILE__)\n      chef.add_recipe \"chef-inator\"\n    end\n  end\n\n  config.vm.define :no_bash do |c|\n    c.vm.box = \"opscode-freebsd-9.2\"\n    c.vm.box_url = \"http://opscode-vm-bento.s3.amazonaws.com/vagrant/#{box_type}/opscode_freebsd-9.2_chef-provisionerless.box\"\n    c.omnibus.chef_version = :latest\n\n    c.vm.synced_folder \".\", \"/vagrant\", type: \"rsync\", id: \"vagrant-root\"\n\n    # This forces all remote commands to execute under `sh`. If we don't\n    # add this config then all `chef` related commands will execute\n    # with `bash` (which might not be installed).\n    c.ssh.shell = \"sh\"\n\n    c.vm.provision :chef_solo do |chef|\n      chef.synced_folder_type = \"rsync\"\n      chef.cookbooks_path = File.expand_path(\"../../../support/cookbooks\", __FILE__)\n      chef.add_recipe \"chef-inator\"\n    end\n  end\nend\n"
  },
  {
    "path": "test/support/cookbooks/chef-inator/README.md",
    "content": "# super-tester cookbook\n\n# Requirements\n\n# Usage\n\n# Attributes\n\n# Recipes\n\n# Author\n\nAuthor:: YOUR_NAME (<YOUR_EMAIL>)\n"
  },
  {
    "path": "test/support/cookbooks/chef-inator/metadata.rb",
    "content": "name             \"chef-inator\"\nmaintainer       \"Dr. Heinz Doofenshmirtz\"\nmaintainer_email \"heinz@doofenshmirtz-evil-inc.com\"\nlicense          \"All rights reserved\"\ndescription      \"Uses Chef to take over the Tri-State Area!\"\nlong_description IO.read(File.join(File.dirname(__FILE__), \"README.md\"))\nversion          \"0.1.0\"\n"
  },
  {
    "path": "test/support/cookbooks/chef-inator/recipes/default.rb",
    "content": "\nChef::Log.info \"CURSE YOU...Perry the Platypus!!!!\"\n"
  },
  {
    "path": "test/unit/spec_helper.rb",
    "content": "$LOAD_PATH.unshift File.expand_path(\"../../../lib\", __FILE__)\n\nrequire \"rspec/core\"\nrequire \"vagrant-omnibus\"\n\nRSpec.configure do |config|\n  config.formatter = :documentation\n\n  # a little syntactic sugar\n  config.alias_it_should_behave_like_to :it_has_behavior, \"has behavior:\"\n\n  # Use color in STDOUT\n  config.color = true\n\n  # Use color not only in STDOUT but also in pagers and files\n  config.tty = true\n\n  # run the examples in random order\n  config.order = :rand\n\n  config.filter_run focus: true\n  config.run_all_when_everything_filtered = true\nend\n"
  },
  {
    "path": "test/unit/vagrant-omnibus/config_spec.rb",
    "content": "require \"spec_helper\"\n\n# rubocop:disable LineLength\n\ndescribe VagrantPlugins::Omnibus::Config do\n  let(:machine) { double(\"machine\") }\n  let(:instance) { described_class.new }\n\n  subject(:config) do\n    instance.tap do |o|\n      o.chef_version = chef_version if defined?(chef_version)\n      o.install_url = install_url if defined?(install_url)\n      o.cache_packages = cache_packages if defined?(cache_packages)\n      o.finalize!\n    end\n  end\n\n  context \"default values\" do\n    describe \"#chef_version\" do\n      subject { super().chef_version }\n      it { is_expected.to be_nil }\n    end\n\n    describe \"#install_url\" do\n      subject { super().install_url }\n      it { is_expected.to be_nil }\n    end\n\n    describe \"#cache_packages\" do\n      subject { super().cache_packages }\n      it { is_expected.to be_truthy }\n    end\n  end\n\n  describe \"no longer resolves :latest to a Chef version\" do\n    let(:chef_version) { :latest }\n\n    describe \"#chef_version\" do\n      subject { super().chef_version }\n      it { is_expected.to eql(:latest) }\n    end\n  end\n\n  describe \"setting a custom `install_url`\" do\n    let(:install_url) { \"http://some_path.com/install.sh\" }\n\n    describe \"#install_url\" do\n      subject { super().install_url }\n      it { is_expected.to eq(\"http://some_path.com/install.sh\") }\n    end\n  end\n\n  describe \"the `cache_packages` config option behaves truthy\" do\n    [true, \"something\", :cachier].each do |obj|\n      describe \"when `#{obj}` (#{obj.class})\" do\n        let(:cache_packages) { obj }\n\n        describe \"#cache_packages\" do\n          subject { super().cache_packages }\n          it { is_expected.to be_truthy }\n        end\n      end\n    end\n    [nil, false].each do |obj|\n      describe \"when `#{obj}` (#{obj.class})\" do\n        let(:cache_packages) { obj }\n\n        describe \"#cache_packages\" do\n          subject { super().cache_packages }\n          it { is_expected.to be_falsey }\n        end\n      end\n    end\n  end\n\n  describe \"validate\" do\n    it \"is a be no-op\" do\n      expect(subject.validate(machine)).to eq(\"VagrantPlugins::Omnibus::Config\" => [])\n    end\n  end\n\n  describe \"#validate!\" do\n    describe \"chef_version validation\" do\n      {\n        \"11.4.0\" => {\n          description: \"valid Chef version string\",\n          valid: true,\n        },\n        \"10.99.99\" => {\n          description: \"invalid Chef version string\",\n          valid: false,\n        },\n        \"FUFUFU\" => {\n          description: \"invalid RubyGems version string\",\n          valid: false,\n        },\n      }.each_pair do |version_string, opts|\n        context \"#{opts[:description]}: #{version_string}\" do\n          let(:chef_version) { version_string }\n          if opts[:valid]\n            it \"passes\" do\n              expect { subject.validate!(machine) }.to_not raise_error\n            end\n          else\n            it \"fails\" do\n              expect { subject.validate!(machine) }.to raise_error(Vagrant::Errors::ConfigInvalid)\n            end\n          end\n        end\n      end\n    end # describe chef_version\n\n    describe \"not specified chef_version validation\" do\n      it \"passes\" do\n        allow_any_instance_of(Gem::DependencyInstaller).to receive(:find_gems_with_sources).and_return([])\n        expect { subject.validate!(machine) }.to_not raise_error\n      end\n    end # describe not specified chef_version validation\n\n  end # describe #validate\nend\n"
  },
  {
    "path": "test/unit/vagrant-omnibus/plugin_spec.rb",
    "content": "require \"spec_helper\"\n\ndescribe VagrantPlugins::Omnibus::Plugin do\n\n  context \"action hooks\" do\n    let(:hook) { double(append: true, prepend: true) }\n    let(:fake_class) { Class.new }\n\n    it \"should hook InstallChef before Provision\" do\n      stub_const(\"VagrantPlugins::Omnibus::Action::InstallChef\", fake_class)\n      hook_proc = described_class.components.action_hooks[:__all_actions__][0]\n      hook = double\n      expect(hook).to receive(:after).with(Vagrant::Action::Builtin::Provision, VagrantPlugins::Omnibus::Action::InstallChef)\n      hook_proc.call(hook)\n    end\n  end\n\n  it \"should define a config of type :omnibus\" do\n    default_config = described_class.components.configs[:top].to_hash[:omnibus]\n    expect(default_config).to be(VagrantPlugins::Omnibus::Config)\n  end\n\n  describe \".check_vagrant_version\" do\n    before :each do\n      stub_const(\"Vagrant::VERSION\", \"1.2.3\")\n    end\n\n    it \"accepts single String argument\" do\n      expect(described_class.check_vagrant_version(\"~> 1.1\")).to be_truthy\n      expect(described_class.check_vagrant_version(\"1.2\")).to be_falsey\n    end\n\n    it \"accepts an Array argument\" do\n      expect(described_class.check_vagrant_version([\">= 1.1\", \"< 1.3.0.beta\"])).to be_truthy\n      expect(described_class.check_vagrant_version([\">= 1.3\"])).to be_falsey\n    end\n\n    it \"accepts multiple arguments\" do\n      expect(described_class.check_vagrant_version(\">= 1.0\", \"<= 1.3\")).to be_truthy\n      expect(described_class.check_vagrant_version(\"~> 1.2\", \">= 1.2.5\")).to be_falsey\n    end\n  end\n\n  describe \".check_vagrant_version!\" do\n    subject { described_class.check_vagrant_version! }\n    let(:requirement) { \">= 1.1.0\" }\n    let(:err_msg) { /requires Vagrant version #{Regexp.escape(requirement.inspect)}/ }\n\n    before :each do\n      stub_const(\n        \"VagrantPlugins::ProxyConf::Plugin::VAGRANT_VERSION_REQUIREMENT\",\n        requirement\n      )\n      stub_const(\"Vagrant::VERSION\", vagrant_version)\n      allow($stderr).to receive(:puts)\n    end\n\n    context \"on too old Vagrant version\" do\n      let(:vagrant_version) { \"1.0.9\" }\n      it \"raises error\" do\n        expect { subject }.to raise_error(err_msg)\n      end\n      it \"warns as stderr\" do\n        expect($stderr).to receive(:puts).with(err_msg)\n        expect { subject }.to raise_error(err_msg)\n      end\n    end\n\n    context \"on exact required Vagrant version\" do\n      let(:vagrant_version) { \"1.1.0\" }\n      it \"does not raise\" do\n        expect { subject }.not_to raise_error\n      end\n    end\n\n    context \"on newer Vagrant version\" do\n      let(:vagrant_version) { \"1.3.5\" }\n      it \"does not raise\" do\n        expect { subject }.not_to raise_error\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "vagrant-omnibus.gemspec",
    "content": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"vagrant-omnibus/version\"\n\nGem::Specification.new do |spec|\n  spec.name          = \"vagrant-omnibus\"\n  spec.version       = VagrantPlugins::Omnibus::VERSION\n  spec.authors       = [\"Seth Chisamore\"]\n  spec.email         = [\"schisamo@chef.io\"]\n  spec.description   = \"A Vagrant plugin that ensures the desired version of\" \\\n                       \" Chef is installed via the platform-specific Omnibus\" \\\n                       \" packages.\"\n  spec.summary       = spec.description\n  spec.homepage      = \"https://github.com/chef/vagrant-omnibus\"\n  spec.license       = \"Apache 2.0\"\n\n  spec.files         = `git ls-files`.split($INPUT_RECORD_SEPARATOR)\n  spec.executables   = spec.files.grep(/^bin\\//) { |f| File.basename(f) }\n  spec.test_files    = spec.files.grep(/^(test|spec|features)\\//)\n  spec.require_paths = [\"lib\"]\n\n  spec.add_development_dependency \"bundler\", \"~> 1.3\"\n  spec.add_development_dependency \"rake\", \"~> 11.0\"\n  spec.add_development_dependency \"rspec\", \"~> 3.0\"\n  spec.add_development_dependency \"chefstyle\", \"~> 0.10.0\"\nend\n"
  }
]