vagrant-clone 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/.idea/.rakeTasks +7 -0
  3. data/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. data/.idea/misc.xml +4 -0
  5. data/.idea/modules.xml +8 -0
  6. data/.idea/runConfigurations/clone.xml +21 -0
  7. data/.idea/runConfigurations/libvirt.xml +21 -0
  8. data/.idea/vagrant-clone.iml +114 -0
  9. data/.idea/vcs.xml +6 -0
  10. data/.idea/workspace.xml +948 -0
  11. data/Gemfile +9 -3
  12. data/Gemfile.lock +123 -37
  13. data/Rakefile +2 -1
  14. data/Vagrantfile +9 -0
  15. data/cookbooks/apt/CHANGELOG.md +321 -0
  16. data/cookbooks/apt/CONTRIBUTING.md +2 -0
  17. data/cookbooks/apt/MAINTAINERS.md +15 -0
  18. data/cookbooks/apt/README.md +250 -0
  19. data/cookbooks/apt/attributes/default.rb +57 -0
  20. data/cookbooks/apt/files/15update-stamp +1 -0
  21. data/cookbooks/apt/files/apt-proxy-v2.conf +50 -0
  22. data/cookbooks/apt/libraries/helpers.rb +49 -0
  23. data/cookbooks/apt/libraries/matchers.rb +16 -0
  24. data/cookbooks/apt/metadata.json +1 -0
  25. data/cookbooks/apt/recipes/cacher-client.rb +52 -0
  26. data/cookbooks/apt/recipes/cacher-ng.rb +39 -0
  27. data/cookbooks/apt/recipes/default.rb +93 -0
  28. data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
  29. data/cookbooks/apt/resources/preference.rb +90 -0
  30. data/cookbooks/apt/templates/01proxy.erb +11 -0
  31. data/cookbooks/apt/templates/10dpkg-options.erb +8 -0
  32. data/cookbooks/apt/templates/10recommends.erb +3 -0
  33. data/cookbooks/apt/templates/20auto-upgrades.erb +5 -0
  34. data/cookbooks/apt/templates/50unattended-upgrades.erb +75 -0
  35. data/cookbooks/apt/templates/acng.conf.erb +275 -0
  36. data/cookbooks/apt/templates/unattended-upgrades.seed.erb +1 -0
  37. data/cookbooks/build-essential/.foodcritic +1 -0
  38. data/cookbooks/build-essential/CHANGELOG.md +257 -0
  39. data/cookbooks/build-essential/CONTRIBUTING.md +2 -0
  40. data/cookbooks/build-essential/MAINTAINERS.md +15 -0
  41. data/cookbooks/build-essential/README.md +134 -0
  42. data/cookbooks/build-essential/attributes/default.rb +21 -0
  43. data/cookbooks/build-essential/libraries/matchers.rb +9 -0
  44. data/cookbooks/build-essential/metadata.json +1 -0
  45. data/cookbooks/build-essential/recipes/_windows.rb +53 -0
  46. data/cookbooks/build-essential/recipes/default.rb +24 -0
  47. data/cookbooks/build-essential/resources/build_essential.rb +106 -0
  48. data/cookbooks/build-essential/resources/xcode_command_line_tools.rb +61 -0
  49. data/cookbooks/compat_resource/CHANGELOG.md +53 -0
  50. data/cookbooks/compat_resource/CONTRIBUTING.md +2 -0
  51. data/cookbooks/compat_resource/MAINTAINERS.md +16 -0
  52. data/cookbooks/compat_resource/README.md +60 -0
  53. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/constants.rb +47 -0
  54. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/delayed_evaluator.rb +40 -0
  55. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/core.rb +73 -0
  56. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/declare_resource.rb +315 -0
  57. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/platform_introspection.rb +292 -0
  58. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/recipe.rb +37 -0
  59. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/universal.rb +70 -0
  60. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/lazy_module_include.rb +98 -0
  61. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/notifying_block.rb +74 -0
  62. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/params_validate.rb +510 -0
  63. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/powershell_out.rb +117 -0
  64. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb +328 -0
  65. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb +713 -0
  66. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_repository.rb +269 -0
  67. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_update.rb +105 -0
  68. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/noop.rb +56 -0
  69. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/support/yum_repo.erb +132 -0
  70. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/systemd_unit.rb +253 -0
  71. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/yum_repository.rb +136 -0
  72. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb +164 -0
  73. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/action_class.rb +114 -0
  74. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_repository.rb +65 -0
  75. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_update.rb +52 -0
  76. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/systemd_unit.rb +81 -0
  77. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/yum_repository.rb +97 -0
  78. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource.rb +214 -0
  79. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource_builder.rb +174 -0
  80. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef.rb +29 -0
  81. data/cookbooks/compat_resource/files/lib/chef_compat/mixin/properties.rb +8 -0
  82. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/exceptions.rb +10 -0
  83. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/log.rb +30 -0
  84. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb +17 -0
  85. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/node.rb +9 -0
  86. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/property.rb +15 -0
  87. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb +65 -0
  88. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe.rb +118 -0
  89. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe_hook.rb +20 -0
  90. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb +60 -0
  91. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource.rb +156 -0
  92. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb +167 -0
  93. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_list.rb +49 -0
  94. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_set.rb +49 -0
  95. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection.rb +103 -0
  96. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb +691 -0
  97. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb +153 -0
  98. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef.rb +33 -0
  99. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches.rb +41 -0
  100. data/cookbooks/compat_resource/files/lib/chef_compat/property.rb +6 -0
  101. data/cookbooks/compat_resource/files/lib/chef_compat/recipe.rb +8 -0
  102. data/cookbooks/compat_resource/files/lib/chef_compat/resource/lwrp_base.rb +44 -0
  103. data/cookbooks/compat_resource/files/lib/chef_compat/resource.rb +56 -0
  104. data/cookbooks/compat_resource/files/lib/chef_upstream_version.rb +3 -0
  105. data/cookbooks/compat_resource/files/lib/compat_resource.rb +35 -0
  106. data/cookbooks/compat_resource/libraries/autoload.rb +31 -0
  107. data/cookbooks/compat_resource/metadata.json +1 -0
  108. data/cookbooks/inifile_chef_gem/CHANGELOG.md +11 -0
  109. data/cookbooks/inifile_chef_gem/README.md +46 -0
  110. data/cookbooks/inifile_chef_gem/metadata.json +51 -0
  111. data/cookbooks/inifile_chef_gem/metadata.rb +11 -0
  112. data/cookbooks/inifile_chef_gem/resources/default.rb +28 -0
  113. data/cookbooks/mariadb/CHANGELOG.md +332 -0
  114. data/cookbooks/mariadb/README.md +225 -0
  115. data/cookbooks/mariadb/attributes/default.rb +199 -0
  116. data/cookbooks/mariadb/libraries/mariadb_conn_helper.rb +53 -0
  117. data/cookbooks/mariadb/libraries/mariadb_helper.rb +216 -0
  118. data/cookbooks/mariadb/libraries/matchers.rb +21 -0
  119. data/cookbooks/mariadb/metadata.json +1 -0
  120. data/cookbooks/mariadb/providers/configuration.rb +39 -0
  121. data/cookbooks/mariadb/recipes/_audit_plugin.rb +63 -0
  122. data/cookbooks/mariadb/recipes/_debian_galera.rb +62 -0
  123. data/cookbooks/mariadb/recipes/_debian_server.rb +78 -0
  124. data/cookbooks/mariadb/recipes/_mariadb_repository.rb +29 -0
  125. data/cookbooks/mariadb/recipes/_redhat_client.rb +27 -0
  126. data/cookbooks/mariadb/recipes/_redhat_galera.rb +55 -0
  127. data/cookbooks/mariadb/recipes/_redhat_server.rb +58 -0
  128. data/cookbooks/mariadb/recipes/client.rb +47 -0
  129. data/cookbooks/mariadb/recipes/config.rb +115 -0
  130. data/cookbooks/mariadb/recipes/default.rb +46 -0
  131. data/cookbooks/mariadb/recipes/devel.rb +41 -0
  132. data/cookbooks/mariadb/recipes/galera.rb +324 -0
  133. data/cookbooks/mariadb/recipes/plugins.rb +3 -0
  134. data/cookbooks/mariadb/recipes/repository.rb +45 -0
  135. data/cookbooks/mariadb/recipes/server.rb +157 -0
  136. data/cookbooks/mariadb/resources/configuration.rb +13 -0
  137. data/cookbooks/mariadb/resources/mysql2_gem.rb +25 -0
  138. data/cookbooks/mariadb/resources/replication.rb +192 -0
  139. data/cookbooks/mariadb/templates/default/conf.d.generic.erb +19 -0
  140. data/cookbooks/mariadb/templates/default/debian.cnf.erb +12 -0
  141. data/cookbooks/mariadb/templates/default/mariadb-server.seed.erb +13 -0
  142. data/cookbooks/mariadb/templates/default/mariadb_grants.erb +42 -0
  143. data/cookbooks/mariadb/templates/default/my.cnf.erb +210 -0
  144. data/cookbooks/mariadb/templates/default/root.cnf.erb +5 -0
  145. data/cookbooks/mingw/.foodcritic +1 -0
  146. data/cookbooks/mingw/CHANGELOG.md +50 -0
  147. data/cookbooks/mingw/CONTRIBUTING.md +2 -0
  148. data/cookbooks/mingw/MAINTAINERS.md +14 -0
  149. data/cookbooks/mingw/README.md +133 -0
  150. data/cookbooks/mingw/files/default/bash.bat +17 -0
  151. data/cookbooks/mingw/files/default/custom-upgrade.sh +23 -0
  152. data/cookbooks/mingw/files/default/custom_prefix.sh +13 -0
  153. data/cookbooks/mingw/files/default/pthread.h +719 -0
  154. data/cookbooks/mingw/files/default/time.h +297 -0
  155. data/cookbooks/mingw/libraries/_helper.rb +38 -0
  156. data/cookbooks/mingw/metadata.json +1 -0
  157. data/cookbooks/mingw/recipes/default.rb +19 -0
  158. data/cookbooks/mingw/resources/get.rb +56 -0
  159. data/cookbooks/mingw/resources/msys2_package.rb +139 -0
  160. data/cookbooks/mingw/resources/tdm_gcc.rb +114 -0
  161. data/cookbooks/ohai/.foodcritic +2 -0
  162. data/cookbooks/ohai/CHANGELOG.md +166 -0
  163. data/cookbooks/ohai/CONTRIBUTING.md +2 -0
  164. data/cookbooks/ohai/MAINTAINERS.md +15 -0
  165. data/cookbooks/ohai/README.md +134 -0
  166. data/cookbooks/ohai/libraries/matchers.rb +41 -0
  167. data/cookbooks/ohai/metadata.json +1 -0
  168. data/cookbooks/ohai/recipes/default.rb +20 -0
  169. data/cookbooks/ohai/resources/hint.rb +55 -0
  170. data/cookbooks/ohai/resources/plugin.rb +117 -0
  171. data/cookbooks/selinux_policy/.gitignore +51 -0
  172. data/cookbooks/selinux_policy/.kitchen.yml +25 -0
  173. data/cookbooks/selinux_policy/.rubocop.yml +2 -0
  174. data/cookbooks/selinux_policy/.travis.yml +26 -0
  175. data/cookbooks/selinux_policy/Berksfile +8 -0
  176. data/cookbooks/selinux_policy/CHANGELOG.md +155 -0
  177. data/cookbooks/selinux_policy/LICENSE +13 -0
  178. data/cookbooks/selinux_policy/README.md +217 -0
  179. data/cookbooks/selinux_policy/Rakefile +68 -0
  180. data/cookbooks/selinux_policy/TESTING.md +2 -0
  181. data/cookbooks/selinux_policy/Thorfile +12 -0
  182. data/cookbooks/selinux_policy/attributes/default.rb +5 -0
  183. data/cookbooks/selinux_policy/chefignore +102 -0
  184. data/cookbooks/selinux_policy/libraries/helper-disabled.rb +29 -0
  185. data/cookbooks/selinux_policy/libraries/matchers.rb +57 -0
  186. data/cookbooks/selinux_policy/metadata.json +58 -0
  187. data/cookbooks/selinux_policy/metadata.rb +20 -0
  188. data/cookbooks/selinux_policy/providers/boolean.rb +28 -0
  189. data/cookbooks/selinux_policy/providers/fcontext.rb +78 -0
  190. data/cookbooks/selinux_policy/providers/module.rb +81 -0
  191. data/cookbooks/selinux_policy/providers/permissive.rb +26 -0
  192. data/cookbooks/selinux_policy/providers/port.rb +58 -0
  193. data/cookbooks/selinux_policy/recipes/default.rb +9 -0
  194. data/cookbooks/selinux_policy/recipes/install.rb +32 -0
  195. data/cookbooks/selinux_policy/resources/boolean.rb +8 -0
  196. data/cookbooks/selinux_policy/resources/fcontext.rb +8 -0
  197. data/cookbooks/selinux_policy/resources/module.rb +21 -0
  198. data/cookbooks/selinux_policy/resources/permissive.rb +6 -0
  199. data/cookbooks/selinux_policy/resources/port.rb +9 -0
  200. data/cookbooks/seven_zip/CHANGELOG.md +30 -0
  201. data/cookbooks/seven_zip/README.md +108 -0
  202. data/cookbooks/seven_zip/attributes/default.rb +31 -0
  203. data/cookbooks/seven_zip/libraries/matchers.rb +33 -0
  204. data/cookbooks/seven_zip/metadata.json +1 -0
  205. data/cookbooks/seven_zip/providers/archive.rb +68 -0
  206. data/cookbooks/seven_zip/recipes/default.rb +41 -0
  207. data/cookbooks/seven_zip/resources/archive.rb +29 -0
  208. data/cookbooks/windows/.foodcritic +2 -0
  209. data/cookbooks/windows/CHANGELOG.md +528 -0
  210. data/cookbooks/windows/CONTRIBUTING.md +2 -0
  211. data/cookbooks/windows/MAINTAINERS.md +21 -0
  212. data/cookbooks/windows/README.md +803 -0
  213. data/cookbooks/windows/attributes/default.rb +21 -0
  214. data/cookbooks/windows/files/dism_features.rb +45 -0
  215. data/cookbooks/windows/libraries/matchers.rb +586 -0
  216. data/cookbooks/windows/libraries/powershell_helper.rb +53 -0
  217. data/cookbooks/windows/libraries/registry_helper.rb +356 -0
  218. data/cookbooks/windows/libraries/version.rb +207 -0
  219. data/cookbooks/windows/libraries/version_helper.rb +79 -0
  220. data/cookbooks/windows/libraries/windows_helper.rb +174 -0
  221. data/cookbooks/windows/libraries/windows_privileged.rb +103 -0
  222. data/cookbooks/windows/libraries/wmi_helper.rb +32 -0
  223. data/cookbooks/windows/metadata.json +1 -0
  224. data/cookbooks/windows/recipes/default.rb +21 -0
  225. data/cookbooks/windows/resources/auto_run.rb +46 -0
  226. data/cookbooks/windows/resources/certificate.rb +166 -0
  227. data/cookbooks/windows/resources/certificate_binding.rb +128 -0
  228. data/cookbooks/windows/resources/feature.rb +82 -0
  229. data/cookbooks/windows/resources/feature_dism.rb +108 -0
  230. data/cookbooks/windows/resources/feature_powershell.rb +70 -0
  231. data/cookbooks/windows/resources/feature_servermanagercmd.rb +76 -0
  232. data/cookbooks/windows/resources/font.rb +80 -0
  233. data/cookbooks/windows/resources/http_acl.rb +110 -0
  234. data/cookbooks/windows/resources/pagefile.rb +152 -0
  235. data/cookbooks/windows/resources/path.rb +54 -0
  236. data/cookbooks/windows/resources/printer.rb +103 -0
  237. data/cookbooks/windows/resources/printer_port.rb +101 -0
  238. data/cookbooks/windows/resources/share.rb +291 -0
  239. data/cookbooks/windows/resources/shortcut.rb +53 -0
  240. data/cookbooks/windows/resources/task.rb +384 -0
  241. data/cookbooks/windows/resources/zipfile.rb +125 -0
  242. data/cookbooks/yum/.foodcritic +1 -0
  243. data/cookbooks/yum/CHANGELOG.md +351 -0
  244. data/cookbooks/yum/CONTRIBUTING.md +2 -0
  245. data/cookbooks/yum/MAINTAINERS.md +16 -0
  246. data/cookbooks/yum/README.md +125 -0
  247. data/cookbooks/yum/attributes/main.rb +103 -0
  248. data/cookbooks/yum/libraries/matchers.rb +9 -0
  249. data/cookbooks/yum/metadata.json +1 -0
  250. data/cookbooks/yum/recipes/default.rb +26 -0
  251. data/cookbooks/yum/recipes/dnf_yum_compat.rb +29 -0
  252. data/cookbooks/yum/resources/globalconfig.rb +119 -0
  253. data/cookbooks/yum/templates/.DS_Store +0 -0
  254. data/cookbooks/yum/templates/main.erb +276 -0
  255. data/cookbooks/yum-epel/CHANGELOG.md +138 -0
  256. data/cookbooks/yum-epel/CONTRIBUTING.md +2 -0
  257. data/cookbooks/yum-epel/MAINTAINERS.md +19 -0
  258. data/cookbooks/yum-epel/README.md +172 -0
  259. data/cookbooks/yum-epel/attributes/default.rb +8 -0
  260. data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +15 -0
  261. data/cookbooks/yum-epel/attributes/epel-source.rb +15 -0
  262. data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +15 -0
  263. data/cookbooks/yum-epel/attributes/epel-testing-source.rb +15 -0
  264. data/cookbooks/yum-epel/attributes/epel-testing.rb +15 -0
  265. data/cookbooks/yum-epel/attributes/epel.rb +21 -0
  266. data/cookbooks/yum-epel/metadata.json +1 -0
  267. data/cookbooks/yum-epel/recipes/default.rb +27 -0
  268. data/cookbooks/yum-scl/.kitchen.dokken.yml +24 -0
  269. data/cookbooks/yum-scl/.kitchen.yml +24 -0
  270. data/cookbooks/yum-scl/.rubocop.yml +6 -0
  271. data/cookbooks/yum-scl/.travis.yml +28 -0
  272. data/cookbooks/yum-scl/Berksfile +3 -0
  273. data/cookbooks/yum-scl/Berksfile.lock +25 -0
  274. data/cookbooks/yum-scl/CHANGELOG.md +11 -0
  275. data/cookbooks/yum-scl/Gemfile +46 -0
  276. data/cookbooks/yum-scl/README.md +76 -0
  277. data/cookbooks/yum-scl/attributes/centos.rb +83 -0
  278. data/cookbooks/yum-scl/attributes/default.rb +15 -0
  279. data/cookbooks/yum-scl/attributes/scientific.rb +1 -0
  280. data/cookbooks/yum-scl/files/default/RPM-GPG-KEY-CentOS-SIG-SCLo +20 -0
  281. data/cookbooks/yum-scl/libraries/yum_scl_helper.rb +33 -0
  282. data/cookbooks/yum-scl/metadata.json +42 -0
  283. data/cookbooks/yum-scl/metadata.rb +12 -0
  284. data/cookbooks/yum-scl/recipes/chef_install.rb +52 -0
  285. data/cookbooks/yum-scl/recipes/default.rb +17 -0
  286. data/cookbooks/yum-scl/recipes/native_install.rb +35 -0
  287. data/lib/vagrant-clone/command/clone.rb +66 -61
  288. data/lib/vagrant-clone/errors.rb +61 -0
  289. data/lib/vagrant-clone/util/clone_manager_base.rb +69 -0
  290. data/lib/vagrant-clone/util/clone_managers/docker.rb +31 -0
  291. data/lib/vagrant-clone/util/clone_managers/libvirt.rb +254 -0
  292. data/lib/vagrant-clone/util/vagrantfile_managers/docker.rb +154 -0
  293. data/lib/vagrant-clone/util/vagrantfile_managers/libvirt.rb +159 -0
  294. data/lib/vagrant-clone/version.rb +2 -2
  295. data/lib/vagrant-clone.rb +6 -6
  296. data/libvirt.txt +7 -0
  297. data/performance_testing.rb +165 -0
  298. data/results.txt +45 -0
  299. data/scripts/create_box.sh +134 -0
  300. data/test.rb +92 -0
  301. data/tools/create_box.sh +130 -0
  302. data/vagrant-clone.gemspec +7 -7
  303. metadata +296 -5
  304. data/lib/vagrant-clone/command/errors.rb +0 -16
  305. data/lib/vagrant-clone/command/provider/docker.rb +0 -13
  306. data/lib/vagrant-clone/utils/vagrantfile_manager.rb +0 -47
