specinfra 2.0.0.beta20 → 2.0.0.beta21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fde0fdddfccea8e542868cf9c1e51d7ce5a09838
4
- data.tar.gz: ee68a571d7c0c2812832574d4a0bb09c3c0bdc83
3
+ metadata.gz: 3c6042a29e45c67e5930ccec5e393e133ead4546
4
+ data.tar.gz: f4bea8e7449d41a66cf951a9f6e5382effc96363
5
5
  SHA512:
6
- metadata.gz: 0540f2743077e41ecf98eadbdca9b69ef5c3f7e2c0bb1e66884cb5c3905bfc2c972da74f58cbdebe6e2b8f1325c305edd9ae1a64941dfc4aac80dedc2649ff9e
7
- data.tar.gz: cdfa3309de23b33a7770f68884c6207531edeed81332f6d572e15cb85c89f7fac508cd964edc143467f009f4b90dbdf6b66988a01b4fae5b54d8401b7d87ef9a
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
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.0.0.beta20"
2
+ VERSION = "2.0.0.beta21"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta20
4
+ version: 2.0.0.beta21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita