passenger 4.0.30 → 4.0.31

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (409) hide show
  1. data.tar.gz.asc +7 -7
  2. data/NEWS +31 -0
  3. data/bin/passenger +5 -5
  4. data/bin/passenger-config +6 -126
  5. data/bin/passenger-install-apache2-module +108 -26
  6. data/bin/passenger-install-nginx-module +81 -27
  7. data/bin/passenger-memory-stats +7 -6
  8. data/bin/passenger-status +13 -10
  9. data/build/agents.rb +8 -12
  10. data/build/apache2.rb +12 -7
  11. data/build/basics.rb +28 -20
  12. data/build/common_library.rb +4 -4
  13. data/build/cplusplus_support.rb +4 -4
  14. data/build/cxx_tests.rb +5 -3
  15. data/build/debian.rb +1 -2
  16. data/build/integration_tests.rb +25 -9
  17. data/build/misc.rb +2 -2
  18. data/build/oxt_tests.rb +5 -6
  19. data/build/packaging.rb +72 -40
  20. data/build/ruby_tests.rb +5 -1
  21. data/build/test_basics.rb +1 -2
  22. data/debian.template/locations.ini.template +1 -0
  23. data/debian.template/rules.template +2 -1
  24. data/dev/install_scripts_bootstrap_code.rb +42 -0
  25. data/dev/run_travis.sh +1 -0
  26. data/dev/runner +27 -0
  27. data/doc/Packaging.txt.md +5 -10
  28. data/doc/Users guide Apache.idmap.txt +3 -1
  29. data/doc/Users guide Apache.txt +5 -3
  30. data/doc/Users guide Nginx.idmap.txt +9 -5
  31. data/doc/Users guide Nginx.txt +47 -17
  32. data/doc/users_guide_snippets/environment_variables.txt +2 -2
  33. data/doc/users_guide_snippets/installation.txt +6 -2
  34. data/doc/users_guide_snippets/tips.txt +4 -0
  35. data/ext/apache2/Hooks.cpp +16 -3
  36. data/ext/common/Account.h +6 -5
  37. data/ext/common/AgentsStarter.h +1 -1
  38. data/ext/common/ApplicationPool2/Common.h +72 -0
  39. data/ext/common/ApplicationPool2/Group.h +263 -148
  40. data/ext/common/ApplicationPool2/Implementation.cpp +66 -44
  41. data/ext/common/ApplicationPool2/Options.h +1 -7
  42. data/ext/common/ApplicationPool2/Pool.h +96 -72
  43. data/ext/common/ApplicationPool2/Process.h +12 -17
  44. data/ext/common/ApplicationPool2/Socket.h +4 -4
  45. data/ext/common/ApplicationPool2/SuperGroup.h +20 -17
  46. data/ext/common/Constants.h +15 -1
  47. data/ext/common/MessageServer.h +22 -0
  48. data/ext/common/Utils.cpp +4 -1
  49. data/ext/common/Utils.h +3 -1
  50. data/ext/common/Utils/StrIntUtils.h +1 -0
  51. data/ext/common/Utils/Timer.h +15 -1
  52. data/ext/common/Utils/utf8/checked.h +0 -0
  53. data/ext/common/Utils/utf8/core.h +0 -0
  54. data/ext/common/Utils/utf8/unchecked.h +0 -0
  55. data/ext/common/agents/Base.cpp +59 -35
  56. data/ext/common/agents/HelperAgent/Main.cpp +23 -12
  57. data/ext/common/agents/HelperAgent/RequestHandler.h +10 -1
  58. data/ext/common/agents/LoggingAgent/FilterSupport.h +9 -5
  59. data/ext/common/agents/TempDirToucher.c +12 -3
  60. data/ext/common/agents/Watchdog/Main.cpp +8 -2
  61. data/ext/nginx/ConfigurationCommands.c +10 -0
  62. data/ext/nginx/ConfigurationFields.h +2 -0
  63. data/ext/nginx/ContentHandler.c +32 -19
  64. data/ext/nginx/CreateLocationConfig.c +5 -0
  65. data/ext/nginx/MergeLocationConfig.c +6 -0
  66. data/ext/nginx/config +13 -6
  67. data/ext/ruby/passenger_native_support.c +61 -2
  68. data/helper-scripts/classic-rails-loader.rb +9 -10
  69. data/helper-scripts/classic-rails-preloader.rb +10 -11
  70. data/helper-scripts/node-loader.js +3 -2
  71. data/helper-scripts/rack-loader.rb +8 -9
  72. data/helper-scripts/rack-preloader.rb +9 -10
  73. data/lib/phusion_passenger.rb +36 -7
  74. data/lib/phusion_passenger/abstract_installer.rb +16 -15
  75. data/lib/phusion_passenger/active_support3_extensions/init.rb +1 -1
  76. data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
  77. data/lib/phusion_passenger/admin_tools/server_instance.rb +5 -5
  78. data/lib/phusion_passenger/analytics_logger.rb +3 -3
  79. data/lib/phusion_passenger/classic_rails/thread_handler_extension.rb +1 -1
  80. data/lib/phusion_passenger/config.rb +125 -0
  81. data/lib/phusion_passenger/config/about_command.rb +183 -0
  82. data/lib/phusion_passenger/config/command.rb +57 -0
  83. data/lib/phusion_passenger/config/restart_app_command.rb +146 -0
  84. data/lib/phusion_passenger/config/utils.rb +108 -0
  85. data/lib/phusion_passenger/console_text_template.rb +2 -1
  86. data/lib/phusion_passenger/constants.rb +7 -2
  87. data/lib/phusion_passenger/loader_shared_helpers.rb +12 -21
  88. data/lib/phusion_passenger/message_client.rb +15 -4
  89. data/lib/phusion_passenger/native_support.rb +116 -98
  90. data/lib/phusion_passenger/nginx/config_options.rb +5 -0
  91. data/lib/phusion_passenger/platform_info.rb +1 -1
  92. data/lib/phusion_passenger/platform_info/apache.rb +9 -5
  93. data/lib/phusion_passenger/platform_info/apache_detector.rb +5 -6
  94. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -3
  95. data/lib/phusion_passenger/platform_info/compiler.rb +29 -11
  96. data/lib/phusion_passenger/platform_info/curl.rb +1 -1
  97. data/lib/phusion_passenger/platform_info/cxx_portability.rb +30 -16
  98. data/lib/phusion_passenger/platform_info/depcheck.rb +6 -6
  99. data/lib/phusion_passenger/platform_info/linux.rb +2 -2
  100. data/lib/phusion_passenger/platform_info/operating_system.rb +25 -5
  101. data/lib/phusion_passenger/platform_info/ruby.rb +7 -4
  102. data/lib/phusion_passenger/platform_info/zlib.rb +1 -1
  103. data/lib/phusion_passenger/plugin.rb +0 -1
  104. data/lib/phusion_passenger/preloader_shared_helpers.rb +1 -1
  105. data/lib/phusion_passenger/public_api.rb +1 -1
  106. data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
  107. data/lib/phusion_passenger/request_handler.rb +8 -9
  108. data/lib/phusion_passenger/request_handler/thread_handler.rb +21 -9
  109. data/lib/phusion_passenger/ruby_core_enhancements.rb +1 -1
  110. data/lib/phusion_passenger/standalone/app_finder.rb +2 -2
  111. data/lib/phusion_passenger/standalone/command.rb +10 -8
  112. data/lib/phusion_passenger/standalone/help_command.rb +1 -1
  113. data/lib/phusion_passenger/standalone/main.rb +3 -3
  114. data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
  115. data/lib/phusion_passenger/standalone/runtime_installer.rb +55 -13
  116. data/lib/phusion_passenger/standalone/runtime_locator.rb +3 -3
  117. data/lib/phusion_passenger/standalone/start_command.rb +6 -7
  118. data/lib/phusion_passenger/standalone/status_command.rb +1 -1
  119. data/lib/phusion_passenger/standalone/stop_command.rb +1 -1
  120. data/lib/phusion_passenger/standalone/utils.rb +1 -1
  121. data/lib/phusion_passenger/standalone/version_command.rb +2 -3
  122. data/lib/phusion_passenger/utils.rb +1 -1
  123. data/lib/phusion_passenger/utils/download.rb +1 -2
  124. data/lib/phusion_passenger/utils/file_system_watcher.rb +1 -1
  125. data/lib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
  126. data/lib/phusion_passenger/utils/tee_input.rb +1 -1
  127. data/lib/phusion_passenger/utils/terminal_choice_menu.rb +217 -0
  128. data/lib/phusion_passenger/utils/unseekable_socket.rb +1 -1
  129. data/resources/templates/apache2/config_snippets.txt.erb +2 -3
  130. data/resources/templates/apache2/deployment_example.txt.erb +2 -2
  131. data/resources/templates/apache2/notify_apache_module_installed.txt.erb +3 -0
  132. data/resources/templates/nginx/config_snippets.txt.erb +1 -1
  133. data/resources/templates/nginx/deployment_example.txt.erb +2 -2
  134. data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +11 -5
  135. data/rpm/Vagrantfile +1 -0
  136. data/test/cxx/ApplicationPool2/PoolTest.cpp +224 -35
  137. data/test/cxx/ApplicationPool2/ProcessTest.cpp +6 -6
  138. data/test/cxx/MessagePassingTest.cpp +1 -1
  139. data/test/cxx/RequestHandlerTest.cpp +26 -26
  140. data/test/integration_tests/apache2_tests.rb +162 -243
  141. data/test/integration_tests/native_packaging_spec.rb +10 -10
  142. data/test/integration_tests/nginx_tests.rb +87 -107
  143. data/test/integration_tests/shared/example_webapp_tests.rb +246 -0
  144. data/test/integration_tests/source_packaging_test.rb +2 -1
  145. data/test/integration_tests/standalone_tests.rb +34 -19
  146. data/test/ruby/admin_tools_spec.rb +4 -4
  147. data/test/ruby/analytics_logger_spec.rb +1 -1
  148. data/test/ruby/debug_logging_spec.rb +2 -2
  149. data/test/ruby/message_channel_spec.rb +1 -1
  150. data/test/ruby/request_handler_spec.rb +171 -64
  151. data/test/ruby/shared/loader_sharedspec.rb +5 -5
  152. data/test/ruby/shared/rails/analytics_logging_extensions_sharedspec.rb +2 -2
  153. data/test/ruby/spec_helper.rb +4 -4
  154. data/test/ruby/standalone/runtime_installer_spec.rb +1 -1
  155. data/test/ruby/standalone/runtime_locator_spec.rb +1 -1
  156. data/test/ruby/utils/file_system_watcher_spec.rb +1 -1
  157. data/test/ruby/utils/hosts_file_parser.rb +1 -1
  158. data/test/ruby/utils/unseekable_socket_spec.rb +1 -1
  159. data/test/ruby/utils_spec.rb +4 -4
  160. data/test/stub/apache2/httpd.conf.erb +5 -0
  161. data/test/stub/index.html +1 -0
  162. data/test/stub/rack/config.ru +80 -33
  163. data/test/stub/{rails_apps/1.2/empty/app/models → rack/public}/.gitignore +0 -0
  164. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/Rakefile +0 -0
  165. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/application_controller.rb +0 -0
  166. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/recipes_controller.rb +0 -0
  167. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/uploads_controller.rb +0 -0
  168. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/welcome_controller.rb +0 -0
  169. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/app/helpers/application_helper.rb +0 -0
  170. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/recipes_helper.rb +0 -0
  171. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/test_helper.rb +0 -0
  172. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/uploads_helper.rb +0 -0
  173. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/welcome_helper.rb +0 -0
  174. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/layouts/default.rhtml +0 -0
  175. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/create.rhtml +0 -0
  176. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/index.rhtml +0 -0
  177. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/new.rhtml +0 -0
  178. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/index.rhtml +0 -0
  179. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/new.html.erb +0 -0
  180. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/cached.rhtml +0 -0
  181. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/index.rhtml +0 -0
  182. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/boot.rb +0 -0
  183. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/database.yml +0 -0
  184. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environment.rb +0 -0
  185. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/environments/development.rb +0 -0
  186. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environments/production.rb +0 -0
  187. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/inflections.rb +0 -0
  188. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/mime_types.rb +0 -0
  189. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/routes.rb +0 -0
  190. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/log/useless.txt +0 -0
  191. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/.htaccess +0 -0
  192. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/404.html +0 -0
  193. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/422.html +0 -0
  194. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/500.html +0 -0
  195. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.cgi +0 -0
  196. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.fcgi +0 -0
  197. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.rb +0 -0
  198. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/favicon.ico +0 -0
  199. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/angrywizard.gif +0 -0
  200. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/cookbook.gif +0 -0
  201. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/header.png +0 -0
  202. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/images/rails.png +0 -0
  203. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/robots.txt +0 -0
  204. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/uploads.html +0 -0
  205. data/test/stub/{rails_apps/1.2/empty/db → rails2.3-mycook/public/uploads}/.gitignore +0 -0
  206. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/welcome/cached.html +0 -0
  207. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/about +0 -0
  208. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/console +0 -0
  209. data/test/stub/{rails_apps/2.2/empty → rails2.3-mycook}/script/dbconsole +0 -0
  210. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/destroy +0 -0
  211. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/generate +0 -0
  212. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/benchmarker +0 -0
  213. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/profiler +0 -0
  214. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/performance/request +0 -0
  215. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/plugin +0 -0
  216. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/inspector +0 -0
  217. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/reaper +0 -0
  218. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/spawner +0 -0
  219. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/runner +0 -0
  220. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/server +0 -0
  221. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/uploads.html +0 -0
  222. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/welcome/cached.html +0 -0
  223. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/cache/useless.txt +0 -0
  224. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/pids/useless.txt +0 -0
  225. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sessions/useless.txt +0 -0
  226. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sockets/useless.txt +0 -0
  227. data/test/stub/rails2.3/app/controllers/foo_controller.rb +1 -1
  228. data/test/stub/rails2.3/config/routes.rb +1 -2
  229. data/test/stub/wsgi/passenger_wsgi.py +47 -8
  230. data/test/stub/{rails_apps/1.2/empty/public/stylesheets → wsgi/public}/.gitignore +0 -0
  231. data/test/support/apache2_controller.rb +2 -2
  232. data/test/support/nginx_controller.rb +11 -5
  233. data/test/support/placebo-preloader.rb +2 -2
  234. data/test/support/test_helper.rb +26 -7
  235. metadata +78 -240
  236. metadata.gz.asc +7 -7
  237. data/debian.template/repack.sh +0 -42
  238. data/debian.template/watch +0 -3
  239. data/test/integration_tests/cgi_environment_spec.rb +0 -36
  240. data/test/integration_tests/hello_world_rack_spec.rb +0 -43
  241. data/test/integration_tests/hello_world_wsgi_spec.rb +0 -41
  242. data/test/integration_tests/mycook_spec.rb +0 -166
  243. data/test/stub/rack/public/rack.jpg +0 -0
  244. data/test/stub/rails_apps/1.2/empty/.gitignore +0 -3
  245. data/test/stub/rails_apps/1.2/empty/app/controllers/application.rb +0 -7
  246. data/test/stub/rails_apps/1.2/empty/config/boot.rb +0 -108
  247. data/test/stub/rails_apps/1.2/empty/config/database.yml +0 -31
  248. data/test/stub/rails_apps/1.2/empty/config/environment.rb +0 -66
  249. data/test/stub/rails_apps/1.2/empty/config/environments/development.rb +0 -21
  250. data/test/stub/rails_apps/1.2/empty/config/environments/production.rb +0 -18
  251. data/test/stub/rails_apps/1.2/empty/config/environments/staging.rb +0 -18
  252. data/test/stub/rails_apps/1.2/empty/config/environments/test.rb +0 -19
  253. data/test/stub/rails_apps/1.2/empty/config/routes.rb +0 -23
  254. data/test/stub/rails_apps/1.2/empty/doc/README_FOR_APP +0 -2
  255. data/test/stub/rails_apps/1.2/empty/public/.htaccess +0 -40
  256. data/test/stub/rails_apps/1.2/empty/public/500.html +0 -30
  257. data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +0 -10
  258. data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +0 -24
  259. data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +0 -10
  260. data/test/stub/rails_apps/1.2/empty/public/robots.txt +0 -1
  261. data/test/stub/rails_apps/1.2/empty/script/about +0 -3
  262. data/test/stub/rails_apps/1.2/empty/script/breakpointer +0 -3
  263. data/test/stub/rails_apps/1.2/empty/script/console +0 -3
  264. data/test/stub/rails_apps/1.2/empty/script/destroy +0 -3
  265. data/test/stub/rails_apps/1.2/empty/script/generate +0 -3
  266. data/test/stub/rails_apps/1.2/empty/script/plugin +0 -3
  267. data/test/stub/rails_apps/1.2/empty/script/runner +0 -3
  268. data/test/stub/rails_apps/1.2/empty/script/server +0 -3
  269. data/test/stub/rails_apps/1.2/empty/test/test_helper.rb +0 -28
  270. data/test/stub/rails_apps/2.0/empty/.gitignore +0 -3
  271. data/test/stub/rails_apps/2.0/empty/Rakefile +0 -10
  272. data/test/stub/rails_apps/2.0/empty/app/controllers/application.rb +0 -10
  273. data/test/stub/rails_apps/2.0/empty/app/helpers/application_helper.rb +0 -3
  274. data/test/stub/rails_apps/2.0/empty/app/models/.gitignore +0 -0
  275. data/test/stub/rails_apps/2.0/empty/config/boot.rb +0 -108
  276. data/test/stub/rails_apps/2.0/empty/config/database.yml +0 -31
  277. data/test/stub/rails_apps/2.0/empty/config/environment.rb +0 -59
  278. data/test/stub/rails_apps/2.0/empty/config/environments/production.rb +0 -18
  279. data/test/stub/rails_apps/2.0/empty/config/environments/staging.rb +0 -18
  280. data/test/stub/rails_apps/2.0/empty/config/environments/test.rb +0 -22
  281. data/test/stub/rails_apps/2.0/empty/config/routes.rb +0 -35
  282. data/test/stub/rails_apps/2.0/empty/db/.gitignore +0 -0
  283. data/test/stub/rails_apps/2.0/empty/doc/README_FOR_APP +0 -2
  284. data/test/stub/rails_apps/2.0/empty/public/.htaccess +0 -40
  285. data/test/stub/rails_apps/2.0/empty/public/404.html +0 -30
  286. data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +0 -10
  287. data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +0 -24
  288. data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +0 -10
  289. data/test/stub/rails_apps/2.0/empty/public/favicon.ico +0 -0
  290. data/test/stub/rails_apps/2.0/empty/public/images/rails.png +0 -0
  291. data/test/stub/rails_apps/2.0/empty/public/stylesheets/.gitignore +0 -0
  292. data/test/stub/rails_apps/2.0/empty/script/performance/benchmarker +0 -3
  293. data/test/stub/rails_apps/2.0/empty/script/performance/profiler +0 -3
  294. data/test/stub/rails_apps/2.0/empty/script/process/inspector +0 -3
  295. data/test/stub/rails_apps/2.0/empty/script/process/reaper +0 -3
  296. data/test/stub/rails_apps/2.0/empty/script/process/spawner +0 -3
  297. data/test/stub/rails_apps/2.0/empty/test/test_helper.rb +0 -38
  298. data/test/stub/rails_apps/2.2/empty/.gitignore +0 -3
  299. data/test/stub/rails_apps/2.2/empty/Rakefile +0 -10
  300. data/test/stub/rails_apps/2.2/empty/app/controllers/application.rb +0 -15
  301. data/test/stub/rails_apps/2.2/empty/app/helpers/application_helper.rb +0 -3
  302. data/test/stub/rails_apps/2.2/empty/app/models/.gitignore +0 -0
  303. data/test/stub/rails_apps/2.2/empty/config/boot.rb +0 -109
  304. data/test/stub/rails_apps/2.2/empty/config/database.yml +0 -31
  305. data/test/stub/rails_apps/2.2/empty/config/environment.rb +0 -75
  306. data/test/stub/rails_apps/2.2/empty/config/environments/development.rb +0 -17
  307. data/test/stub/rails_apps/2.2/empty/config/environments/production.rb +0 -24
  308. data/test/stub/rails_apps/2.2/empty/config/environments/staging.rb +0 -24
  309. data/test/stub/rails_apps/2.2/empty/config/environments/test.rb +0 -22
  310. data/test/stub/rails_apps/2.2/empty/config/initializers/inflections.rb +0 -10
  311. data/test/stub/rails_apps/2.2/empty/config/initializers/mime_types.rb +0 -5
  312. data/test/stub/rails_apps/2.2/empty/config/initializers/new_rails_defaults.rb +0 -17
  313. data/test/stub/rails_apps/2.2/empty/config/locales/en.yml +0 -5
  314. data/test/stub/rails_apps/2.2/empty/config/routes.rb +0 -43
  315. data/test/stub/rails_apps/2.2/empty/db/.gitignore +0 -0
  316. data/test/stub/rails_apps/2.2/empty/doc/README_FOR_APP +0 -5
  317. data/test/stub/rails_apps/2.2/empty/public/404.html +0 -30
  318. data/test/stub/rails_apps/2.2/empty/public/422.html +0 -30
  319. data/test/stub/rails_apps/2.2/empty/public/500.html +0 -33
  320. data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +0 -10
  321. data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +0 -24
  322. data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +0 -10
  323. data/test/stub/rails_apps/2.2/empty/public/favicon.ico +0 -0
  324. data/test/stub/rails_apps/2.2/empty/public/images/rails.png +0 -0
  325. data/test/stub/rails_apps/2.2/empty/public/robots.txt +0 -5
  326. data/test/stub/rails_apps/2.2/empty/public/stylesheets/.gitignore +0 -0
  327. data/test/stub/rails_apps/2.2/empty/script/about +0 -4
  328. data/test/stub/rails_apps/2.2/empty/script/console +0 -3
  329. data/test/stub/rails_apps/2.2/empty/script/destroy +0 -3
  330. data/test/stub/rails_apps/2.2/empty/script/generate +0 -3
  331. data/test/stub/rails_apps/2.2/empty/script/performance/benchmarker +0 -3
  332. data/test/stub/rails_apps/2.2/empty/script/performance/profiler +0 -3
  333. data/test/stub/rails_apps/2.2/empty/script/performance/request +0 -3
  334. data/test/stub/rails_apps/2.2/empty/script/plugin +0 -3
  335. data/test/stub/rails_apps/2.2/empty/script/process/inspector +0 -3
  336. data/test/stub/rails_apps/2.2/empty/script/process/reaper +0 -3
  337. data/test/stub/rails_apps/2.2/empty/script/process/spawner +0 -3
  338. data/test/stub/rails_apps/2.2/empty/script/runner +0 -3
  339. data/test/stub/rails_apps/2.2/empty/script/server +0 -3
  340. data/test/stub/rails_apps/2.2/empty/test/performance/browsing_test.rb +0 -9
  341. data/test/stub/rails_apps/2.2/empty/test/test_helper.rb +0 -38
  342. data/test/stub/rails_apps/2.3/empty/.gitignore +0 -3
  343. data/test/stub/rails_apps/2.3/empty/Rakefile +0 -10
  344. data/test/stub/rails_apps/2.3/empty/app/controllers/application_controller.rb +0 -10
  345. data/test/stub/rails_apps/2.3/empty/app/helpers/application_helper.rb +0 -3
  346. data/test/stub/rails_apps/2.3/empty/app/models/.gitignore +0 -0
  347. data/test/stub/rails_apps/2.3/empty/config/boot.rb +0 -110
  348. data/test/stub/rails_apps/2.3/empty/config/database.yml +0 -31
  349. data/test/stub/rails_apps/2.3/empty/config/environment.rb +0 -41
  350. data/test/stub/rails_apps/2.3/empty/config/environments/development.rb +0 -17
  351. data/test/stub/rails_apps/2.3/empty/config/environments/production.rb +0 -28
  352. data/test/stub/rails_apps/2.3/empty/config/environments/staging.rb +0 -28
  353. data/test/stub/rails_apps/2.3/empty/config/environments/test.rb +0 -28
  354. data/test/stub/rails_apps/2.3/empty/config/initializers/backtrace_silencers.rb +0 -7
  355. data/test/stub/rails_apps/2.3/empty/config/initializers/inflections.rb +0 -10
  356. data/test/stub/rails_apps/2.3/empty/config/initializers/mime_types.rb +0 -5
  357. data/test/stub/rails_apps/2.3/empty/config/initializers/new_rails_defaults.rb +0 -21
  358. data/test/stub/rails_apps/2.3/empty/config/initializers/session_store.rb +0 -15
  359. data/test/stub/rails_apps/2.3/empty/config/locales/en.yml +0 -5
  360. data/test/stub/rails_apps/2.3/empty/config/routes.rb +0 -43
  361. data/test/stub/rails_apps/2.3/empty/db/.gitignore +0 -0
  362. data/test/stub/rails_apps/2.3/empty/db/seeds.rb +0 -7
  363. data/test/stub/rails_apps/2.3/empty/doc/README_FOR_APP +0 -2
  364. data/test/stub/rails_apps/2.3/empty/public/404.html +0 -30
  365. data/test/stub/rails_apps/2.3/empty/public/422.html +0 -30
  366. data/test/stub/rails_apps/2.3/empty/public/500.html +0 -30
  367. data/test/stub/rails_apps/2.3/empty/public/favicon.ico +0 -0
  368. data/test/stub/rails_apps/2.3/empty/public/images/rails.png +0 -0
  369. data/test/stub/rails_apps/2.3/empty/public/robots.txt +0 -5
  370. data/test/stub/rails_apps/2.3/empty/public/stylesheets/.gitignore +0 -0
  371. data/test/stub/rails_apps/2.3/empty/script/about +0 -4
  372. data/test/stub/rails_apps/2.3/empty/script/console +0 -3
  373. data/test/stub/rails_apps/2.3/empty/script/dbconsole +0 -3
  374. data/test/stub/rails_apps/2.3/empty/script/destroy +0 -3
  375. data/test/stub/rails_apps/2.3/empty/script/generate +0 -3
  376. data/test/stub/rails_apps/2.3/empty/script/performance/benchmarker +0 -3
  377. data/test/stub/rails_apps/2.3/empty/script/performance/profiler +0 -3
  378. data/test/stub/rails_apps/2.3/empty/script/plugin +0 -3
  379. data/test/stub/rails_apps/2.3/empty/script/runner +0 -3
  380. data/test/stub/rails_apps/2.3/empty/script/server +0 -3
  381. data/test/stub/rails_apps/2.3/empty/test/performance/browsing_test.rb +0 -9
  382. data/test/stub/rails_apps/2.3/empty/test/test_helper.rb +0 -38
  383. data/test/stub/rails_apps/2.3/mycook/Rakefile +0 -10
  384. data/test/stub/rails_apps/2.3/mycook/app/helpers/application_helper.rb +0 -3
  385. data/test/stub/rails_apps/2.3/mycook/config/environments/development.rb +0 -18
  386. data/test/stub/rails_apps/2.3/mycook/config/initializers/inflections.rb +0 -10
  387. data/test/stub/rails_apps/2.3/mycook/config/initializers/mime_types.rb +0 -5
  388. data/test/stub/rails_apps/2.3/mycook/public/404.html +0 -30
  389. data/test/stub/rails_apps/2.3/mycook/public/422.html +0 -30
  390. data/test/stub/rails_apps/2.3/mycook/public/500.html +0 -30
  391. data/test/stub/rails_apps/2.3/mycook/public/favicon.ico +0 -0
  392. data/test/stub/rails_apps/2.3/mycook/public/images/rails.png +0 -0
  393. data/test/stub/rails_apps/2.3/mycook/public/robots.txt +0 -5
  394. data/test/stub/rails_apps/2.3/mycook/public/uploads/.gitignore +0 -0
  395. data/test/stub/rails_apps/2.3/mycook/script/about +0 -3
  396. data/test/stub/rails_apps/2.3/mycook/script/console +0 -3
  397. data/test/stub/rails_apps/2.3/mycook/script/dbconsole +0 -3
  398. data/test/stub/rails_apps/2.3/mycook/script/destroy +0 -3
  399. data/test/stub/rails_apps/2.3/mycook/script/generate +0 -3
  400. data/test/stub/rails_apps/2.3/mycook/script/performance/benchmarker +0 -3
  401. data/test/stub/rails_apps/2.3/mycook/script/performance/profiler +0 -3
  402. data/test/stub/rails_apps/2.3/mycook/script/performance/request +0 -3
  403. data/test/stub/rails_apps/2.3/mycook/script/plugin +0 -3
  404. data/test/stub/rails_apps/2.3/mycook/script/process/inspector +0 -3
  405. data/test/stub/rails_apps/2.3/mycook/script/process/reaper +0 -3
  406. data/test/stub/rails_apps/2.3/mycook/script/process/spawner +0 -3
  407. data/test/stub/rails_apps/2.3/mycook/script/runner +0 -3
  408. data/test/stub/rails_apps/2.3/mycook/script/server +0 -3
  409. data/test/stub/wsgi/public/wsgi-snake.jpg +0 -0
