sshkit-interactive 0.2.0 → 0.2.1

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: 2b9f9fe3a0df465a8ce537cde0a15dd59a8c757a
4
- data.tar.gz: 8d66b61a1c46fec1547fd4aeaa0bd99396daba00
3
+ metadata.gz: bdc3246ae37e2704528c372a077f39f0c248cf7b
4
+ data.tar.gz: e9d0427c36f308df360a923f5fd7b76db8f0ab05
5
5
  SHA512:
6
- metadata.gz: c7c4f24a202860ae9b4543fd05c16531b64daea2718a39a3ac8e906bc5470271de288e09badaf8ee6d34310ebed65388f67f138bd75c86a1f7bc9ae07e5ffa70
7
- data.tar.gz: 1c344d7c66e3fe33ebfe57ad387d073238c1d6f621595dda8fea50b7c85dd5e6d53eb122274628d367065816fcbf3bed2a96e1570af2c08ced4d94285573c97b
6
+ metadata.gz: b94273bcde5b62b76c7a3845f72eb4dbc08caa4d3f85151b321bc1270325bec604c8edaa883022b37107880a4b2879ec45fd2421771ff8a14d5bb9cfb041f26a
7
+ data.tar.gz: 92fb8c75c9a99a40ea5b7478fcedee27ec684a628d1250fb1ade9143921353910c953ddb417515c9c1907811444de1658c071489dcd5e06e9544846dbea4ffc0
data/.gitignore CHANGED
@@ -11,4 +11,4 @@
11
11
  *.so
12
12
  *.o
13
13
  *.a
14
- mkmf.log
14
+ *.log
data/.travis.yml CHANGED
@@ -3,11 +3,11 @@ sudo: false
3
3
  language: ruby
4
4
 
5
5
  rvm:
6
- - ruby-2.2.5
7
- - ruby-2.3.1
8
- - rbx-2.5.8
6
+ - ruby-2.2.6
7
+ - ruby-2.3.3
8
+ - ruby-2.4.0
9
9
  - jruby-1.7
10
- - jruby-9.1.2.0
10
+ - jruby-9.1.7.0
11
11
 
12
12
  gemfile:
13
13
  - spec/gemfiles/net-ssh2_8.gemfile
@@ -15,6 +15,8 @@ gemfile:
15
15
  - spec/gemfiles/net-ssh3_0.gemfile
16
16
  - spec/gemfiles/net-ssh3_1.gemfile
17
17
  - spec/gemfiles/net-ssh3_2.gemfile
18
+ - spec/gemfiles/net-ssh4_0.gemfile
19
+ - spec/gemfiles/net-ssh4_1.gemfile
18
20
 
19
21
  matrix:
20
22
  exclude:
@@ -24,8 +26,12 @@ matrix:
24
26
  gemfile: spec/gemfiles/net-ssh3_1.gemfile
25
27
  - rvm: jruby-1.7
26
28
  gemfile: spec/gemfiles/net-ssh3_2.gemfile
29
+ - rvm: jruby-1.7
30
+ gemfile: spec/gemfiles/net-ssh4_0.gemfile
31
+ - rvm: jruby-1.7
32
+ gemfile: spec/gemfiles/net-ssh4_1.gemfile
27
33
 
28
34
  before_install:
29
- - gem install bundler -v '~> 1.13'
35
+ - gem install bundler -v '~> 1.14.0'
30
36
 
31
37
  script: bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.2.1 (2017-05-01)
4
+ ### Change
5
+ - run dummy command to force setting global netssh_options on host if using with capistrano
6
+
3
7
  ## 0.2.0 (2016-09-16)
4
8
  ### Feature
5
9
  - add DSL for interactive command invocation (`run_interactively`)
@@ -25,7 +25,7 @@ module SSHKit
25
25
  args << '-A' if forward_agent?
26
26
  args << "-p #{port}" if port
27
27
  args << "-l #{user}" if user
28
- args << %Q{-o "PreferredAuthentications #{auth_methods_str}"} if auth_methods.count > 0
28
+ args << %Q{-o "PreferredAuthentications #{auth_methods.join(',')}"} if auth_methods.count > 0
29
29
  args << %Q{-o "ProxyCommand #{proxy_command}"} if proxy
30
30
  args << %Q{-o "HostName #{host_name}"} if host_name
31
31
 
@@ -42,7 +42,7 @@ module SSHKit
42
42
  :ssh,
43
43
  *ssh_cmd_args,
44
44
  host.hostname,
45
- "\"#{remote_command_str}\""
45
+ %Q{"\\$SHELL -l -c \\"#{remote_command.to_command}\\""}
46
46
  ].reject(&:empty?).join(' ')
47
47
  end
48
48
 
@@ -70,15 +70,11 @@ module SSHKit
70
70
  end
71
71
 
72
72
  def keys
73
- netssh_options[:keys] || []
73
+ Array(netssh_options[:keys])
74
74
  end
75
75
 
76
76
  def auth_methods
77
- netssh_options[:auth_methods] || []
78
- end
79
-
80
- def auth_methods_str
81
- auth_methods.join(',')
77
+ Array(netssh_options[:auth_methods])
82
78
  end
83
79
 
84
80
  def proxy
@@ -88,10 +84,6 @@ module SSHKit
88
84
  def proxy_command
89
85
  proxy.command_line_template
90
86
  end
91
-
92
- def remote_command_str
93
- %Q{\\$SHELL -l -c \\"#{remote_command.to_command}\\"}
94
- end
95
87
  end
96
88
  end
97
89
  end
@@ -3,6 +3,9 @@ module SSHKit
3
3
  module DSL
4
4
  # run commands interactively
5
5
  def run_interactively(host, &block)
6
+ # Force setting global netssh_options on host if using capistrano
7
+ SSHKit.config.backend.new(host) { test(:true) }.run
8
+
6
9
  Thread.current[:run_interactively] = true
7
10
 
8
11
  SSHKit::Interactive::Backend.new(host, &block).run
@@ -1,5 +1,5 @@
1
1
  module SSHKit
2
2
  module Interactive
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
data/spec/backend_spec.rb CHANGED
@@ -30,7 +30,12 @@ describe SSHKit::Interactive::Backend do
30
30
  }.to raise_error(SSHKit::Interactive::Unsupported)
31
31
  end
32
32
 
33
- it 'respects the specified env'
33
+ it 'respects the specified env' do
34
+ backend.with(foo: :bar) do
35
+ expect_system_call('ssh -t -A example.com "\\$SHELL -l -c \\"( export FOO="bar" ; /usr/bin/env ls )\\""')
36
+ backend.execute('ls')
37
+ end
38
+ end
34
39
 
35
40
  describe 'prevents calling unsupported operations' do
36
41
  it '#upload!' do
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ gem 'net-ssh', '~> 4.0.0'
5
+
6
+ # Specify your gem's dependencies in sshkit-interactive.gemspec
7
+ gemspec path: '../..'
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ gem 'net-ssh', '~> 4.1.0'
5
+
6
+ # Specify your gem's dependencies in sshkit-interactive.gemspec
7
+ gemspec path: '../..'
data/spec/spec_helper.rb CHANGED
@@ -94,6 +94,8 @@ RSpec.configure do |config|
94
94
  =end
95
95
 
96
96
  config.before(:each) do
97
+ SSHKit.config.backend = SSHKit::Backend::Printer
98
+
97
99
  # block all system calls
98
100
  allow_any_instance_of(SSHKit::Interactive::Command).to receive(:system)
99
101
 
@@ -17,9 +17,9 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_dependency 'sshkit', '~> 1.9'
20
+ spec.add_dependency 'sshkit', '~> 1.12'
21
21
 
22
- spec.add_development_dependency 'bundler', '~> 1.13'
23
- spec.add_development_dependency 'rake', '~> 11.0'
24
- spec.add_development_dependency 'rspec', '~> 3.5'
22
+ spec.add_development_dependency 'bundler', '~> 1.14.0'
23
+ spec.add_development_dependency 'rake', '~> 12.0.0'
24
+ spec.add_development_dependency 'rspec', '~> 3.5.0'
25
25
  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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aidan Feldman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-15 00:00:00.000000000 Z
11
+ date: 2017-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sshkit
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '1.12'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: '1.12'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.13'
33
+ version: 1.14.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.13'
40
+ version: 1.14.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '11.0'
47
+ version: 12.0.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '11.0'
54
+ version: 12.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.5'
61
+ version: 3.5.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.5'
68
+ version: 3.5.0
69
69
  description:
70
70
  email:
71
71
  - aidan.feldman@gmail.com
@@ -94,6 +94,8 @@ files:
94
94
  - spec/gemfiles/net-ssh3_0.gemfile
95
95
  - spec/gemfiles/net-ssh3_1.gemfile
96
96
  - spec/gemfiles/net-ssh3_2.gemfile
97
+ - spec/gemfiles/net-ssh4_0.gemfile
98
+ - spec/gemfiles/net-ssh4_1.gemfile
97
99
  - spec/spec_helper.rb
98
100
  - sshkit-interactive.gemspec
99
101
  homepage: https://github.com/afeld/sshkit-interactive
@@ -116,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
118
  version: '0'
117
119
  requirements: []
118
120
  rubyforge_project:
119
- rubygems_version: 2.5.1
121
+ rubygems_version: 2.6.11
120
122
  signing_key:
121
123
  specification_version: 4
122
124
  summary: An SSHKit backend that allows you to execute interactive commands on your
@@ -130,4 +132,6 @@ test_files:
130
132
  - spec/gemfiles/net-ssh3_0.gemfile
131
133
  - spec/gemfiles/net-ssh3_1.gemfile
132
134
  - spec/gemfiles/net-ssh3_2.gemfile
135
+ - spec/gemfiles/net-ssh4_0.gemfile
136
+ - spec/gemfiles/net-ssh4_1.gemfile
133
137
  - spec/spec_helper.rb