vagrant-ssh 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/vagrant-ssh/shell.rb +7 -7
- data/lib/vagrant-ssh/version.rb +1 -1
- data/spec/vagrant_ssh_spec.rb +5 -4
- data/vagrant-ssh.gemspec +9 -8
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da57ea6f39e34c5f7d221d1ddab9a70274e19614
|
4
|
+
data.tar.gz: c50226a826f6618f008af7c42c39100f60f9b614
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0ce8c75f0db9ef64633b2366d9bd9db27b136ebcb41a234f65772c493b8662aef7ebda5cf003b9559d3106e7180bc966db20ac3f7004aa76281c1aeb27149ef
|
7
|
+
data.tar.gz: 561b2d1765499d9115c889d4ecaab0fea3bb6eb96637ca7409a50ba24ece1a30d956d2174b2fd0b0065227859ca47d73693dd9604be63283eebeca07a8f3f1c2
|
data/Rakefile
CHANGED
data/lib/vagrant-ssh/shell.rb
CHANGED
@@ -3,8 +3,8 @@ module VagrantSsh
|
|
3
3
|
attr_reader :options
|
4
4
|
|
5
5
|
def initialize(hostname, logger = Logger.new(STDOUT), options = {})
|
6
|
-
@options = { :
|
7
|
-
:
|
6
|
+
@options = { user: 'vagrant',
|
7
|
+
password: 'vagrant' }.merge(options)
|
8
8
|
@user = options[:user]
|
9
9
|
@hostname = hostname
|
10
10
|
@logger = logger # left out of options so it does not conflict with Net::SSH own options hash
|
@@ -18,12 +18,12 @@ module VagrantSsh
|
|
18
18
|
exit_code = nil
|
19
19
|
exit_signal = nil
|
20
20
|
ssh.open_channel do |channel|
|
21
|
-
channel.exec(command) do |
|
21
|
+
channel.exec(command) do |_ch, success|
|
22
22
|
abort "FAILED: couldn't execute command: (#{command})" unless success
|
23
|
-
channel.on_data { |
|
24
|
-
channel.on_extended_data { |
|
25
|
-
channel.on_request('exit-status') { |
|
26
|
-
channel.on_request(
|
23
|
+
channel.on_data { |_ch, data| stdout += data }
|
24
|
+
channel.on_extended_data { |_ch, _type, data| stderr += data }
|
25
|
+
channel.on_request('exit-status') { |_ch, data| exit_code = data.read_long }
|
26
|
+
channel.on_request('exit-signal') { |_ch, data| exit_signal = data.read_long }
|
27
27
|
end
|
28
28
|
end
|
29
29
|
ssh.loop
|
data/lib/vagrant-ssh/version.rb
CHANGED
data/spec/vagrant_ssh_spec.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
describe VagrantSsh::Shell do
|
2
|
-
|
2
|
+
subject(:vagrant_ssh) { VagrantSsh::Shell.new(host, nil_logger) }
|
3
|
+
|
4
|
+
let(:credentials) { { user: 'vagrant', password: 'vagrant' } }
|
3
5
|
let(:nil_logger) { Logger.new(nil) }
|
4
6
|
let(:host) { '33.33.33.33' }
|
5
7
|
|
6
8
|
it 'defaults to the standard Vagrant credentials' do
|
7
|
-
expect(
|
9
|
+
expect(vagrant_ssh.options).to eq credentials
|
8
10
|
end
|
9
11
|
|
10
12
|
it 'should interface with a Vagrant VM correctly' do
|
11
|
-
|
12
|
-
expect(@ssh.execute('whoami').strip).to eq 'vagrant'
|
13
|
+
expect(vagrant_ssh.execute('whoami').strip).to eq 'vagrant'
|
13
14
|
end
|
14
15
|
end
|
data/vagrant-ssh.gemspec
CHANGED
@@ -4,14 +4,14 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'vagrant-ssh/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
11
|
-
spec.description
|
12
|
-
spec.summary
|
13
|
-
spec.homepage
|
14
|
-
spec.license
|
7
|
+
spec.name = 'vagrant-ssh'
|
8
|
+
spec.version = VagrantSsh::VERSION
|
9
|
+
spec.authors = ['Ben Snape']
|
10
|
+
spec.email = ['bsnape@gmail.com']
|
11
|
+
spec.description = 'An easy way to execute SSH commands on your Vagrant image.'
|
12
|
+
spec.summary = 'An easy way to execute SSH commands on your Vagrant image.'
|
13
|
+
spec.homepage = 'http://www.bensnape.com'
|
14
|
+
spec.license = 'GNU'
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_development_dependency 'rake', '~> 10'
|
24
24
|
spec.add_development_dependency 'rspec', '~> 3'
|
25
|
+
spec.add_development_dependency 'rubocop', '~> 0.29'
|
25
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Snape
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.29'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.29'
|
55
69
|
description: An easy way to execute SSH commands on your Vagrant image.
|
56
70
|
email:
|
57
71
|
- bsnape@gmail.com
|