sys-admin 1.7.0 → 1.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 99eafdabb409a5f068337908f24ff54f7ec71c1b
4
- data.tar.gz: 4596acd0951f39bdb26a8a9c24319a35a5f52ecc
2
+ SHA256:
3
+ metadata.gz: fc5a6e4241a2079b4b053afc23e964478d97dabbe8534b89dff5a1e30eb70021
4
+ data.tar.gz: f5576fe04be229bc4a1e9a207fae244dd9385ae599ac1a41fcbb5f689e0ddfb8
5
5
  SHA512:
6
- metadata.gz: 84af367e19c13a4e1ee0e1f1cc716f6fdb744d2d870207b1848333649d44a2ced3dd302acab2c5939c38343a50c74005cf89fba038326408914d69349d10aaba
7
- data.tar.gz: 6a5c585230206ca94a8350a26c12ed0a0bef38e3de96dc2d62fd0873bfe4a8583c7945d1f70e3670324659aa51e0c651e4a5eb5a38be692780de25aa9de37b8e
6
+ metadata.gz: 0abb1505ea82e7bb2be19ad4f81167347bf5dc838c40a9f306a024c0316519535e5b19ca2be1517b97b83e0873e76601b6462c15e8ec73c0fe01cc6d134c7023
7
+ data.tar.gz: 7ed678a7746cb6217443accf91f140ea37f4c0aa14cc49392334264efa418e5f66772fb6d01956daa1f37cf342f79ca0076c69b9226c1ce23d86f11c5c0416c8
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGES CHANGED
@@ -1,168 +1,173 @@
1
- == 1.7.0 - 21-Feb-2018
2
- * Changed the license to Apache 2.0.
3
- * VERSION constant is now frozen.
4
- * Ignore dependency warnings in gem:create task.
5
- * Minor README updates.
6
- * Updated cert.
7
-
8
- == 1.6.4 - 6-Sep-2015
9
- * Added a sys-admin.rb file for convenience.
10
- * Set VERSION in a single place.
11
- * Assume Rubygems 2.x for Rakefile tasks.
12
- * This gem is now signed.
13
-
14
- == 1.6.3 - 8-Mar-2014
15
- * The Admin#get_group method now handles groups with very large numbers
16
- of members more robustly.
17
-
18
- == 1.6.2 - 11-Feb-2014
19
- * The User#gid method is now supported on MS Windows. It returns the user's
20
- primary group ID.
21
-
22
- == 1.6.1 - 24-Jan-2014
23
- * Added the Admin.add_group_member and Admin.remove_group member methods. These
24
- let you add a user to a specific group. Thanks go to Alexey Kolyanov for the
25
- idea and the code.
26
- * Modified the Admin.configure_user method so that you don't need to know the
27
- old password. Just pass a single string argument for the new password.
28
- * Fixed a potential encoding issue for the Admin.get_login method on JRuby.
29
- * Updated the gem:create task in the Rakefile.
30
- * Added rake as a development dependency.
31
-
32
- == 1.6.0 - 5-Jan-2013
33
- * Converted code to use FFI. This mostly only affects the unix flavors.
34
- * The Admin.users and Admin.groups methods no longer accept a block.
35
- * Some test suite updates.
36
- * Because all code is now pure Ruby, there is longer any need for two
37
- separate gems. There is now a single, unified gem that works on all
38
- supported platforms.
39
-
40
- == 1.5.6 - 30-Jul-2011
41
- * Fixed issue for non-gnu platforms where it would use the wrong function
42
- prototype because the Ruby core team took it upon themselves to explicitly
43
- defined _GNU_SOURCE in config.h in 1.8.7 and later for reasons that baffle me.
44
- * Some tests on Windows are now skipped unless run with elevated security.
45
-
46
- == 1.5.5 - 5-Jul-2011
47
- * Modified lastlog handling, and ignore getpwent_r and getgrent_r, on AIX.
48
- Thanks go to Rick Ohnemus for the spot and patches.
49
- * Explicitly set spec.cpu on Windows to 'universal' in the gem creation task.
50
- * Fixed a bug in the User.get_login and User.get_group methods where the query
51
- being generated was incorrect if no options were passed. Thanks go to
52
- Matthew Brown for the spot.
53
-
54
- == 1.5.4 - 7-Oct-2010
55
- * Prefer the getlastlogx() function over lastlog() where supported.
56
-
57
- == 1.5.3 - 6-Oct-2010
58
- * Refactored the Rakefile. The old installation tasks have been replaced
59
- with gem build and install tasks. In addition, the platform handling has
60
- been updated for MS Windows.
61
- * Portions of the gemspec have been moved into the Rakefile gem tasks.
62
- * Deploying the mingw gem by default for MS Windows now.
63
-
64
- == 1.5.2 - 2-Aug-2009
65
- * Now compatible with Ruby 1.9.x.
66
- * Added test-unit as a development dependency.
67
-
68
- == 1.5.1 - 23-Jul-2009
69
- * Added the User#dir attribute. This attribute contains a user's home
70
- directory if set, or nil if it isn't.
71
- * User objects returned by the Admin.users method now include the uid.
72
- Previously only the Admin.get_user method set it.
73
- * Added win32-security as a dependency.
74
- * Changed license to Artistic 2.0.
75
-
76
- == 1.5.0 - 29-Mar-2009
77
- * INTERFACE CHANGE (WINDOWS ONLY): The interface for MS Windows has undergone
78
- a radical change. Most methods now accept a hash of options that are
79
- passed directly to the underlying WMI class. Please see the documentation
80
- for details.
81
- * Now works on various BSD flavors.
82
- * Added the User#groups method. This returns an array of groups that the
83
- user belongs to. Suggestion inspired by Gonzalo Garramuno.
84
- * Added the Group#members method. The returns an array of users that the
85
- group contains.
86
- * Changed User#class to User#access_class for UNIX flavors to avoid
87
- conflicts with the Ruby core Object method.
88
- * Added more tests and renamed the test files.
89
- * Removed an unnecessary function call where a platform might try to
90
- get lastlog information even if the lastlog.h or utmp.h headers couldn't
91
- be found.
92
-
93
- == 1.4.4 - 19-Nov-2008
94
- * Added the User#uid method for MS Windows (which is just the user's relative
95
- identifier).
96
- * Now requires test-unit 2.x.
97
- * Some updates to the test suite to take advantage of test-unit 2.x features.
98
- * Some minor gemspec tweaks.
99
-
100
- == 1.4.3 - 2-Mar-2008
101
- * The block form of Admin.users now properly ensures that endpwent() is
102
- called. Likewise, the block form of Admin.groups now properly ensures
103
- that endgrent() is called. This would only have been an issue if you
104
- broke out of the block before it terminated.
105
- * The AdminError class is now Admin::Error.
106
- * Some internal directory layout changes.
107
-
108
- == 1.4.2 - 26-Jun-2007
109
- * Fixed a bug in the Admin.get_login method where it would return junk
110
- if the underlying getlogin() function failed (Unix). Thanks go to Gonzalo
111
- Garramuno for the spot. This bug also resulted in some refactoring of the
112
- underlying C code.
113
- * Removed the install.rb file. The logic in that file has been moved directly
114
- into the Rakefile.
115
-
116
- == 1.4.1 - 21-Mar-2007
117
- * Bug fix for OS X. Thanks go to an anonymous user for the spot.
118
- * Added a Rakefile. Building, testing and installing should now use the
119
- Rake tasks (for non-gem installs).
120
- * Much more inline documentation, especially for User and Group attributes.
121
-
122
- == 1.4.0 - 20-Jan-2007
123
- * Added the following methods: add_local_user, config_local_user,
124
- delete_local_user, add_global_group, config_global_group, and
125
- delete_global_group. MS Windows only at the moment.
126
- * Added corresponding tests.
127
- * Added much more inline documentation.
128
- * Major refactoring of the get_lastlog_info helper function in admin.h. This
129
- fixed a major bug in some flavors of Linux where the Admin.users method
130
- could go into an infinite loop. It also fixed some minor bugs where console
131
- and host values were sometimes filled with junk characters.
132
- * Added the User#change attribute, and a check for the pw_change struct member
133
- in the extconf.rb file.
134
- * The User#expire attribute is now handled as a Time object instead of an
135
- integer.
136
- * Renamed tc_win32.rb to tc_windows.rb
137
-
138
- == 1.3.1 - 29-Jun-2005
139
- * Fixed a bug where the inability to read the lastlog file caused an error.
140
- From now on that error is ignored, and the lastlog attributes of the User
141
- object are set to nil.
142
- * Added a beta version of Admin.delete_user (Windows only).
143
-
144
- == 1.3.0 - 3-Jun-2005
145
- * Bug fixes for Linux.
146
- * Removed the version.h file - no longer needed since the Win32 version is
147
- pure Ruby.
148
-
149
- == 1.2.0 - 30-Apr-2005
150
- * Replaced the Win32 version with a pure Ruby version that uses Win32API and
151
- win32ole + WMI.
152
- * The LocalGroup class no longer exists in the Win32 version. Instead, it is
153
- now an attribute of a Group object. The issue was forced by WMI.
154
- * The default for users and groups on Win32 systems is now local rather than
155
- global. See the documentation for why you probably don't want to iterate
156
- over global accounts.
157
- * Corresponding doc changes and test suite changes.
158
-
159
- == 1.1.0 - 1-Apr-2005
160
- * Fixed bug where a segfault could occur when trying to retrieve a user or
161
- group by an ID that didn't exist (Unix).
162
- * Added tests for intentional failures.
163
- * Added lastlog information tothe User class (Unix).
164
- * Modified the way User objects are created internally (Unix).
165
- * Fixed a bug in the User#shell attribute (Unix).
166
-
167
- == 1.0.0 - 25-Mar-2005
168
- * Initial release
1
+ == 1.7.1 - 19-Mar-2018
2
+ * Fixed deprecation warnings in tests.
3
+ * Added gemspec metadata.
4
+ * Updated cert again, this one should last 10 years.
5
+
6
+ == 1.7.0 - 21-Feb-2018
7
+ * Changed the license to Apache 2.0.
8
+ * VERSION constant is now frozen.
9
+ * Ignore dependency warnings in gem:create task.
10
+ * Minor README updates.
11
+ * Updated cert.
12
+
13
+ == 1.6.4 - 6-Sep-2015
14
+ * Added a sys-admin.rb file for convenience.
15
+ * Set VERSION in a single place.
16
+ * Assume Rubygems 2.x for Rakefile tasks.
17
+ * This gem is now signed.
18
+
19
+ == 1.6.3 - 8-Mar-2014
20
+ * The Admin#get_group method now handles groups with very large numbers
21
+ of members more robustly.
22
+
23
+ == 1.6.2 - 11-Feb-2014
24
+ * The User#gid method is now supported on MS Windows. It returns the user's
25
+ primary group ID.
26
+
27
+ == 1.6.1 - 24-Jan-2014
28
+ * Added the Admin.add_group_member and Admin.remove_group member methods. These
29
+ let you add a user to a specific group. Thanks go to Alexey Kolyanov for the
30
+ idea and the code.
31
+ * Modified the Admin.configure_user method so that you don't need to know the
32
+ old password. Just pass a single string argument for the new password.
33
+ * Fixed a potential encoding issue for the Admin.get_login method on JRuby.
34
+ * Updated the gem:create task in the Rakefile.
35
+ * Added rake as a development dependency.
36
+
37
+ == 1.6.0 - 5-Jan-2013
38
+ * Converted code to use FFI. This mostly only affects the unix flavors.
39
+ * The Admin.users and Admin.groups methods no longer accept a block.
40
+ * Some test suite updates.
41
+ * Because all code is now pure Ruby, there is longer any need for two
42
+ separate gems. There is now a single, unified gem that works on all
43
+ supported platforms.
44
+
45
+ == 1.5.6 - 30-Jul-2011
46
+ * Fixed issue for non-gnu platforms where it would use the wrong function
47
+ prototype because the Ruby core team took it upon themselves to explicitly
48
+ defined _GNU_SOURCE in config.h in 1.8.7 and later for reasons that baffle me.
49
+ * Some tests on Windows are now skipped unless run with elevated security.
50
+
51
+ == 1.5.5 - 5-Jul-2011
52
+ * Modified lastlog handling, and ignore getpwent_r and getgrent_r, on AIX.
53
+ Thanks go to Rick Ohnemus for the spot and patches.
54
+ * Explicitly set spec.cpu on Windows to 'universal' in the gem creation task.
55
+ * Fixed a bug in the User.get_login and User.get_group methods where the query
56
+ being generated was incorrect if no options were passed. Thanks go to
57
+ Matthew Brown for the spot.
58
+
59
+ == 1.5.4 - 7-Oct-2010
60
+ * Prefer the getlastlogx() function over lastlog() where supported.
61
+
62
+ == 1.5.3 - 6-Oct-2010
63
+ * Refactored the Rakefile. The old installation tasks have been replaced
64
+ with gem build and install tasks. In addition, the platform handling has
65
+ been updated for MS Windows.
66
+ * Portions of the gemspec have been moved into the Rakefile gem tasks.
67
+ * Deploying the mingw gem by default for MS Windows now.
68
+
69
+ == 1.5.2 - 2-Aug-2009
70
+ * Now compatible with Ruby 1.9.x.
71
+ * Added test-unit as a development dependency.
72
+
73
+ == 1.5.1 - 23-Jul-2009
74
+ * Added the User#dir attribute. This attribute contains a user's home
75
+ directory if set, or nil if it isn't.
76
+ * User objects returned by the Admin.users method now include the uid.
77
+ Previously only the Admin.get_user method set it.
78
+ * Added win32-security as a dependency.
79
+ * Changed license to Artistic 2.0.
80
+
81
+ == 1.5.0 - 29-Mar-2009
82
+ * INTERFACE CHANGE (WINDOWS ONLY): The interface for MS Windows has undergone
83
+ a radical change. Most methods now accept a hash of options that are
84
+ passed directly to the underlying WMI class. Please see the documentation
85
+ for details.
86
+ * Now works on various BSD flavors.
87
+ * Added the User#groups method. This returns an array of groups that the
88
+ user belongs to. Suggestion inspired by Gonzalo Garramuno.
89
+ * Added the Group#members method. The returns an array of users that the
90
+ group contains.
91
+ * Changed User#class to User#access_class for UNIX flavors to avoid
92
+ conflicts with the Ruby core Object method.
93
+ * Added more tests and renamed the test files.
94
+ * Removed an unnecessary function call where a platform might try to
95
+ get lastlog information even if the lastlog.h or utmp.h headers couldn't
96
+ be found.
97
+
98
+ == 1.4.4 - 19-Nov-2008
99
+ * Added the User#uid method for MS Windows (which is just the user's relative
100
+ identifier).
101
+ * Now requires test-unit 2.x.
102
+ * Some updates to the test suite to take advantage of test-unit 2.x features.
103
+ * Some minor gemspec tweaks.
104
+
105
+ == 1.4.3 - 2-Mar-2008
106
+ * The block form of Admin.users now properly ensures that endpwent() is
107
+ called. Likewise, the block form of Admin.groups now properly ensures
108
+ that endgrent() is called. This would only have been an issue if you
109
+ broke out of the block before it terminated.
110
+ * The AdminError class is now Admin::Error.
111
+ * Some internal directory layout changes.
112
+
113
+ == 1.4.2 - 26-Jun-2007
114
+ * Fixed a bug in the Admin.get_login method where it would return junk
115
+ if the underlying getlogin() function failed (Unix). Thanks go to Gonzalo
116
+ Garramuno for the spot. This bug also resulted in some refactoring of the
117
+ underlying C code.
118
+ * Removed the install.rb file. The logic in that file has been moved directly
119
+ into the Rakefile.
120
+
121
+ == 1.4.1 - 21-Mar-2007
122
+ * Bug fix for OS X. Thanks go to an anonymous user for the spot.
123
+ * Added a Rakefile. Building, testing and installing should now use the
124
+ Rake tasks (for non-gem installs).
125
+ * Much more inline documentation, especially for User and Group attributes.
126
+
127
+ == 1.4.0 - 20-Jan-2007
128
+ * Added the following methods: add_local_user, config_local_user,
129
+ delete_local_user, add_global_group, config_global_group, and
130
+ delete_global_group. MS Windows only at the moment.
131
+ * Added corresponding tests.
132
+ * Added much more inline documentation.
133
+ * Major refactoring of the get_lastlog_info helper function in admin.h. This
134
+ fixed a major bug in some flavors of Linux where the Admin.users method
135
+ could go into an infinite loop. It also fixed some minor bugs where console
136
+ and host values were sometimes filled with junk characters.
137
+ * Added the User#change attribute, and a check for the pw_change struct member
138
+ in the extconf.rb file.
139
+ * The User#expire attribute is now handled as a Time object instead of an
140
+ integer.
141
+ * Renamed tc_win32.rb to tc_windows.rb
142
+
143
+ == 1.3.1 - 29-Jun-2005
144
+ * Fixed a bug where the inability to read the lastlog file caused an error.
145
+ From now on that error is ignored, and the lastlog attributes of the User
146
+ object are set to nil.
147
+ * Added a beta version of Admin.delete_user (Windows only).
148
+
149
+ == 1.3.0 - 3-Jun-2005
150
+ * Bug fixes for Linux.
151
+ * Removed the version.h file - no longer needed since the Win32 version is
152
+ pure Ruby.
153
+
154
+ == 1.2.0 - 30-Apr-2005
155
+ * Replaced the Win32 version with a pure Ruby version that uses Win32API and
156
+ win32ole + WMI.
157
+ * The LocalGroup class no longer exists in the Win32 version. Instead, it is
158
+ now an attribute of a Group object. The issue was forced by WMI.
159
+ * The default for users and groups on Win32 systems is now local rather than
160
+ global. See the documentation for why you probably don't want to iterate
161
+ over global accounts.
162
+ * Corresponding doc changes and test suite changes.
163
+
164
+ == 1.1.0 - 1-Apr-2005
165
+ * Fixed bug where a segfault could occur when trying to retrieve a user or
166
+ group by an ID that didn't exist (Unix).
167
+ * Added tests for intentional failures.
168
+ * Added lastlog information tothe User class (Unix).
169
+ * Modified the way User objects are created internally (Unix).
170
+ * Fixed a bug in the User#shell attribute (Unix).
171
+
172
+ == 1.0.0 - 25-Mar-2005
173
+ * Initial release
data/MANIFEST CHANGED
@@ -1,18 +1,18 @@
1
- * sys-admin.gemspec
2
- * CHANGES
3
- * MANIFEST
4
- * Rakefile
5
- * README
6
- * certs/djberg96_pub.pem
7
- * examples/groups.rb
8
- * examples/users.rb
9
- * lib/sys/admin.rb
10
- * lib/darwin/sys/admin.rb
11
- * lib/linux/sys/admin.rb
12
- * lib/bsd/sys/admin.rb
13
- * lib/sunos/sys/admin.rb
14
- * lib/sys/admin/common.rb
15
- * lib/sys/admin/custom.rb
16
- * test/test_sys_admin.rb
17
- * test/test_sys_admin_unix.rb
18
- * test/test_sys_admin_windows.rb
1
+ * sys-admin.gemspec
2
+ * CHANGES
3
+ * MANIFEST
4
+ * Rakefile
5
+ * README
6
+ * certs/djberg96_pub.pem
7
+ * examples/groups.rb
8
+ * examples/users.rb
9
+ * lib/sys/admin.rb
10
+ * lib/darwin/sys/admin.rb
11
+ * lib/linux/sys/admin.rb
12
+ * lib/bsd/sys/admin.rb
13
+ * lib/sunos/sys/admin.rb
14
+ * lib/sys/admin/common.rb
15
+ * lib/sys/admin/custom.rb
16
+ * test/test_sys_admin.rb
17
+ * test/test_sys_admin_unix.rb
18
+ * test/test_sys_admin_windows.rb
data/README CHANGED
@@ -1,148 +1,148 @@
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
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