1
0
Fork 0
mirror of https://gitlab.com/ydkn/capistrano-rails-console.git synced 2023-02-13 20:54:14 -05:00

Merge pull request #1 from valgusk/master

added rbenv support
This commit is contained in:
Florian Schwab 2014-07-15 09:49:06 +02:00
commit 4820432278

View file

@ -2,6 +2,10 @@ def rvm_loaded?
Gem::Specification::find_all_by_name('capistrano-rvm').any?
end
def rbenv_loaded?
Gem::Specification::find_all_by_name('capistrano-rbenv').any?
end
def bundler_loaded?
Gem::Specification::find_all_by_name('capistrano-bundler').any?
end
@ -20,10 +24,11 @@ namespace :rails do
command = []
command << "#{fetch(:rvm_path)}/bin/rvm #{fetch(:rvm_ruby_version)} do" if rvm_loaded?
command << "#{ fetch :rbenv_prefix } " if rbenv_loaded?
command << "bundle exec" if bundler_loaded?
command << "rails console #{fetch(:rails_env)}"
exec %Q(ssh #{app_server.user}@#{app_server.hostname} -p #{app_server.port || 22} -t "cd #{current_path} && #{command.join(' ')}")
exec %Q(ssh #{app_server.netssh_options[:user]}@#{app_server.hostname} -p #{app_server.port || 22} -t "cd #{current_path} && #{command.join(' ')}")
end
end