specinfra 2.10.4 → 2.11.0

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: 58daefbc8fc4037f564149fcfa06d1284d803b7e
4
- data.tar.gz: f6a4fb6a92a216bf3ad622296e3aa0623b450c18
3
+ metadata.gz: 5f3d2e29c23332edd854c392a4f387a9f208e890
4
+ data.tar.gz: 45fa4dee5d7f55637bc88b814529e0e8c7707ae7
5
5
  SHA512:
6
- metadata.gz: b0dd548e3131f619ad2f5961f68b625e437e7b1e61ae9968d80b53809b900470c63ee95d858a064355f4d26c95bbb0f4f008489c8cee619ca5dd95fdc7a98bc3
7
- data.tar.gz: 0b5f7b307e92f6689db3c0e54a7e1e81f452428bc56342da70822d545f2439f2d13263c9e1306c5d1e80147a764df5f4236b0e201aa5f22705e7b89995343ecb
6
+ metadata.gz: d27096006e2273c9e1599964e608c821c5c0877d88383d1bbe68166f4bc84f4d194e3799b05944bf858658bfa37103d3e67d4bdfaa04fcbeda766ecc62a92b9b
7
+ data.tar.gz: 51f2385e6445e672753f5e46129608e45741c5f8d55db2e247fff2b7c6b395a7a1a298b78ae934bf4d03b1a2e816ec252cf5c9d17141f3dd8c6d95ec4b1486a0
@@ -25,6 +25,10 @@ module Specinfra::Backend
25
25
  FileUtils.cp(from, to)
26
26
  end
27
27
 
28
+ def send_directory(from, to)
29
+ FileUtils.cp_r(from, to)
30
+ end
31
+
28
32
  def build_command(cmd)
29
33
  shell = Specinfra.configuration.shell || '/bin/sh'
30
34
  cmd = cmd.shelljoin if cmd.is_a?(Array)
@@ -24,14 +24,11 @@ module Specinfra::Backend
24
24
  end
25
25
 
26
26
  def send_file(from, to)
27
- if Specinfra.configuration.scp.nil?
28
- Specinfra.configuration.scp = create_scp
29
- end
27
+ scp_upload!(from, to)
28
+ end
30
29
 
31
- tmp = File.join('/tmp', File.basename(to))
32
- scp = Specinfra.configuration.scp
33
- scp.upload!(from, tmp)
34
- run_command(Specinfra.command.get(:move_file, tmp, to))
30
+ def send_directory(from, to)
31
+ scp_upload!(from, to, :recursive => true)
35
32
  end
36
33
 
37
34
  def build_command(cmd)
@@ -84,7 +81,18 @@ module Specinfra::Backend
84
81
  end
85
82
  Net::SCP.new(ssh)
86
83
  end
87
-
84
+
85
+ def scp_upload!(from, to, opt={})
86
+ if Specinfra.configuration.scp.nil?
87
+ Specinfra.configuration.scp = create_scp
88
+ end
89
+
90
+ tmp = File.join('/tmp', File.basename(to))
91
+ scp = Specinfra.configuration.scp
92
+ scp.upload!(from, tmp, opt)
93
+ run_command(Specinfra.command.get(:move_file, tmp, to))
94
+ end
95
+
88
96
  def ssh_exec!(command)
89
97
  stdout_data = ''
90
98
  stderr_data = ''
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.10.4"
2
+ VERSION = "2.11.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.4
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-20 00:00:00.000000000 Z
11
+ date: 2014-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh