windows-pr 0.7.0 → 0.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.
@@ -3,75 +3,68 @@
3
3
  #
4
4
  # Test case for the windows/synchronize package.
5
5
  ##################################################################
6
- base = File.basename(Dir.pwd)
7
- if base == 'test' || base =~ /windows-pr/
8
- Dir.chdir '..' if base == 'test'
9
- $LOAD_PATH.unshift Dir.pwd + '/lib'
10
- Dir.chdir 'test' rescue nil
11
- end
12
-
13
6
  require "windows/synchronize"
14
7
  require "test/unit"
15
8
 
16
- class Foo
9
+ class SynchFoo
17
10
  include Windows::Synchronize
18
11
  end
19
12
 
20
13
  class TC_Windows_Synchronize < Test::Unit::TestCase
21
14
  def setup
22
15
  @handle = (0.chr * 16).unpack('LLLL')
23
- @foo = Foo.new
16
+ @foo = SynchFoo.new
24
17
  end
25
18
 
26
19
  def test_numeric_constants
27
- assert_not_nil(Foo::INFINITE)
28
- assert_not_nil(Foo::WAIT_OBJECT_0)
29
- assert_not_nil(Foo::WAIT_TIMEOUT)
30
- assert_not_nil(Foo::WAIT_ABANDONED)
31
- assert_not_nil(Foo::WAIT_FAILED)
32
- assert_not_nil(Foo::QS_ALLEVENTS)
33
- assert_not_nil(Foo::QS_ALLINPUT)
34
- assert_not_nil(Foo::QS_ALLPOSTMESSAGE)
35
- assert_not_nil(Foo::QS_HOTKEY)
36
- assert_not_nil(Foo::QS_INPUT)
37
- assert_not_nil(Foo::QS_KEY)
38
- assert_not_nil(Foo::QS_MOUSE)
39
- assert_not_nil(Foo::QS_MOUSEBUTTON)
40
- assert_not_nil(Foo::QS_MOUSEMOVE)
41
- assert_not_nil(Foo::QS_PAINT)
42
- assert_not_nil(Foo::QS_POSTMESSAGE)
43
- assert_not_nil(Foo::QS_RAWINPUT)
44
- assert_not_nil(Foo::QS_SENDMESSAGE)
45
- assert_not_nil(Foo::QS_TIMER)
46
- assert_not_nil(Foo::MWMO_ALERTABLE)
47
- assert_not_nil(Foo::MWMO_INPUTAVAILABLE)
48
- assert_not_nil(Foo::MWMO_WAITALL)
49
- assert_not_nil(Foo::EVENT_ALL_ACCESS)
50
- assert_not_nil(Foo::EVENT_MODIFY_STATE)
51
- assert_not_nil(Foo::MUTEX_ALL_ACCESS)
52
- assert_not_nil(Foo::MUTEX_MODIFY_STATE)
53
- assert_not_nil(Foo::SEMAPHORE_ALL_ACCESS)
54
- assert_not_nil(Foo::SEMAPHORE_MODIFY_STATE)
20
+ assert_not_nil(SynchFoo::INFINITE)
21
+ assert_not_nil(SynchFoo::WAIT_OBJECT_0)
22
+ assert_not_nil(SynchFoo::WAIT_TIMEOUT)
23
+ assert_not_nil(SynchFoo::WAIT_ABANDONED)
24
+ assert_not_nil(SynchFoo::WAIT_FAILED)
25
+ assert_not_nil(SynchFoo::QS_ALLEVENTS)
26
+ assert_not_nil(SynchFoo::QS_ALLINPUT)
27
+ assert_not_nil(SynchFoo::QS_ALLPOSTMESSAGE)
28
+ assert_not_nil(SynchFoo::QS_HOTKEY)
29
+ assert_not_nil(SynchFoo::QS_INPUT)
30
+ assert_not_nil(SynchFoo::QS_KEY)
31
+ assert_not_nil(SynchFoo::QS_MOUSE)
32
+ assert_not_nil(SynchFoo::QS_MOUSEBUTTON)
33
+ assert_not_nil(SynchFoo::QS_MOUSEMOVE)
34
+ assert_not_nil(SynchFoo::QS_PAINT)
35
+ assert_not_nil(SynchFoo::QS_POSTMESSAGE)
36
+ assert_not_nil(SynchFoo::QS_RAWINPUT)
37
+ assert_not_nil(SynchFoo::QS_SENDMESSAGE)
38
+ assert_not_nil(SynchFoo::QS_TIMER)
39
+ assert_not_nil(SynchFoo::MWMO_ALERTABLE)
40
+ assert_not_nil(SynchFoo::MWMO_INPUTAVAILABLE)
41
+ assert_not_nil(SynchFoo::MWMO_WAITALL)
42
+ assert_not_nil(SynchFoo::EVENT_ALL_ACCESS)
43
+ assert_not_nil(SynchFoo::EVENT_MODIFY_STATE)
44
+ assert_not_nil(SynchFoo::MUTEX_ALL_ACCESS)
45
+ assert_not_nil(SynchFoo::MUTEX_MODIFY_STATE)
46
+ assert_not_nil(SynchFoo::SEMAPHORE_ALL_ACCESS)
47
+ assert_not_nil(SynchFoo::SEMAPHORE_MODIFY_STATE)
55
48
  end
