kitchen-transport-sshtar 0.1.1 → 0.1.2

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: 5ab51b52677d378a3a02289007f17190207be94d
4
- data.tar.gz: da0afcf0f116900ce7dc19a0200d74ace307855d
3
+ metadata.gz: 840a4d047ba32e134b910ed3f3752125383677d6
4
+ data.tar.gz: 70892e544bcbaf5dd5c8aaa21b119239285ff6e9
5
5
  SHA512:
6
- metadata.gz: bfc62baa3a6b3a4d8d4870e7ace14bc3cb5b5e748d624aeee0b7a8b3d19b7d2420c08c6d063155ad1a11761d68b13aed10f6c17cc628fe785afb2bb00e3783e3
7
- data.tar.gz: 311578fe48c47aae20218385688c7808653030a263293c778da926ffe9409465aa1832e8fdfd5ea023a6ef048445563ce1543b19daf51a40bcbc55469f7041d5
6
+ metadata.gz: f4ed346a922eb40219f34dcc940def07b92711fc673bcfb3540ae173b9b1c12901a1433a63e537584181b40befefa048784cf4439c697a8e7a60e737a278b15e
7
+ data.tar.gz: cc0ab9a2b8e88b0869e06443728e39a15210ee696de6b4aa73ecd8067ec9d2e4c84201282deb68beb85fadb46d2839ec808de89b380a75d945526ee6efde4f18
@@ -17,7 +17,7 @@
17
17
  module Kitchen
18
18
  module Transport
19
19
  module Sshtar
20
- VERSION = '0.1.1'
20
+ VERSION = '0.1.2'
21
21
  end
22
22
  end
23
23
  end
@@ -35,12 +35,20 @@ module Kitchen
35
35
  class Connection < Ssh::Connection
36
36
  def upload(locals, remote)
37
37
  Array(locals).each do |local|
38
- full_remote = File.join(remote, File.basename(local))
39
38
  recursive = File.directory?(local)
40
- execute("mkdir -p #{full_remote}") if recursive
41
- time = Benchmark.realtime do
39
+ if recursive
40
+ full_remote = File.join(remote, File.basename(local))
42
41
  tar_command = "tar -C #{local} -c#{@logger.debug? ? 'v' : ''}f - ./"
43
42
  untar_command = "tar #{@logger.debug? ? '' : '--warning=none'} -C #{full_remote} -x#{@logger.debug? ? 'v' : ''}f -"
43
+ execute("mkdir -p #{full_remote}") if recursive
44
+ else
45
+ local_dir = File.dirname(local)
46
+ local_file = File.basename(local)
47
+ full_remote = remote
48
+ tar_command = "tar -C #{local_dir} -c#{@logger.debug? ? 'v' : ''} - #{local_file}"
49
+ untar_command = "tar #{@logger.debug? ? '' : '--warning=none'} -C #{full_remote} -x#{@logger.debug? ? 'v' : ''}f - #{local_file}"
50
+ end
51
+ time = Benchmark.realtime do
44
52
  ssh_command = [login_command.command, login_command.arguments].flatten.join(' ')
45
53
  sync_command = "#{tar_command} | #{ssh_command} '#{untar_command}'"
46
54
  @logger.debug("[SSH-TAR] Running ssh-tar command: #{sync_command}")
@@ -53,4 +61,4 @@ module Kitchen
53
61
 
54
62
  end
55
63
  end
56
- end
64
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-transport-sshtar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilja Bobkevic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-09 00:00:00.000000000 Z
11
+ date: 2015-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen