engineyard-serverside 2.8.0.pre → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (312) hide show
  1. checksums.yaml +7 -0
  2. data/bin/engineyard-serverside-execute-service-hook +1 -1
  3. data/features/hook/running-a-deploy-hook.feature +277 -0
  4. data/features/hook/step_definitions/running-a-deploy-hook-steps.rb +200 -0
  5. data/features/step_definitions/command_steps.rb +8 -0
  6. data/features/step_definitions/version_steps.rb +5 -0
  7. data/features/support/env.rb +63 -0
  8. data/features/support/error_codes.rb +17 -0
  9. data/features/support/fs_helpers.rb +82 -0
  10. data/features/support/output_helpers.rb +7 -0
  11. data/features/support/runner.rb +41 -0
  12. data/features/version.feature +7 -0
  13. data/lib/engineyard-serverside.rb +2 -5
  14. data/lib/engineyard-serverside/callbacks/collection/base.rb +12 -5
  15. data/lib/engineyard-serverside/callbacks/distributor.rb +2 -7
  16. data/lib/engineyard-serverside/callbacks/executor/executable.rb +2 -0
  17. data/lib/engineyard-serverside/cli/app.rb +6 -0
  18. data/lib/engineyard-serverside/cli/workflows/calling_deploy_hooks.rb +1 -2
  19. data/lib/engineyard-serverside/configuration.rb +3 -3
  20. data/lib/engineyard-serverside/deploy.rb +4 -8
  21. data/lib/engineyard-serverside/shell.rb +38 -10
  22. data/lib/engineyard-serverside/version.rb +1 -1
  23. data/spec/engineyard-serverside/callbacks/collection/combined_spec.rb +232 -0
  24. data/spec/engineyard-serverside/callbacks/collection/deploy_hooks_spec.rb +170 -0
  25. data/spec/engineyard-serverside/callbacks/collection/service_hooks/collection_spec.rb +171 -0
  26. data/spec/engineyard-serverside/callbacks/collection/service_hooks/combined_spec.rb +174 -0
  27. data/spec/engineyard-serverside/callbacks/collection/service_hooks_spec.rb +31 -0
  28. data/spec/engineyard-serverside/callbacks/collection_spec.rb +49 -0
  29. data/spec/engineyard-serverside/callbacks/distributor/remote_spec.rb +135 -0
  30. data/spec/engineyard-serverside/callbacks/distributor/viability_filter_spec.rb +208 -0
  31. data/spec/engineyard-serverside/callbacks/distributor_spec.rb +43 -0
  32. data/spec/engineyard-serverside/callbacks/executor/executable_spec.rb +386 -0
  33. data/spec/engineyard-serverside/callbacks/executor/ruby/context_spec.rb +538 -0
  34. data/spec/engineyard-serverside/callbacks/executor/ruby/executor_spec.rb +313 -0
  35. data/spec/engineyard-serverside/callbacks/executor/ruby_spec.rb +35 -0
  36. data/spec/engineyard-serverside/callbacks/executor_spec.rb +45 -0
  37. data/spec/engineyard-serverside/callbacks_spec.rb +31 -0
  38. data/spec/engineyard-serverside/cli/workflows/base_spec.rb +237 -0
  39. data/spec/engineyard-serverside/cli/workflows/calling_deploy_hooks_spec.rb +65 -0
  40. data/spec/engineyard-serverside/cli/workflows/deploying_applications_spec.rb +61 -0
  41. data/spec/engineyard-serverside/cli/workflows/disabling_maintenance_spec.rb +61 -0
  42. data/spec/engineyard-serverside/cli/workflows/enabling_maintenance_spec.rb +61 -0
  43. data/spec/engineyard-serverside/cli/workflows/helpers_spec.rb +64 -0
  44. data/spec/engineyard-serverside/cli/workflows/rolling_back_applications_spec.rb +61 -0
  45. data/spec/engineyard-serverside/cli/workflows/showing_maintenance_status_spec.rb +60 -0
  46. data/spec/engineyard-serverside/cli/workflows_spec.rb +87 -0
  47. data/spec/engineyard-serverside/dependency_manager/base_spec.rb +139 -0
  48. data/spec/engineyard-serverside/paths_spec.rb +820 -0
  49. data/spec/engineyard-serverside/propagator_spec.rb +56 -0
  50. data/spec/engineyard-serverside/server_spec.rb +390 -0
  51. data/spec/engineyard-serverside/shell/helpers_spec.rb +98 -0
  52. data/spec/engineyard-serverside/shell/yieldio_spec.rb +33 -0
  53. data/spec/engineyard-serverside/shell_spec.rb +543 -0
  54. data/spec/engineyard-serverside/slug/distributor_spec.rb +199 -0
  55. data/spec/engineyard-serverside/slug/enabler_spec.rb +191 -0
  56. data/spec/engineyard-serverside/slug/failure_handler_spec.rb +114 -0
  57. data/spec/engineyard-serverside/slug/finalizer_spec.rb +191 -0
  58. data/spec/engineyard-serverside/slug/generator_spec.rb +82 -0
  59. data/spec/engineyard-serverside/slug/migrator_spec.rb +137 -0
  60. data/spec/engineyard-serverside/slug/restarter_spec.rb +226 -0
  61. data/spec/engineyard-serverside/slug/source/updater_spec.rb +710 -0
  62. data/spec/engineyard-serverside/slug/source_spec.rb +40 -0
  63. data/spec/engineyard-serverside/source_spec.rb +171 -0
  64. data/spec/railway_spec.rb +130 -0
  65. data/spec/result/failure_spec.rb +113 -0
  66. data/spec/result/success_spec.rb +109 -0
  67. data/spec/result_spec.rb +23 -0
  68. data/spec/spec_helper.rb +3 -349
  69. metadata +327 -602
  70. data/lib/vendor/json_pure/COPYING +0 -57
  71. data/lib/vendor/json_pure/GPL +0 -340
  72. data/lib/vendor/json_pure/README.rdoc +0 -358
  73. data/lib/vendor/json_pure/VERSION +0 -1
  74. data/lib/vendor/json_pure/lib/json.rb +0 -62
  75. data/lib/vendor/json_pure/lib/json/add/bigdecimal.rb +0 -28
  76. data/lib/vendor/json_pure/lib/json/add/complex.rb +0 -22
  77. data/lib/vendor/json_pure/lib/json/add/core.rb +0 -11
  78. data/lib/vendor/json_pure/lib/json/add/date.rb +0 -34
  79. data/lib/vendor/json_pure/lib/json/add/date_time.rb +0 -48
  80. data/lib/vendor/json_pure/lib/json/add/exception.rb +0 -31
  81. data/lib/vendor/json_pure/lib/json/add/ostruct.rb +0 -31
  82. data/lib/vendor/json_pure/lib/json/add/range.rb +0 -29
  83. data/lib/vendor/json_pure/lib/json/add/rational.rb +0 -22
  84. data/lib/vendor/json_pure/lib/json/add/regexp.rb +0 -30
  85. data/lib/vendor/json_pure/lib/json/add/struct.rb +0 -30
  86. data/lib/vendor/json_pure/lib/json/add/symbol.rb +0 -25
  87. data/lib/vendor/json_pure/lib/json/add/time.rb +0 -38
  88. data/lib/vendor/json_pure/lib/json/common.rb +0 -484
  89. data/lib/vendor/json_pure/lib/json/ext.rb +0 -21
  90. data/lib/vendor/json_pure/lib/json/generic_object.rb +0 -70
  91. data/lib/vendor/json_pure/lib/json/pure.rb +0 -21
  92. data/lib/vendor/json_pure/lib/json/pure/generator.rb +0 -522
  93. data/lib/vendor/json_pure/lib/json/pure/parser.rb +0 -359
  94. data/lib/vendor/json_pure/lib/json/version.rb +0 -8
  95. data/lib/vendor/multi_json/CHANGELOG.md +0 -121
  96. data/lib/vendor/multi_json/CONTRIBUTING.md +0 -46
  97. data/lib/vendor/multi_json/Gemfile +0 -31
  98. data/lib/vendor/multi_json/LICENSE.md +0 -20
  99. data/lib/vendor/multi_json/README.md +0 -105
  100. data/lib/vendor/multi_json/Rakefile +0 -12
  101. data/lib/vendor/multi_json/lib/multi_json.rb +0 -137
  102. data/lib/vendor/multi_json/lib/multi_json/adapters/gson.rb +0 -20
  103. data/lib/vendor/multi_json/lib/multi_json/adapters/json_common.rb +0 -35
  104. data/lib/vendor/multi_json/lib/multi_json/adapters/json_gem.rb +0 -12
  105. data/lib/vendor/multi_json/lib/multi_json/adapters/json_pure.rb +0 -12
  106. data/lib/vendor/multi_json/lib/multi_json/adapters/nsjsonserialization.rb +0 -35
  107. data/lib/vendor/multi_json/lib/multi_json/adapters/oj.rb +0 -29
  108. data/lib/vendor/multi_json/lib/multi_json/adapters/ok_json.rb +0 -58
  109. data/lib/vendor/multi_json/lib/multi_json/adapters/yajl.rb +0 -20
  110. data/lib/vendor/multi_json/lib/multi_json/vendor/okjson.rb +0 -602
  111. data/lib/vendor/multi_json/lib/multi_json/version.rb +0 -3
  112. data/lib/vendor/multi_json/spec/adapter_shared_example.rb +0 -162
  113. data/lib/vendor/multi_json/spec/helper.rb +0 -45
  114. data/lib/vendor/multi_json/spec/json_common_shared_example.rb +0 -36
  115. data/lib/vendor/multi_json/spec/multi_json_spec.rb +0 -151
  116. data/spec/archive_deploy_spec.rb +0 -53
  117. data/spec/basic_deploy_spec.rb +0 -26
  118. data/spec/bundler_deploy_spec.rb +0 -160
  119. data/spec/configuration_spec.rb +0 -206
  120. data/spec/custom_deploy_spec.rb +0 -128
  121. data/spec/deploy_hook_spec.rb +0 -378
  122. data/spec/deprecation_spec.rb +0 -23
  123. data/spec/ey_yml_customized_deploy_spec.rb +0 -99
  124. data/spec/fixtures/gitrepo.tar.gz +0 -0
  125. data/spec/fixtures/invalid_hook.rb +0 -1
  126. data/spec/fixtures/lockfiles/0.9-no-bundler +0 -111
  127. data/spec/fixtures/lockfiles/0.9-with-bundler +0 -117
  128. data/spec/fixtures/lockfiles/1.0-no-bundler +0 -54
  129. data/spec/fixtures/lockfiles/1.0.0.rc.1-with-bundler +0 -162
  130. data/spec/fixtures/lockfiles/1.0.18-do_mysql +0 -88
  131. data/spec/fixtures/lockfiles/1.0.18-do_postgres +0 -79
  132. data/spec/fixtures/lockfiles/1.0.18-mysql +0 -43
  133. data/spec/fixtures/lockfiles/1.0.18-mysql2 +0 -43
  134. data/spec/fixtures/lockfiles/1.0.18-pg +0 -43
  135. data/spec/fixtures/lockfiles/1.0.6-no-bundler +0 -51
  136. data/spec/fixtures/lockfiles/1.0.6-with-any-bundler +0 -52
  137. data/spec/fixtures/lockfiles/1.0.6-with-bundler +0 -52
  138. data/spec/fixtures/lockfiles/1.15.1-no-bundler +0 -51
  139. data/spec/fixtures/lockfiles/1.3.1-rails-3.2.13 +0 -112
  140. data/spec/fixtures/lockfiles/not-a-lockfile +0 -1
  141. data/spec/fixtures/repos/assets_detected/Gemfile +0 -5
  142. data/spec/fixtures/repos/assets_detected/Gemfile.lock +0 -88
  143. data/spec/fixtures/repos/assets_detected/README +0 -1
  144. data/spec/fixtures/repos/assets_detected/Rakefile +0 -5
  145. data/spec/fixtures/repos/assets_detected/app/assets/empty +0 -0
  146. data/spec/fixtures/repos/assets_detected/config/application.rb +0 -5
  147. data/spec/fixtures/repos/assets_detected/config/ey.yml +0 -3
  148. data/spec/fixtures/repos/assets_disabled/Gemfile +0 -5
  149. data/spec/fixtures/repos/assets_disabled/Gemfile.lock +0 -88
  150. data/spec/fixtures/repos/assets_disabled/README +0 -1
  151. data/spec/fixtures/repos/assets_disabled/Rakefile +0 -6
  152. data/spec/fixtures/repos/assets_disabled/app/assets/empty +0 -0
  153. data/spec/fixtures/repos/assets_disabled/config/application.rb +0 -5
  154. data/spec/fixtures/repos/assets_disabled/config/ey.yml +0 -3
  155. data/spec/fixtures/repos/assets_disabled_in_ey_yml/Gemfile +0 -5
  156. data/spec/fixtures/repos/assets_disabled_in_ey_yml/Gemfile.lock +0 -88
  157. data/spec/fixtures/repos/assets_disabled_in_ey_yml/README +0 -1
  158. data/spec/fixtures/repos/assets_disabled_in_ey_yml/Rakefile +0 -6
  159. data/spec/fixtures/repos/assets_disabled_in_ey_yml/app/assets/empty +0 -0
  160. data/spec/fixtures/repos/assets_disabled_in_ey_yml/config/application.rb +0 -5
  161. data/spec/fixtures/repos/assets_disabled_in_ey_yml/config/ey.yml +0 -5
  162. data/spec/fixtures/repos/assets_disabled_utf8/Gemfile +0 -5
  163. data/spec/fixtures/repos/assets_disabled_utf8/Gemfile.lock +0 -88
  164. data/spec/fixtures/repos/assets_disabled_utf8/README +0 -3
  165. data/spec/fixtures/repos/assets_disabled_utf8/Rakefile +0 -5
  166. data/spec/fixtures/repos/assets_disabled_utf8/app/assets/empty +0 -0
  167. data/spec/fixtures/repos/assets_disabled_utf8/config/application.rb +0 -7
  168. data/spec/fixtures/repos/assets_disabled_utf8/config/ey.yml +0 -3
  169. data/spec/fixtures/repos/assets_enabled_all/Gemfile +0 -5
  170. data/spec/fixtures/repos/assets_enabled_all/Gemfile.lock +0 -88
  171. data/spec/fixtures/repos/assets_enabled_all/README +0 -1
  172. data/spec/fixtures/repos/assets_enabled_all/app/assets/empty +0 -0
  173. data/spec/fixtures/repos/assets_enabled_all/config/application.rb +0 -5
  174. data/spec/fixtures/repos/assets_enabled_all/config/ey.yml +0 -6
  175. data/spec/fixtures/repos/assets_enabled_all/script/assets +0 -5
  176. data/spec/fixtures/repos/assets_enabled_all/tmp/obstruction +0 -1
  177. data/spec/fixtures/repos/assets_enabled_in_ey_yml/Gemfile +0 -3
  178. data/spec/fixtures/repos/assets_enabled_in_ey_yml/Gemfile.lock +0 -10
  179. data/spec/fixtures/repos/assets_enabled_in_ey_yml/README +0 -1
  180. data/spec/fixtures/repos/assets_enabled_in_ey_yml/Rakefile +0 -8
  181. data/spec/fixtures/repos/assets_enabled_in_ey_yml/config/ey.yml +0 -4
  182. data/spec/fixtures/repos/assets_enabled_util_only/Gemfile +0 -5
  183. data/spec/fixtures/repos/assets_enabled_util_only/Gemfile.lock +0 -88
  184. data/spec/fixtures/repos/assets_enabled_util_only/README +0 -1
  185. data/spec/fixtures/repos/assets_enabled_util_only/Rakefile +0 -6
  186. data/spec/fixtures/repos/assets_enabled_util_only/app/assets/empty +0 -0
  187. data/spec/fixtures/repos/assets_enabled_util_only/config/application.rb +0 -5
  188. data/spec/fixtures/repos/assets_enabled_util_only/config/ey.yml +0 -6
  189. data/spec/fixtures/repos/assets_error/Gemfile +0 -5
  190. data/spec/fixtures/repos/assets_error/Gemfile.lock +0 -88
  191. data/spec/fixtures/repos/assets_error/README +0 -1
  192. data/spec/fixtures/repos/assets_error/Rakefile +0 -4
  193. data/spec/fixtures/repos/assets_error/app/assets/empty +0 -0
  194. data/spec/fixtures/repos/assets_error/config/application.rb +0 -5
  195. data/spec/fixtures/repos/assets_error/config/ey.yml +0 -4
  196. data/spec/fixtures/repos/assets_in_hook/Gemfile +0 -5
  197. data/spec/fixtures/repos/assets_in_hook/Gemfile.lock +0 -88
  198. data/spec/fixtures/repos/assets_in_hook/README +0 -2
  199. data/spec/fixtures/repos/assets_in_hook/Rakefile +0 -5
  200. data/spec/fixtures/repos/assets_in_hook/app/assets/empty +0 -0
  201. data/spec/fixtures/repos/assets_in_hook/config/application.rb +0 -5
  202. data/spec/fixtures/repos/assets_in_hook/config/ey.yml +0 -3
  203. data/spec/fixtures/repos/assets_in_hook/deploy/before_compile_assets.rb +0 -2
  204. data/spec/fixtures/repos/bundle_fails/Gemfile +0 -1
  205. data/spec/fixtures/repos/bundle_fails/README +0 -1
  206. data/spec/fixtures/repos/bundle_fails/deploy/after_bundle.rb +0 -1
  207. data/spec/fixtures/repos/bundler_disabled/Gemfile +0 -4
  208. data/spec/fixtures/repos/bundler_disabled/Gemfile.lock +0 -12
  209. data/spec/fixtures/repos/bundler_disabled/README +0 -1
  210. data/spec/fixtures/repos/bundler_disabled/config/ey.yml +0 -2
  211. data/spec/fixtures/repos/bundler_disabled/deploy/after_bundle.rb +0 -1
  212. data/spec/fixtures/repos/bundler_disabled/deploy/before_bundle.rb +0 -1
  213. data/spec/fixtures/repos/bundler_old/Gemfile +0 -5
  214. data/spec/fixtures/repos/bundler_old/Gemfile.lock +0 -15
  215. data/spec/fixtures/repos/bundler_old/README +0 -1
  216. data/spec/fixtures/repos/default/Gemfile +0 -4
  217. data/spec/fixtures/repos/default/Gemfile.lock +0 -12
  218. data/spec/fixtures/repos/default/README +0 -5
  219. data/spec/fixtures/repos/default/ey.yml +0 -3
  220. data/spec/fixtures/repos/executable_hooks/README +0 -1
  221. data/spec/fixtures/repos/executable_hooks/deploy/before_restart +0 -72
  222. data/spec/fixtures/repos/executable_hooks_not_executable/README +0 -3
  223. data/spec/fixtures/repos/executable_hooks_not_executable/deploy/before_restart +0 -3
  224. data/spec/fixtures/repos/ey_yml/Gemfile +0 -4
  225. data/spec/fixtures/repos/ey_yml/Gemfile.lock +0 -12
  226. data/spec/fixtures/repos/ey_yml/README +0 -1
  227. data/spec/fixtures/repos/ey_yml/config/ey.yml +0 -18
  228. data/spec/fixtures/repos/ey_yml/deploy/before_migrate.rb +0 -6
  229. data/spec/fixtures/repos/ey_yml_alt/Gemfile +0 -4
  230. data/spec/fixtures/repos/ey_yml_alt/Gemfile.lock +0 -12
  231. data/spec/fixtures/repos/ey_yml_alt/README +0 -1
  232. data/spec/fixtures/repos/ey_yml_alt/deploy/before_migrate.rb +0 -6
  233. data/spec/fixtures/repos/ey_yml_alt/ey.yml +0 -12
  234. data/spec/fixtures/repos/hook_fails/README +0 -1
  235. data/spec/fixtures/repos/hook_fails/deploy/before_deploy.rb +0 -1
  236. data/spec/fixtures/repos/hooks/README +0 -1
  237. data/spec/fixtures/repos/hooks/deploy/after_bundle.rb +0 -1
  238. data/spec/fixtures/repos/hooks/deploy/after_compile_assets.rb +0 -1
  239. data/spec/fixtures/repos/hooks/deploy/after_deploy.rb +0 -1
  240. data/spec/fixtures/repos/hooks/deploy/after_migrate.rb +0 -1
  241. data/spec/fixtures/repos/hooks/deploy/after_restart.rb +0 -1
  242. data/spec/fixtures/repos/hooks/deploy/after_symlink.rb +0 -1
  243. data/spec/fixtures/repos/hooks/deploy/before_bundle.rb +0 -1
  244. data/spec/fixtures/repos/hooks/deploy/before_compile_assets.rb +0 -1
  245. data/spec/fixtures/repos/hooks/deploy/before_deploy.rb +0 -1
  246. data/spec/fixtures/repos/hooks/deploy/before_migrate.rb +0 -1
  247. data/spec/fixtures/repos/hooks/deploy/before_restart.rb +0 -1
  248. data/spec/fixtures/repos/hooks/deploy/before_symlink.rb +0 -1
  249. data/spec/fixtures/repos/multi_dep_manager/README +0 -1
  250. data/spec/fixtures/repos/multi_dep_manager/composer.json +0 -5
  251. data/spec/fixtures/repos/multi_dep_manager/composer.lock +0 -462
  252. data/spec/fixtures/repos/multi_dep_manager/package.json +0 -7
  253. data/spec/fixtures/repos/multi_dep_manager/public/index.php +0 -4
  254. data/spec/fixtures/repos/no_ey_config/Gemfile +0 -3
  255. data/spec/fixtures/repos/no_ey_config/Gemfile.lock +0 -10
  256. data/spec/fixtures/repos/no_ey_config/README +0 -1
  257. data/spec/fixtures/repos/no_ey_config/ey.yml +0 -3
  258. data/spec/fixtures/repos/no_ey_config_no_warning/Gemfile +0 -3
  259. data/spec/fixtures/repos/no_ey_config_no_warning/Gemfile.lock +0 -10
  260. data/spec/fixtures/repos/no_ey_config_no_warning/README +0 -1
  261. data/spec/fixtures/repos/no_ey_config_no_warning/ey.yml +0 -5
  262. data/spec/fixtures/repos/no_gemfile_lock/Gemfile +0 -4
  263. data/spec/fixtures/repos/no_gemfile_lock/README +0 -1
  264. data/spec/fixtures/repos/no_gemfile_lock/ey.yml +0 -3
  265. data/spec/fixtures/repos/nodejs/README +0 -1
  266. data/spec/fixtures/repos/nodejs/package.json +0 -7
  267. data/spec/fixtures/repos/not_bundled/README +0 -1
  268. data/spec/fixtures/repos/npm_disabled/README +0 -1
  269. data/spec/fixtures/repos/npm_disabled/config/ey.yml +0 -2
  270. data/spec/fixtures/repos/npm_disabled/package.json +0 -7
  271. data/spec/fixtures/repos/php_composer_disabled/README +0 -1
  272. data/spec/fixtures/repos/php_composer_disabled/composer.json +0 -5
  273. data/spec/fixtures/repos/php_composer_disabled/composer.lock +0 -462
  274. data/spec/fixtures/repos/php_composer_disabled/config/ey.yml +0 -2
  275. data/spec/fixtures/repos/php_composer_disabled/public/index.php +0 -4
  276. data/spec/fixtures/repos/php_composer_lock/README +0 -1
  277. data/spec/fixtures/repos/php_composer_lock/composer.json +0 -5
  278. data/spec/fixtures/repos/php_composer_lock/composer.lock +0 -462
  279. data/spec/fixtures/repos/php_composer_lock/public/index.php +0 -4
  280. data/spec/fixtures/repos/php_no_composer_lock/README +0 -1
  281. data/spec/fixtures/repos/php_no_composer_lock/composer.json +0 -21
  282. data/spec/fixtures/repos/php_no_composer_lock/public/index.php +0 -4
  283. data/spec/fixtures/repos/public_system/Gemfile +0 -4
  284. data/spec/fixtures/repos/public_system/Gemfile.lock +0 -12
  285. data/spec/fixtures/repos/public_system/README +0 -5
  286. data/spec/fixtures/repos/public_system/ey.yml +0 -3
  287. data/spec/fixtures/repos/public_system/public/system/cant_touch_this.txt +0 -3
  288. data/spec/fixtures/repos/sqlite3/Gemfile +0 -4
  289. data/spec/fixtures/repos/sqlite3/Gemfile.lock +0 -89
  290. data/spec/fixtures/repos/sqlite3/README +0 -1
  291. data/spec/fixtures/retwisj.war +0 -0
  292. data/spec/fixtures/valid_hook.rb +0 -1
  293. data/spec/git_strategy_spec.rb +0 -34
  294. data/spec/lockfile_parser_spec.rb +0 -126
  295. data/spec/maintenance_spec.rb +0 -44
  296. data/spec/multi_dependency_manager_spec.rb +0 -25
  297. data/spec/nodejs_deploy_spec.rb +0 -30
  298. data/spec/php_deploy_spec.rb +0 -81
  299. data/spec/platform_configure_spec.rb +0 -61
  300. data/spec/rails31_deploy_spec.rb +0 -172
  301. data/spec/restart_spec.rb +0 -43
  302. data/spec/rollback_spec.rb +0 -87
  303. data/spec/server_spec.rb +0 -70
  304. data/spec/services_deploy_spec.rb +0 -165
  305. data/spec/shell_spec.rb +0 -57
  306. data/spec/source/archive_spec.rb +0 -33
  307. data/spec/source/git_spec.rb +0 -44
  308. data/spec/sqlite3_deploy_spec.rb +0 -38
  309. data/spec/support/integration.rb +0 -103
  310. data/spec/support/source_doubles.rb +0 -28
  311. data/spec/support/timecop.rb +0 -5
  312. data/spec/symlink_spec.rb +0 -15
