capistrano-rails-console 0.5.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8e03e9c997a1447dd97fdc4ec188de36432abee
4
- data.tar.gz: 310d77fb78f42ad3885062c95d908b32e457ead5
3
+ metadata.gz: 598ddcd8d79222e0574cd8e09448a5a0032f355e
4
+ data.tar.gz: 7541199e11fbbe296e238c01181081f24b505454
5
5
  SHA512:
6
- metadata.gz: f6036ec91e01217908e465edccdc037b810d667f9b1f8045d56cd5dd7ada681844d7446e16ebb3fd1d20c4e312d7784ac8e3bb974f10f34d94ff643c934298de
7
- data.tar.gz: 94ee4ef297c6e703eef9e136d65dd9436fd42d03a91d7387187548f92f3c5f1977beb5150e7041ba9e78c28427061359dde620cb6458c5c1fb87d95253e19350
6
+ metadata.gz: 298a610fa794f2ce123cbeff593de162d3e2363524e9f002abd4966fcea9a5e615ab104bcb22b374c2c1adb4d70e6ebbc0daebc53928d0a33fdebc97dc66c3bb
7
+ data.tar.gz: fc662fff600897df4bcce8d960a5ecb5376106db423d94e7c435d99c5907716a39b9db55e59b19266d0b028334d91b6cd1925949fc389da2dcaccafcdecf2030
@@ -1,11 +1,19 @@
1
- ## 0.5.2 (2015-04-02)
2
-
3
- Bugfixes:
1
+ # Change Log
4
2
 
5
- - removed rails binary check due to different environments in sshkit and the ssh shellout
3
+ ## 1.0.0 (2015-08-01)
4
+ ### Fixed
5
+ - removed dependency on capistrano-rails gem setting propper rails_env
6
+ - setting ssh port through `ssh_options`
7
+ - setting ssh user through `ssh_options`
8
+ - require a minimum version of 3.1.0 for capistrano (sshkit compatibility)
6
9
 
7
- ## 0.5.1 (2015-04-01)
10
+ ### Feature
11
+ - support for ssh keys
8
12
 
9
- Bugfixes:
13
+ ## 0.5.2 (2015-04-02)
14
+ ### Fixed
15
+ - removed rails binary check due to different environments in sshkit and the ssh shellout
10
16
 
11
- - missing ssh proxy options in console task
17
+ ## 0.5.1 (2015-04-01)
18
+ ### Fixed
19
+ - missing ssh proxy options in console task
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
  [![Dependencies](https://img.shields.io/gemnasium/ydkn/capistrano-rails-console.svg)](https://gemnasium.com/ydkn/capistrano-rails-console)
3
3
  [![Code Climate](https://img.shields.io/codeclimate/github/ydkn/capistrano-rails-console.svg)](https://codeclimate.com/github/ydkn/capistrano-rails-console)
4
4
 
5
+ [![Join the chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ydkn/capistrano-rails-console)
6
+
7
+
5
8
  # Capistrano::Rails::Console
6
9
 
7
10
  Remote rails console for capistrano
@@ -4,23 +4,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'capistrano/rails/console/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "capistrano-rails-console"
7
+ spec.name = 'capistrano-rails-console'
8
8
  spec.version = Capistrano::Rails::Console::VERSION
9
- spec.authors = ["Florian Schwab"]
10
- spec.email = ["me@ydkn.de"]
9
+ spec.authors = ['Florian Schwab']
10
+ spec.email = ['me@ydkn.de']
11
11
  spec.description = %q{Remote rails console for capistrano}
12
12
  spec.summary = %q{Remote rails console for capistrano}
13
- spec.homepage = "https://github.com/ydkn/capistrano-rails-console"
14
- spec.license = "MIT"
13
+ spec.homepage = 'https://github.com/ydkn/capistrano-rails-console'
14
+ spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'capistrano', '>= 3.0.0', '< 4.0.0'
21
+ spec.add_dependency 'capistrano', '>= 3.1.0', '< 4.0.0'
22
22
 
23
- spec.add_development_dependency 'bundler', '~> 1.3'
23
+ spec.add_development_dependency 'bundler'
24
24
  spec.add_development_dependency 'rake'
25
25
  spec.add_development_dependency 'yard'
26
26
  end
@@ -7,27 +7,41 @@ end
7
7
 
8
8
  namespace :rails do
9
9
  desc "Interact with a remote rails console"
10
- task console: ['deploy:set_rails_env'] do
10
+ task :console do
11
11
  on primary :app do |host|
12
12
  test(:true) # initialize ssh_options on host
13
13
 
14
- ssh_cmd_options = []
14
+ ssh_cmd_args = []
15
15
  rails_console_args = []
16
16
 
17
17
  if host.ssh_options && host.ssh_options[:proxy]
18
18
  template = host.ssh_options[:proxy].command_line_template
19
- ssh_cmd_options << "-o ProxyCommand=\"#{template}\""
19
+ ssh_cmd_args << "-o ProxyCommand=\"#{template}\""
20
20
  end
21
21
 
22
22
  rails_console_args << '--sandbox' if ENV.key?('sandbox') || ENV.key?('s')
23
23
 
24
- cmd = SSHKit::Command.new(:rails, "console #{fetch(:rails_env)} #{rails_console_args.join(' ')}", host: host)
24
+ rails_env = fetch(:rails_env, fetch(:stage, 'production'))
25
+
26
+ cmd = SSHKit::Command.new(:rails, :console, rails_env, *rails_console_args, host: host)
25
27
  SSHKit.config.output << cmd
26
28
 
27
- user_host = [host.user, host.hostname].compact.join('@')
28
- ssh_cmd = "ssh #{ssh_cmd_options.join(' ')} #{user_host} -p #{host.port || 22}"
29
+ port = host.port || (host.ssh_options || {})[:port]
30
+ ssh_cmd_args << "-p #{port}" if port
31
+
32
+ ssh_user = if host.ssh_options && host.ssh_options[:user]
33
+ host.ssh_options[:user]
34
+ else
35
+ host.user
36
+ end
37
+ ssh_cmd_args << [ssh_user, host.hostname].compact.join('@')
38
+
39
+ if host.ssh_options && host.ssh_options[:keys] && host.ssh_options[:keys].length > 0
40
+ identity = host.ssh_options[:keys][0]
41
+ ssh_cmd_args << "-i #{identity}"
42
+ end
29
43
 
30
- exec(%Q(#{ssh_cmd} -t "cd #{current_path} && (#{cmd.environment_string} #{cmd})"))
44
+ exec(%Q(ssh #{ssh_cmd_args.join(' ')} -t "cd #{current_path} && (#{cmd.environment_string} #{cmd})"))
31
45
  end
32
46
  end
33
47
  end
@@ -5,7 +5,7 @@ module Capistrano
5
5
  # Console
6
6
  module Console
7
7
  # gem version
8
- VERSION = '0.5.2'
8
+ VERSION = '1.0.0'
9
9
  end
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-rails-console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Schwab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-02 00:00:00.000000000 Z
11
+ date: 2015-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0
19
+ version: 3.1.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 4.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 3.0.0
29
+ version: 3.1.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 4.0.0
@@ -34,16 +34,16 @@ dependencies:
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '1.3'
39
+ version: '0'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '1.3'
46
+ version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.4.6
114
+ rubygems_version: 2.4.8
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Remote rails console for capistrano