win32-api 1.5.0-universal-mingw32 → 1.5.1-universal-mingw32

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
2
  SHA1:
3
- metadata.gz: 43f49890c4c1c03565dcebe7e0b9a1633e299d7c
4
- data.tar.gz: 1fb103cb311aca0cca09355fa689b9343b1a44ce
3
+ metadata.gz: 8c920b8eacb567c87bdd29eacdf4c2efaa8a3743
4
+ data.tar.gz: 9f3da9d42ed3c5bb1c886f0c09fc01ba410fd6ad
5
5
  SHA512:
6
- metadata.gz: 6d185f01c4f9f1e553acbace429ebe58e610c1209d90d8db1f6c92e4471f821ca05ce5652f6767210968edee583d84f67865d3402ea6c048f3591b35178fae67
7
- data.tar.gz: 4de7942471cd2360ce77eeb925830d8aa7e274b46bae4efc5166bac8dabdc542da61acde4e7dd60f42ba69256471cfb160120ded5131b8f200b5ea1cda74825e
6
+ metadata.gz: 3a2e33ead9630fda6b92d5e649a250bedb21f9192b2d22ce65ff5119b96d5f82613c1f22d34b547da90742aed10acb955cfd9736c58111b3e6ee1a4c8d5dafde
7
+ data.tar.gz: c47f3a2c23fc05820d700e0c3616d30fd9bbdd7e9905d6d578dc62498c6d6af52cf25b4e35cd96b4640edd421c9cbe5b55ca158ebdb696cbcb4a3fadfaad6477
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.5.1 - 14-Feb-2014
2
+ * Fixed a potential zero-initialization issue. Thanks go to Peter Huene
3
+ for the spot and the patch.
4
+ * Added rake as a development dependency.
5
+
1
6
  == 1.5.0 - 22-Aug-2013
2
7
  * Fixes for Ruby x64.
3
8
  * There are now separate 32 and 64 bit binaries packaged for Ruby 2.x.
data/MANIFEST CHANGED
@@ -1,10 +1,10 @@
1
- * CHANGES
2
- * MANIFEST
3
- * README
4
- * Rakefile
5
- * win32-api.gemspec
6
- * ext/extconf.rb
7
- * ext/win32/api.c
8
- * test/test_win32_api.rb
9
- * test/test_win32_api_callback.rb
1
+ * CHANGES
2
+ * MANIFEST
3
+ * README
4
+ * Rakefile
5
+ * win32-api.gemspec
6
+ * ext/extconf.rb
7
+ * ext/win32/api.c
8
+ * test/test_win32_api.rb
9
+ * test/test_win32_api_callback.rb
10
10
  * test/test_win32_api_function.rb
data/Rakefile CHANGED
@@ -66,9 +66,9 @@ namespace 'gem' do
66
66
  # These are just what's on my system at the moment. Adjust as needed.
67
67
  args.with_defaults(
68
68
  :ruby18 => "c:/ruby187/bin/ruby",
69
- :ruby19 => "c:/ruby/bin/ruby",
69
+ :ruby19 => "c:/ruby193/bin/ruby",
70
70
  :ruby2_32 => "c:/ruby2/bin/ruby",
71
- :ruby2_64 => "c:/ruby200-x64/bin/ruby"
71
+ :ruby2_64 => "c:/ruby264/bin/ruby"
72
72
  )
73
73
 
74
74
  Rake::Task[:clobber].invoke
data/ext/win32/api.c CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
 
39
39
  #define MAX_BUF 1024
40
- #define WINDOWS_API_VERSION "1.5.0"
40
+ #define WINDOWS_API_VERSION "1.5.1"
41
41
 
42
42
  #define _T_VOID 0
43
43
  #define _T_LONG 1