56
49
 
57
50
  def test_method_constants
58
- assert_not_nil(Foo::CreateEvent)
59
- assert_not_nil(Foo::CreateMutex)
60
- assert_not_nil(Foo::CreateSemaphore)
61
- assert_not_nil(Foo::GetOverlappedResult)
62
- assert_not_nil(Foo::MsgWaitForMultipleObjects)
63
- assert_not_nil(Foo::MsgWaitForMultipleObjectsEx)
64
- assert_not_nil(Foo::OpenEvent)
65
- assert_not_nil(Foo::OpenMutex)
66
- assert_not_nil(Foo::OpenSemaphore)
67
- assert_not_nil(Foo::ReleaseMutex)
68
- assert_not_nil(Foo::ReleaseSemaphore)
69
- assert_not_nil(Foo::ResetEvent)
70
- assert_not_nil(Foo::SetEvent)
71
- assert_not_nil(Foo::WaitForMultipleObjects)
72
- assert_not_nil(Foo::WaitForMultipleObjectsEx)
73
- assert_not_nil(Foo::WaitForSingleObject)
74
- assert_not_nil(Foo::WaitForSingleObjectEx)
51
+ assert_not_nil(SynchFoo::CreateEvent)
52
+ assert_not_nil(SynchFoo::CreateMutex)
53
+ assert_not_nil(SynchFoo::CreateSemaphore)
54
+ assert_not_nil(SynchFoo::GetOverlappedResult)
55
+ assert_not_nil(SynchFoo::MsgWaitForMultipleObjects)
56
+ assert_not_nil(SynchFoo::MsgWaitForMultipleObjectsEx)
57
+ assert_not_nil(SynchFoo::OpenEvent)
58
+ assert_not_nil(SynchFoo::OpenMutex)
59
+ assert_not_nil(SynchFoo::OpenSemaphore)
60
+ assert_not_nil(SynchFoo::ReleaseMutex)
61
+ assert_not_nil(SynchFoo::ReleaseSemaphore)
62
+ assert_not_nil(SynchFoo::ResetEvent)
63
+ assert_not_nil(SynchFoo::SetEvent)
64
+ assert_not_nil(SynchFoo::WaitForMultipleObjects)
65
+ assert_not_nil(SynchFoo::WaitForMultipleObjectsEx)
66
+ assert_not_nil(SynchFoo::WaitForSingleObject)
67
+ assert_not_nil(SynchFoo::WaitForSingleObjectEx)
75
68
  end
