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

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 ### Fixed
- removed dependency on capistrano-rails gem setting propper rails_env - removed dependency on capistrano-rails gem setting propper rails_env
- setting ssh port through `ssh_options` - 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 ### Feature
- support for ssh keys - 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) [![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) [![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 # Capistrano::Rails::Console
Remote rails console for capistrano 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' require 'capistrano/rails/console/version'
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = "capistrano-rails-console" spec.name = 'capistrano-rails-console'
spec.version = Capistrano::Rails::Console::VERSION spec.version = Capistrano::Rails::Console::VERSION
spec.authors = ["Florian Schwab"] spec.authors = ['Florian Schwab']
spec.email = ["me@ydkn.de"] spec.email = ['me@ydkn.de']
spec.description = %q{Remote rails console for capistrano} spec.description = %q{Remote rails console for capistrano}
spec.summary = %q{Remote rails console for capistrano} spec.summary = %q{Remote rails console for capistrano}
spec.homepage = "https://github.com/ydkn/capistrano-rails-console" spec.homepage = 'https://github.com/ydkn/capistrano-rails-console'
spec.license = "MIT" spec.license = 'MIT'
spec.files = `git ls-files`.split($/) spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 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 'rake'
spec.add_development_dependency 'yard' spec.add_development_dependency 'yard'
end end

View file

@ -30,7 +30,12 @@ namespace :rails do
port = host.port || (host.ssh_options || {})[:port] port = host.port || (host.ssh_options || {})[:port]
ssh_cmd_args << "-p #{port}" if 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 if host.ssh_options && host.ssh_options[:keys] && host.ssh_options[:keys].length > 0
identity = host.ssh_options[:keys][0] identity = host.ssh_options[:keys][0]