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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 771660f19f29c77370081230f6b8b12a5ff88795
4
- data.tar.gz: 09d5eb78741d9c75bb8ce829207bbd594031e3fc
3
+ metadata.gz: da57ea6f39e34c5f7d221d1ddab9a70274e19614
4
+ data.tar.gz: c50226a826f6618f008af7c42c39100f60f9b614
5
5
  SHA512:
6
- metadata.gz: 4f423c7db88d83f247c1650023d91439ed67c5167a8b861c1c7aa282d940f8855ffd41fedb38694330ac713f71786bcebb76b843fd2f520f4919ffc7702d8b6a
7
- data.tar.gz: 72d25e25bd207d1fce9162b8e1d0242c06de8dad5a06a14e7e5a096f91b8269bf60fd664bf3f3e2ddbeaa8cfc52da16601a6a9f9cabb9fb6c0fec505b3d6b28d
6
+ metadata.gz: a0ce8c75f0db9ef64633b2366d9bd9db27b136ebcb41a234f65772c493b8662aef7ebda5cf003b9559d3106e7180bc966db20ac3f7004aa76281c1aeb27149ef
7
+ data.tar.gz: 561b2d1765499d9115c889d4ecaab0fea3bb6eb96637ca7409a50ba24ece1a30d956d2174b2fd0b0065227859ca47d73693dd9604be63283eebeca07a8f3f1c2
data/Rakefile CHANGED
@@ -18,4 +18,4 @@ task :destroy_vm do
18
18
  p `vagrant destroy -f`
19
19
  end
20
20
 
21
- task :default => :spec
21
+ task default: :spec
@@ -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 = { :user => 'vagrant',
7
- :password => 'vagrant' }.merge(options)
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 |ch, success|
21
+ channel.exec(command) do |_ch, success|
22
22
  abort "FAILED: couldn't execute command: (#{command})" unless success
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 }
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
@@ -1,3 +1,3 @@
1
1
  module VagrantSsh
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -1,14 +1,15 @@
1
1
  describe VagrantSsh::Shell do
2
- let(:credentials) { { :user => 'vagrant', :password => 'vagrant' } }
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(VagrantSsh::Shell.new(host, nil_logger).options).to eq credentials
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
- @ssh = VagrantSsh::Shell.new(host, nil_logger, credentials)
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 = 'vagrant-ssh'
8
- spec.version = VagrantSsh::VERSION
9
- spec.authors = ['Ben Snape']
10
- spec.email = ['bsnape@gmail.com']
11
- spec.description = %q{An easy way to execute SSH commands on your Vagrant image.}
12
- spec.summary = %q{An easy way to execute SSH commands on your Vagrant image.}
13
- spec.homepage = 'http://www.bensnape.com'
14
- spec.license = 'GNU'
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.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