specinfra 2.0.0.beta42 → 2.0.0.beta43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/command/base/file.rb +9 -1
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/base/file_spec.rb +40 -37
- data/spec/command/base/user_spec.rb +2 -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: a06b77b911ce755c1986e00e888fe05daba5f26a
|
4
|
+
data.tar.gz: 254bfa7133035990605a1de17e1fa50875903bc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 207c342c8bed16c798138c5123084bbf188de49372dc2ff6247798daa954da5ac152514c0ae68b1337e20801ef07110a9a06b8d3da213afa54c5b93e0da9d7ea
|
7
|
+
data.tar.gz: f43b065d0ec5f6126e04e50089dcdd19b74c3ea343acf325c19fde9976878b8f4ac2ba5b26f27282ff9abed8c07d00c5ee6b10bd633f9d9aa0fa001e30ec8d51
|
@@ -74,7 +74,7 @@ class Specinfra::Command::Base::File < Specinfra::Command::Base
|
|
74
74
|
|
75
75
|
def check_is_mounted(path)
|
76
76
|
regexp = "on #{path} "
|
77
|
-
"mount | grep
|
77
|
+
"mount | grep -- '#{escape(regexp)}'"
|
78
78
|
end
|
79
79
|
|
80
80
|
def get_mode(file)
|
@@ -93,6 +93,14 @@ class Specinfra::Command::Base::File < Specinfra::Command::Base
|
|
93
93
|
"stat -c %N #{escape(link)} | egrep -e \"-> .#{escape(target)}.\""
|
94
94
|
end
|
95
95
|
|
96
|
+
def check_is_link(link)
|
97
|
+
"test -L #{escape(link)}"
|
98
|
+
end
|
99
|
+
|
100
|
+
def get_link_target(link)
|
101
|
+
"readlink -f #{escape(link)}"
|
102
|
+
end
|
103
|
+
|
96
104
|
def get_mtime(file)
|
97
105
|
"stat -c %Y #{escape(file)}"
|
98
106
|
end
|
data/lib/specinfra/version.rb
CHANGED
@@ -2,52 +2,55 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
set :os, { :family => nil }
|
4
4
|
|
5
|
-
describe '
|
6
|
-
|
7
|
-
|
8
|
-
end
|
5
|
+
describe get_command(:check_file_is_directory, '/tmp') do
|
6
|
+
it { should eq 'test -d /tmp' }
|
7
|
+
end
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
describe get_command(:change_file_mode, '/tmp', '0644') do
|
10
|
+
it { should eq 'chmod 0644 /tmp' }
|
11
|
+
end
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
describe get_command(:change_file_owner, '/tmp', 'root') do
|
14
|
+
it { should eq 'chown root /tmp' }
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
describe get_command(:change_file_owner, '/tmp', 'root', 'root') do
|
18
|
+
it { should eq 'chown root:root /tmp' }
|
19
|
+
end
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
describe get_command(:change_file_group, '/tmp', 'root') do
|
22
|
+
it { should eq 'chgrp root /tmp' }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe get_command(:create_file_as_directory, '/tmp') do
|
26
|
+
it { should eq 'mkdir -p /tmp' }
|
27
|
+
end
|
25
28
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
+
describe get_command(:get_file_owner_user, '/tmp') do
|
30
|
+
it { should eq 'stat -c %U /tmp' }
|
31
|
+
end
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
+
describe get_command(:get_file_owner_group, '/tmp') do
|
34
|
+
it { should eq 'stat -c %G /tmp' }
|
35
|
+
end
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
describe get_command(:move_file, '/src', '/dest') do
|
38
|
+
it { should eq 'mv /src /dest' }
|
39
|
+
end
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
describe get_command(:link_file_to, '/link', '/target') do
|
42
|
+
it { should eq 'ln -s /target /link' }
|
43
|
+
end
|
41
44
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
+
describe get_command(:remove_file, '/tmp') do
|
46
|
+
it { should eq 'rm -rf /tmp' }
|
47
|
+
end
|
45
48
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
describe get_command(:check_file_is_link, '/tmp') do
|
50
|
+
it { should eq 'test -L /tmp' }
|
51
|
+
end
|
49
52
|
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
+
describe get_command(:get_file_link_target, '/tmp') do
|
54
|
+
it { should eq 'readlink -f /tmp' }
|
53
55
|
end
|
56
|
+
|
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.beta43
|
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-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|