specinfra 2.0.0.beta20 → 2.0.0.beta21
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/command/base/file.rb +8 -0
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/base/file_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c6042a29e45c67e5930ccec5e393e133ead4546
|
4
|
+
data.tar.gz: f4bea8e7449d41a66cf951a9f6e5382effc96363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b65d6980447f491ec79bbbfe60df7eba1da24d10cade2eed1b067b8d1e5a7ce41def85ccf2302d30a3db53b9d2126b30ac5d7c1337e340708e59026ec026c00
|
7
|
+
data.tar.gz: 8e2dbf074b2e4252a631ded88fff4def3533ff0fa9a89ee584111cc3d9590e0957e9452f282868829524d68df5e0fec1370589692f4f25aec28a0d153ff30fd4
|
@@ -82,6 +82,14 @@ class Specinfra::Command::Base::File < Specinfra::Command::Base
|
|
82
82
|
"stat -c %a #{escape(file)}"
|
83
83
|
end
|
84
84
|
|
85
|
+
def get_owner_user(file)
|
86
|
+
"stat -c %U #{escape(file)}"
|
87
|
+
end
|
88
|
+
|
89
|
+
def get_owner_group(file)
|
90
|
+
"stat -c %G #{escape(file)}"
|
91
|
+
end
|
92
|
+
|
85
93
|
def check_is_linked_to(link, target)
|
86
94
|
"stat -c %N #{escape(link)} | egrep -e \"-> .#{escape(target)}.\""
|
87
95
|
end
|
data/lib/specinfra/version.rb
CHANGED
@@ -30,4 +30,12 @@ describe 'File related commands' do
|
|
30
30
|
context Specinfra.command.create_file_as_directory('/tmp') do
|
31
31
|
it { should eq 'mkdir -p /tmp' }
|
32
32
|
end
|
33
|
+
|
34
|
+
context Specinfra.command.get_file_owner_user('/tmp') do
|
35
|
+
it { should eq 'stat -c %U /tmp' }
|
36
|
+
end
|
37
|
+
|
38
|
+
context Specinfra.command.get_file_owner_group('/tmp') do
|
39
|
+
it { should eq 'stat -c %G /tmp' }
|
40
|
+
end
|
33
41
|
end
|