@@ -1,21 +0,0 @@
1
- if ENV['SIMPLECOV_COVERAGE'].to_i == 1
2
- require 'simplecov'
3
- SimpleCov.start do
4
- add_filter "/tests/"
5
- end
6
- end
7
- require 'json/common'
8
-
9
- module JSON
10
- # This module holds all the modules/classes that implement JSON's
11
- # functionality as C extensions.
12
- module Ext
13
- require 'json/ext/parser'
14
- require 'json/ext/generator'
15
- $DEBUG and warn "Using Ext extension for JSON."
16
- JSON.parser = Parser
17
- JSON.generator = Generator
18
- end
19
-
20
- JSON_LOADED = true unless defined?(::JSON::JSON_LOADED)
21
- end
@@ -1,70 +0,0 @@
1
- require 'ostruct'
2
-
3
- module JSON
4
- class GenericObject < OpenStruct
5
- class << self
6
- alias [] new
7
-
8
- def json_creatable?
9
- @json_creatable
10
- end
11
-
12
- attr_writer :json_creatable
13
-
14
- def json_create(data)
15
- data = data.dup
16
- data.delete JSON.create_id
17
- self[data]
18
- end
19
-
20
- def from_hash(object)
21
- case
22
- when object.respond_to?(:to_hash)
23
- result = new
24
- object.to_hash.each do |key, value|
25
- result[key] = from_hash(value)
26
- end
27
- result
28
- when object.respond_to?(:to_ary)
29
- object.to_ary.map { |a| from_hash(a) }
30
- else
31
- object
32
- end
33
- end
34
-
35
- def load(source, proc = nil, opts = {})
36
- result = ::JSON.load(source, proc, opts.merge(:object_class => self))
37
- result.nil? ? new : result
38
- end
39
-
40
- def dump(obj, *args)
41
- ::JSON.dump(obj, *args)
42
- end
43
- end
44
- self.json_creatable = false
45
-
46
- def to_hash
47
- table
48
- end
49
-
50
- def [](name)
51
- table[name.to_sym]
52
- end
53
-
54
- def []=(name, value)
55
- __send__ "#{name}=", value
56
- end
57
-
58
- def |(other)
59
- self.class[other.to_hash.merge(to_hash)]
60
- end
61
-
62
- def as_json(*)
63
- { JSON.create_id => self.class.name }.merge to_hash
64
- end
65
-
66
- def to_json(*a)
67
- as_json.to_json(*a)
68
- end
69
- end
70
- end
@@ -1,21 +0,0 @@
1
- if ENV['SIMPLECOV_COVERAGE'].to_i == 1
2
- require 'simplecov'
3
- SimpleCov.start do
4
- add_filter "/tests/"
5
- end
6
- end
7
- require 'json/common'
8
- require 'json/pure/parser'
9
- require 'json/pure/generator'
10
-
11
- module JSON
12
- # This module holds all the modules/classes that implement JSON's
13
- # functionality in pure ruby.
14
- module Pure
15
- $DEBUG and warn "Using Pure library for JSON."
16
- JSON.parser = Parser
17
- JSON.generator = Generator
18
- end
19
-
20
- JSON_LOADED = true unless defined?(::JSON::JSON_LOADED)
21
- end
@@ -1,522 +0,0 @@
1
- module JSON
2
- MAP = {
3
- "\x0" => '\u0000',
4
- "\x1" => '\u0001',
5
- "\x2" => '\u0002',
6
- "\x3" => '\u0003',
7
- "\x4" => '\u0004',
8
- "\x5" => '\u0005',
9
- "\x6" => '\u0006',
10
- "\x7" => '\u0007',
11
- "\b" => '\b',
12
- "\t" => '\t',
13
- "\n" => '\n',
14
- "\xb" => '\u000b',
15
- "\f" => '\f',
16
- "\r" => '\r',
17
- "\xe" => '\u000e',
18
- "\xf" => '\u000f',
19
- "\x10" => '\u0010',
20
- "\x11" => '\u0011',
21
- "\x12" => '\u0012',
22
- "\x13" => '\u0013',
23
- "\x14" => '\u0014',
24
- "\x15" => '\u0015',
25
- "\x16" => '\u0016',
26
- "\x17" => '\u0017',
27
- "\x18" => '\u0018',
28
- "\x19" => '\u0019',
29
- "\x1a" => '\u001a',
30
- "\x1b" => '\u001b',
31
- "\x1c" => '\u001c',
32
- "\x1d" => '\u001d',
33
- "\x1e" => '\u001e',
34
- "\x1f" => '\u001f',
35
- '"' => '\"',
36
- '\\' => '\\\\',
37
- } # :nodoc:
38
-
39
- # Convert a UTF8 encoded Ruby string _string_ to a JSON string, encoded with
40
- # UTF16 big endian characters as \u????, and return it.
41
- if defined?(::Encoding)
42
- def utf8_to_json(string) # :nodoc:
43
- string = string.dup
44
- string.force_encoding(::Encoding::ASCII_8BIT)
45
- string.gsub!(/["\\\x0-\x1f]/) { MAP[$&] }
46
- string.force_encoding(::Encoding::UTF_8)
47
- string
48
- end
49
-
50
- def utf8_to_json_ascii(string) # :nodoc:
51
- string = string.dup
52
- string.force_encoding(::Encoding::ASCII_8BIT)
53
- string.gsub!(/["\\\x0-\x1f]/n) { MAP[$&] }
54
- string.gsub!(/(
55
- (?:
56
- [\xc2-\xdf][\x80-\xbf] |
57
- [\xe0-\xef][\x80-\xbf]{2} |
58
- [\xf0-\xf4][\x80-\xbf]{3}
59
- )+ |
60
- [\x80-\xc1\xf5-\xff] # invalid
61
- )/nx) { |c|
62
- c.size == 1 and raise GeneratorError, "invalid utf8 byte: '#{c}'"
63
- s = JSON.iconv('utf-16be', 'utf-8', c).unpack('H*')[0]
64
- s.force_encoding(::Encoding::ASCII_8BIT)
65
- s.gsub!(/.{4}/n, '\\\\u\&')
66
- s.force_encoding(::Encoding::UTF_8)
67
- }
68
- string.force_encoding(::Encoding::UTF_8)
69
- string
70
- rescue => e
71
- raise GeneratorError.wrap(e)
72
- end
73
-
74
- def valid_utf8?(string)
75
- encoding = string.encoding
76
- (encoding == Encoding::UTF_8 || encoding == Encoding::ASCII) &&
77
- string.valid_encoding?
78
- end
79
- module_function :valid_utf8?
80
- else
81
- def utf8_to_json(string) # :nodoc:
82
- string.gsub(/["\\\x0-\x1f]/n) { MAP[$&] }
83
- end
84
-
85
- def utf8_to_json_ascii(string) # :nodoc:
86
- string = string.gsub(/["\\\x0-\x1f]/) { MAP[$&] }
87
- string.gsub!(/(
88
- (?:
89
- [\xc2-\xdf][\x80-\xbf] |
90
- [\xe0-\xef][\x80-\xbf]{2} |
91
- [\xf0-\xf4][\x80-\xbf]{3}
92
- )+ |
93
- [\x80-\xc1\xf5-\xff] # invalid
94
- )/nx) { |c|
95
- c.size == 1 and raise GeneratorError, "invalid utf8 byte: '#{c}'"
96
- s = JSON.iconv('utf-16be', 'utf-8', c).unpack('H*')[0]
97
- s.gsub!(/.{4}/n, '\\\\u\&')
98
- }
99
- string
100
- rescue => e
101
- raise GeneratorError.wrap(e)
102
- end
103
-
104
- def valid_utf8?(string)
105
- string =~
106
- /\A( [\x09\x0a\x0d\x20-\x7e] # ASCII
107
- | [\xc2-\xdf][\x80-\xbf] # non-overlong 2-byte
108
- | \xe0[\xa0-\xbf][\x80-\xbf] # excluding overlongs
109
- | [\xe1-\xec\xee\xef][\x80-\xbf]{2} # straight 3-byte
110
- | \xed[\x80-\x9f][\x80-\xbf] # excluding surrogates
111
- | \xf0[\x90-\xbf][\x80-\xbf]{2} # planes 1-3
112
- | [\xf1-\xf3][\x80-\xbf]{3} # planes 4-15
113
- | \xf4[\x80-\x8f][\x80-\xbf]{2} # plane 16
114
- )*\z/nx
115
- end
116
- end
117
- module_function :utf8_to_json, :utf8_to_json_ascii, :valid_utf8?
118
-
119
-
120
- module Pure
121
- module Generator
122
- # This class is used to create State instances, that are use to hold data
123
- # while generating a JSON text from a Ruby data structure.
124
- class State
125
- # Creates a State object from _opts_, which ought to be Hash to create
126
- # a new State instance configured by _opts_, something else to create
127
- # an unconfigured instance. If _opts_ is a State object, it is just
128
- # returned.
129
- def self.from_state(opts)
130
- case
131
- when self === opts
132
- opts
133
- when opts.respond_to?(:to_hash)
134
- new(opts.to_hash)
135
- when opts.respond_to?(:to_h)
136
- new(opts.to_h)
137
- else
138
- SAFE_STATE_PROTOTYPE.dup
139
- end
140
- end
141
-
142
- # Instantiates a new State object, configured by _opts_.
143
- #
144
- # _opts_ can have the following keys:
145
- #
146
- # * *indent*: a string used to indent levels (default: ''),
147
- # * *space*: a string that is put after, a : or , delimiter (default: ''),
148
- # * *space_before*: a string that is put before a : pair delimiter (default: ''),
149
- # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
150
- # * *array_nl*: a string that is put at the end of a JSON array (default: ''),
151
- # * *check_circular*: is deprecated now, use the :max_nesting option instead,
152
- # * *max_nesting*: sets the maximum level of data structure nesting in
153
- # the generated JSON, max_nesting = 0 if no maximum should be checked.
154
- # * *allow_nan*: true if NaN, Infinity, and -Infinity should be
155
- # generated, otherwise an exception is thrown, if these values are
156
- # encountered. This options defaults to false.
157
- # * *quirks_mode*: Enables quirks_mode for parser, that is for example
158
- # generating single JSON values instead of documents is possible.
159
- def initialize(opts = {})
160
- @indent = ''
161
- @space = ''
162
- @space_before = ''
163
- @object_nl = ''
164
- @array_nl = ''
165
- @allow_nan = false
166
- @ascii_only = false
167
- @quirks_mode = false
168
- @buffer_initial_length = 1024
169
- configure opts
170
- end
171
-
172
- # This string is used to indent levels in the JSON text.
173
- attr_accessor :indent
174
-
175
- # This string is used to insert a space between the tokens in a JSON
176
- # string.
177
- attr_accessor :space
178
-
179
- # This string is used to insert a space before the ':' in JSON objects.
180
- attr_accessor :space_before
181
-
182
- # This string is put at the end of a line that holds a JSON object (or
183
- # Hash).
184
- attr_accessor :object_nl
185
-
186
- # This string is put at the end of a line that holds a JSON array.
187
- attr_accessor :array_nl
188
-
189
- # This integer returns the maximum level of data structure nesting in
190
- # the generated JSON, max_nesting = 0 if no maximum is checked.
191
- attr_accessor :max_nesting
192
-
193
- # If this attribute is set to true, quirks mode is enabled, otherwise
194
- # it's disabled.
195
- attr_accessor :quirks_mode
196
-
197
- # :stopdoc:
198
- attr_reader :buffer_initial_length
199
-
200
- def buffer_initial_length=(length)
201
- if length > 0
202
- @buffer_initial_length = length
203
- end
204
- end
205
- # :startdoc:
206
-
207
- # This integer returns the current depth data structure nesting in the
208
- # generated JSON.
209
- attr_accessor :depth
210
-
211
- def check_max_nesting # :nodoc:
212
- return if @max_nesting.zero?
213
- current_nesting = depth + 1
214
- current_nesting > @max_nesting and
215
- raise NestingError, "nesting of #{current_nesting} is too deep"
216
- end
217
-
218
- # Returns true, if circular data structures are checked,
219
- # otherwise returns false.
220
- def check_circular?
221
- !@max_nesting.zero?
222
- end
223
-
224
- # Returns true if NaN, Infinity, and -Infinity should be considered as
225
- # valid JSON and output.
226
- def allow_nan?
227
- @allow_nan
228
- end
229
-
230
- # Returns true, if only ASCII characters should be generated. Otherwise
231
- # returns false.
232
- def ascii_only?
233
- @ascii_only
234
- end
235
-
236
- # Returns true, if quirks mode is enabled. Otherwise returns false.
237
- def quirks_mode?
238
- @quirks_mode
239
- end
240
-
241
- # Configure this State instance with the Hash _opts_, and return
242
- # itself.
243
- def configure(opts)
244
- if opts.respond_to?(:to_hash)
245
- opts = opts.to_hash
246
- elsif opts.respond_to?(:to_h)
247
- opts = opts.to_h
248
- else
249
- raise TypeError, "can't convert #{opts.class} into Hash"
250
- end
251
- for key, value in opts
252
- instance_variable_set "@#{key}", value
253
- end
254
- @indent = opts[:indent] if opts.key?(:indent)
255
- @space = opts[:space] if opts.key?(:space)
256
- @space_before = opts[:space_before] if opts.key?(:space_before)
257
- @object_nl = opts[:object_nl] if opts.key?(:object_nl)
258
- @array_nl = opts[:array_nl] if opts.key?(:array_nl)
259
- @allow_nan = !!opts[:allow_nan] if opts.key?(:allow_nan)
260
- @ascii_only = opts[:ascii_only] if opts.key?(:ascii_only)
261
- @depth = opts[:depth] || 0
262
- @quirks_mode = opts[:quirks_mode] if opts.key?(:quirks_mode)
263
- @buffer_initial_length ||= opts[:buffer_initial_length]
264
-
265
- if !opts.key?(:max_nesting) # defaults to 100
266
- @max_nesting = 100
267
- elsif opts[:max_nesting]
268
- @max_nesting = opts[:max_nesting]
269
- else
270
- @max_nesting = 0
271
- end
272
- self
273
- end
274
- alias merge configure
275
-
276
- # Returns the configuration instance variables as a hash, that can be
277
- # passed to the configure method.
278
- def to_h
279
- result = {}
280
- for iv in instance_variables
281
- iv = iv.to_s[1..-1]
282
- result[iv.to_sym] = self[iv]
283
- end
284
- result
285
- end
286
-
287
- alias to_hash to_h
288
-
289
- # Generates a valid JSON document from object +obj+ and returns the
290
- # result. If no valid JSON document can be created this method raises a
291
- # GeneratorError exception.
292
- def generate(obj)
293
- result = obj.to_json(self)
294
- JSON.valid_utf8?(result) or raise GeneratorError,
295
- "source sequence #{result.inspect} is illegal/malformed utf-8"
296
- unless @quirks_mode
297
- unless result =~ /\A\s*\[/ && result =~ /\]\s*\Z/ ||
298
- result =~ /\A\s*\{/ && result =~ /\}\s*\Z/
299
- then
300
- raise GeneratorError, "only generation of JSON objects or arrays allowed"
301
- end
302
- end
303
- result
304
- end
305
-
306
- # Return the value returned by method +name+.
307
- def [](name)
308
- if respond_to?(name)
309
- __send__(name)
310
- else
311
- instance_variable_get("@#{name}")
312
- end
313
- end
314
-
315
- def []=(name, value)
316
- if respond_to?(name_writer = "#{name}=")
317
- __send__ name_writer, value
318
- else
319
- instance_variable_set "@#{name}", value
320
- end
321
- end
322
- end
323
-
324
- module GeneratorMethods
325
- module Object
326
- # Converts this object to a string (calling #to_s), converts
327
- # it to a JSON string, and returns the result. This is a fallback, if no
328
- # special method #to_json was defined for some object.
329
- def to_json(*) to_s.to_json end
330
- end
331
-
332
- module Hash
333
- # Returns a JSON string containing a JSON object, that is unparsed from
334
- # this Hash instance.
335
- # _state_ is a JSON::State object, that can also be used to configure the
336
- # produced JSON string output further.
337
- # _depth_ is used to find out nesting depth, to indent accordingly.
338
- def to_json(state = nil, *)
339
- state = State.from_state(state)
340
- state.check_max_nesting
341
- json_transform(state)
342
- end
343
-
344
- private
345
-
346
- def json_shift(state)
347
- state.object_nl.empty? or return ''
348
- state.indent * state.depth
349
- end
350
-
351
- def json_transform(state)
352
- delim = ','
353
- delim << state.object_nl
354
- result = '{'
355
- result << state.object_nl
356
- depth = state.depth += 1
357
- first = true
358
- indent = !state.object_nl.empty?
359
- each { |key,value|
360
- result << delim unless first
361
- result << state.indent * depth if indent
362
- result << key.to_s.to_json(state)
363
- result << state.space_before
364
- result << ':'
365
- result << state.space
366
- result << value.to_json(state)
367
- first = false
368
- }
369
- depth = state.depth -= 1
370
- result << state.object_nl
371
- result << state.indent * depth if indent
372
- result << '}'
373
- result
374
- end
375
- end
376
-
377
- module Array
378
- # Returns a JSON string containing a JSON array, that is unparsed from
379
- # this Array instance.
380
- # _state_ is a JSON::State object, that can also be used to configure the
381
- # produced JSON string output further.
382
- def to_json(state = nil, *)
383
- state = State.from_state(state)
384
- state.check_max_nesting
385
- json_transform(state)
386
- end
387
-
388
- private
389
-
390
- def json_transform(state)
391
- delim = ','
392
- delim << state.array_nl
393
- result = '['
394
- result << state.array_nl
395
- depth = state.depth += 1
396
- first = true
397
- indent = !state.array_nl.empty?
398
- each { |value|
399
- result << delim unless first
400
- result << state.indent * depth if indent
401
- result << value.to_json(state)
402
- first = false
403
- }
404
- depth = state.depth -= 1
405
- result << state.array_nl
406
- result << state.indent * depth if indent
407
- result << ']'
408
- end
409
- end
410
-
411
- module Integer
412
- # Returns a JSON string representation for this Integer number.
413
- def to_json(*) to_s end
414
- end
415
-
416
- module Float
417
- # Returns a JSON string representation for this Float number.
418
- def to_json(state = nil, *)
419
- state = State.from_state(state)
420
- case
421
- when infinite?
422
- if state.allow_nan?
423
- to_s
424
- else
425
- raise GeneratorError, "#{self} not allowed in JSON"
426
- end
427
- when nan?
428
- if state.allow_nan?
429
- to_s
430
- else
431
- raise GeneratorError, "#{self} not allowed in JSON"
432
- end
433
- else
434
- to_s
435
- end
436
- end
437
- end
438
-
439
- module String
440
- if defined?(::Encoding)
441
- # This string should be encoded with UTF-8 A call to this method
442
- # returns a JSON string encoded with UTF16 big endian characters as
443
- # \u????.
444
- def to_json(state = nil, *args)
445
- state = State.from_state(state)
446
- if encoding == ::Encoding::UTF_8
447
- string = self
448
- else
449
- string = encode(::Encoding::UTF_8)
450
- end
451
- if state.ascii_only?
452
- '"' << JSON.utf8_to_json_ascii(string) << '"'
453
- else
454
- '"' << JSON.utf8_to_json(string) << '"'
455
- end
456
- end
457
- else
458
- # This string should be encoded with UTF-8 A call to this method
459
- # returns a JSON string encoded with UTF16 big endian characters as
460
- # \u????.
461
- def to_json(state = nil, *args)
462
- state = State.from_state(state)
463
- if state.ascii_only?
464
- '"' << JSON.utf8_to_json_ascii(self) << '"'
465
- else
466
- '"' << JSON.utf8_to_json(self) << '"'
467
- end
468
- end
469
- end
470
-
471
- # Module that holds the extinding methods if, the String module is
472
- # included.
473
- module Extend
474
- # Raw Strings are JSON Objects (the raw bytes are stored in an
475
- # array for the key "raw"). The Ruby String can be created by this
476
- # module method.
477
- def json_create(o)
478
- o['raw'].pack('C*')
479
- end
480
- end
481
-
482
- # Extends _modul_ with the String::Extend module.
483
- def self.included(modul)
484
- modul.extend Extend
485
- end
486
-
487
- # This method creates a raw object hash, that can be nested into
488
- # other data structures and will be unparsed as a raw string. This
489
- # method should be used, if you want to convert raw strings to JSON
490
- # instead of UTF-8 strings, e. g. binary data.
491
- def to_json_raw_object
492
- {
493
- JSON.create_id => self.class.name,
494
- 'raw' => self.unpack('C*'),
495
- }
496
- end
497
-
498
- # This method creates a JSON text from the result of
499
- # a call to to_json_raw_object of this String.
500
- def to_json_raw(*args)
501
- to_json_raw_object.to_json(*args)
502
- end
503
- end
504
-
505
- module TrueClass
506
- # Returns a JSON string for true: 'true'.
507
- def to_json(*) 'true' end
508
- end
509
-
510
- module FalseClass
511
- # Returns a JSON string for false: 'false'.
512
- def to_json(*) 'false' end
513
- end
514
-
515
- module NilClass
516
- # Returns a JSON string for nil: 'null'.
517
- def to_json(*) 'null' end
518
- end
519
- end
520
- end
521
- end
522
- end