sys-admin 1.4.0-mswin32 → 1.4.1-mswin32

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.
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ == 1.4.1 - 21-Mar-2007
2
+ * Bug fix for OS X. Thanks go to an anonymous user for the spot.
3
+ * Added a Rakefile. Building, testing and installing should now use the
4
+ Rake tasks (for non-gem installs).
5
+ * Much more inline documentation, especially for User and Group attributes.
6
+
1
7
  == 1.4.0 - 20-Jan-2007
2
8
  * Added the following methods: add_local_user, config_local_user,
3
9
  delete_local_user, add_global_group, config_global_group, and
data/MANIFEST CHANGED
@@ -2,6 +2,7 @@
2
2
  * sys-admin.gemspec
3
3
  * CHANGES
4
4
  * MANIFEST
5
+ * Rakefile
5
6
  * README
6
7
 
7
8
  * examples/groups.rb
data/README CHANGED
@@ -3,15 +3,8 @@
3
3
  Etc module.
4
4
 
5
5
  == Installation
6
- === Windows
7
- ruby tc_admin.rb # optional (in the 'test' directory)
8
- ruby install.rb
9
-
10
- === Unix
11
- ruby extconf.rb (in the 'ext' directory)
12
- make
13
- ruby tc_admin.rb # optional (in the 'test' directory)
14
- make install
6
+ rake test (optional)
7
+ rake install
15
8
 
16
9
  == Synopsis
17
10
  require 'sys/admin'
data/Rakefile ADDED
@@ -0,0 +1,53 @@
1
+ require 'rake'
2
+ require 'rake/clean'
3
+ require 'rake/testtask'
4
+
5
+ desc "Clean the build files for the sys-admin source for UNIX systems"
6
+ task :clean do
7
+ Dir.chdir('ext') do
8
+ unless RUBY_PLATFORM.match('mswin')
9
+ FileUtils.rm_rf('sys') if File.exists?('sys')
10
+ build_file = 'admin.' + Config::CONFIG['DLEXT']
11
+ sh 'make distclean' if File.exists?(build_file)
12
+ end
13
+ end
14
+ end
15
+
16
+ desc "Build the sys-admin package on UNIX systems (but don't install it)"
17
+ task :build => [:clean] do
18
+ Dir.chdir('ext') do
19
+ unless RUBY_PLATFORM.match('mswin')
20
+ ruby 'extconf.rb'
21
+ sh 'make'
22
+ build_file = 'admin.' + Config::CONFIG['DLEXT']
23
+ Dir.mkdir('sys') unless File.exists?('sys')
24
+ FileUtils.cp(build_file, 'sys')
25
+ end
26
+ end
27
+ end
28
+
29
+ if RUBY_PLATFORM.match('mswin')
30
+ desc "Install the sys-admin package"
31
+ task :install do
32
+ sh 'ruby install.rb'
33
+ end
34
+ else
35
+ desc "Install the sys-admin package"
36
+ task :install => [:build] do
37
+ Dir.chdir('ext') do
38
+ sh 'make install'
39
+ end
40
+ end
41
+ end
42
+
43
+ desc "Run the test suite"
44
+ Rake::TestTask.new("test") do |t|
45
+ if RUBY_PLATFORM.match('mswin')
46
+ t.libs << 'lib'
47
+ else
48
+ task :test => :build
49
+ t.libs << 'ext'
50
+ t.libs.delete('lib')
51
+ end
52
+ t.test_files = FileList['test/tc_admin.rb']
53
+ end
data/lib/sys/admin.rb CHANGED
@@ -284,7 +284,7 @@ module Sys
284
284
  end
285
285
 
286
286
  class Admin
287
- VERSION = '1.4.0'
287
+ VERSION = '1.4.1'
288
288
 
289
289
  SidTypeUser = 1
290
290
  SidTypeGroup = 2
data/sys-admin.gemspec CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
4
  gem.name = 'sys-admin'
5
- gem.version = '1.4.0'
5
+ gem.version = '1.4.1'
6
6
  gem.author = 'Daniel J. Berger'
7
7
  gem.email = 'djberg96@gmail.com'
8
8
  gem.homepage = 'http://www.rubyforge.org/projects/sysutils'
data/test/tc_unix.rb CHANGED
@@ -1,18 +1,9 @@
1
1
  ###############################################################################
2
2
  # tc_unix.rb
3
3
  #
4
- # Test suite for the Unix version of sys-admin.
4
+ # Test suite for the Unix version of sys-admin. This test should be run
5
+ # via the 'rake test' task.
5
6
  ###############################################################################
6
- base = File.basename(Dir.pwd)
7
-
8
- if base == "test" || base =~ /sys-admin.*/
9
- require "fileutils"
10
- Dir.chdir("..") if base == "test"
11
- Dir.mkdir("sys") unless File.exists?("sys")
12
- FileUtils.cp("ext/admin.so", "sys") if File.exists?("ext/admin.so")
13
- $LOAD_PATH.unshift(Dir.pwd)
14
- end
15
-
16
7
  require 'test/unit'
17
8
  require 'sys/admin'
18
9
  include Sys
@@ -26,7 +17,7 @@ class TC_Sys_Admin_Unix < Test::Unit::TestCase
26
17
  end
27
18
 
28
19
  def test_version
29
- assert_equal("1.4.0", Admin::VERSION)
20
+ assert_equal("1.4.1", Admin::VERSION)
30
21
  end
31
22
 
32
23
  def test_get_login
data/test/tc_windows.rb CHANGED
@@ -4,18 +4,9 @@
4
4
  # Test suite for the Win32 version of sys-admin. Note that some of the tests
5
5
  # are numbered to ensure a certain order. That way I can add test users
6
6
  # before configuring or deleting them.
7
+ #
8
+ # It is assumed that this test will be run via the 'rake test' task.
7
9
  ###############################################################################
8
- base = File.basename(Dir.pwd)
9
-
10
- if base == "test" || base =~ /sys-admin.*/
11
- require "ftools"
12
- Dir.chdir("..") if base == "test"
13
- Dir.mkdir("sys") unless File.exists?("sys")
14
- File.copy("lib/sys/admin.rb", "sys/admin.rb")
15
- $LOAD_PATH.unshift(Dir.pwd)
16
- Dir.chdir("test") rescue nil
17
- end
18
-
19
10
  require "test/unit"
20
11
  require "sys/admin"
21
12
  require "socket"
@@ -33,7 +24,7 @@ class TC_Sys_Admin_Win32 < Test::Unit::TestCase
33
24
  end
34
25
 
35
26
  def test_version
36
- assert_equal("1.4.0", Admin::VERSION)
27
+ assert_equal("1.4.1", Admin::VERSION)
37
28
  end
38
29
 
39
30
  def test_01_add_local_user
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
2
+ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: sys-admin
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.4.0
7
- date: 2007-01-20 00:00:00 -07:00
6
+ version: 1.4.1
7
+ date: 2007-03-22 00:00:00 -06:00
8
8
  summary: A unified, cross platform replacement for the "etc" package.
9
9
  require_paths:
10
10
  - lib
@@ -40,6 +40,7 @@ files:
40
40
  - install.rb
41
41
  - lib
42
42
  - MANIFEST
43
+ - Rakefile
43
44
  - README
44
45
  - sys-admin.gemspec
45
46
  - test