76
69
 
77
70
  def teardown
data/test/tc_unicode.rb CHANGED
@@ -3,55 +3,48 @@
3
3
  #
4
4
  # Test case for the Windows::Unicode module.
5
5
  #####################################################################
6
- base = File.basename(Dir.pwd)
7
- if base == 'test' || base =~ /windows-pr/
8
- Dir.chdir '..' if base == 'test'
9
- $LOAD_PATH.unshift Dir.pwd + '/lib'
10
- Dir.chdir 'test' rescue nil
11
- end
12
-
13
6
  require "windows/unicode"
14
7
  require "test/unit"
15
8
 
16
- class Foo
9
+ class UnicodeFoo
17
10
  include Windows::Unicode
18
11
  end
19
12
 
20
13
  class TC_Windows_Unicode < Test::Unit::TestCase
21
14
  def setup
22
- @foo = Foo.new
15
+ @foo = UnicodeFoo.new
23
16
  end
24
17
 
25
18
  def test_numeric_constants
26
- assert_equal(0, Foo::CP_ACP)
27
- assert_equal(1, Foo::CP_OEMCP)
28
- assert_equal(2, Foo::CP_MACCP)
29
- assert_equal(3, Foo::CP_THREAD_ACP)
30
- assert_equal(42, Foo::CP_SYMBOL)
31
- assert_equal(65000, Foo::CP_UTF7)
32
- assert_equal(65001, Foo::CP_UTF8)
33
-
34
- assert_equal(0x00000001, Foo::MB_PRECOMPOSED)
35
- assert_equal(0x00000002, Foo::MB_COMPOSITE)
36
- assert_equal(0x00000004, Foo::MB_USEGLYPHCHARS)
37
- assert_equal(0x00000008, Foo::MB_ERR_INVALID_CHARS)
38
-
39
- assert_equal(0x00000200, Foo::WC_COMPOSITECHECK)
40
- assert_equal(0x00000010, Foo::WC_DISCARDNS)
41
- assert_equal(0x00000020, Foo::WC_SEPCHARS)
42
- assert_equal(0x00000040, Foo::WC_DEFAULTCHAR)
43
- assert_equal(0x00000400, Foo::WC_NO_BEST_FIT_CHARS)
19
+ assert_equal(0, UnicodeFoo::CP_ACP)
20
+ assert_equal(1, UnicodeFoo::CP_OEMCP)
21
+ assert_equal(2, UnicodeFoo::CP_MACCP)
22
+ assert_equal(3, UnicodeFoo::CP_THREAD_ACP)
23
+ assert_equal(42, UnicodeFoo::CP_SYMBOL)
24
+ assert_equal(65000, UnicodeFoo::CP_UTF7)
25
+ assert_equal(65001, UnicodeFoo::CP_UTF8)
26
+
27
+ assert_equal(0x00000001, UnicodeFoo::MB_PRECOMPOSED)
28
+ assert_equal(0x00000002, UnicodeFoo::MB_COMPOSITE)
29
+ assert_equal(0x00000004, UnicodeFoo::MB_USEGLYPHCHARS)
30
+ assert_equal(0x00000008, UnicodeFoo::MB_ERR_INVALID_CHARS)
31
+
32
+ assert_equal(0x00000200, UnicodeFoo::WC_COMPOSITECHECK)
33
+ assert_equal(0x00000010, UnicodeFoo::WC_DISCARDNS)
34
+ assert_equal(0x00000020, UnicodeFoo::WC_SEPCHARS)
35
+ assert_equal(0x00000040, UnicodeFoo::WC_DEFAULTCHAR)
36
+ assert_equal(0x00000400, UnicodeFoo::WC_NO_BEST_FIT_CHARS)
44
37
  end
45
38
 
46
39
  def test_method_constants