metadata.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJSwdn7AAoJECrHRaUKISqMXbgH/RrefbDrOoSI6MXo2shbbAw3
6
- iN41MXVz6uMYsn5E27TrJOM0y/LlIMAchxH0FRdz5RVTWcN7L+n6wZ+oYB3Nisje
7
- btY9lM+QXKjmwFy+mijT92eW4kCdYiuNjJ3snX7GDqdpv/XKC/7QM/2OxeIqT5xC
8
- +dbDdZyGC/QaSiJQzsMWmb0jxBomMYSfYP4Ok/w8ECULtzdAf2VR1XaU7YoytfUP
9
- x8a5900g/kJdixo1KBkJaHuNfNS0fbHE0QCtyrZdE6pT6yoIYpXNBe7etxjO7XmW
10
- n7W+u5WVbeqbcx95iKpDLcFAcV3Stx/FhrxIcw46eeZig/F4v2JWTycbW/6HYn0=
11
- =nsoZ
5
+ iQEcBAABAgAGBQJSxKiOAAoJECrHRaUKISqMkDQIALlSDaBn8gk+2DEMoio84Jjq
6
+ Wb3UF1/TDMF57rg6pgloa1oJL0ACCoqd3EkVWBlhC9MXaCZkGwKj6AFSKD1qsjkV
7
+ Xz1ywyOaSryyYTgiFp2JfNh2YOOkIQETRfu2ZBQErE3Zlc1ATpUYRDyr5gQxsTbL
8
+ p99Qb0pGymppHM/et74tKz57DCRiBtwHAaoKxRCeIyHXOokgkWTbM8hyscII51l7
9
+ WMpSraIqv1LE8lFvrGMABFIwykYabsP1MpckOMgFpwSGlOfKo6luowRGdDGVPGZW
10
+ 7DwawHPWTOnxF5A0BBrPM6TH61eQhlor2MJ1sI35emRXnRQAC09XCJEkQndwYmQ=
11
+ =fqBy
12
12
  -----END PGP SIGNATURE-----
@@ -1,42 +0,0 @@
1
- #!/bin/sh
2
- # Repackage upstream source to exclude non-distributable files
3
- # should be called as "repack.sh --upstream-source <ver> <downloaded file>
4
- # (for example, via uscan)
5
-
6
- set -e
7
- set -u
8
-
9
- VER="$2debian"
10
- FILE="$3"
11
- PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'`
12
-
13
- REPACK_DIR="$PKG-$VER.orig" # DevRef § 6.7.8.2
14
-
15
- echo -e "\nRepackaging $FILE\n"
16
-
17
- DIR=`mktemp -d ./tmpRepackXXXXXX`
18
- trap "rm -rf \"$DIR\"" QUIT INT EXIT
19
-
20
- # Create an extra directory to cope with rootless tarballs
21
- UP_BASE="$DIR/unpack"
22
- mkdir "$UP_BASE"
23
- tar xzf "$FILE" -C "$UP_BASE"
24
-
25
- if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then
26
- # Tarball does contain a root directory
27
- UP_BASE="$UP_BASE/`ls -1 "$UP_BASE"`"
28
- fi
29
-
30
- ## Remove stuff
31
- rm -vfr $UP_BASE/test/support/valgrind.h
32
- rm -vfr $UP_BASE/debian
33
-
34
- mv "$UP_BASE" "$DIR/$REPACK_DIR"
35
-
36
- # Using a pipe hides tar errors!
37
- tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR"
38
- gzip -9 < "$DIR/repacked.tar" > "$DIR/repacked.tar.gz"
39
- FILE="../${PKG}_${VER}.orig.tar.gz"
40
- mv "$DIR/repacked.tar.gz" "$FILE"
41
-
42
- echo "*** $FILE repackaged"
@@ -1,3 +0,0 @@
1
- version=3
2
- options="dversionmangle=s/debian[0-9]*//" \
3
- http://rubyforge.org/frs/?group_id=5873 .*passenger-([\d.-]*)\.t.* debian debian/repack.sh
@@ -1,36 +0,0 @@
1
- shared_examples_for "CGI environment variables compliance" do
2
- specify "REQUEST_URI contains the request URI including query string" do
3
- cgi_envs = get('/welcome/cgi_environment?foo=escaped%20string')
4
- cgi_envs.should include("REQUEST_URI = #{@base_uri}/welcome/cgi_environment?foo=escaped%20string\n")
5
- end
6
-
7
- specify "REQUEST_URI contains the original escaped URI" do
8
- cgi_envs = get('/welcome/cgi_environment/%C3%BC?foo=escaped%20string')
9
- cgi_envs.downcase.should include("request_uri = #{@base_uri}/welcome/cgi_environment/%c3%bc?foo=escaped%20string\n")
10
- end
11
-
12
- specify "PATH_INFO contains the request URI without the base URI and without the query string" do
13
- cgi_envs = get('/welcome/cgi_environment?foo=escaped%20string')
14
- cgi_envs.should include("PATH_INFO = /welcome/cgi_environment\n")
15
- end
16
-
17
- specify "PATH_INFO contains the original escaped URI" do
18
- cgi_envs = get('/welcome/cgi_environment/%C3%BC')
19
- cgi_envs.downcase.should include("path_info = /welcome/cgi_environment/%c3%bc\n")
20
- end
21
-
22
- specify "QUERY_STRING contains the query string" do
23
- cgi_envs = get('/welcome/cgi_environment?foo=escaped%20string')
24
- cgi_envs.should include("QUERY_STRING = foo=escaped%20string\n")
25
- end
26
-
27
- specify "QUERY_STRING must be present even when there's no query string" do
28
- cgi_envs = get('/welcome/cgi_environment')
29
- cgi_envs.should include("QUERY_STRING = \n")
30
- end
31
-
32
- specify "SCRIPT_NAME contains the base URI, or the empty string if the app is deployed on the root URI" do
33
- cgi_envs = get('/welcome/cgi_environment')
34
- cgi_envs.should include("SCRIPT_NAME = #{@base_uri}\n")
35
- end
36
- end
@@ -1,43 +0,0 @@
1
- shared_examples_for "HelloWorld Rack application" do
2
- it "is possible to fetch static assets" do
3
- get('/rack.jpg').should == @stub.public_file('rack.jpg')
4
- end
5
-
6
- it "is possible to GET a regular Rack page" do
7
- get('/').should =~ /hello/
8
- end
9
-
10
- it "supports responses with the 'chunked' transfer encoding" do
11
- get('/chunked').should ==
12
- "chunk1\n" +
13
- "chunk2\n" +
14
- "chunk3\n"
15
- end
16
-
17
- it "supports restarting via restart.txt" do
18
- get('/').should =~ /hello/
19
- File.write("#{@stub.app_root}/config.ru", %q{
20
- app = lambda do |env|
21
- [200, { "Content-Type" => "text/html" }, "changed"]
22
- end
23
- run app
24
- })
25
- File.new("#{@stub.app_root}/tmp/restart.txt", "w").close
26
- File.utime(2, 2, "#{@stub.app_root}/tmp/restart.txt")
27
- get('/').should == "changed"
28
- end
29
-
30
- if Process.uid == 0
31
- it "runs as an unprivileged user" do
32
- File.prepend("#{@stub.app_root}/config.ru", %q{
33
- File.new('foo.txt', 'w').close
34
- })
35
- File.new("#{@stub.app_root}/tmp/restart.txt", "w").close
36
- File.utime(1, 1, "#{@stub.app_root}/tmp/restart.txt")
37
- get('/')
38
- stat = File.stat("#{@stub.app_root}/foo.txt")
39
- stat.uid.should_not == 0
40
- stat.gid.should_not == 0
41
- end
42
- end
43
- end
@@ -1,41 +0,0 @@
1
- shared_examples_for "HelloWorld WSGI application" do
2
- after :each do
3
- File.unlink("#{@stub.app_root}/passenger_wsgi.pyc") rescue nil
4
- end
5
-
6
- it "is possible to fetch static assets" do
7
- get('/wsgi-snake.jpg').should == @stub.public_file('wsgi-snake.jpg')
8
- end
9
-
10
- it "is possible to GET a regular WSGI page" do
11
- get('/').should include("hello <b>world</b>")
12
- end
13
-
14
- it "supports restarting via restart.txt" do
15
- get('/').should include("hello <b>world</b>")
16
-
17
- code = %q{
18
- def application(env, start_response):
19
- start_response('200 OK', [('Content-Type', 'text/html')])
20
- return ["changed"]
21
- }.gsub(/^\t\t\t/, '')
22
-
23
- File.write("#{@stub.app_root}/passenger_wsgi.py", code)
24
- File.new("#{@stub.app_root}/tmp/restart.txt", "w").close
25
- File.utime(2, 2, "#{@stub.app_root}/tmp/restart.txt")
26
- get('/').should == "changed"
27
- end
28
-
29
- if Process.uid == 0
30
- it "runs as an unprivileged user" do
31
- File.prepend("#{@stub.app_root}/passenger_wsgi.py",
32
- "file('foo.txt', 'w').close()\n")
33
- File.new("#{@stub.app_root}/tmp/restart.txt", "w").close
34
- File.utime(1, 1, "#{@stub.app_root}/tmp/restart.txt")
35
- get('/')
36
- stat = File.stat("#{@stub.app_root}/foo.txt")
37
- stat.uid.should_not == 0
38
- stat.gid.should_not == 0
39
- end
40
- end
41
- end
@@ -1,166 +0,0 @@
1
- shared_examples_for "MyCook(tm) beta" do
2
- it "is possible to fetch static assets" do
3
- get('/images/rails.png').should == @stub.public_file('images/rails.png')
4
- end
5
-
6
- it "supports page caching on file URIs" do
7
- get('/welcome/cached').should =~ %r{This is the cached version of /welcome/cached}
8
- end
9
-
10
- it "supports page caching on directory URIs" do
11
- get('/uploads').should =~ %r{This is the cached version of /uploads}
12
- end
13
-
14
- it "supports page caching on root/base URIs" do
15
- File.write("#{@stub.app_root}/public/index.html", "This is index.html.")
16
- get('/').should == "This is index.html."
17
- end
18
-
19
- it "doesn't use page caching if the HTTP request is not GET" do
20
- post('/welcome/cached').should =~ %r{This content should never be displayed}
21
- end
22
-
23
- # TODO: move this to module compatibility tests
24
- it "isn't interfered by Rails's default .htaccess dispatcher rules" do
25
- get('/welcome/in_passenger').should == 'true'
26
- end
27
-
28
- it "is possible to GET a regular Rails page" do
29
- get('/').should =~ /Welcome to MyCook/
30
- end
31
-
32
- it "is possible to pass GET parameters to a Rails page" do
33
- result = get('/welcome/parameters_test?hello=world&recipe[name]=Green+Bananas')
34
- result.should =~ %r{<hello>world</hello>}
35
- result.should =~ %r{<recipe>}
36
- result.should =~ %r{<name>Green Bananas</name>}
37
- end
38
-
39
- it "is possible to POST to a Rails page" do
40
- result = post('/recipes', {
41
- 'recipe[name]' => 'Banana Pancakes',
42
- 'recipe[instructions]' => 'Call 0900-BANANAPANCAKES'
43
- })
44
- result.should =~ %r{HTTP method: post}
45
- result.should =~ %r{Name: Banana Pancakes}
46
- result.should =~ %r{Instructions: Call 0900-BANANAPANCAKES}
47
- end
48
-
49
- it "is possible to upload a file" do
50
- rails_png = File.open("#{@stub.app_root}/public/images/rails.png", 'rb')
51
- params = {
52
- 'upload[name1]' => 'Kotonoha',
53
- 'upload[name2]' => 'Sekai',
54
- 'upload[data]' => rails_png
55
- }
56
- begin
57
- response = post('/uploads', params)
58
- rails_png.rewind
59
- response.should ==
60
- "name 1 = Kotonoha\n" <<
61
- "name 2 = Sekai\n" <<
62
- "data = " << rails_png.read
63
- ensure
64
- rails_png.close
65
- end
66
- end
67
-
68
- it "supports HTTP POST with 'chunked' transfer encoding" do
69
- if !@web_server_supports_chunked_transfer_encoding
70
- # Nginx doesn't support 'chunked' transfer encoding for uploads.
71
- return pending
72
- end
73
-
74
- uri = URI.parse(@server)
75
- base_uri = uri.path.sub(%r(/$), '')
76
- socket = TCPSocket.new(uri.host, uri.port)
77
- begin
78
- socket.write("POST #{base_uri}/uploads/single HTTP/1.1\r\n")
79
- socket.write("Host: #{uri.host}\r\n")
80
- socket.write("Transfer-Encoding: chunked\r\n")
81
- socket.write("Content-Type: application/x-www-form-urlencoded\r\n")
82
- socket.write("\r\n")
83
-
84
- chunk = "foo=bar!"
85
- socket.write("%X\r\n%s\r\n" % [chunk.size, chunk])
86
- socket.write("0\r\n")
87
- socket.close_write
88
-
89
- lines = socket.read.split(/\r?\n/)
90
- lines.last.should == "bar!"
91
- ensure
92
- socket.close
93
- end
94
- end
95
-
96
- it "properly handles custom headers" do
97
- response = get_response('/welcome/headers_test')
98
- response["X-Foo"].should == "Bar"
99
- end
100
-
101
- it "supports restarting via restart.txt" do
102
- controller = "#{@stub.app_root}/app/controllers/test_controller.rb"
103
- restart_file = "#{@stub.app_root}/tmp/restart.txt"
104
- now = Time.now
105
-
106
- File.write(controller, %q{
107
- class TestController < ApplicationController
108
- layout nil
109
- def index
110
- render :text => "foo"
111
- end
112
- end
113
- })
114
- File.touch(restart_file, now - 10)
115
- get('/test').should == "foo"
116
-
117
- File.write(controller, %q{
118
- class TestController < ApplicationController
119
- layout nil
120
- def index
121
- render :text => "bar"
122
- end
123
- end
124
- })
125
-
126
- File.touch(restart_file, now - 5)
127
- get('/test').should == 'bar'
128
- end
129
-
130
- it "does not make the web server crash if the app crashes" do
131
- post('/welcome/terminate')
132
- sleep(0.25) # Give the app the time to terminate itself.
133
- get('/').should =~ /Welcome to MyCook/
134
- end
135
-
136
- it "does not conflict with Phusion Passenger if there's a model named 'Passenger'" do
137
- Dir.mkdir("#{@stub.app_root}/app/models") rescue nil
138
- File.write("#{@stub.app_root}/app/models/passenger.rb", %q{
139
- class Passenger
140
- def name
141
- return "Gourry Gabriev"
142
- end
143
- end
144
- })
145
- File.touch("#{@stub.app_root}/tmp/restart.txt")
146
- get('/welcome/passenger_name').should == 'Gourry Gabriev'
147
- end
148
-
149
- it "sets the 'Status' header" do
150
- response = get_response('/nonexistant')
151
- response["Status"].should == "404 Not Found"
152
- end
153
-
154
- if Process.uid == 0
155
- it "runs as an unprivileged user" do
156
- post('/welcome/touch')
157
- begin
158
- stat = File.stat("#{@stub.app_root}/public/touch.txt")
159
- stat.uid.should_not == 0
160
- stat.gid.should_not == 0
161
- ensure
162
- File.unlink("#{@stub.app_root}/public/touch.txt") rescue nil
163
- end
164
- end
165
- end
166
- end
@@ -1,3 +0,0 @@
1
- db/*.sqlite3
2
- tmp/**/*
3
- log/*
@@ -1,7 +0,0 @@
1
- # Filters added to this controller apply to all controllers in the application.
2
- # Likewise, all the methods added will be available for all controllers.
3
-
4
- class ApplicationController < ActionController::Base
5
- # Pick a unique cookie name to distinguish our session data from others'
6
- session :session_key => '_empty_session_id'
7
- end
@@ -1,108 +0,0 @@
1
- # Don't change this file!
2
- # Configure your app in config/environment.rb and config/environments/*.rb
3
-
4
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5
-
6
- module Rails
7
- class << self
8
- def boot!
9
- unless booted?
10
- preinitialize
11
- pick_boot.run
12
- end
13
- end
14
-
15
- def booted?
16
- defined? Rails::Initializer
17
- end
18
-
19
- def pick_boot
20
- (vendor_rails? ? VendorBoot : GemBoot).new
21
- end
22
-
23
- def vendor_rails?
24
- File.exist?("#{RAILS_ROOT}/vendor/rails")
25
- end
26
-
27
- def preinitialize
28
- load(preinitializer_path) if File.exists?(preinitializer_path)
29
- end
30
-
31
- def preinitializer_path
32
- "#{RAILS_ROOT}/config/preinitializer.rb"
33
- end
34
- end
35
-
36
- class Boot
37
- def run
38
- load_initializer
39
- Rails::Initializer.run(:set_load_path)
40
- end
41
- end
42
-
43
- class VendorBoot < Boot
44
- def load_initializer
45
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
46
- end
47
- end
48
-
49
- class GemBoot < Boot
50
- def load_initializer
51
- self.class.load_rubygems
52
- load_rails_gem
53
- require 'initializer'
54
- end
55
-
56
- def load_rails_gem
57
- if version = self.class.gem_version
58
- gem 'rails', version
59
- else
60
- gem 'rails', '<= 2.9.0'
61
- end
62
- rescue Gem::LoadError => load_error
63
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
64
- exit 1
65
- end
66
-
67
- class << self
68
- def rubygems_version
69
- Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
70
- end
71
-
72
- def gem_version
73
- if defined? RAILS_GEM_VERSION
74
- RAILS_GEM_VERSION
75
- elsif ENV.include?('RAILS_GEM_VERSION')
76
- ENV['RAILS_GEM_VERSION']
77
- else
78
- parse_gem_version(read_environment_rb)
79
- end
80
- end
81
-
82
- def load_rubygems
83
- require 'rubygems'
84
-
85
- unless rubygems_version >= '0.9.4'
86
- $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
87
- exit 1
88
- end
89
-
90
- rescue LoadError
91
- $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
92
- exit 1
93
- end
94
-
95
- def parse_gem_version(text)
96
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*'([!~<>=]*\s*[\d.]+)'/
97
- end
98
-
99
- private
100
- def read_environment_rb
101
- File.read("#{RAILS_ROOT}/config/environment.rb")
102
- end
103
- end
104
- end
105
- end
106
-
107
- # All that for this:
108
- Rails.boot!