sshkit-interactive 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -7
- data/CHANGELOG.md +9 -1
- data/lib/sshkit/interactive/command.rb +7 -1
- data/lib/sshkit/interactive/version.rb +1 -1
- data/spec/backend_spec.rb +7 -4
- data/spec/command_spec.rb +3 -3
- data/spec/dsl_spec.rb +1 -1
- data/sshkit-interactive.gemspec +2 -3
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85a367dc3b5b858208966b608522f5cfa5437184
|
4
|
+
data.tar.gz: dbade21d2bfb2b0e4e438ccff779f4d998f1d5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa2aedd29c8f938e711165aacee63d03869e523bbe39950d99aa189fc210a1d567fabe882d8a2270dae8f1b90e04f332f2d8e3c43bc9b5f141fba431a08d1315
|
7
|
+
data.tar.gz: 41adf32334b6ea3abe35eaa6a52a2970547366af9821fbd6a69c884b9d37a4039511d18e22073f5c833fc490cc7bd7c11a331cc7e5b9e089e6e773e17a0f3a94
|
data/.travis.yml
CHANGED
@@ -3,11 +3,11 @@ sudo: false
|
|
3
3
|
language: ruby
|
4
4
|
|
5
5
|
rvm:
|
6
|
-
- ruby-2.2.
|
7
|
-
- ruby-2.3.
|
8
|
-
- ruby-2.4.
|
6
|
+
- ruby-2.2.7
|
7
|
+
- ruby-2.3.4
|
8
|
+
- ruby-2.4.1
|
9
9
|
- jruby-1.7
|
10
|
-
- jruby-9.1.
|
10
|
+
- jruby-9.1.12.0
|
11
11
|
|
12
12
|
gemfile:
|
13
13
|
- spec/gemfiles/net-ssh2_8.gemfile
|
@@ -31,7 +31,4 @@ matrix:
|
|
31
31
|
- rvm: jruby-1.7
|
32
32
|
gemfile: spec/gemfiles/net-ssh4_1.gemfile
|
33
33
|
|
34
|
-
before_install:
|
35
|
-
- gem install bundler -v '~> 1.14.0'
|
36
|
-
|
37
34
|
script: bundle exec rake spec
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## 0.2.
|
3
|
+
## 0.2.3 (2017-09-03)
|
4
|
+
### Fix
|
5
|
+
- [fix sudo with new variable expansion](https://github.com/afeld/sshkit-interactive/pull/18)
|
6
|
+
- [fix Travis CI builds](https://github.com/afeld/sshkit-interactive/pull/19)
|
7
|
+
|
4
8
|
### Change
|
9
|
+
- bump rspec version to 3.6.x
|
10
|
+
|
11
|
+
## 0.2.2 (2017-08-07)
|
12
|
+
### Fix
|
5
13
|
- [fix incorrect variable expansion](https://github.com/afeld/sshkit-interactive/pull/16)
|
6
14
|
|
7
15
|
## 0.2.1 (2017-05-01)
|
@@ -42,7 +42,7 @@ module SSHKit
|
|
42
42
|
:ssh,
|
43
43
|
*ssh_cmd_args,
|
44
44
|
host.hostname,
|
45
|
-
|
45
|
+
command
|
46
46
|
].reject(&:empty?).join(' ')
|
47
47
|
end
|
48
48
|
|
@@ -84,6 +84,12 @@ module SSHKit
|
|
84
84
|
def proxy_command
|
85
85
|
proxy.command_line_template
|
86
86
|
end
|
87
|
+
|
88
|
+
def command
|
89
|
+
cmd = remote_command.to_command.gsub("'", "\\\"") # replace single quotes with double quotes
|
90
|
+
|
91
|
+
%Q{'$SHELL -l -c \"#{cmd}\"'}
|
92
|
+
end
|
87
93
|
end
|
88
94
|
end
|
89
95
|
end
|
data/spec/backend_spec.rb
CHANGED
@@ -4,20 +4,22 @@ describe SSHKit::Interactive::Backend do
|
|
4
4
|
let(:backend) { SSHKit::Interactive::Backend.new(host) }
|
5
5
|
|
6
6
|
it 'does a system call with the SSH command' do
|
7
|
-
expect_system_call('ssh -t -A example.com
|
7
|
+
expect_system_call('ssh -t -A example.com \'$SHELL -l -c "/usr/bin/env ls"\'')
|
8
8
|
backend.execute('ls')
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'respects the specified directory' do
|
12
12
|
backend.within('/var/log') do
|
13
|
-
expect_system_call('ssh -t -A example.com
|
13
|
+
expect_system_call('ssh -t -A example.com \'$SHELL -l -c "cd /var/log && /usr/bin/env ls"\'')
|
14
|
+
|
14
15
|
backend.execute('ls')
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
18
19
|
it 'respects the specified user' do
|
19
20
|
backend.as('deployer') do
|
20
|
-
expect_system_call('ssh -t -A example.com
|
21
|
+
expect_system_call('ssh -t -A example.com \'$SHELL -l -c "sudo -u deployer -- sh -c \\"/usr/bin/env ls\\""\'')
|
22
|
+
|
21
23
|
backend.execute('ls')
|
22
24
|
end
|
23
25
|
end
|
@@ -32,7 +34,8 @@ describe SSHKit::Interactive::Backend do
|
|
32
34
|
|
33
35
|
it 'respects the specified env' do
|
34
36
|
backend.with(foo: :bar) do
|
35
|
-
expect_system_call('ssh -t -A example.com
|
37
|
+
expect_system_call('ssh -t -A example.com \'$SHELL -l -c "( export FOO="bar" ; /usr/bin/env ls )"\'')
|
38
|
+
|
36
39
|
backend.execute('ls')
|
37
40
|
end
|
38
41
|
end
|
data/spec/command_spec.rb
CHANGED
@@ -85,20 +85,20 @@ describe SSHKit::Interactive::Command do
|
|
85
85
|
cmd = SSHKit::Interactive::Command.new(host, command)
|
86
86
|
|
87
87
|
expect(cmd).to receive(:ssh_cmd_args).and_return(%w(-A -B -C))
|
88
|
-
expect(cmd.to_s).to eq('ssh -A -B -C example.com
|
88
|
+
expect(cmd.to_s).to eq('ssh -A -B -C example.com \'$SHELL -l -c "/usr/bin/env ls"\'')
|
89
89
|
end
|
90
90
|
|
91
91
|
it 'excludes options if they\'re blank' do
|
92
92
|
cmd = SSHKit::Interactive::Command.new(host, command)
|
93
93
|
|
94
94
|
expect(cmd).to receive(:ssh_cmd_args).and_return([])
|
95
|
-
expect(cmd.to_s).to eq('ssh example.com
|
95
|
+
expect(cmd.to_s).to eq('ssh example.com \'$SHELL -l -c "/usr/bin/env ls"\'')
|
96
96
|
end
|
97
97
|
|
98
98
|
it 'accepts a remote command' do
|
99
99
|
cmd = SSHKit::Interactive::Command.new(host, command)
|
100
100
|
|
101
|
-
expect(cmd.to_s).to eq('ssh -t -A example.com
|
101
|
+
expect(cmd.to_s).to eq('ssh -t -A example.com \'$SHELL -l -c "/usr/bin/env ls"\'')
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
data/spec/dsl_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe SSHKit::Interactive::DSL do
|
|
5
5
|
let(:host) { SSHKit::Host.new('example.com') }
|
6
6
|
|
7
7
|
it 'will execute interactively' do
|
8
|
-
expect_system_call('ssh -t -A example.com
|
8
|
+
expect_system_call('ssh -t -A example.com \'$SHELL -l -c "/usr/bin/env ls"\'')
|
9
9
|
|
10
10
|
run_interactively host do
|
11
11
|
execute(:ls)
|
data/sshkit-interactive.gemspec
CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.add_dependency 'sshkit', '~> 1.12'
|
21
21
|
|
22
|
-
spec.add_development_dependency '
|
23
|
-
spec.add_development_dependency '
|
24
|
-
spec.add_development_dependency 'rspec', '~> 3.5.0'
|
22
|
+
spec.add_development_dependency 'rake', '~> 12.0.0'
|
23
|
+
spec.add_development_dependency 'rspec', '~> 3.6.0'
|
25
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sshkit-interactive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aidan Feldman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sshkit
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.12'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.14.0
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.14.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +44,14 @@ dependencies:
|
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
47
|
+
version: 3.6.0
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.
|
54
|
+
version: 3.6.0
|
69
55
|
description:
|
70
56
|
email:
|
71
57
|
- aidan.feldman@gmail.com
|
@@ -118,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
104
|
version: '0'
|
119
105
|
requirements: []
|
120
106
|
rubyforge_project:
|
121
|
-
rubygems_version: 2.6.
|
107
|
+
rubygems_version: 2.6.12
|
122
108
|
signing_key:
|
123
109
|
specification_version: 4
|
124
110
|
summary: An SSHKit backend that allows you to execute interactive commands on your
|