lib/capistrano/tasks/passenger.cap in capistrano-passenger-0.2.0 vs lib/capistrano/tasks/passenger.cap in capistrano-passenger-0.2.1

- old
+ new

@@ -8,18 +8,19 @@ end exit end on roles(fetch(:passenger_roles)), in: fetch(:passenger_restart_runner), wait: fetch(:passenger_restart_wait), limit: fetch(:passenger_restart_limit) do with fetch(:passenger_environment_variables) do - within(release_path) do + within(fetch(:passenger_in_gemfile, false) ? release_path : capture(:pwd)) do if restart_with_touch.nil? # 'passenger -v' may output one of the following depending on the version: # Phusion Passenger version x.x.x # Phusion Passenger Enterprise version x.x.x # Phusion Passenger x.x.x # Phusion Passenger Enterprise x.x.x - passenger_version = capture(:passenger, '-v').match(/^Phusion Passenger (Enterprise )?(version )?(.*)$/)[3] + # and it may have a (R) after Passenger + passenger_version = capture(:passenger, '-v').match(/^Phusion Passenger(\(R\))? (Enterprise )?(version )?(.*)$/)[4] restart_with_touch = Gem::Version.new(passenger_version) < Gem::Version.new('4.0.33') end if restart_with_touch execute :mkdir, '-p', release_path.join('tmp') @@ -45,40 +46,40 @@ namespace :rvm do task hook: :"passenger:test_which_passenger" do unless fetch(:passenger_in_path) if fetch(:passenger_rvm_ruby_version) == fetch(:rvm_ruby_version) - set :rvm_map_bins, fetch(:rvm_map_bins) + [:passenger, :'passenger-config'] + set :rvm_map_bins, fetch(:rvm_map_bins) + [:passenger, :'passenger-config', :'passenger-status'] else after :'rvm:hook', :'passenger:rvm:after_rvm_path_is_set' end end end task :after_rvm_path_is_set do # This is very similar to code in capistrano-rvm. Ideally, there would be a way to hook into that code instead of duplicating it with only minor changes. passenger_rvm_prefix = "#{fetch(:rvm_path)}/bin/rvm #{fetch(:passenger_rvm_ruby_version)} do" - [:passenger, :'passenger-config'].each do |command| + [:passenger, :'passenger-config', :'passenger-status'].each do |command| SSHKit.config.command_map.prefix[command.to_sym].unshift(passenger_rvm_prefix) end end end namespace :rbenv do task hook: :"passenger:test_which_passenger" do - set :rbenv_map_bins, fetch(:rbenv_map_bins) + [:passenger, :'passenger-config'] unless fetch(:passenger_in_path) + set :rbenv_map_bins, fetch(:rbenv_map_bins) + [:passenger, :'passenger-config', :'passenger-status'] unless fetch(:passenger_in_path) end end namespace :chruby do task hook: :"passenger:test_which_passenger" do - set :chruby_map_bins, fetch(:chruby_map_bins) + [:passenger, :'passenger-config'] unless fetch(:passenger_in_path) + set :chruby_map_bins, fetch(:chruby_map_bins) + [:passenger, :'passenger-config', :'passenger-status'] unless fetch(:passenger_in_path) end end namespace :bundler do task :hook do - set :bundle_bins, fetch(:bundle_bins) + [:passenger, :'passenger-config'] if fetch(:passenger_in_gemfile, false) + set :bundle_bins, fetch(:bundle_bins) + [:passenger, :'passenger-config', :'passenger-status'] if fetch(:passenger_in_gemfile, false) end end end namespace :load do