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.
- data.tar.gz.asc +7 -7
- data/NEWS +31 -0
- data/bin/passenger +5 -5
- data/bin/passenger-config +6 -126
- data/bin/passenger-install-apache2-module +108 -26
- data/bin/passenger-install-nginx-module +81 -27
- data/bin/passenger-memory-stats +7 -6
- data/bin/passenger-status +13 -10
- data/build/agents.rb +8 -12
- data/build/apache2.rb +12 -7
- data/build/basics.rb +28 -20
- data/build/common_library.rb +4 -4
- data/build/cplusplus_support.rb +4 -4
- data/build/cxx_tests.rb +5 -3
- data/build/debian.rb +1 -2
- data/build/integration_tests.rb +25 -9
- data/build/misc.rb +2 -2
- data/build/oxt_tests.rb +5 -6
- data/build/packaging.rb +72 -40
- data/build/ruby_tests.rb +5 -1
- data/build/test_basics.rb +1 -2
- data/debian.template/locations.ini.template +1 -0
- data/debian.template/rules.template +2 -1
- data/dev/install_scripts_bootstrap_code.rb +42 -0
- data/dev/run_travis.sh +1 -0
- data/dev/runner +27 -0
- data/doc/Packaging.txt.md +5 -10
- data/doc/Users guide Apache.idmap.txt +3 -1
- data/doc/Users guide Apache.txt +5 -3
- data/doc/Users guide Nginx.idmap.txt +9 -5
- data/doc/Users guide Nginx.txt +47 -17
- data/doc/users_guide_snippets/environment_variables.txt +2 -2
- data/doc/users_guide_snippets/installation.txt +6 -2
- data/doc/users_guide_snippets/tips.txt +4 -0
- data/ext/apache2/Hooks.cpp +16 -3
- data/ext/common/Account.h +6 -5
- data/ext/common/AgentsStarter.h +1 -1
- data/ext/common/ApplicationPool2/Common.h +72 -0
- data/ext/common/ApplicationPool2/Group.h +263 -148
- data/ext/common/ApplicationPool2/Implementation.cpp +66 -44
- data/ext/common/ApplicationPool2/Options.h +1 -7
- data/ext/common/ApplicationPool2/Pool.h +96 -72
- data/ext/common/ApplicationPool2/Process.h +12 -17
- data/ext/common/ApplicationPool2/Socket.h +4 -4
- data/ext/common/ApplicationPool2/SuperGroup.h +20 -17
- data/ext/common/Constants.h +15 -1
- data/ext/common/MessageServer.h +22 -0
- data/ext/common/Utils.cpp +4 -1
- data/ext/common/Utils.h +3 -1
- data/ext/common/Utils/StrIntUtils.h +1 -0
- data/ext/common/Utils/Timer.h +15 -1
- data/ext/common/Utils/utf8/checked.h +0 -0
- data/ext/common/Utils/utf8/core.h +0 -0
- data/ext/common/Utils/utf8/unchecked.h +0 -0
- data/ext/common/agents/Base.cpp +59 -35
- data/ext/common/agents/HelperAgent/Main.cpp +23 -12
- data/ext/common/agents/HelperAgent/RequestHandler.h +10 -1
- data/ext/common/agents/LoggingAgent/FilterSupport.h +9 -5
- data/ext/common/agents/TempDirToucher.c +12 -3
- data/ext/common/agents/Watchdog/Main.cpp +8 -2
- data/ext/nginx/ConfigurationCommands.c +10 -0
- data/ext/nginx/ConfigurationFields.h +2 -0
- data/ext/nginx/ContentHandler.c +32 -19
- data/ext/nginx/CreateLocationConfig.c +5 -0
- data/ext/nginx/MergeLocationConfig.c +6 -0
- data/ext/nginx/config +13 -6
- data/ext/ruby/passenger_native_support.c +61 -2
- data/helper-scripts/classic-rails-loader.rb +9 -10
- data/helper-scripts/classic-rails-preloader.rb +10 -11
- data/helper-scripts/node-loader.js +3 -2
- data/helper-scripts/rack-loader.rb +8 -9
- data/helper-scripts/rack-preloader.rb +9 -10
- data/lib/phusion_passenger.rb +36 -7
- data/lib/phusion_passenger/abstract_installer.rb +16 -15
- data/lib/phusion_passenger/active_support3_extensions/init.rb +1 -1
- data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
- data/lib/phusion_passenger/admin_tools/server_instance.rb +5 -5
- data/lib/phusion_passenger/analytics_logger.rb +3 -3
- data/lib/phusion_passenger/classic_rails/thread_handler_extension.rb +1 -1
- data/lib/phusion_passenger/config.rb +125 -0
- data/lib/phusion_passenger/config/about_command.rb +183 -0
- data/lib/phusion_passenger/config/command.rb +57 -0
- data/lib/phusion_passenger/config/restart_app_command.rb +146 -0
- data/lib/phusion_passenger/config/utils.rb +108 -0
- data/lib/phusion_passenger/console_text_template.rb +2 -1
- data/lib/phusion_passenger/constants.rb +7 -2
- data/lib/phusion_passenger/loader_shared_helpers.rb +12 -21
- data/lib/phusion_passenger/message_client.rb +15 -4
- data/lib/phusion_passenger/native_support.rb +116 -98
- data/lib/phusion_passenger/nginx/config_options.rb +5 -0
- data/lib/phusion_passenger/platform_info.rb +1 -1
- data/lib/phusion_passenger/platform_info/apache.rb +9 -5
- data/lib/phusion_passenger/platform_info/apache_detector.rb +5 -6
- data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -3
- data/lib/phusion_passenger/platform_info/compiler.rb +29 -11
- data/lib/phusion_passenger/platform_info/curl.rb +1 -1
- data/lib/phusion_passenger/platform_info/cxx_portability.rb +30 -16
- data/lib/phusion_passenger/platform_info/depcheck.rb +6 -6
- data/lib/phusion_passenger/platform_info/linux.rb +2 -2
- data/lib/phusion_passenger/platform_info/operating_system.rb +25 -5
- data/lib/phusion_passenger/platform_info/ruby.rb +7 -4
- data/lib/phusion_passenger/platform_info/zlib.rb +1 -1
- data/lib/phusion_passenger/plugin.rb +0 -1
- data/lib/phusion_passenger/preloader_shared_helpers.rb +1 -1
- data/lib/phusion_passenger/public_api.rb +1 -1
- data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
- data/lib/phusion_passenger/request_handler.rb +8 -9
- data/lib/phusion_passenger/request_handler/thread_handler.rb +21 -9
- data/lib/phusion_passenger/ruby_core_enhancements.rb +1 -1
- data/lib/phusion_passenger/standalone/app_finder.rb +2 -2
- data/lib/phusion_passenger/standalone/command.rb +10 -8
- data/lib/phusion_passenger/standalone/help_command.rb +1 -1
- data/lib/phusion_passenger/standalone/main.rb +3 -3
- data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
- data/lib/phusion_passenger/standalone/runtime_installer.rb +55 -13
- data/lib/phusion_passenger/standalone/runtime_locator.rb +3 -3
- data/lib/phusion_passenger/standalone/start_command.rb +6 -7
- data/lib/phusion_passenger/standalone/status_command.rb +1 -1
- data/lib/phusion_passenger/standalone/stop_command.rb +1 -1
- data/lib/phusion_passenger/standalone/utils.rb +1 -1
- data/lib/phusion_passenger/standalone/version_command.rb +2 -3
- data/lib/phusion_passenger/utils.rb +1 -1
- data/lib/phusion_passenger/utils/download.rb +1 -2
- data/lib/phusion_passenger/utils/file_system_watcher.rb +1 -1
- data/lib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
- data/lib/phusion_passenger/utils/tee_input.rb +1 -1
- data/lib/phusion_passenger/utils/terminal_choice_menu.rb +217 -0
- data/lib/phusion_passenger/utils/unseekable_socket.rb +1 -1
- data/resources/templates/apache2/config_snippets.txt.erb +2 -3
- data/resources/templates/apache2/deployment_example.txt.erb +2 -2
- data/resources/templates/apache2/notify_apache_module_installed.txt.erb +3 -0
- data/resources/templates/nginx/config_snippets.txt.erb +1 -1
- data/resources/templates/nginx/deployment_example.txt.erb +2 -2
- data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +11 -5
- data/rpm/Vagrantfile +1 -0
- data/test/cxx/ApplicationPool2/PoolTest.cpp +224 -35
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +6 -6
- data/test/cxx/MessagePassingTest.cpp +1 -1
- data/test/cxx/RequestHandlerTest.cpp +26 -26
- data/test/integration_tests/apache2_tests.rb +162 -243
- data/test/integration_tests/native_packaging_spec.rb +10 -10
- data/test/integration_tests/nginx_tests.rb +87 -107
- data/test/integration_tests/shared/example_webapp_tests.rb +246 -0
- data/test/integration_tests/source_packaging_test.rb +2 -1
- data/test/integration_tests/standalone_tests.rb +34 -19
- data/test/ruby/admin_tools_spec.rb +4 -4
- data/test/ruby/analytics_logger_spec.rb +1 -1
- data/test/ruby/debug_logging_spec.rb +2 -2
- data/test/ruby/message_channel_spec.rb +1 -1
- data/test/ruby/request_handler_spec.rb +171 -64
- data/test/ruby/shared/loader_sharedspec.rb +5 -5
- data/test/ruby/shared/rails/analytics_logging_extensions_sharedspec.rb +2 -2
- data/test/ruby/spec_helper.rb +4 -4
- data/test/ruby/standalone/runtime_installer_spec.rb +1 -1
- data/test/ruby/standalone/runtime_locator_spec.rb +1 -1
- data/test/ruby/utils/file_system_watcher_spec.rb +1 -1
- data/test/ruby/utils/hosts_file_parser.rb +1 -1
- data/test/ruby/utils/unseekable_socket_spec.rb +1 -1
- data/test/ruby/utils_spec.rb +4 -4
- data/test/stub/apache2/httpd.conf.erb +5 -0
- data/test/stub/index.html +1 -0
- data/test/stub/rack/config.ru +80 -33
- data/test/stub/{rails_apps/1.2/empty/app/models → rack/public}/.gitignore +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/Rakefile +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/application_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/recipes_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/uploads_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/welcome_controller.rb +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/app/helpers/application_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/recipes_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/test_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/uploads_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/welcome_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/layouts/default.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/create.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/new.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/new.html.erb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/cached.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/boot.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/database.yml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environment.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/environments/development.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environments/production.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/inflections.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/mime_types.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/routes.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/log/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/.htaccess +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/404.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/422.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/500.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.cgi +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.fcgi +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.rb +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/favicon.ico +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/angrywizard.gif +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/cookbook.gif +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/header.png +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/images/rails.png +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/robots.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/uploads.html +0 -0
- data/test/stub/{rails_apps/1.2/empty/db → rails2.3-mycook/public/uploads}/.gitignore +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/welcome/cached.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/about +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/console +0 -0
- data/test/stub/{rails_apps/2.2/empty → rails2.3-mycook}/script/dbconsole +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/destroy +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/generate +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/benchmarker +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/profiler +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/performance/request +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/plugin +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/inspector +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/reaper +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/spawner +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/runner +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/server +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/uploads.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/welcome/cached.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/cache/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/pids/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sessions/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sockets/useless.txt +0 -0
- data/test/stub/rails2.3/app/controllers/foo_controller.rb +1 -1
- data/test/stub/rails2.3/config/routes.rb +1 -2
- data/test/stub/wsgi/passenger_wsgi.py +47 -8
- data/test/stub/{rails_apps/1.2/empty/public/stylesheets → wsgi/public}/.gitignore +0 -0
- data/test/support/apache2_controller.rb +2 -2
- data/test/support/nginx_controller.rb +11 -5
- data/test/support/placebo-preloader.rb +2 -2
- data/test/support/test_helper.rb +26 -7
- metadata +78 -240
- metadata.gz.asc +7 -7
- data/debian.template/repack.sh +0 -42
- data/debian.template/watch +0 -3
- data/test/integration_tests/cgi_environment_spec.rb +0 -36
- data/test/integration_tests/hello_world_rack_spec.rb +0 -43
- data/test/integration_tests/hello_world_wsgi_spec.rb +0 -41
- data/test/integration_tests/mycook_spec.rb +0 -166
- data/test/stub/rack/public/rack.jpg +0 -0
- data/test/stub/rails_apps/1.2/empty/.gitignore +0 -3
- data/test/stub/rails_apps/1.2/empty/app/controllers/application.rb +0 -7
- data/test/stub/rails_apps/1.2/empty/config/boot.rb +0 -108
- data/test/stub/rails_apps/1.2/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/1.2/empty/config/environment.rb +0 -66
- data/test/stub/rails_apps/1.2/empty/config/environments/development.rb +0 -21
- data/test/stub/rails_apps/1.2/empty/config/environments/production.rb +0 -18
- data/test/stub/rails_apps/1.2/empty/config/environments/staging.rb +0 -18
- data/test/stub/rails_apps/1.2/empty/config/environments/test.rb +0 -19
- data/test/stub/rails_apps/1.2/empty/config/routes.rb +0 -23
- data/test/stub/rails_apps/1.2/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/1.2/empty/public/.htaccess +0 -40
- data/test/stub/rails_apps/1.2/empty/public/500.html +0 -30
- data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/1.2/empty/public/robots.txt +0 -1
- data/test/stub/rails_apps/1.2/empty/script/about +0 -3
- data/test/stub/rails_apps/1.2/empty/script/breakpointer +0 -3
- data/test/stub/rails_apps/1.2/empty/script/console +0 -3
- data/test/stub/rails_apps/1.2/empty/script/destroy +0 -3
- data/test/stub/rails_apps/1.2/empty/script/generate +0 -3
- data/test/stub/rails_apps/1.2/empty/script/plugin +0 -3
- data/test/stub/rails_apps/1.2/empty/script/runner +0 -3
- data/test/stub/rails_apps/1.2/empty/script/server +0 -3
- data/test/stub/rails_apps/1.2/empty/test/test_helper.rb +0 -28
- data/test/stub/rails_apps/2.0/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.0/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.0/empty/app/controllers/application.rb +0 -10
- data/test/stub/rails_apps/2.0/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.0/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/config/boot.rb +0 -108
- data/test/stub/rails_apps/2.0/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.0/empty/config/environment.rb +0 -59
- data/test/stub/rails_apps/2.0/empty/config/environments/production.rb +0 -18
- data/test/stub/rails_apps/2.0/empty/config/environments/staging.rb +0 -18
- data/test/stub/rails_apps/2.0/empty/config/environments/test.rb +0 -22
- data/test/stub/rails_apps/2.0/empty/config/routes.rb +0 -35
- data/test/stub/rails_apps/2.0/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/2.0/empty/public/.htaccess +0 -40
- data/test/stub/rails_apps/2.0/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/2.0/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.0/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.0/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.0/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.0/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.2/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.2/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.2/empty/app/controllers/application.rb +0 -15
- data/test/stub/rails_apps/2.2/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.2/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/config/boot.rb +0 -109
- data/test/stub/rails_apps/2.2/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.2/empty/config/environment.rb +0 -75
- data/test/stub/rails_apps/2.2/empty/config/environments/development.rb +0 -17
- data/test/stub/rails_apps/2.2/empty/config/environments/production.rb +0 -24
- data/test/stub/rails_apps/2.2/empty/config/environments/staging.rb +0 -24
- data/test/stub/rails_apps/2.2/empty/config/environments/test.rb +0 -22
- data/test/stub/rails_apps/2.2/empty/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.2/empty/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.2/empty/config/initializers/new_rails_defaults.rb +0 -17
- data/test/stub/rails_apps/2.2/empty/config/locales/en.yml +0 -5
- data/test/stub/rails_apps/2.2/empty/config/routes.rb +0 -43
- data/test/stub/rails_apps/2.2/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/doc/README_FOR_APP +0 -5
- data/test/stub/rails_apps/2.2/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.2/empty/public/422.html +0 -30
- data/test/stub/rails_apps/2.2/empty/public/500.html +0 -33
- data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/2.2/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.2/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.2/empty/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.2/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/script/about +0 -4
- data/test/stub/rails_apps/2.2/empty/script/console +0 -3
- data/test/stub/rails_apps/2.2/empty/script/destroy +0 -3
- data/test/stub/rails_apps/2.2/empty/script/generate +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/request +0 -3
- data/test/stub/rails_apps/2.2/empty/script/plugin +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.2/empty/script/runner +0 -3
- data/test/stub/rails_apps/2.2/empty/script/server +0 -3
- data/test/stub/rails_apps/2.2/empty/test/performance/browsing_test.rb +0 -9
- data/test/stub/rails_apps/2.2/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.3/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.3/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.3/empty/app/controllers/application_controller.rb +0 -10
- data/test/stub/rails_apps/2.3/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.3/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/config/boot.rb +0 -110
- data/test/stub/rails_apps/2.3/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.3/empty/config/environment.rb +0 -41
- data/test/stub/rails_apps/2.3/empty/config/environments/development.rb +0 -17
- data/test/stub/rails_apps/2.3/empty/config/environments/production.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/environments/staging.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/environments/test.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/initializers/backtrace_silencers.rb +0 -7
- data/test/stub/rails_apps/2.3/empty/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.3/empty/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.3/empty/config/initializers/new_rails_defaults.rb +0 -21
- data/test/stub/rails_apps/2.3/empty/config/initializers/session_store.rb +0 -15
- data/test/stub/rails_apps/2.3/empty/config/locales/en.yml +0 -5
- data/test/stub/rails_apps/2.3/empty/config/routes.rb +0 -43
- data/test/stub/rails_apps/2.3/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/db/seeds.rb +0 -7
- data/test/stub/rails_apps/2.3/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/2.3/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/422.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/500.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.3/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.3/empty/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.3/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/script/about +0 -4
- data/test/stub/rails_apps/2.3/empty/script/console +0 -3
- data/test/stub/rails_apps/2.3/empty/script/dbconsole +0 -3
- data/test/stub/rails_apps/2.3/empty/script/destroy +0 -3
- data/test/stub/rails_apps/2.3/empty/script/generate +0 -3
- data/test/stub/rails_apps/2.3/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.3/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.3/empty/script/plugin +0 -3
- data/test/stub/rails_apps/2.3/empty/script/runner +0 -3
- data/test/stub/rails_apps/2.3/empty/script/server +0 -3
- data/test/stub/rails_apps/2.3/empty/test/performance/browsing_test.rb +0 -9
- data/test/stub/rails_apps/2.3/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.3/mycook/Rakefile +0 -10
- data/test/stub/rails_apps/2.3/mycook/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.3/mycook/config/environments/development.rb +0 -18
- data/test/stub/rails_apps/2.3/mycook/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.3/mycook/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.3/mycook/public/404.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/422.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/500.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.3/mycook/public/uploads/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/mycook/script/about +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/console +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/dbconsole +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/destroy +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/generate +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/request +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/plugin +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/runner +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/server +0 -3
- 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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
5
|
+
iQEcBAABAgAGBQJSxKiOAAoJECrHRaUKISqMkDQIALlSDaBn8gk+2DEMoio84Jjq
|
6
|
+
Wb3UF1/TDMF57rg6pgloa1oJL0ACCoqd3EkVWBlhC9MXaCZkGwKj6AFSKD1qsjkV
|
7
|
+
Xz1ywyOaSryyYTgiFp2JfNh2YOOkIQETRfu2ZBQErE3Zlc1ATpUYRDyr5gQxsTbL
|
8
|
+
p99Qb0pGymppHM/et74tKz57DCRiBtwHAaoKxRCeIyHXOokgkWTbM8hyscII51l7
|
9
|
+
WMpSraIqv1LE8lFvrGMABFIwykYabsP1MpckOMgFpwSGlOfKo6luowRGdDGVPGZW
|
10
|
+
7DwawHPWTOnxF5A0BBrPM6TH61eQhlor2MJ1sI35emRXnRQAC09XCJEkQndwYmQ=
|
11
|
+
=fqBy
|
12
12
|
-----END PGP SIGNATURE-----
|
data/debian.template/repack.sh
DELETED
@@ -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"
|
data/debian.template/watch
DELETED
@@ -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
|
Binary file
|
@@ -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!
|