@@ -0,0 +1,510 @@
1
+ #
2
+ # NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
3
+ #
4
+ # THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
5
+ #
6
+ # NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
7
+ #
8
+
9
+ begin
10
+ require 'chef/mixin/params_validate'
11
+ rescue LoadError; end
12
+
13
+ require 'chef_compat/copied_from_chef'
14
+ class Chef
15
+ module ::ChefCompat
16
+ module CopiedFromChef
17
+ #
18
+ # Author:: Adam Jacob (<adam@chef.io>)
19
+ # Copyright:: Copyright 2008-2016, Chef Software Inc.
20
+ # License:: Apache License, Version 2.0
21
+ #
22
+ # Licensed under the Apache License, Version 2.0 (the "License");
23
+ # you may not use this file except in compliance with the License.
24
+ # You may obtain a copy of the License at
25
+ #
26
+ # http://www.apache.org/licenses/LICENSE-2.0
27
+ #
28
+ # Unless required by applicable law or agreed to in writing, software
29
+ # distributed under the License is distributed on an "AS IS" BASIS,
30
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+ # See the License for the specific language governing permissions and
32
+ # limitations under the License.
33
+
34
+ require "chef_compat/copied_from_chef/chef/constants"
35
+ require "chef_compat/copied_from_chef/chef/property"
36
+ require "chef_compat/copied_from_chef/chef/delayed_evaluator"
37
+
38
+ class Chef < (defined?(::Chef) ? ::Chef : Object)
39
+ module Mixin
40
+ CopiedFromChef.extend_chef_module(::Chef::Mixin, self) if defined?(::Chef::Mixin)
41
+ module ParamsValidate
42
+ CopiedFromChef.extend_chef_module(::Chef::Mixin::ParamsValidate, self) if defined?(::Chef::Mixin::ParamsValidate)
43
+ # Takes a hash of options, along with a map to validate them. Returns the original
44
+ # options hash, plus any changes that might have been made (through things like setting
45
+ # default values in the validation map)
46
+ #
47
+ # For example:
48
+ #
49
+ # validate({ :one => "neat" }, { :one => { :kind_of => String }})
50
+ #
51
+ # Would raise an exception if the value of :one above is not a kind_of? string. Valid
52
+ # map options are:
53
+ #
54
+ # @param opts [Hash<Symbol,Object>] Validation opts.
55
+ # @option opts [Object,Array] :is An object, or list of
56
+ # objects, that must match the value using Ruby's `===` operator
57
+ # (`opts[:is].any? { |v| v === value }`). (See #_pv_is.)
58
+ # @option opts [Object,Array] :equal_to An object, or list
59
+ # of objects, that must be equal to the value using Ruby's `==`
60
+ # operator (`opts[:is].any? { |v| v == value }`) (See #_pv_equal_to.)
61
+ # @option opts [Regexp,Array<Regexp>] :regex An object, or
62
+ # list of objects, that must match the value with `regex.match(value)`.
63
+ # (See #_pv_regex)
64
+ # @option opts [Class,Array<Class>] :kind_of A class, or
65
+ # list of classes, that the value must be an instance of. (See
66
+ # #_pv_kind_of.)
67
+ # @option opts [Hash<String,Proc>] :callbacks A hash of
68
+ # messages -> procs, all of which match the value. The proc must
69
+ # return a truthy or falsey value (true means it matches). (See
70
+ # #_pv_callbacks.)
71
+ # @option opts [Symbol,Array<Symbol>] :respond_to A method
72
+ # name, or list of method names, the value must respond to. (See
73
+ # #_pv_respond_to.)
74
+ # @option opts [Symbol,Array<Symbol>] :cannot_be A property,
75
+ # or a list of properties, that the value cannot have (such as `:nil` or
76
+ # `:empty`). The method with a questionmark at the end is called on the
77
+ # value (e.g. `value.empty?`). If the value does not have this method,
78
+ # it is considered valid (i.e. if you don't respond to `empty?` we
79
+ # assume you are not empty). (See #_pv_cannot_be.)
80
+ # @option opts [Proc] :coerce A proc which will be called to
81
+ # transform the user input to canonical form. The value is passed in,
82
+ # and the transformed value returned as output. Lazy values will *not*
83
+ # be passed to this method until after they are evaluated. Called in the
84
+ # context of the resource (meaning you can access other properties).
85
+ # (See #_pv_coerce.) (See #_pv_coerce.)
86
+ # @option opts [Boolean] :required `true` if this property
87
+ # must be present and not `nil`; `false` otherwise. This is checked
88
+ # after the resource is fully initialized. (See #_pv_required.)
89
+ # @option opts [Boolean] :name_property `true` if this
90
+ # property defaults to the same value as `name`. Equivalent to
91
+ # `default: lazy { name }`, except that #property_is_set? will
92
+ # return `true` if the property is set *or* if `name` is set. (See
93
+ # #_pv_name_property.)
94
+ # @option opts [Boolean] :name_attribute Same as `name_property`.
95
+ # @option opts [Object] :default The value this property
96
+ # will return if the user does not set one. If this is `lazy`, it will
97
+ # be run in the context of the instance (and able to access other
98
+ # properties). (See #_pv_default.)
99
+ #
100
+ def validate(opts, map)
101
+ map = map.validation_options if map.is_a?(Property)
102
+
103
+ #--
104
+ # validate works by taking the keys in the validation map, assuming it's a hash, and
105
+ # looking for _pv_:symbol as methods. Assuming it find them, it calls the right
106
+ # one.
107
+ #++
108
+ raise ArgumentError, "Options must be a hash" unless opts.kind_of?(Hash)
109
+ raise ArgumentError, "Validation Map must be a hash" unless map.kind_of?(Hash)
110
+
111
+ map.each do |key, validation|
112
+ unless key.kind_of?(Symbol) || key.kind_of?(String)
113
+ raise ArgumentError, "Validation map keys must be symbols or strings!"
114
+ end
115
+ case validation
116
+ when true
117
+ _pv_required(opts, key)
118
+ when false
119
+ true
120
+ when Hash
121
+ validation.each do |check, carg|
122
+ check_method = "_pv_#{check}"
123
+ if self.respond_to?(check_method, true)
124
+ self.send(check_method, opts, key, carg)
125
+ else
126
+ raise ArgumentError, "Validation map has unknown check: #{check}"
127
+ end
128
+ end
129
+ end
130
+ end
131
+ opts
132
+ end
133
+
134
+ def lazy(&block)
135
+ DelayedEvaluator.new(&block)
136
+ end
137
+
138
+ def set_or_return(symbol, value, validation)
139
+ property = SetOrReturnProperty.new(name: symbol, **validation)
140
+ property.call(self, value)
141
+ end
142
+
143
+ private
144
+
145
+ def explicitly_allows_nil?(key, validation)
146
+ validation.has_key?(:is) && _pv_is({ key => nil }, key, validation[:is], raise_error: false)
147
+ end
148
+
149
+ # Return the value of a parameter, or nil if it doesn't exist.
150
+ def _pv_opts_lookup(opts, key)
151
+ if opts.has_key?(key.to_s)
152
+ opts[key.to_s]
153
+ elsif opts.has_key?(key.to_sym)
154
+ opts[key.to_sym]
155
+ else
156
+ nil
157
+ end
158
+ end
159
+
160
+ # Raise an exception if the parameter is not found.
161
+ def _pv_required(opts, key, is_required = true, explicitly_allows_nil = false)
162
+ if is_required
163
+ return true if opts.has_key?(key.to_s) && (explicitly_allows_nil || !opts[key.to_s].nil?)
164
+ return true if opts.has_key?(key.to_sym) && (explicitly_allows_nil || !opts[key.to_sym].nil?)
165
+ raise Exceptions::ValidationFailed, "Required argument #{key.inspect} is missing!"
166
+ end
167
+ true
168
+ end
169
+
170
+ #
171
+ # List of things values must be equal to.
172
+ #
173
+ # Uses Ruby's `==` to evaluate (equal_to == value). At least one must
174
+ # match for the value to be valid.
175
+ #
176
+ # `nil` passes this validation automatically.
177
+ #
178
+ # @return [Array,nil] List of things values must be equal to, or nil if
179
+ # equal_to is unspecified.
180
+ #
181
+ def _pv_equal_to(opts, key, to_be)
182
+ value = _pv_opts_lookup(opts, key)
183
+ unless value.nil?
184
+ to_be = Array(to_be)
185
+ to_be.each do |tb|
186
+ return true if value == tb
187
+ end
188
+ raise Exceptions::ValidationFailed, "Option #{key} must be equal to one of: #{to_be.join(", ")}! You passed #{value.inspect}."
189
+ end
190
+ end
191
+
192
+ #
193
+ # List of things values must be instances of.
194
+ #
195
+ # Uses value.kind_of?(kind_of) to evaluate. At least one must match for
196
+ # the value to be valid.
197
+ #
198
+ # `nil` automatically passes this validation.
199
+ #
200
+ def _pv_kind_of(opts, key, to_be)
201
+ value = _pv_opts_lookup(opts, key)
202
+ unless value.nil?
203
+ to_be = Array(to_be)
204
+ to_be.each do |tb|
205
+ return true if value.kind_of?(tb)
206
+ end
207
+ raise Exceptions::ValidationFailed, "Option #{key} must be a kind of #{to_be}! You passed #{value.inspect}."
208
+ end
209
+ end
210
+
211
+ #
212
+ # List of method names values must respond to.
213
+ #
214
+ # Uses value.respond_to?(respond_to) to evaluate. At least one must match
215
+ # for the value to be valid.
216
+ #
217
+ def _pv_respond_to(opts, key, method_name_list)
218
+ value = _pv_opts_lookup(opts, key)
219
+ unless value.nil?
220
+ Array(method_name_list).each do |method_name|
221
+ unless value.respond_to?(method_name)
222
+ raise Exceptions::ValidationFailed, "Option #{key} must have a #{method_name} method!"
223
+ end
224
+ end
225
+ end
226
+ end
227
+
228
+ #
229
+ # List of things that must not be true about the value.
230
+ #
231
+ # Calls `value.<thing>?` All responses must be false for the value to be
232
+ # valid.
233
+ # Values which do not respond to <thing>? are considered valid (because if
234
+ # a value doesn't respond to `:readable?`, then it probably isn't
235
+ # readable.)
236
+ #
237
+ # @example
238
+ # ```ruby
239
+ # property :x, cannot_be: [ :nil, :empty ]
240
+ # x [ 1, 2 ] #=> valid
241
+ # x 1 #=> valid
242
+ # x [] #=> invalid
243
+ # x nil #=> invalid
244
+ # ```
245
+ #
246
+ def _pv_cannot_be(opts, key, predicate_method_base_name)
247
+ value = _pv_opts_lookup(opts, key)
248
+ if !value.nil?
249
+ Array(predicate_method_base_name).each do |method_name|
250
+ predicate_method = :"#{method_name}?"
251
+
252
+ if value.respond_to?(predicate_method)
253
+ if value.send(predicate_method)
254
+ raise Exceptions::ValidationFailed, "Option #{key} cannot be #{predicate_method_base_name}"
255
+ end
256
+ end
257
+ end
258
+ end
259
+ end
260
+
261
+ #
262
+ # The default value for a property.
263
+ #
264
+ # When the property is not assigned, this will be used.
265
+ #
266
+ # If this is a lazy value, it will either be passed the resource as a value,
267
+ # or if the lazy proc does not take parameters, it will be run in the
268
+ # context of the instance with instance_eval.
269
+ #
270
+ # @example
271
+ # ```ruby
272
+ # property :x, default: 10
273
+ # ```
274
+ #
275
+ # @example
276
+ # ```ruby
277
+ # property :x
278
+ # property :y, default: lazy { x+2 }
279
+ # ```
280
+ #
281
+ # @example
282
+ # ```ruby
283
+ # property :x
284
+ # property :y, default: lazy { |r| r.x+2 }
285
+ # ```
286
+ #
287
+ def _pv_default(opts, key, default_value)
288
+ value = _pv_opts_lookup(opts, key)
289
+ if value.nil?
290
+ default_value = default_value.freeze if !default_value.is_a?(DelayedEvaluator)
291
+ opts[key] = default_value
292
+ end
293
+ end
294
+
295
+ #
296
+ # List of regexes values that must match.
297
+ #
298
+ # Uses regex.match() to evaluate. At least one must match for the value to
299
+ # be valid.
300
+ #
301
+ # `nil` passes regex validation automatically.
302
+ #
303
+ # @example
304
+ # ```ruby
305
+ # property :x, regex: [ /abc/, /xyz/ ]
306
+ # ```
307
+ #
308
+ def _pv_regex(opts, key, regex)
309
+ value = _pv_opts_lookup(opts, key)
310
+ if !value.nil?
311
+ Array(regex).flatten.each do |r|
312
+ return true if r.match(value.to_s)
313
+ end
314
+ raise Exceptions::ValidationFailed, "Option #{key}'s value #{value} does not match regular expression #{regex.inspect}"
315
+ end
316
+ end
317
+
318
+ #
319
+ # List of procs we pass the value to.
320
+ #
321
+ # All procs must return true for the value to be valid. If any procs do
322
+ # not return true, the key will be used for the message: `"Property x's
323
+ # value :y <message>"`.
324
+ #
325
+ # @example
326
+ # ```ruby
327
+ # property :x, callbacks: { "is bigger than 10" => proc { |v| v <= 10 }, "is not awesome" => proc { |v| !v.awesome }}
328
+ # ```
329
+ #
330
+ def _pv_callbacks(opts, key, callbacks)
331
+ raise ArgumentError, "Callback list must be a hash!" unless callbacks.kind_of?(Hash)
332
+ value = _pv_opts_lookup(opts, key)
333
+ if !value.nil?
334
+ callbacks.each do |message, zeproc|
335
+ unless zeproc.call(value)
336
+ raise Exceptions::ValidationFailed, "Option #{key}'s value #{value} #{message}!"
337
+ end
338
+ end
339
+ end
340
+ end
341
+
342
+ #
343
+ # Allows a parameter to default to the value of the resource name.
344
+ #
345
+ # @example
346
+ # ```ruby
347
+ # property :x, name_property: true
348
+ # ```
349
+ #
350
+ def _pv_name_property(opts, key, is_name_property = true)
351
+ if is_name_property
352
+ if opts[key].nil?
353
+ raise CannotValidateStaticallyError, "name_property cannot be evaluated without a resource." if self == Chef::Mixin::ParamsValidate
354
+ opts[key] = self.instance_variable_get(:"@name")
355
+ end
356
+ end
357
+ end
358
+ alias :_pv_name_attribute :_pv_name_property
359
+
360
+ #
361
+ # List of valid things values can be.
362
+ #
363
+ # Uses Ruby's `===` to evaluate (is === value). At least one must match
364
+ # for the value to be valid.
365
+ #
366
+ # If a proc is passed, it is instance_eval'd in the resource, passed the
367
+ # value, and must return a truthy or falsey value.
368
+ #
369
+ # @example Class
370
+ # ```ruby
371
+ # property :x, String
372
+ # x 'valid' #=> valid
373
+ # x 1 #=> invalid
374
+ # x nil #=> invalid
375
+ #
376
+ # @example Value
377
+ # ```ruby
378
+ # property :x, [ :a, :b, :c, nil ]
379
+ # x :a #=> valid
380
+ # x nil #=> valid
381
+ # ```
382
+ #
383
+ # @example Regex
384
+ # ```ruby
385
+ # property :x, /bar/
386
+ # x 'foobar' #=> valid
387
+ # x 'foo' #=> invalid
388
+ # x nil #=> invalid
389
+ # ```
390
+ #
391
+ # @example Proc
392
+ # ```ruby
393
+ # property :x, proc { |x| x > y }
394
+ # property :y, default: 2
395
+ # x 3 #=> valid
396
+ # x 1 #=> invalid
397
+ # ```
398
+ #
399
+ # @example Property
400
+ # ```ruby
401
+ # type = Property.new(is: String)
402
+ # property :x, type
403
+ # x 'foo' #=> valid
404
+ # x 1 #=> invalid
405
+ # x nil #=> invalid
406
+ # ```
407
+ #
408
+ # @example RSpec Matcher
409
+ # ```ruby
410
+ # include RSpec::Matchers
411
+ # property :x, a_string_matching /bar/
412
+ # x 'foobar' #=> valid
413
+ # x 'foo' #=> invalid
414
+ # x nil #=> invalid
415
+ # ```
416
+ #
417
+ def _pv_is(opts, key, to_be, raise_error: true)
418
+ return true if !opts.has_key?(key.to_s) && !opts.has_key?(key.to_sym)
419
+ value = _pv_opts_lookup(opts, key)
420
+ to_be = [ to_be ].flatten(1)
421
+ errors = []
422
+ passed = to_be.any? do |tb|
423
+ case tb
424
+ when Proc
425
+ raise CannotValidateStaticallyError, "is: proc { } must be evaluated once for each resource" if self == Chef::Mixin::ParamsValidate
426
+ instance_exec(value, &tb)
427
+ when Property
428
+ begin
429
+ validate(opts, { key => tb.validation_options })
430
+ true
431
+ rescue Exceptions::ValidationFailed
432
+ # re-raise immediately if there is only one "is" so we get a better stack
433
+ raise if to_be.size == 1
434
+ errors << $!
435
+ false
436
+ end
437
+ else
438
+ tb === value
439
+ end
440
+ end
441
+ if passed
442
+ true
443
+ else
444
+ message = "Property #{key} must be one of: #{to_be.map { |v| v.inspect }.join(", ")}! You passed #{value.inspect}."
445
+ unless errors.empty?
446
+ message << " Errors:\n#{errors.map { |m| "- #{m}" }.join("\n")}"
447
+ end
448
+ raise Exceptions::ValidationFailed, message
449
+ end
450
+ end
451
+
452
+ #
453
+ # Method to mess with a value before it is validated and stored.
454
+ #
455
+ # Allows you to transform values into a canonical form that is easy to
456
+ # work with.
457
+ #
458
+ # This is passed the value to transform, and is run in the context of the
459
+ # instance (so it has access to other resource properties). It must return
460
+ # the value that will be stored in the instance.
461
+ #
462
+ # @example
463
+ # ```ruby
464
+ # property :x, Integer, coerce: { |v| v.to_i }
465
+ # ```
466
+ #
467
+ def _pv_coerce(opts, key, coercer)
468
+ if opts.has_key?(key.to_s)
469
+ raise CannotValidateStaticallyError, "coerce must be evaluated for each resource." if self == Chef::Mixin::ParamsValidate
470
+ opts[key.to_s] = instance_exec(opts[key], &coercer)
471
+ elsif opts.has_key?(key.to_sym)
472
+ raise CannotValidateStaticallyError, "coerce must be evaluated for each resource." if self == Chef::Mixin::ParamsValidate
473
+ opts[key.to_sym] = instance_exec(opts[key], &coercer)
474
+ end
475
+ end
476
+
477
+ # We allow Chef::Mixin::ParamsValidate.validate(), but we will raise an
478
+ # error if you try to do anything requiring there to be an actual resource.
479
+ # This way, you can statically validate things if you have constant validation
480
+ # (which is the norm).
481
+ extend self
482
+
483
+ # Used by #set_or_return to avoid emitting a deprecation warning for
484
+ # "value nil" and to keep default stickiness working exactly the same
485
+ # @api private
486
+ class SetOrReturnProperty < (defined?(::Chef::Mixin::ParamsValidate::SetOrReturnProperty) ? ::Chef::Mixin::ParamsValidate::SetOrReturnProperty : Chef::Property)
487
+ def get(resource, nil_set: false)
488
+ value = super
489
+ # All values are sticky, frozen or not
490
+ if !is_set?(resource)
491
+ set_value(resource, value)
492
+ end
493
+ value
494
+ end
495
+
496
+ def call(resource, value = NOT_PASSED)
497
+ # setting to nil does a get
498
+ if value.nil? && !explicitly_accepts_nil?(resource)
499
+ get(resource, nil_set: true)
500
+ else
501
+ super
502
+ end
503
+ end
504
+ end
505
+ end
506
+ end
507
+ end
508
+ end
509
+ end
510
+ end
@@ -0,0 +1,117 @@
1
+ #
2
+ # NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
3
+ #
4
+ # THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
5
+ #
6
+ # NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
7
+ #
8
+
9
+ begin
10
+ require 'chef/mixin/powershell_out'
11
+ rescue LoadError; end
12
+
13
+ require 'chef_compat/copied_from_chef'
14
+ class Chef
15
+ module ::ChefCompat
16
+ module CopiedFromChef
17
+ #--
18
+ # Copyright:: Copyright 2015-2016, Chef Software, Inc.
19
+ # License:: Apache License, Version 2.0
20
+ #
21
+ # Licensed under the Apache License, Version 2.0 (the "License");
22
+ # you may not use this file except in compliance with the License.
23
+ # You may obtain a copy of the License at
24
+ #
25
+ # http://www.apache.org/licenses/LICENSE-2.0
26
+ #
27
+ # Unless required by applicable law or agreed to in writing, software
28
+ # distributed under the License is distributed on an "AS IS" BASIS,
29
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30
+ # See the License for the specific language governing permissions and
31
+ # limitations under the License.
32
+
33
+
34
+ class Chef < (defined?(::Chef) ? ::Chef : Object)
35
+ module Mixin
36
+ CopiedFromChef.extend_chef_module(::Chef::Mixin, self) if defined?(::Chef::Mixin)
37
+ module PowershellOut
38
+ CopiedFromChef.extend_chef_module(::Chef::Mixin::PowershellOut, self) if defined?(::Chef::Mixin::PowershellOut)
39
+ include Chef::Mixin::ShellOut
40
+ include Chef::Mixin::WindowsArchitectureHelper
41
+
42
+ # Run a command under powershell with the same API as shell_out. The
43
+ # options hash is extended to take an "architecture" flag which
44
+ # can be set to :i386 or :x86_64 to force the windows architecture.
45
+ #
46
+ # @param script [String] script to run
47
+ # @param options [Hash] options hash
48
+ # @return [Mixlib::Shellout] mixlib-shellout object
49
+ def powershell_out(*command_args)
50
+ script = command_args.first
51
+ options = command_args.last.is_a?(Hash) ? command_args.last : nil
52
+
53
+ run_command_with_os_architecture(script, options)
54
+ end
55
+
56
+ # Run a command under powershell with the same API as shell_out!
57
+ # (raises exceptions on errors)
58
+ #
59
+ # @param script [String] script to run
60
+ # @param options [Hash] options hash
61
+ # @return [Mixlib::Shellout] mixlib-shellout object
62
+ def powershell_out!(*command_args)
63
+ cmd = powershell_out(*command_args)
64
+ cmd.error!
65
+ cmd
66
+ end
67
+
68
+ private
69
+
70
+ # Helper function to run shell_out and wrap it with the correct
71
+ # flags to possibly disable WOW64 redirection (which we often need
72
+ # because chef-client runs as a 32-bit app on 64-bit windows).
73
+ #
74
+ # @param script [String] script to run
75
+ # @param options [Hash] options hash
76
+ # @return [Mixlib::Shellout] mixlib-shellout object
77
+ def run_command_with_os_architecture(script, options)
78
+ options ||= {}
79
+ options = options.dup
80
+ arch = options.delete(:architecture)
81
+
82
+ with_os_architecture(nil, architecture: arch) do
83
+ shell_out(
84
+ build_powershell_command(script),
85
+ options
86
+ )
87
+ end
88
+ end
89
+
90
+ # Helper to build a powershell command around the script to run.
91
+ #
92
+ # @param script [String] script to run
93
+ # @retrurn [String] powershell command to execute
94
+ def build_powershell_command(script)
95
+ flags = [
96
+ # Hides the copyright banner at startup.
97
+ "-NoLogo",
98
+ # Does not present an interactive prompt to the user.
99
+ "-NonInteractive",
100
+ # Does not load the Windows PowerShell profile.
101
+ "-NoProfile",
102
+ # always set the ExecutionPolicy flag
103
+ # see http://technet.microsoft.com/en-us/library/ee176961.aspx
104
+ "-ExecutionPolicy Unrestricted",
105
+ # Powershell will hang if STDIN is redirected
106
+ # http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected
107
+ "-InputFormat None",
108
+ ]
109
+
110
+ "powershell.exe #{flags.join(' ')} -Command \"#{script.gsub('"', '\"')}\""
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end