@@ -66,6 +66,7 @@ static void api_free(Win32API* ptr){
66
66
 
67
67
  static VALUE api_allocate(VALUE klass){
68
68
  Win32API* ptr = malloc(sizeof(Win32API));
69
+ memset(ptr, 0, sizeof(*ptr));
69
70
  return Data_Wrap_Struct(klass, 0, api_free, ptr);
70
71
  }
71
72
 
Binary file
Binary file
Binary file
Binary file
@@ -18,7 +18,7 @@ class TC_Win32_API < Test::Unit::TestCase
18
18
  end
19
19
 
20
20
  def test_version
21
- assert_equal('1.5.0', API::VERSION)
21
+ assert_equal('1.5.1', API::VERSION)
22
22
  end
23
23
 
24
24
  def test_constructor_basic
@@ -1,74 +1,74 @@
1
- ############################################################################
2
- # test_win32_api_callback.rb
3
- #
4
- # Test case for the Win32::API::Callback class. You should run this as Rake
5
- # task, i.e. 'rake test', instead of running it directly.
6
- ############################################################################
7
- require 'rubygems'
8
- gem 'test-unit'
9
-
10
- require 'win32/api'
11
- require 'test/unit'
12
- include Win32
13
-
14
- class TC_Win32_API_Callback < Test::Unit::TestCase
15
- def setup
16
- @buffer = 0.chr * 260
17
- @api_ew = API.new('EnumWindows', 'KP', 'L', 'user32')
18
- @api_gwt = API.new('GetWindowText', 'LPI', 'I', 'user32')
19
- @callback = nil
20
- end
21
-
22
- def test_constructor
23
- assert_respond_to(API::Callback, :new)
24
- assert_nothing_raised{ API::Callback.new('LP', 'I') }
25
- assert_nothing_raised{ API::Callback.new('LP', 'I'){} }
26
- end
27
-
28
- def test_prototype
29
- assert_nothing_raised{ @callback = API::Callback.new('LP', 'I') }
30
- assert_respond_to(@callback, :prototype)
31
- assert_equal('LP', @callback.prototype)
32
- end
33
-
34
- def test_return_value
35
- assert_nothing_raised{ @callback = API::Callback.new('LP', 'I') }
36
- assert_respond_to(@callback, :return_type)
37
- assert_equal('I', @callback.return_type)
38
- end
39
-
40
- def test_address
41
- assert_nothing_raised{ @callback = API::Callback.new('LP', 'I') }
42
- assert_respond_to(@callback, :address)
43
- assert_kind_of(Integer, @callback.address)
44
- assert_true(@callback.address > 0)
45
- end
46
-
47
- def test_callback
48
- assert_nothing_raised{
49
- @callback = API::Callback.new('LP', 'I'){ |handle, param|
50
- buf = "\0" * 200
51
- @api_gwt.call(handle, buf, 200);
52
- buf.index(param).nil? ? true : false
53
- }
54
- }
55
- assert_nothing_raised{ @api_ew.call(@callback, 'UEDIT32') }
56
- end
57
-
58
- def test_constructor_expected_errors
59
- assert_raise(API::PrototypeError){ API::Callback.new('X') }
60
- assert_raise(API::PrototypeError){ API::Callback.new('L', 'Y') }
61
- end
62
-
63
- def test_constructor_expected_error_messages
64
- assert_raise_message("Illegal prototype 'X'"){ API::Callback.new('X') }
65
- assert_raise_message("Illegal return type 'Y'"){ API::Callback.new('L', 'Y') }
66
- end
67
-
68
- def teardown
69
- @buffer = nil
70
- @api_ew = nil
71
- @api_gwt = nil
72
- @callback = nil
73
- end
74
- end
1
+ ############################################################################
2
+ # test_win32_api_callback.rb
3
+ #
4
+ # Test case for the Win32::API::Callback class. You should run this as Rake
5
+ # task, i.e. 'rake test', instead of running it directly.
6
+ ############################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
10
+ require 'win32/api'
11
+ require 'test/unit'
12
+ include Win32
13
+
14
+ class TC_Win32_API_Callback < Test::Unit::TestCase
15
+ def setup
16
+ @buffer = 0.chr * 260
17
+ @api_ew = API.new('EnumWindows', 'KP', 'L', 'user32')
18
+ @api_gwt = API.new('GetWindowText', 'LPI', 'I', 'user32')
19
+ @callback = nil
20
+ end
21
+
22
+ def test_constructor
23
+ assert_respond_to(API::Callback, :new)
24
+ assert_nothing_raised{ API::Callback.new('LP', 'I') }
25
+ assert_nothing_raised{ API::Callback.new('LP', 'I'){} }
26
+ end
27
+
28
+ def test_prototype
29
+ assert_nothing_raised{ @callback = API::Callback.new('LP', 'I') }
30
+ assert_respond_to(@callback, :prototype)
31
+ assert_equal('LP', @callback.prototype)
32
+ end
33
+
34
+ def test_return_value
35
+ assert_nothing_raised{ @callback = API::Callback.new('LP', 'I') }
36
+ assert_respond_to(@callback, :return_type)
37
+ assert_equal('I', @callback.return_type)
38
+ end
39
+
40
+ def test_address
41
+ assert_nothing_raised{ @callback = API::Callback.new('LP', 'I') }
42
+ assert_respond_to(@callback, :address)
43
+ assert_kind_of(Integer, @callback.address)
44
+ assert_true(@callback.address > 0)
45
+ end
46
+
47
+ def test_callback
48
+ assert_nothing_raised{
49
+ @callback = API::Callback.new('LP', 'I'){ |handle, param|
50
+ buf = "\0" * 200
51
+ @api_gwt.call(handle, buf, 200);
52
+ buf.index(param).nil? ? true : false
53
+ }
54
+ }
55
+ assert_nothing_raised{ @api_ew.call(@callback, 'UEDIT32') }
56
+ end
57
+
58
+ def test_constructor_expected_errors
59
+ assert_raise(API::PrototypeError){ API::Callback.new('X') }
60
+ assert_raise(API::PrototypeError){ API::Callback.new('L', 'Y') }
61
+ end
62
+
63
+ def test_constructor_expected_error_messages
64
+ assert_raise_message("Illegal prototype 'X'"){ API::Callback.new('X') }
65
+ assert_raise_message("Illegal return type 'Y'"){ API::Callback.new('L', 'Y') }
66
+ end
67
+
68
+ def teardown
69
+ @buffer = nil
70
+ @api_ew = nil
71
+ @api_gwt = nil
72
+ @callback = nil
73
+ end
74
+ end
@@ -1,66 +1,66 @@
1
- ########################################################################
2
- # test_win32_api_function.rb
3
- #
4
- # Test case for the Win32::API::Function class. You should run these
5
- # tests via the 'rake test' task.
6
- ########################################################################
7
- require 'rubygems'
8
- gem 'test-unit'
9
-
10
- require 'test/unit'
11
- require 'win32/api'
12
- include Win32
13
-
14
- class TC_Win32_API_Function < Test::Unit::TestCase
15
- def setup
16
- @func = Win32::API::Function.new(123456789, 'LP', 'L')
17
- end
18
-
19
- def test_constructor
20
- assert_nothing_raised{ Win32::API::Function.new(1) }
21
- assert_nothing_raised{ Win32::API::Function.new(1, 'LL') }
22
- assert_nothing_raised{ Win32::API::Function.new(1, 'LL', 'I') }
23
- end
24
-
25
- def test_subclass
26
- assert_kind_of(Win32::API, @func)
27
- assert_respond_to(@func, :call)
28
- end
29
-
30
- def test_address
31
- assert_respond_to(@func, :address)
32
- assert_equal(123456789, @func.address)
33
- end
34
-
35
- def test_prototype
36
- assert_respond_to(@func, :prototype)
37
- assert_equal(['L', 'P'], @func.prototype)
38
- end
39
-
40
- def test_return_type
41
- assert_respond_to(@func, :return_type)
42
- assert_equal('L', @func.return_type)
43
- end
44
-
45
- def test_expected_errors_from_arguments
46
- assert_raise(ArgumentError){ Win32::API::Function.new }
47
- assert_raise(TypeError){ Win32::API::Function.new('L') }
48
- assert_raise(Win32::API::PrototypeError){ Win32::API::Function.new(1, 'X') }
49
- assert_raise(Win32::API::PrototypeError){ Win32::API::Function.new(1, 'X', 'Y') }
50
- end
51
-
52
- def test_expected_error_messages
53
- assert_raise_message("Illegal prototype 'X'"){ API::Function.new(1, 'X') }
54
- assert_raise_message("Illegal return type 'Y'"){ API::Function.new(1, 'L', 'Y') }
55
- end
56
-
57
- def test_expected_errors_from_call
58
- assert_raise(ArgumentError){ @func.call }
59
- assert_raise(ArgumentError){ @func.call(1) }
60
- assert_raise(ArgumentError){ @func.call(1, 'a', 2) }
61
- end
62
-
63
- def teardown
64
- @func = nil
65
- end
66
- end
1
+ ########################################################################
2
+ # test_win32_api_function.rb
3
+ #
4
+ # Test case for the Win32::API::Function class. You should run these
5
+ # tests via the 'rake test' task.
6
+ ########################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
10
+ require 'test/unit'
11
+ require 'win32/api'
12
+ include Win32
13
+
14
+ class TC_Win32_API_Function < Test::Unit::TestCase
15
+ def setup
16
+ @func = Win32::API::Function.new(123456789, 'LP', 'L')
17
+ end
18
+
19
+ def test_constructor
20
+ assert_nothing_raised{ Win32::API::Function.new(1) }
21
+ assert_nothing_raised{ Win32::API::Function.new(1, 'LL') }
22
+ assert_nothing_raised{ Win32::API::Function.new(1, 'LL', 'I') }
23
+ end
24
+
25
+ def test_subclass
26
+ assert_kind_of(Win32::API, @func)
27
+ assert_respond_to(@func, :call)
28
+ end
29
+
30
+ def test_address
31
+ assert_respond_to(@func, :address)
32
+ assert_equal(123456789, @func.address)
33
+ end
34
+
35
+ def test_prototype
36
+ assert_respond_to(@func, :prototype)
37
+ assert_equal(['L', 'P'], @func.prototype)
38
+ end
39
+
40
+ def test_return_type
41
+ assert_respond_to(@func, :return_type)
42
+ assert_equal('L', @func.return_type)
43
+ end
44
+
45
+ def test_expected_errors_from_arguments
46
+ assert_raise(ArgumentError){ Win32::API::Function.new }
47
+ assert_raise(TypeError){ Win32::API::Function.new('L') }
48
+ assert_raise(Win32::API::PrototypeError){ Win32::API::Function.new(1, 'X') }
49
+ assert_raise(Win32::API::PrototypeError){ Win32::API::Function.new(1, 'X', 'Y') }
50
+ end
51
+
52
+ def test_expected_error_messages
53
+ assert_raise_message("Illegal prototype 'X'"){ API::Function.new(1, 'X') }
54
+ assert_raise_message("Illegal return type 'Y'"){ API::Function.new(1, 'L', 'Y') }
55
+ end
56
+
57
+ def test_expected_errors_from_call
58
+ assert_raise(ArgumentError){ @func.call }
59
+ assert_raise(ArgumentError){ @func.call(1) }
60
+ assert_raise(ArgumentError){ @func.call(1, 'a', 2) }
61
+ end
62
+
63
+ def teardown
64
+ @func = nil
65
+ end
66
+ end
data/win32-api.gemspec CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-api'
5
- spec.version = '1.5.0'
5
+ spec.version = '1.5.1'
6
6
  spec.authors = ['Daniel J. Berger', 'Park Heesob']
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST', 'ext/win32/api.c']
18
18
 
19
19
  spec.add_development_dependency('test-unit', '>= 2.5.0')
20
+ spec.add_development_dependency('rake')
20
21
 
21
22
  spec.description = <<-EOF
22
23
  The Win32::API library is meant as a replacement for the Win32API
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-22 00:00:00.000000000 Z
12
+ date: 2014-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: 2.5.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
28
42
  description: |2
29
43
  The Win32::API library is meant as a replacement for the Win32API
30
44
  library that ships as part of the standard library. It contains several
@@ -73,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
87
  version: '0'
74
88
  requirements: []
75
89
  rubyforge_project: win32utils
76
- rubygems_version: 2.0.7
90
+ rubygems_version: 2.0.3
77
91
  signing_key:
78
92
  specification_version: 4
79
93
  summary: A superior replacement for Win32API