47
- assert_not_nil(Foo::GetTextCharset)
48
- assert_not_nil(Foo::GetTextCharsetInfo)
49
- assert_not_nil(Foo::IsDBCSLeadByte)
50
- assert_not_nil(Foo::IsDBCSLeadByteEx)
51
- assert_not_nil(Foo::IsTextUnicode)
52
- assert_not_nil(Foo::MultiByteToWideChar)
53
- assert_not_nil(Foo::TranslateCharsetInfo)
54
- assert_not_nil(Foo::WideCharToMultiByte)
40
+ assert_not_nil(UnicodeFoo::GetTextCharset)
41
+ assert_not_nil(UnicodeFoo::GetTextCharsetInfo)
42
+ assert_not_nil(UnicodeFoo::IsDBCSLeadByte)
43
+ assert_not_nil(UnicodeFoo::IsDBCSLeadByteEx)
44
+ assert_not_nil(UnicodeFoo::IsTextUnicode)
45
+ assert_not_nil(UnicodeFoo::MultiByteToWideChar)
46
+ assert_not_nil(UnicodeFoo::TranslateCharsetInfo)
47
+ assert_not_nil(UnicodeFoo::WideCharToMultiByte)
55
48
  end
56
49
 
57
50
  def teardown
data/test/tc_volume.rb CHANGED
@@ -3,27 +3,20 @@
3
3
  #
4
4
  # Test case for the Windows::Volume module.
5
5
  #####################################################################
6
- base = File.basename(Dir.pwd)
7
- if base == 'test' || base =~ /windows-pr/
8
- Dir.chdir '..' if base == 'test'
9
- $LOAD_PATH.unshift Dir.pwd + '/lib'
10
- Dir.chdir 'test' rescue nil
11
- end
12
-
13
6
  require 'windows/volume'
14
7
  require 'test/unit'
15
8
 
16
- class Foo
9
+ class VolumeFoo
17
10
  include Windows::Volume
18
11
  end
19
12
 
20
- class TC_Windows_Clipboard < Test::Unit::TestCase
13
+ class TC_Windows_Volume < Test::Unit::TestCase
21
14
  def setup
22
- @foo = Foo.new
15
+ @foo = VolumeFoo.new
23
16
  end
24
17
 
25
18
  def test_method_constants
26
- assert_not_nil(Foo::GetVolumeInformation)
19
+ assert_not_nil(VolumeFoo::GetVolumeInformation)
27
20
  end
28
21
 
29
22
  def teardown
data/test/tc_window.rb ADDED
@@ -0,0 +1,45 @@
1
+ #####################################################################
2
+ # tc_window.rb
3
+ #
4
+ # Test case for the Windows::Window module.
5
+ #####################################################################
6
+ require 'windows/window'
7
+ require 'test/unit'
8
+
9
+ class WindowFoo
10
+ include Windows::Window
11
+ end
12
+
13
+ class TC_Windows_Window < Test::Unit::TestCase
14
+ def setup
15
+ @foo = WindowFoo.new
16
+ end
17
+
18
+ def test_numeric_constants
19
+ assert_equal(0, WindowFoo::SW_HIDE)
20
+ assert_equal(1, WindowFoo::SW_SHOWNORMAL)
21
+ assert_equal(1, WindowFoo::SW_NORMAL)
22
+ assert_equal(2, WindowFoo::SW_SHOWMINIMIZED)
23
+ assert_equal(3, WindowFoo::SW_SHOWMAXIMIZED)
24
+ assert_equal(3, WindowFoo::SW_MAXIMIZE)
25
+ assert_equal(4, WindowFoo::SW_SHOWNOACTIVATE)
26
+ assert_equal(5, WindowFoo::SW_SHOW)
27
+ assert_equal(6, WindowFoo::SW_MINIMIZE)
28
+ assert_equal(7, WindowFoo::SW_SHOWMINNOACTIVE)
29
+ assert_equal(8, WindowFoo::SW_SHOWNA)
30
+ assert_equal(9, WindowFoo::SW_RESTORE)
31
+ assert_equal(10, WindowFoo::SW_SHOWDEFAULT)
32
+ assert_equal(11, WindowFoo::SW_FORCEMINIMIZE)
33
+ assert_equal(11, WindowFoo::SW_MAX)
34
+ end
35
+
36
+ def test_method_constants
37
+ assert_not_nil(WindowFoo::GetClientRect)
38
+ assert_not_nil(WindowFoo::GetForegroundWindow)
39
+ assert_not_nil(WindowFoo::GetWindowRect)
40
+ end
41
+
42
+ def teardown
43
+ @foo = nil
44
+ end
45
+ end
data/windows-pr.gemspec CHANGED
@@ -2,22 +2,23 @@ require "rubygems"
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
4
  gem.name = "windows-pr"
