vagrant-scp 0.5.4 → 0.5.9

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
- SHA1:
3
- metadata.gz: c94d03251e09000e8ae6cfb6b6ec6d2aa5970d0b
4
- data.tar.gz: 61fdd2a2dc70a5ef98c1d6bf83037b8350ed7ae4
2
+ SHA256:
3
+ metadata.gz: df188ae6f299559786afcf799c99ee23f77010538f96d496ed0871006dedd5ec
4
+ data.tar.gz: b10ab56b55235b0c99c11b6d3663d8f35cfca5bd0c84d5520a523b339646457f
5
5
  SHA512:
6
- metadata.gz: a69f24db5e46b9fdf324c7224d1940f9d94e08dd55437466633ab5526548c3e411457face8cb8b39115b6b77af9783a4db082666a9fad7405716c8f9372fd532
7
- data.tar.gz: ebb14738abc8d484262909e73ebeeef5d102e5a44e80afdb495e0c0c93e1789a4bf280f8aa068d6ea858797c194b9833bf556d48d497546f3d44861f7dbd35ec
6
+ metadata.gz: e478cb9254926da3eb9d65f6630408510343ff1f9c4b13301561ad906036d9bba199644628def3284ccf7af8b7aa4cc773a8c920cb0012ad5fe4c7868895931b
7
+ data.tar.gz: fc96757ab88b04308fa646aa9f8731da3f962a90827cdcd330fe5839b30ac207eab0c05cf939c478bfb9bdccab0dd8117598b36569def7ff2548371336eef405
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vagrant::Scp
2
2
 
3
- Copy files to a Vagrant VM via SCP.
3
+ Copy files to a Vagrant guest via SCP.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,7 +10,7 @@ You need to install the plugin, like so
10
10
 
11
11
  ## Usage
12
12
 
13
- If you have just a single Vagrant VM, you can copy files over like this:
13
+ If you have just a single Vagrant guest, you can copy files over like this:
14
14
 
15
15
  vagrant scp <some_local_file_or_dir> <somewhere_on_the_vm>
16
16
 
@@ -18,11 +18,22 @@ If you have multiple VMs, you can specify it.
18
18
 
19
19
  vagrant scp <some_local_file_or_dir> [vm_name]:<somewhere_on_the_vm>
20
20
 
21
- Copying files out of the VM works in the same fashion
21
+ Copying files out of the guest works in the same fashion
22
22
 
23
23
  vagrant scp [vm_name]:<somewhere_on_the_vm> <some_local_file_or_dir>
24
24
 
25
- That’s it!
25
+ If source is a directory it will be copied recursively.
26
+
27
+
28
+ ## Examples
29
+
30
+ If you have just one guest, you can copy files to it like this:
31
+
32
+ vagrant scp file_on_host.txt :file_on_vm.txt
33
+
34
+ And from the guest like this:
35
+
36
+ vagrant scp :file_on_vm.txt file_on_host.txt
26
37
 
27
38
  ## Vagrant version
28
- We support Vagrant 1.7+. Note that Ubuntu 14.04 LTS ships version 1.4.3. You can get the deb file with the latest Vagrant [here](https://www.vagrantup.com/downloads.html).
39
+ We require Vagrant v1.7 or newer. If you are running older version (check with `vagrant --version`), install recent version directly from [vendor site](https://www.vagrantup.com/).
@@ -1,3 +1,4 @@
1
+ require 'pathname'
1
2
 
2
3
  module VagrantPlugins
3
4
  module Scp
@@ -18,18 +19,26 @@ module VagrantPlugins
18
19
  raise Vagrant::Errors::SSHNotReady if @ssh_info.nil?
19
20
  user_at_host = "#{@ssh_info[:username]}@#{@ssh_info[:host]}"
20
21
  if net_ssh_command == :upload!
21
- target = "#{user_at_host}:#{target_files}"
22
- source = source_files
22
+ target = "#{user_at_host}:'#{target_files}'"
23
+ source = "'#{source_files}'"
23
24
  else
24
- target = target_files
25
- source = "#{user_at_host}:#{source_files}"
25
+ target = "'#{target_files}'"
26
+ source = "#{user_at_host}:'#{source_files}'"
26
27
  end
28
+
29
+ if @ssh_info[:proxy_command]
30
+ proxy_command = "-o ProxyCommand='#{@ssh_info[:proxy_command]}'"
31
+ else
32
+ proxy_command = ''
33
+ end
34
+
27
35
  command = [
28
36
  "scp",
29
37
  "-r",
30
38
  "-o StrictHostKeyChecking=no",
31
39
  "-o UserKnownHostsFile=/dev/null",
32
40
  "-o port=#{@ssh_info[:port]}",
41
+ proxy_command,
33
42
  "-i '#{@ssh_info[:private_key_path][0]}'",
34
43
  source,
35
44
  target
@@ -43,7 +52,8 @@ module VagrantPlugins
43
52
  def parse_args
44
53
  opts = OptionParser.new do |o|
45
54
  o.banner = "Usage: vagrant scp <local_path> [vm_name]:<remote_path> \n"
46
- o.banner += " vagrant scp [vm_name]:<remote_path> <local_path>"
55
+ o.banner += " vagrant scp [vm_name]:<remote_path> <local_path> \n"
56
+ o.banner += "Directories will be copied recursively."
47
57
  o.separator ""
48
58
  o.separator "Options:"
49
59
  o.separator ""
@@ -56,7 +66,7 @@ module VagrantPlugins
56
66
 
57
67
  def host
58
68
  host = [@file_1, @file_2].map{|file_spec| file_spec.match(/^([^:]*):/)[1] rescue nil}.compact.first
59
- host = nil if (host.nil? || host == 0 )
69
+ host = nil if (host.nil? || host == '' || host == 0 )
60
70
  host
61
71
  end
62
72
 
@@ -69,7 +79,11 @@ module VagrantPlugins
69
79
  end
70
80
 
71
81
  def target_files
72
- format_file_path(@file_2)
82
+ if target_location_specified?
83
+ format_file_path(@file_2)
84
+ else
85
+ Pathname.new(source_files).basename
86
+ end
73
87
  end
74
88
 
75
89
  def format_file_path(filepath)
@@ -80,6 +94,9 @@ module VagrantPlugins
80
94
  end
81
95
  end
82
96
 
97
+ def target_location_specified?
98
+ !@file_2.end_with?(':')
99
+ end
83
100
  end
84
101
 
85
102
  end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Scp
3
- VERSION = "0.5.4"
3
+ VERSION = "0.5.9"
4
4
  end
5
5
  end
data/vagrant-scp.gemspec CHANGED
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake", "~> 0"
21
+ spec.add_development_dependency "bundler", ">= 2.2.10"
22
+ spec.add_development_dependency "rake", ">= 12.3.3"
23
23
  spec.add_runtime_dependency 'log4r', "~> 1.1"
24
- spec.add_runtime_dependency 'net-scp', "~> 1.1"
24
+ spec.add_runtime_dependency 'net-scp', ">= 1.1"
25
25
 
26
26
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-scp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Invernizzi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-02 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: 2.2.10
20
20
  type: :development
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.3'
26
+ version: 2.2.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 12.3.3
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: '0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: log4r
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,14 +56,14 @@ dependencies:
56
56
  name: net-scp
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.1'
69
69
  description: Copy files to a Vagrant VM via SCP.
@@ -103,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubyforge_project:
107
- rubygems_version: 2.4.6
106
+ rubygems_version: 3.1.2
108
107
  signing_key:
109
108
  specification_version: 4
110
109
  summary: Copy files to a Vagrant VM via SCP.