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 +4 -4
- data/lib/specinfra/backend/ssh.rb +3 -1
- data/lib/specinfra/command/base/file.rb +14 -0
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/base/file_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7163f14a863695e5d6bbee763c4e0148a478c48
|
4
|
+
data.tar.gz: f1299a3ca4ea7225a27f42cc3649c08309aa5f01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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
|
+
|
data/lib/specinfra/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|