open_directory 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/open_directory/user.rb +14 -5
- data/lib/open_directory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjNkZDUzYjE4MGI1ZTc3YWI2YTA5MDVhMTc2MDE5MjUyZDU3MjliYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWEwOGQ0MWFiZTVjNmU2NTU2ZWQ4NmI0NjU1ZWFiMWQ4ZmFlNGRjOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODk1MDc2YTA2OTUyZjc5MzEwMTFjYTMwMzc1NDU3ZjdiOTI0ZTRhNDZiYmI1
|
10
|
+
NzI3ZmIyNmU5YTg4MTM2MTZiZmQ3ZGZjY2Q0ZTAzODdiZjQyZmJhNTc3ZTRl
|
11
|
+
NzlkMzJjODc4NmI5NjMzZDk0N2QyYzk1ZGUzZjQ2NTYxNmFkZGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTcyNTg0Y2Q1ZDJlZDgxOGU3ZDc3MGJlMTIzNzhjMGNjYzc0MDhiNjVkY2Nj
|
14
|
+
OGZkYjBiOGZiY2QyODU0MThkNjczNTQ4YjAyMWRlMGEzODUwODVjYjY4ZTgy
|
15
|
+
MTFhOWQwYjA3YTFjNWEyYWQzMWY5ODRmYjg5MThiYjUxOTE3NWQ=
|
data/lib/open_directory/user.rb
CHANGED
@@ -31,10 +31,8 @@ module OpenDirectory
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def self.
|
35
|
-
Dscl.generate("
|
36
|
-
Dscl.generate("passwd", "/Users/#{username}", ["'#{password}'"])
|
37
|
-
Dscl.generate("create", "/Users/#{username}", ["NFSHomeDirectory", "/Users/#{username}"])
|
34
|
+
def self.base_script(username, password=nil, params=[])
|
35
|
+
Dscl.generate("passwd", "/Users/#{username}", ["'#{password}'"]) unless password.nil?
|
38
36
|
params.each do |key, value|
|
39
37
|
if key == :Keywords
|
40
38
|
value.each do |keyword|
|
@@ -44,7 +42,18 @@ module OpenDirectory
|
|
44
42
|
Dscl.generate("create", "/Users/#{username}", [key, "'#{value}'"])
|
45
43
|
end
|
46
44
|
end
|
47
|
-
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.update(username, password=nil, params=[])
|
48
|
+
base_script(username, password, params)
|
49
|
+
Dscl.run
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.create(username, password, params=[])
|
53
|
+
Dscl.generate("create", "/Users/#{username}")
|
54
|
+
Dscl.generate("passwd", "/Users/#{username}", ["'#{password}'"])
|
55
|
+
base_script(username, password, params)
|
56
|
+
Dscl.run
|
48
57
|
end
|
49
58
|
|
50
59
|
def self.delete(username)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_directory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mauro Morales
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plist
|