5
- gem.version = "0.7.0"
5
+ gem.version = "0.7.1"
6
6
  gem.author = "Daniel J. Berger"
7
7
  gem.email = "djberg96@gmail.com"
8
8
  gem.homepage = "http://www.rubyforge.org/projects/win32utils"
9
9
  gem.platform = Gem::Platform::RUBY
10
- gem.summary = "Windows functions and constants predefined via Win32API"
11
- gem.description = "Windows functions and constants predefined via Win32API"
12
- gem.test_file = "test/ts_all.rb"
10
+ gem.summary = "Windows functions and constants bundled via Win32::API"
11
+ gem.description = "Windows functions and constants bundled via Win32::API"
12
+ gem.test_files = Dir["test/tc*"]
13
13
  gem.has_rdoc = true
14
14
  gem.files = Dir["doc/*.txt"] + Dir["lib/windows/*.rb"]
15
- gem.files += Dir["lib/windows/msvcrt/*.rb"]
15
+ gem.files += Dir["lib/windows/msvcrt/*.rb"]
16
+ gem.files += Dir["lib/windows/gdi/*.rb"]
16
17
  gem.files += Dir["test/*"] + Dir["[A-Z]*"]
17
18
  gem.files.reject! { |fn| fn.include? "CVS" }
18
19
  gem.require_path = "lib"
19
20
  gem.extra_rdoc_files = ["MANIFEST", "README", "CHANGES"]
20
- gem.add_dependency("windows-api", ">= 0.1.1")
21
+ gem.add_dependency("windows-api", ">= 0.2.0")
21
22
  end
22
23
 
23
24
  if $0 == __FILE__
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: windows-pr
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.0
7
- date: 2007-08-09 00:00:00 -06:00
8
- summary: Windows functions and constants predefined via Win32API
6
+ version: 0.7.1
7
+ date: 2007-09-21 00:00:00 -06:00
8
+ summary: Windows functions and constants bundled via Win32::API
9
9
  require_paths:
10
10
  - lib
11
11
  email: djberg96@gmail.com
12
12
  homepage: http://www.rubyforge.org/projects/win32utils
13
13
  rubyforge_project:
14
- description: Windows functions and constants predefined via Win32API
14
+ description: Windows functions and constants bundled via Win32::API
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -58,17 +58,14 @@ files:
58
58
  - lib/windows/sound.rb
59
59
  - lib/windows/synchronize.rb
60
60
  - lib/windows/system_info.rb
61
+ - lib/windows/time.rb
61
62
  - lib/windows/unicode.rb
62
63
  - lib/windows/volume.rb
63
64
  - lib/windows/window.rb
64
- - test/ts_all.rb
65
- - lib/windows/msvcrt/buffer.rb
66
- - lib/windows/msvcrt/file.rb
67
- - lib/windows/msvcrt/io.rb
68
- - lib/windows/msvcrt/string.rb
69
- - test/CVS
70
65
  - test/tc_clipboard.rb
66
+ - test/tc_com.rb
71
67
  - test/tc_console.rb
68
+ - test/tc_debug.rb
72
69
  - test/tc_error.rb
