sys-admin 1.7.1 → 1.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/{CHANGES → CHANGES.md} +48 -25
- data/Gemfile +3 -0
- data/LICENSE +177 -0
- data/{MANIFEST → MANIFEST.md} +5 -3
- data/README.md +159 -0
- data/Rakefile +2 -2
- data/lib/bsd/sys/admin.rb +13 -7
- data/lib/darwin/sys/admin.rb +14 -7
- data/lib/linux/sys/admin.rb +13 -12
- data/lib/sunos/sys/admin.rb +12 -5
- data/lib/sys/admin.rb +1 -1
- data/lib/sys/admin/common.rb +3 -6
- data/lib/unix/sys/admin.rb +7 -5
- data/lib/windows/sys/admin.rb +13 -10
- data/sys-admin.gemspec +6 -7
- data/test/test_sys_admin.rb +1 -1
- metadata +22 -43
- metadata.gz.sig +0 -0
- data/README +0 -148
data/sys-admin.gemspec
CHANGED
@@ -3,19 +3,18 @@ require 'rubygems'
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'sys-admin'
|
6
|
-
spec.version = '1.7.
|
6
|
+
spec.version = '1.7.6'
|
7
7
|
spec.author = 'Daniel J. Berger'
|
8
|
-
spec.license = 'Apache
|
8
|
+
spec.license = 'Apache-2.0'
|
9
9
|
spec.email = 'djberg96@gmail.com'
|
10
|
-
spec.homepage = 'http://www.github.com/djberg96/
|
10
|
+
spec.homepage = 'http://www.github.com/djberg96/sys-admin'
|
11
11
|
spec.summary = 'A unified, cross platform replacement for the "etc" library.'
|
12
12
|
spec.test_file = 'test/test_sys_admin.rb'
|
13
13
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
14
14
|
spec.cert_chain = ['certs/djberg96_pub.pem']
|
15
15
|
|
16
|
-
spec.
|
17
|
-
|
18
|
-
spec.add_dependency('ffi', '>= 1.1.0')
|
16
|
+
spec.add_dependency('ffi', '~> 1.1')
|
17
|
+
spec.add_dependency('win32-security', '~> 0.5') if Gem.win_platform?
|
19
18
|
|
20
19
|
spec.add_development_dependency('test-unit', '>= 2.5.0')
|
21
20
|
spec.add_development_dependency('rake')
|
@@ -23,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
23
22
|
spec.metadata = {
|
24
23
|
'homepage_uri' => 'https://github.com/djberg96/sys-admin',
|
25
24
|
'bug_tracker_uri' => 'https://github.com/djberg96/sys-admin/issues',
|
26
|
-
'changelog_uri' => 'https://github.com/djberg96/sys-admin/blob/ffi/CHANGES',
|
25
|
+
'changelog_uri' => 'https://github.com/djberg96/sys-admin/blob/ffi/CHANGES.md',
|
27
26
|
'documentation_uri' => 'https://github.com/djberg96/sys-admin/wiki',
|
28
27
|
'source_code_uri' => 'https://github.com/djberg96/sys-admin',
|
29
28
|
'wiki_uri' => 'https://github.com/djberg96/sys-admin/wiki'
|
data/test/test_sys_admin.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
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.6
|
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
|
- |
|
@@ -35,22 +35,22 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2021-03-24 00:00:00.000000000 Z
|
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,64 +88,44 @@ 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:
|
96
|
-
-
|
93
|
+
- CHANGES.md
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE
|
96
|
+
- MANIFEST.md
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
97
99
|
- certs/djberg96_pub.pem
|
98
|
-
- CHANGES
|
99
|
-
- doc
|
100
100
|
- doc/sys-admin-unix.txt
|
101
101
|
- doc/sys-admin-windows.txt
|
102
|
-
- examples
|
103
102
|
- examples/example_groups.rb
|
104
103
|
- examples/example_users.rb
|
105
|
-
- lib
|
106
|
-
- lib/bsd
|
107
|
-
- lib/bsd/sys
|
108
104
|
- lib/bsd/sys/admin.rb
|
109
|
-
- lib/darwin
|
110
|
-
- lib/darwin/sys
|
111
105
|
- lib/darwin/sys/admin.rb
|
112
|
-
- lib/linux
|
113
|
-
- lib/linux/sys
|
114
106
|
- lib/linux/sys/admin.rb
|
115
|
-
- lib/sunos
|
116
|
-
- lib/sunos/sys
|
117
107
|
- lib/sunos/sys/admin.rb
|
118
|
-
- lib/sys
|
119
|
-
- lib/sys/admin
|
108
|
+
- lib/sys-admin.rb
|
109
|
+
- lib/sys/admin.rb
|
120
110
|
- lib/sys/admin/common.rb
|
121
111
|
- lib/sys/admin/custom.rb
|
122
|
-
- lib/sys/admin.rb
|
123
|
-
- lib/sys-admin.rb
|
124
|
-
- lib/unix
|
125
|
-
- lib/unix/sys
|
126
112
|
- lib/unix/sys/admin.rb
|
127
|
-
- lib/windows
|
128
|
-
- lib/windows/sys
|
129
113
|
- lib/windows/sys/admin.rb
|
130
|
-
- MANIFEST
|
131
|
-
- Rakefile
|
132
|
-
- README
|
133
114
|
- sys-admin.gemspec
|
134
|
-
- test
|
135
115
|
- test/test_sys_admin.rb
|
136
116
|
- test/test_sys_admin_unix.rb
|
137
117
|
- test/test_sys_admin_windows.rb
|
138
|
-
homepage: http://www.github.com/djberg96/
|
118
|
+
homepage: http://www.github.com/djberg96/sys-admin
|
139
119
|
licenses:
|
140
|
-
- Apache
|
120
|
+
- Apache-2.0
|
141
121
|
metadata:
|
142
122
|
homepage_uri: https://github.com/djberg96/sys-admin
|
143
123
|
bug_tracker_uri: https://github.com/djberg96/sys-admin/issues
|
144
|
-
changelog_uri: https://github.com/djberg96/sys-admin/blob/ffi/CHANGES
|
124
|
+
changelog_uri: https://github.com/djberg96/sys-admin/blob/ffi/CHANGES.md
|
145
125
|
documentation_uri: https://github.com/djberg96/sys-admin/wiki
|
146
126
|
source_code_uri: https://github.com/djberg96/sys-admin
|
147
127
|
wiki_uri: https://github.com/djberg96/sys-admin/wiki
|
148
|
-
post_install_message:
|
128
|
+
post_install_message:
|
149
129
|
rdoc_options: []
|
150
130
|
require_paths:
|
151
131
|
- lib
|
@@ -160,9 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
140
|
- !ruby/object:Gem::Version
|
161
141
|
version: '0'
|
162
142
|
requirements: []
|
163
|
-
|
164
|
-
|
165
|
-
signing_key:
|
143
|
+
rubygems_version: 3.2.15
|
144
|
+
signing_key:
|
166
145
|
specification_version: 4
|
167
146
|
summary: A unified, cross platform replacement for the "etc" library.
|
168
147
|
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
|