vagrant_commands 0.0.7 → 0.0.8
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/lib/vagrant_commands/scp.rb +16 -0
- data/lib/vagrant_commands/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e5aa0045e056c74ebd0e89fc0adba431f0edc1d
|
4
|
+
data.tar.gz: 2b5dd34ac42d2adc0bdc5269316b320117de0400
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|