sys-admin 1.7.0 → 1.7.5
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/{CHANGES → CHANGES.md} +188 -168
- data/LICENSE +177 -0
- data/{MANIFEST → MANIFEST.md} +19 -18
- data/README.md +159 -0
- data/Rakefile +47 -47
- data/certs/djberg96_pub.pem +21 -21
- data/doc/sys-admin-unix.txt +162 -162
- data/doc/sys-admin-windows.txt +346 -346
- data/examples/example_groups.rb +27 -27
- data/examples/example_users.rb +41 -41
- data/lib/bsd/sys/admin.rb +256 -256
- data/lib/darwin/sys/admin.rb +237 -237
- data/lib/linux/sys/admin.rb +273 -273
- data/lib/sunos/sys/admin.rb +261 -261
- data/lib/sys-admin.rb +1 -1
- data/lib/sys/admin.rb +24 -24
- data/lib/sys/admin/common.rb +137 -137
- data/lib/sys/admin/custom.rb +16 -16
- data/lib/unix/sys/admin.rb +163 -163
- data/lib/windows/sys/admin.rb +997 -997
- data/sys-admin.gemspec +37 -31
- data/test/test_sys_admin.rb +23 -19
- data/test/test_sys_admin_unix.rb +260 -260
- data/test/test_sys_admin_windows.rb +337 -337
- metadata +67 -64
- metadata.gz.sig +0 -0
- data/README +0 -148
metadata
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sys-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel J. Berger
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain:
|
|
11
11
|
- |
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
|
13
13
|
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0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
+
058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
|
|
26
|
+
HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
|
|
27
|
+
AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
|
|
28
|
+
YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
|
|
29
|
+
/3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
|
|
30
|
+
h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
|
|
31
|
+
6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
|
|
32
|
+
ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
|
|
33
|
+
1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
|
|
34
|
+
DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
|
|
35
|
+
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
|
36
|
+
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
|
37
37
|
-----END CERTIFICATE-----
|
|
38
|
-
date:
|
|
38
|
+
date:
|
|
39
39
|
dependencies:
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: ffi
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
|
-
- - "
|
|
44
|
+
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 1.1
|
|
46
|
+
version: '1.1'
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
|
-
- - "
|
|
51
|
+
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 1.1
|
|
53
|
+
version: '1.1'
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
55
|
name: test-unit
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -88,58 +88,62 @@ description: |2
|
|
|
88
88
|
email: djberg96@gmail.com
|
|
89
89
|
executables: []
|
|
90
90
|
extensions: []
|
|
91
|
-
extra_rdoc_files:
|
|
92
|
-
- CHANGES
|
|
93
|
-
- README
|
|
94
|
-
- MANIFEST
|
|
91
|
+
extra_rdoc_files: []
|
|
95
92
|
files:
|
|
93
|
+
- LICENSE
|
|
94
|
+
- test
|
|
95
|
+
- test/test_sys_admin_windows.rb
|
|
96
|
+
- test/test_sys_admin.rb
|
|
97
|
+
- test/test_sys_admin_unix.rb
|
|
98
|
+
- README.md
|
|
99
|
+
- Rakefile
|
|
100
|
+
- MANIFEST.md
|
|
96
101
|
- certs
|
|
97
102
|
- certs/djberg96_pub.pem
|
|
98
|
-
- CHANGES
|
|
99
|
-
- doc
|
|
100
|
-
- doc/sys-admin-unix.txt
|
|
101
|
-
- doc/sys-admin-windows.txt
|
|
102
103
|
- examples
|
|
103
|
-
- examples/example_groups.rb
|
|
104
104
|
- examples/example_users.rb
|
|
105
|
+
- examples/example_groups.rb
|
|
105
106
|
- lib
|
|
106
|
-
- lib/bsd
|
|
107
|
-
- lib/bsd/sys
|
|
108
|
-
- lib/bsd/sys/admin.rb
|
|
109
|
-
- lib/darwin
|
|
110
|
-
- lib/darwin/sys
|
|
111
|
-
- lib/darwin/sys/admin.rb
|
|
112
|
-
- lib/linux
|
|
113
|
-
- lib/linux/sys
|
|
114
|
-
- lib/linux/sys/admin.rb
|
|
115
107
|
- lib/sunos
|
|
116
108
|
- lib/sunos/sys
|
|
117
109
|
- lib/sunos/sys/admin.rb
|
|
110
|
+
- lib/bsd
|
|
111
|
+
- lib/bsd/sys
|
|
112
|
+
- lib/bsd/sys/admin.rb
|
|
113
|
+
- lib/sys-admin.rb
|
|
114
|
+
- lib/unix
|
|
115
|
+
- lib/unix/sys
|
|
116
|
+
- lib/unix/sys/admin.rb
|
|
118
117
|
- lib/sys
|
|
119
118
|
- lib/sys/admin
|
|
120
119
|
- lib/sys/admin/common.rb
|
|
121
120
|
- lib/sys/admin/custom.rb
|
|
122
121
|
- lib/sys/admin.rb
|
|
123
|
-
- lib/
|
|
124
|
-
- lib/
|
|
125
|
-
- lib/
|
|
126
|
-
- lib/
|
|
122
|
+
- lib/linux
|
|
123
|
+
- lib/linux/sys
|
|
124
|
+
- lib/linux/sys/admin.rb
|
|
125
|
+
- lib/darwin
|
|
126
|
+
- lib/darwin/sys
|
|
127
|
+
- lib/darwin/sys/admin.rb
|
|
127
128
|
- lib/windows
|
|
128
129
|
- lib/windows/sys
|
|
129
130
|
- lib/windows/sys/admin.rb
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
131
|
+
- CHANGES.md
|
|
132
|
+
- doc
|
|
133
|
+
- doc/sys-admin-windows.txt
|
|
134
|
+
- doc/sys-admin-unix.txt
|
|
133
135
|
- sys-admin.gemspec
|
|
134
|
-
-
|
|
135
|
-
- test/test_sys_admin.rb
|
|
136
|
-
- test/test_sys_admin_unix.rb
|
|
137
|
-
- test/test_sys_admin_windows.rb
|
|
138
|
-
homepage: http://www.github.com/djberg96/sysutils
|
|
136
|
+
homepage: http://www.github.com/djberg96/sys-admin
|
|
139
137
|
licenses:
|
|
140
|
-
- Apache
|
|
141
|
-
metadata:
|
|
142
|
-
|
|
138
|
+
- Apache-2.0
|
|
139
|
+
metadata:
|
|
140
|
+
homepage_uri: https://github.com/djberg96/sys-admin
|
|
141
|
+
bug_tracker_uri: https://github.com/djberg96/sys-admin/issues
|
|
142
|
+
changelog_uri: https://github.com/djberg96/sys-admin/blob/ffi/CHANGES.md
|
|
143
|
+
documentation_uri: https://github.com/djberg96/sys-admin/wiki
|
|
144
|
+
source_code_uri: https://github.com/djberg96/sys-admin
|
|
145
|
+
wiki_uri: https://github.com/djberg96/sys-admin/wiki
|
|
146
|
+
post_install_message:
|
|
143
147
|
rdoc_options: []
|
|
144
148
|
require_paths:
|
|
145
149
|
- lib
|
|
@@ -154,9 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
154
158
|
- !ruby/object:Gem::Version
|
|
155
159
|
version: '0'
|
|
156
160
|
requirements: []
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
signing_key:
|
|
161
|
+
rubygems_version: 3.0.3
|
|
162
|
+
signing_key:
|
|
160
163
|
specification_version: 4
|
|
161
164
|
summary: A unified, cross platform replacement for the "etc" library.
|
|
162
165
|
test_files:
|
metadata.gz.sig
CHANGED
|
Binary file
|
data/README
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
== Description
|
|
2
|
-
The sys-admin library is a unified, cross platform replacement for the Etc module.
|
|
3
|
-
|
|
4
|
-
== Installation
|
|
5
|
-
gem install sys-admin
|
|
6
|
-
|
|
7
|
-
== Synopsis
|
|
8
|
-
require 'sys/admin' # or sys-admin
|
|
9
|
-
include Sys
|
|
10
|
-
|
|
11
|
-
# Returns an Array of User objects
|
|
12
|
-
a = Admin.users
|
|
13
|
-
|
|
14
|
-
# Returns an Array of Group objects
|
|
15
|
-
g = Admin.groups
|
|
16
|
-
|
|
17
|
-
# Get information about a particular user
|
|
18
|
-
p Admin.get_user("nobody")
|
|
19
|
-
p Admin.get_user("nobody", :localaccount => true)
|
|
20
|
-
|
|
21
|
-
# Get information about a particular group
|
|
22
|
-
p Admin.get_group("adm")
|
|
23
|
-
p Admin.get_group("adm", :localaccount => true)
|
|
24
|
-
|
|
25
|
-
== Admin
|
|
26
|
-
Admin.get_login
|
|
27
|
-
Returns the user name (only) of the current login.
|
|
28
|
-
|
|
29
|
-
Admin.get_user(name, options = {})
|
|
30
|
-
Admin.get_user(uid, options = {})
|
|
31
|
-
Returns a User object based on +name+ or +uid+. The +options+ hash is
|
|
32
|
-
for MS Windows only, and allows you to restrict the search based on the
|
|
33
|
-
options you provide, e.g. 'domain' or 'localaccount'.
|
|
34
|
-
|
|
35
|
-
Admin.get_group(name, options = {})
|
|
36
|
-
Admin.get_group(gid, options = {})
|
|
37
|
-
Returns a Group object based on +name+ or +uid+. The +options+ hash is
|
|
38
|
-
for MS Windows only, and allows you to restrict the search based on the
|
|
39
|
-
options you provide, e.g. 'domain' or 'localaccount'.
|
|
40
|
-
|
|
41
|
-
Admin.groups(options = {})
|
|
42
|
-
Returns an Array of Group objects.
|
|
43
|
-
|
|
44
|
-
The +options+ hash is for MS Windows only, and allows you to restrict the
|
|
45
|
-
search based on the options you provide, e.g. 'domain' or 'localaccount'.
|
|
46
|
-
|
|
47
|
-
Admin.users(options = {})
|
|
48
|
-
Returns an Array of User objects.
|
|
49
|
-
|
|
50
|
-
The +options+ hash is for MS Windows only, and allows you to restrict the
|
|
51
|
-
search based on the options you provide, e.g. 'domain' or 'localaccount'.
|
|
52
|
-
|
|
53
|
-
== User class
|
|
54
|
-
=== User (Windows)
|
|
55
|
-
The User class has the following attributes on MS Windows systems:
|
|
56
|
-
|
|
57
|
-
* account_type
|
|
58
|
-
* caption
|
|
59
|
-
* description
|
|
60
|
-
* domain
|
|
61
|
-
* password
|
|
62
|
-
* full_name
|
|
63
|
-
* gid
|
|
64
|
-
* install_date
|
|
65
|
-
* name
|
|
66
|
-
* sid
|
|
67
|
-
* status
|
|
68
|
-
* disabled?
|
|
69
|
-
* local?
|
|
70
|
-
* lockout?
|
|
71
|
-
* password_changeable?
|
|
72
|
-
* password_expires?
|
|
73
|
-
* password_required?
|
|
74
|
-
* uid
|
|
75
|
-
|
|
76
|
-
=== User (Unix)
|
|
77
|
-
The User class has the following attributes on Unix systems:
|
|
78
|
-
|
|
79
|
-
* name
|
|
80
|
-
* passwd
|
|
81
|
-
* uid
|
|
82
|
-
* gid
|
|
83
|
-
* dir
|
|
84
|
-
* shell
|
|
85
|
-
* gecos
|
|
86
|
-
* quota
|
|
87
|
-
* age
|
|
88
|
-
* class
|
|
89
|
-
* comment
|
|
90
|
-
* change
|
|
91
|
-
* expire
|
|
92
|
-
|
|
93
|
-
== Group Classes
|
|
94
|
-
=== Group (Windows)
|
|
95
|
-
The Group class has the following attributes on MS Windows systems:
|
|
96
|
-
|
|
97
|
-
* caption
|
|
98
|
-
* description
|
|
99
|
-
* domain
|
|
100
|
-
* install_date
|
|
101
|
-
* name
|
|
102
|
-
* sid
|
|
103
|
-
* status
|
|
104
|
-
* gid
|
|
105
|
-
* local?
|
|
106
|
-
|
|
107
|
-
=== Group (Unix)
|
|
108
|
-
The Group class has the following attributes on Unix systems:
|
|
109
|
-
|
|
110
|
-
* name
|
|
111
|
-
* gid
|
|
112
|
-
* members
|
|
113
|
-
* passwd
|
|
114
|
-
|
|
115
|
-
== Error Classes
|
|
116
|
-
Admin::Error < StandardError
|
|
117
|
-
Raised if anything goes wrong with any of the above methods.
|
|
118
|
-
|
|
119
|
-
== Developer's Notes
|
|
120
|
-
=== MS Windows
|
|
121
|
-
The Windows version now uses a win32ole + WMI approach to getting
|
|
122
|
-
information. This means that the WMI service must be running on the
|
|
123
|
-
target machine in order to work (which it is, by default).
|
|
124
|
-
|
|
125
|
-
=== UNIX
|
|
126
|
-
The underlying implementation is similar to core Ruby's Etc implementation.
|
|
127
|
-
But, in addition to the different interface, I use the re-entrant version
|
|
128
|
-
of the appropriate functions when available.
|
|
129
|
-
|
|
130
|
-
== Future Plans
|
|
131
|
-
Make the User and Group objects comparable.
|
|
132
|
-
Add ability to add, configure and delete users on Unix platforms.
|
|
133
|
-
|
|
134
|
-
== Known Bugs
|
|
135
|
-
None that I'm aware of. If you find any, please log them on the project
|
|
136
|
-
page at:
|
|
137
|
-
|
|
138
|
-
https://github.com/djberg96/sys-admin
|
|
139
|
-
|
|
140
|
-
== License
|
|
141
|
-
Apache 2.0
|
|
142
|
-
|
|
143
|
-
== Copyright
|
|
144
|
-
(C) 2005-2018, Daniel J. Berger
|
|
145
|
-
All Rights Reserved
|
|
146
|
-
|
|
147
|
-
== Author
|
|
148
|
-
Daniel J. Berger
|