73
70
  - test/tc_eventlog.rb
74
71
  - test/tc_file.rb
@@ -83,17 +80,44 @@ files:
83
80
  - test/tc_synchronize.rb
84
81
  - test/tc_unicode.rb
85
82
  - test/tc_volume.rb
83
+ - test/tc_window.rb
84
+ - lib/windows/msvcrt/buffer.rb
85
+ - lib/windows/msvcrt/file.rb
86
+ - lib/windows/msvcrt/io.rb
87
+ - lib/windows/msvcrt/string.rb
88
+ - lib/windows/gdi/bitmap.rb
89
+ - lib/windows/gdi/device_context.rb
90
+ - lib/windows/gdi/painting_drawing.rb
91
+ - test/CVS
86
92
  - CHANGES
87
93
  - CVS
88
94
  - doc
89
- - install.rb
90
95
  - lib
91
96
  - MANIFEST
97
+ - Rakefile
92
98
  - README
93
99
  - test
94
100
  - windows-pr.gemspec
95
101
  test_files:
96
- - test/ts_all.rb
102
+ - test/tc_clipboard.rb
103
+ - test/tc_com.rb
104
+ - test/tc_console.rb
105
+ - test/tc_debug.rb
106
+ - test/tc_error.rb
107
+ - test/tc_eventlog.rb
108
+ - test/tc_file.rb
109
+ - test/tc_library.rb
110
+ - test/tc_memory.rb
111
+ - test/tc_msvcrt_buffer.rb
112
+ - test/tc_path.rb
113
+ - test/tc_pipe.rb
114
+ - test/tc_process.rb
115
+ - test/tc_registry.rb
116
+ - test/tc_security.rb
117
+ - test/tc_synchronize.rb
118
+ - test/tc_unicode.rb
119
+ - test/tc_volume.rb
120
+ - test/tc_window.rb
97
121
  rdoc_options: []
98
122
 
99
123
  extra_rdoc_files:
@@ -114,5 +138,5 @@ dependencies:
114
138
  requirements:
115
139
  - - ">="
116
140
  - !ruby/object:Gem::Version
117
- version: 0.1.1
141
+ version: 0.2.0
118
142
  version:
data/install.rb DELETED
@@ -1,18 +0,0 @@
1
- require "ftools"
2
- require "rbconfig"
3
- include Config
4
-
5
- sitelibdir = CONFIG["sitelibdir"]
6
- installdir = sitelibdir + "/windows"
7
- installdir2 = sitelibdir + "/windows/msvcrt"
8
-
9
- Dir.mkdir(installdir) unless File.exists?(installdir)
10
- Dir.mkdir(installdir2) unless File.exists?(installdir2)
11
-
12
- Dir["lib/windows/*.rb"].each{ |file|
13
- File.copy(file, installdir, true)
14
- }
15
-
16
- Dir["lib/windows/msvcrt/*.rb"].each{ |file|
17
- File.copy(file, installdir2, true)
18
- }
data/test/ts_all.rb DELETED
@@ -1,19 +0,0 @@
1
- $LOAD_PATH.unshift(Dir.pwd)
2
- $LOAD_PATH.unshift(Dir.pwd + '/lib')
3
- $LOAD_PATH.unshift(Dir.pwd + '/lib/windows')
4
- $LOAD_PATH.unshift(Dir.pwd + '/lib/windows/msvcrt')
5
- $LOAD_PATH.unshift(Dir.pwd + '/test')
6
-
7
- Dir.chdir('test') rescue nil
8
-
9
- require 'tc_console'
10
- require 'tc_error'
11
- require 'tc_file'
12
- require 'tc_memory'
13
- require 'tc_msvcrt_buffer'
14
- require 'tc_path'
15
- require 'tc_pipe'
16
- require 'tc_registry'
17
- require 'tc_security'
18
- require 'tc_synchronize'
19
- require 'tc_unicode'