Merge branch 'master' into pr/14

This commit is contained in:
Florian Schwab 2015-07-28 16:17:36 +02:00
commit 2440233d72
4 changed files with 19 additions and 9 deletions

View File

@ -4,6 +4,8 @@
### Fixed
- removed dependency on capistrano-rails gem setting propper rails_env
- setting ssh port through `ssh_options`
- setting ssh user through `ssh_options`
- require a minimum version of 3.1.0 for capistrano (sshkit compatibility)
### Feature
- support for ssh keys

View File

@ -2,6 +2,9 @@
[![Dependencies](https://img.shields.io/gemnasium/ydkn/capistrano-rails-console.svg)](https://gemnasium.com/ydkn/capistrano-rails-console)
[![Code Climate](https://img.shields.io/codeclimate/github/ydkn/capistrano-rails-console.svg)](https://codeclimate.com/github/ydkn/capistrano-rails-console)
[![Join the chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ydkn/capistrano-rails-console)
# Capistrano::Rails::Console
Remote rails console for capistrano

View File

@ -4,23 +4,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'capistrano/rails/console/version'
Gem::Specification.new do |spec|
spec.name = "capistrano-rails-console"
spec.name = 'capistrano-rails-console'
spec.version = Capistrano::Rails::Console::VERSION
spec.authors = ["Florian Schwab"]
spec.email = ["me@ydkn.de"]
spec.authors = ['Florian Schwab']
spec.email = ['me@ydkn.de']
spec.description = %q{Remote rails console for capistrano}
spec.summary = %q{Remote rails console for capistrano}
spec.homepage = "https://github.com/ydkn/capistrano-rails-console"
spec.license = "MIT"
spec.homepage = 'https://github.com/ydkn/capistrano-rails-console'
spec.license = 'MIT'
spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
spec.require_paths = ['lib']
spec.add_dependency 'capistrano', '>= 3.0.0', '< 4.0.0'
spec.add_dependency 'capistrano', '>= 3.1.0', '< 4.0.0'
spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'yard'
end

View File

@ -30,7 +30,12 @@ namespace :rails do
port = host.port || (host.ssh_options || {})[:port]
ssh_cmd_args << "-p #{port}" if port
ssh_cmd_args << [host.user, host.hostname].compact.join('@')
ssh_user = if host.ssh_options && host.ssh_options[:user]
host.ssh_options[:user]
else
host.user
end
ssh_cmd_args << [ssh_user, host.hostname].compact.join('@')
if host.ssh_options && host.ssh_options[:keys] && host.ssh_options[:keys].length > 0
identity = host.ssh_options[:keys][0]