specinfra 2.0.0.beta34 → 2.0.0.beta35

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: 04fe4418ee4871cd5abfdf758d69d21943f8011d
4
- data.tar.gz: e873183e7ffe189a562bed3141796d0672d4cc2d
3
+ metadata.gz: e7163f14a863695e5d6bbee763c4e0148a478c48
4
+ data.tar.gz: f1299a3ca4ea7225a27f42cc3649c08309aa5f01
5
5
  SHA512:
6
- metadata.gz: 7e46891da659b6f7b16368c8059f16ab013e9ae5d7839968d5c5450e9916bdbc8ae529bafb060c03dc26a16a812daa95813f1d31ae3b0841c157ddc1d0e57197
7
- data.tar.gz: 8e0ae98f77f51a39309c5ab8fa347dc89b75e5c797e3a56f4d3f59103e0ae8301a805edbbf0ac2a4f61249e181f7ee52d7cb68e69d10ff7753d00647dafb9985
6
+ metadata.gz: f4addcae6f6301d663efb4adda843d3b6048a7f12d990cb712ef148f2dc5a5161fa1066ed0693e96f270ba14366305da8f4e22d6cabb5cfd7d2e28dfd141ac48
7
+ data.tar.gz: fd5722e81f2515b2016516f40cd2e8fb5bebfee81d2d0236b9768701ed77cc49adbb3d983a232da8b217a1b8b467ef4bf9560009f62fef0122f1a3c32556d6a8
@@ -27,8 +27,10 @@ module Specinfra::Backend
27
27
  Specinfra.configuration.scp = create_scp
28
28
  end
29
29
 
30
+ tmp = File.join('/tmp', File.basename(to))
30
31
  scp = Specinfra.configuration.scp
31
- scp.upload!(from, to)
32
+ scp.upload!(from, tmp)
33
+ run_command(Specinfra.command.get(:move_file, tmp, to))
32
34
  end
33
35
 
34
36
  private
@@ -117,5 +117,19 @@ class Specinfra::Command::Base::File < Specinfra::Command::Base
117
117
  def create_as_directory(file)
118
118
  "mkdir -p #{escape(file)}"
119
119
  end
120
+
121
+ def move(src, dest)
122
+ "mv #{escape(src)} #{escape(dest)}"
123
+ end
124
+
125
+ def link_to(link, target)
126
+ "ln -s #{escape(target)} #{escape(link)}"
127
+ end
120
128
  end
121
129
  end
130
+
131
+
132
+
133
+
134
+
135
+
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.0.0.beta34"
2
+ VERSION = "2.0.0.beta35"
3
3
  end
@@ -38,4 +38,12 @@ describe 'File related commands' do
38
38
  context Specinfra.command.get(:get_file_owner_group, '/tmp') do
39
39
  it { should eq 'stat -c %G /tmp' }
40
40
  end
41
+
42
+ context Specinfra.command.get(:move_file, '/src', '/dest') do
43
+ it { should eq 'mv /src /dest' }
44
+ end
45
+
46
+ context Specinfra.command.get(:link_file_to, '/link', '/target') do
47
+ it { should eq 'ln -s /target /link' }
48
+ end
41
49
  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.0.0.beta34
4
+ version: 2.0.0.beta35
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-08-18 00:00:00.000000000 Z
11
+ date: 2014-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh