sys-admin 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,11 @@
1
+ == 1.5.1 - 23-Jul-2009
2
+ * Added the User#dir attribute. This attribute contains a user's home
3
+ directory if set, or nil if it isn't.
4
+ * User objects returned by the Admin.users method now include the uid.
5
+ Previously only the Admin.get_user method set it.
6
+ * Added win32-security as a dependency.
7
+ * Changed license to Artistic 2.0.
8
+
1
9
  == 1.5.0 - 29-Mar-2009
2
10
  * INTERFACE CHANGE (WINDOWS ONLY): The interface for MS Windows has undergone
3
11
  a radical change. Most methods now accept a hash of options that are
data/MANIFEST CHANGED
@@ -9,6 +9,6 @@
9
9
  * ext/admin.h
10
10
  * ext/extconf.rb
11
11
  * lib/sys/admin.rb
12
- * test/tc_admin.rb
13
- * test/tc_unix.rb
14
- * test/tc_windows.rb
12
+ * test/test_sys_admin.rb
13
+ * test/test_sys_admin_unix.rb
14
+ * test/test_sys_admin_windows.rb
data/README CHANGED
@@ -151,7 +151,7 @@ Admin::Error < StandardError
151
151
  page at http://www.rubyforge.org/projects/sysutils.
152
152
 
153
153
  == License
154
- Ruby's
154
+ Artistic 2.0
155
155
 
156
156
  == Copyright
157
157
  (C) 2005-2009, Daniel J. Berger
@@ -145,10 +145,10 @@ User#uid
145
145
  website at http://www.rubyforge.org/projects/sysutils.
146
146
 
147
147
  == License
148
- Ruby's
148
+ Artistic 2.0
149
149
 
150
150
  == Copyright
151
- Copyright 2002-2008, Daniel J. Berger
151
+ Copyright 2002-2009, Daniel J. Berger
152
152
 
153
153
  All Rights Reserved. This module is free software. It may be used,
154
154
  redistributed and/or modified under the same terms as Ruby itself.
@@ -226,6 +226,12 @@ User#description
226
226
 
227
227
  User#description=
228
228
  Sets the description of the account.
229
+
230
+ User#dir
231
+ Returns the user's home directory.
232
+
233
+ User#dir=
234
+ Sets the user's home directory.
229
235
 
230
236
  User#disabled?
231
237
  Returns whether or not the account is disabled.
@@ -311,10 +317,10 @@ User#status
311
317
  website at http://www.rubyforge.org/projects/sysutils.
312
318
 
313
319
  == License
314
- Ruby's
320
+ Artistic 2.0
315
321
 
316
322
  == Copyright
317
- Copyright 2002-2008, Daniel J. Berger
323
+ Copyright 2002-2009, Daniel J. Berger
318
324
 
319
325
  All Rights Reserved. This module is free software. It may be used,
320
326
  redistributed and/or modified under the same terms as Ruby itself.
data/ext/sys/admin.c CHANGED
@@ -4,7 +4,7 @@
4
4
  /*
5
5
  * call-seq:
6
6
  * User.new
7
- * User.new{ |user| ... }
7
+ * User.new{ |user| ... }
8
8
  *
9
9
  * Creates and returns a User object, which encapsulates the information
10
10
  * typically found within an /etc/passwd entry, i.e. a struct passwd.
@@ -21,11 +21,11 @@ static VALUE user_init(VALUE self){
21
21
  /*
22
22
  * call-seq:
23
23
  * Group.new
24
- * Group.new{ |user| ... }
24
+ * Group.new{ |user| ... }
25
25
  *
26
26
  * Creates and returns a Group object, which encapsulates the information
27
27
  * typically found within an /etc/group entry, i.e. a struct group.
28
- *
28
+ *
29
29
  * If a block is provided, yields the object back to the block.
30
30
  */
31
31
  static VALUE group_init(VALUE self){
@@ -100,7 +100,7 @@ static VALUE admin_get_login(VALUE klass){
100
100
  /* call-seq:
101
101
  * Admin.get_user(name)
102
102
  * Admin.get_user(uid)
103
- *
103
+ *
104
104
  * Returns a User object for the given +name+ or +uid+. Raises an Admin::Error
105
105
  * if a user cannot be found for that name or user ID.
106
106
  */
@@ -118,13 +118,13 @@ static VALUE admin_get_user(VALUE klass, VALUE v_value){
118
118
  /* call-seq:
119
119
  * Admin.get_group(name)
120
120
  * Admin.get_group(gid)
121
- *
121
+ *
122
122
  * Returns a Group object for the given +name+ or +gid+. Raises an Admin::Error
123
123
  * if a group cannot be found for that name or GID.
124
124
  *
125
125
  *--
126
126
  * Developer's Note:
127
- *
127
+ *
128
128
  * I generally oppose method overloading like this, but for this method, and
129
129
  * for only two types, I can live with it for the added convenience it
130
130
  * provides.
@@ -235,7 +235,7 @@ static VALUE admin_users_body(VALUE klass){
235
235
  else
236
236
  rb_ary_push(v_array, get_user(pwd_p));
237
237
  }
238
- #else
238
+ #else
239
239
  while(getpwent_r(&pwd, buf, USER_BUF_SIZE) != NULL){
240
240
  if(rb_block_given_p())
241
241
  rb_yield(get_user(&pwd));
@@ -404,6 +404,6 @@ void Init_admin(){
404
404
 
405
405
  /* Constants */
406
406
 
407
- /* 1.5.0: The version of this library */
407
+ /* 1.5.1: The version of this library */
408
408
  rb_define_const(cAdmin, "VERSION", rb_str_new2(SYS_ADMIN_VERSION));
409
409
  }
data/ext/sys/admin.h CHANGED
@@ -8,7 +8,7 @@
8
8
  #include <errno.h>
9
9
  #include <string.h>
10
10
 
11
- #define SYS_ADMIN_VERSION "1.5.0"
11
+ #define SYS_ADMIN_VERSION "1.5.1"
12
12
 
13
13
  #if defined(__MACH__) || defined(__APPLE__)
14
14
  #define __BSD__
@@ -16,6 +16,6 @@ end
16
16
 
17
17
  class TC_Sys_Admin_All < Test::Unit::TestCase
18
18
  def test_version
19
- assert_equal('1.5.0', Sys::Admin::VERSION)
19
+ assert_equal('1.5.1', Sys::Admin::VERSION)
20
20
  end
21
21
  end
@@ -256,6 +256,16 @@ class TC_Sys_Admin_Win32 < Test::Unit::TestCase
256
256
  assert_respond_to(@user, :uid=)
257
257
  end
258
258
 
259
+ def test_user_dir_basic
260
+ assert_respond_to(@user, :dir)
261
+ assert_respond_to(@user, :dir=)
262
+ end
263
+
264
+ def test_user_dir
265
+ assert_nothing_raised{ Admin.get_user(@user_name, :localaccount => true) }
266
+ assert_kind_of(String, @user_name.dir)
267
+ end
268
+
259
269
  # Group class
260
270
 
261
271
  def test_group_instance_caption
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-29 00:00:00 -06:00
12
+ date: 2009-07-23 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: A unified, cross platform replacement for the "etc" library.
16
+ description: " The sys-admin library is a unified, cross platform replacement for the\n 'etc' library that ships as part of the Ruby standard library. It\n provides a common interface for all platforms, including MS Windows. In\n addition, it provides an interface for adding, deleting and configuring\n users on MS Windows.\n"
17
17
  email: djberg96@gmail.com
18
18
  executables: []
19
19
 
@@ -40,8 +40,8 @@ files:
40
40
  - ext/sys/admin.h
41
41
  has_rdoc: true
42
42
  homepage: http://www.rubyforge.org/projects/sysutils
43
- licenses: []
44
-
43
+ licenses:
44
+ - Artistic 2.0
45
45
  post_install_message:
46
46
  rdoc_options: []
47
47
 
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  requirements: []
63
63
 
64
64
  rubyforge_project: sysutils
65
- rubygems_version: 1.3.1.2403
65
+ rubygems_version: 1.3.4
66
66
  signing_key:
67
67
  specification_version: 3
68
68
  summary: A unified, cross platform replacement for the "etc" library.