vagrant_commands 0.0.7 → 0.0.8

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: b7ee969164608b47a7ef2ecce4d49ea41e320fec
4
- data.tar.gz: 5c4a7414e41b16f1262dd1e179d518fd53495266
3
+ metadata.gz: 7e5aa0045e056c74ebd0e89fc0adba431f0edc1d
4
+ data.tar.gz: 2b5dd34ac42d2adc0bdc5269316b320117de0400
5
5
  SHA512:
6
- metadata.gz: 27744c2db9a4f2318beb703f5f85d5b3e81548489d62de14ce7a0f5bfb5319dc57b2daa2792cc7210a78f329afdcf3d1e6b70e207aa54fb58336da4f32c0f7d7
7
- data.tar.gz: 212ce596f0b4934b0f3dc9ba77bfbca2e04302adfad5306ba523b97475a647a0bbfc9d123c765d05a09213a5d2d1d3d1ccac535971bc70a154cee4e3d87b6731
6
+ metadata.gz: 0122176dfb1c70598fc0f685af083e991e15393a31a13ad98d9947f134ef52fbd6cfed776aedbe2026ea50d74b1d93465546a0fead177d21c740f340abe41590
7
+ data.tar.gz: fe995ad3438eea38c2751c64d27341916fd7fae20d5072ba315f7cf226be816df14de8002091ae30a4de1617c1aee99ca0e0fe9b2bad5b68b38b080f11a6fd8d
@@ -0,0 +1,16 @@
1
+ module Scp
2
+ def self.execute_command(from_file,to_file,box_name)
3
+ portNum = get_ssh_details(/(?<=Port ).*/,box_name)
4
+ keyPath = get_ssh_details(/(?<=IdentityFile ).*/,box_name)
5
+ hostName = get_ssh_details(/(?<=HostName ).*/,box_name)
6
+ userName = get_ssh_details(/(?<=User ).*/,box_name)
7
+
8
+ puts "scp -o 'StrictHostKeyChecking no' -i #{keyPath} -P #{portNum} #{from_file} #{userName}@#{hostName}:#{to_file}"
9
+ `scp -o 'StrictHostKeyChecking no' -i #{keyPath} -P #{portNum} #{from_file} #{userName}@#{hostName}:#{to_file}`
10
+ end
11
+
12
+ def self.get_ssh_details(regex, box_name)
13
+ response = `vagrant ssh-config #{box_name}`
14
+ return response.match(regex)
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module VagrantCommands
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Jackson
@@ -48,6 +48,7 @@ files:
48
48
  - lib/vagrant_commands/boxes.rb
49
49
  - lib/vagrant_commands/commands.rb
50
50
  - lib/vagrant_commands/plugins.rb
51
+ - lib/vagrant_commands/scp.rb
51
52
  - lib/vagrant_commands/shell.rb
52
53
  - lib/vagrant_commands/version.rb
53
54
  homepage: https://github.com/nicholasjackson/vagrant-commands