specinfra 2.31.0 → 2.31.1
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/darwin/base/user.rb +15 -0
- data/lib/specinfra/command.rb +1 -0
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/darwin/user_spec.rb +15 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ac92a114a3705919efc2c56b4c6eba09a4af69b
|
|
4
|
+
data.tar.gz: 015664f4d52904a7c571e79d2fbc3b3d31ea4ef3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c567fbe8600390aa363a6aa9a13028194b5f9b3f95e2790ff7d32dc056ca51cbb9a8c570a850a12eefa53fe8e29f554a5cb137f9a26ef16bef661e5b50ec8475
|
|
7
|
+
data.tar.gz: b48c94257bb8cdd3b354c4813d511bea5a25e6f963d486f204d04bbda2ccf877c34c92968cbb51c210ea8cf4321d6267b6dfeb6338525b153a90b86414a70f39
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Specinfra::Command::Darwin::Base::User < Specinfra::Command::Base::User
|
|
2
|
+
class << self
|
|
3
|
+
def check_has_home_directory(user, path_to_home)
|
|
4
|
+
"#{get_home_directory(user)} | grep -E '^#{escape(path_to_home)}$'"
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def check_has_login_shell(user, path_to_shell)
|
|
8
|
+
"finger #{escape(user)} | grep -E '^Directory' | awk '{ print $4 }' | grep -E '^#{escape(path_to_shell)}$'"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def get_home_directory(user)
|
|
12
|
+
"finger #{escape(user)} | grep -E '^Directory' | awk '{ print $2 }'"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/specinfra/command.rb
CHANGED
|
@@ -128,6 +128,7 @@ require 'specinfra/command/darwin/base/host'
|
|
|
128
128
|
require 'specinfra/command/darwin/base/service'
|
|
129
129
|
require 'specinfra/command/darwin/base/package'
|
|
130
130
|
require 'specinfra/command/darwin/base/port'
|
|
131
|
+
require 'specinfra/command/darwin/base/user'
|
|
131
132
|
|
|
132
133
|
# Debian (inherit Linux)
|
|
133
134
|
require 'specinfra/command/debian'
|
data/lib/specinfra/version.rb
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
set :os, { :family => 'darwin' }
|
|
4
|
+
|
|
5
|
+
describe get_command(:check_user_has_home_directory, 'foo', '/Users/foo') do
|
|
6
|
+
it { should eq "finger foo | grep -E '^Directory' | awk '{ print $2 }' | grep -E '^/Users/foo$'" }
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
describe get_command(:check_user_has_login_shell, 'foo', '/bin/bash') do
|
|
10
|
+
it { should eq "finger foo | grep -E '^Directory' | awk '{ print $4 }' | grep -E '^/bin/bash$'" }
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe get_command(:get_user_home_directory, 'foo') do
|
|
14
|
+
it { should eq "finger foo | grep -E '^Directory' | awk '{ print $2 }'" }
|
|
15
|
+
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.31.
|
|
4
|
+
version: 2.31.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gosuke Miyashita
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-05-
|
|
11
|
+
date: 2015-05-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: net-ssh
|
|
@@ -199,6 +199,7 @@ files:
|
|
|
199
199
|
- lib/specinfra/command/darwin/base/package.rb
|
|
200
200
|
- lib/specinfra/command/darwin/base/port.rb
|
|
201
201
|
- lib/specinfra/command/darwin/base/service.rb
|
|
202
|
+
- lib/specinfra/command/darwin/base/user.rb
|
|
202
203
|
- lib/specinfra/command/debian.rb
|
|
203
204
|
- lib/specinfra/command/debian/base.rb
|
|
204
205
|
- lib/specinfra/command/debian/base/package.rb
|
|
@@ -389,6 +390,7 @@ files:
|
|
|
389
390
|
- spec/command/base/package_spec.rb
|
|
390
391
|
- spec/command/base/user_spec.rb
|
|
391
392
|
- spec/command/darwin/file_spec.rb
|
|
393
|
+
- spec/command/darwin/user_spec.rb
|
|
392
394
|
- spec/command/debian/service_spec.rb
|
|
393
395
|
- spec/command/esxi/package_spec.rb
|
|
394
396
|
- spec/command/factory_spec.rb
|
|
@@ -451,6 +453,7 @@ test_files:
|
|
|
451
453
|
- spec/command/base/package_spec.rb
|
|
452
454
|
- spec/command/base/user_spec.rb
|
|
453
455
|
- spec/command/darwin/file_spec.rb
|
|
456
|
+
- spec/command/darwin/user_spec.rb
|
|
454
457
|
- spec/command/debian/service_spec.rb
|
|
455
458
|
- spec/command/esxi/package_spec.rb
|
|
456
459
|
- spec/command/factory_spec.rb
|