win32-api 1.4.8-x86-mingw32 → 1.4.9-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +4 -0
- data/Rakefile +31 -9
- data/ext/win32/api.c +2 -2
- data/lib/win32/api.rb +4 -2
- data/lib/win32/ruby18/win32/api.so +0 -0
- data/lib/win32/ruby19/win32/api.so +0 -0
- data/lib/win32/ruby2/win32/api.so +0 -0
- data/test/test_win32_api.rb +12 -15
- data/win32-api.gemspec +2 -4
- metadata +41 -60
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bddd9cd5267eb7dff8e7cee6cce00ad189c2e223
|
4
|
+
data.tar.gz: 144132e3751a21382101dd75653c9aa06547055c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d16711c6868e8bdab58f3737d35386c61a5d4a3d4d67694fe96527316016f5dfa8c7c473b2055f41476820d7d4c8b3fc257a65367fa529d5aff778f5d27d0109
|
7
|
+
data.tar.gz: bdf52e87e5ae6901a2013a34ad8f11c389bce0bca6ecbb86ede73797fea393202a64e60e2def056e49fee440aed7de64fda189047a79b9b48c24f023087e7542
|
data/CHANGES
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
== 1.4.9 - 14-Jul-2013
|
2
|
+
* Added a binary for Ruby 2.0.
|
3
|
+
* Add devkit to Rakefile for the gem:binary task.
|
4
|
+
|
1
5
|
== 1.4.8 - 16-Jan-2011
|
2
6
|
* A binary for both 1.8.x and 1.9.x is now shipped as part of the binary
|
3
7
|
build. A stub file is used to dynamically require the correct binary based
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rake'
|
|
2
2
|
require 'rake/clean'
|
3
3
|
require 'rake/testtask'
|
4
4
|
require 'rbconfig'
|
5
|
-
include
|
5
|
+
include RbConfig
|
6
6
|
|
7
7
|
CLEAN.include(
|
8
8
|
'**/*.gem', # Gem files
|
@@ -38,6 +38,7 @@ end
|
|
38
38
|
|
39
39
|
desc "Build the win32-api library"
|
40
40
|
task :build => [:clean, :build_manifest] do
|
41
|
+
require 'devkit'
|
41
42
|
Dir.chdir('ext') do
|
42
43
|
ruby "extconf.rb"
|
43
44
|
sh make
|
@@ -46,42 +47,59 @@ task :build => [:clean, :build_manifest] do
|
|
46
47
|
end
|
47
48
|
|
48
49
|
namespace 'gem' do
|
50
|
+
require 'rubygems/package'
|
51
|
+
|
49
52
|
desc 'Build the win32-api gem'
|
50
53
|
task :create => [:clean] do
|
51
54
|
spec = eval(IO.read('win32-api.gemspec'))
|
52
|
-
Gem::
|
55
|
+
if Gem::VERSION.to_f < 2.0
|
56
|
+
Gem::Builder.new(spec).build
|
57
|
+
else
|
58
|
+
Gem::Package.build(spec)
|
59
|
+
end
|
53
60
|
end
|
54
61
|
|
55
62
|
desc 'Build a binary gem'
|
56
|
-
task :binary, :ruby18, :ruby19 do |task, args|
|
63
|
+
task :binary, :ruby18, :ruby19, :ruby2 do |task, args|
|
64
|
+
require 'devkit'
|
65
|
+
|
66
|
+
# These are just what's on my system at the moment. Subject to change.
|
57
67
|
args.with_defaults(
|
58
|
-
:ruby18 => "c:/
|
59
|
-
:ruby19 => "c:/
|
68
|
+
:ruby18 => "c:/ruby187/bin/ruby",
|
69
|
+
:ruby19 => "c:/ruby/bin/ruby",
|
70
|
+
:ruby2 => "c:/ruby2/bin/ruby"
|
60
71
|
)
|
61
72
|
|
62
73
|
Rake::Task[:clobber].invoke
|
74
|
+
|
63
75
|
mkdir_p 'lib/win32/ruby18/win32'
|
64
76
|
mkdir_p 'lib/win32/ruby19/win32'
|
77
|
+
mkdir_p 'lib/win32/ruby2/win32'
|
65
78
|
|
66
79
|
args.each{ |key, rubyx|
|
67
80
|
Dir.chdir('ext') do
|
68
81
|
sh "make distclean" rescue nil
|
69
82
|
sh "#{rubyx} extconf.rb"
|
70
83
|
sh "make"
|
84
|
+
|
71
85
|
if key.to_s == 'ruby18'
|
72
86
|
cp 'api.so', '../lib/win32/ruby18/win32/api.so'
|
73
|
-
|
87
|
+
elsif key.to_s == 'ruby19'
|
74
88
|
cp 'api.so', '../lib/win32/ruby19/win32/api.so'
|
89
|
+
else
|
90
|
+
cp 'api.so', '../lib/win32/ruby2/win32/api.so'
|
75
91
|
end
|
76
92
|
end
|
77
93
|
}
|
78
94
|
|
79
95
|
# Create a stub file that automatically require's the correct binary
|
80
96
|
File.open('lib/win32/api.rb', 'w'){ |fh|
|
81
|
-
fh.puts "if RUBY_VERSION.to_f
|
97
|
+
fh.puts "if RUBY_VERSION.to_f < 1.9"
|
98
|
+
fh.puts " require File.join(File.dirname(__FILE__), 'ruby18/win32/api')"
|
99
|
+
fh.puts "elsif RUBY_VERSION.to_f < 2.0"
|
82
100
|
fh.puts " require File.join(File.dirname(__FILE__), 'ruby19/win32/api')"
|
83
101
|
fh.puts "else"
|
84
|
-
fh.puts " require File.join(File.dirname(__FILE__), '
|
102
|
+
fh.puts " require File.join(File.dirname(__FILE__), 'ruby2/win32/api')"
|
85
103
|
fh.puts "end"
|
86
104
|
}
|
87
105
|
|
@@ -90,7 +108,11 @@ namespace 'gem' do
|
|
90
108
|
spec.extensions = nil
|
91
109
|
spec.files = spec.files.reject{ |f| f.include?('ext') }
|
92
110
|
|
93
|
-
Gem::
|
111
|
+
if Gem::VERSION.to_f < 2.0
|
112
|
+
Gem::Builder.new(spec).build
|
113
|
+
else
|
114
|
+
Gem::Package.build(spec)
|
115
|
+
end
|
94
116
|
end
|
95
117
|
|
96
118
|
desc 'Install the gem'
|
data/ext/win32/api.c
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
#endif
|
18
18
|
|
19
19
|
#define MAX_BUF 1024
|
20
|
-
#define WINDOWS_API_VERSION "1.4.
|
20
|
+
#define WINDOWS_API_VERSION "1.4.9"
|
21
21
|
|
22
22
|
#define _T_VOID 0
|
23
23
|
#define _T_LONG 1
|
@@ -944,6 +944,6 @@ void Init_api(){
|
|
944
944
|
|
945
945
|
/* Constants */
|
946
946
|
|
947
|
-
/* 1.4.
|
947
|
+
/* 1.4.9: The version of the win32-api library */
|
948
948
|
rb_define_const(cAPI, "VERSION", rb_str_new2(WINDOWS_API_VERSION));
|
949
949
|
}
|
data/lib/win32/api.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
if RUBY_VERSION.to_f
|
1
|
+
if RUBY_VERSION.to_f < 1.9
|
2
|
+
require File.join(File.dirname(__FILE__), 'ruby18/win32/api')
|
3
|
+
elsif RUBY_VERSION.to_f < 2.0
|
2
4
|
require File.join(File.dirname(__FILE__), 'ruby19/win32/api')
|
3
5
|
else
|
4
|
-
require File.join(File.dirname(__FILE__), '
|
6
|
+
require File.join(File.dirname(__FILE__), 'ruby2/win32/api')
|
5
7
|
end
|
Binary file
|
Binary file
|
Binary file
|
data/test/test_win32_api.rb
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
############################################################################
|
2
2
|
# test_win32_api.rb
|
3
|
-
#
|
3
|
+
#
|
4
4
|
# Test case for the Win32::API class. You should run this as Rake task,
|
5
5
|
# i.e. 'rake test', instead of running it directly.
|
6
6
|
############################################################################
|
7
|
-
require 'rubygems'
|
8
|
-
gem 'test-unit'
|
9
|
-
|
10
7
|
require 'win32/api'
|
11
|
-
require 'test
|
8
|
+
require 'test-unit'
|
12
9
|
include Win32
|
13
10
|
|
14
11
|
class TC_Win32_API < Test::Unit::TestCase
|
@@ -21,7 +18,7 @@ class TC_Win32_API < Test::Unit::TestCase
|
|
21
18
|
end
|
22
19
|
|
23
20
|
def test_version
|
24
|
-
assert_equal('1.4.
|
21
|
+
assert_equal('1.4.9', API::VERSION)
|
25
22
|
end
|
26
23
|
|
27
24
|
def test_constructor_basic
|
@@ -30,13 +27,13 @@ class TC_Win32_API < Test::Unit::TestCase
|
|
30
27
|
assert_nothing_raised{ API.new('GetCurrentDirectory', 'LP', 'L') }
|
31
28
|
assert_nothing_raised{ API.new('GetCurrentDirectory', 'LP', 'L', 'kernel32') }
|
32
29
|
end
|
33
|
-
|
30
|
+
|
34
31
|
def test_call
|
35
32
|
assert_respond_to(@gcd, :call)
|
36
33
|
assert_nothing_raised{ @gcd.call(@buf.length, @buf) }
|
37
34
|
assert_equal(Dir.pwd.tr('/', "\\"), @buf.strip)
|
38
35
|
end
|
39
|
-
|
36
|
+
|
40
37
|
def test_call_with_void
|
41
38
|
assert_nothing_raised{ @gle.call }
|
42
39
|
assert_nothing_raised{ @gle.call(nil) }
|
@@ -45,18 +42,18 @@ class TC_Win32_API < Test::Unit::TestCase
|
|
45
42
|
def test_call_return_value_on_failure
|
46
43
|
assert_equal(0xFFFFFFFF, @gfa.call('C:/foobarbazblah'))
|
47
44
|
end
|
48
|
-
|
45
|
+
|
49
46
|
def test_dll_name
|
50
47
|
assert_respond_to(@gcd, :dll_name)
|
51
48
|
assert_equal('kernel32', @gcd.dll_name)
|
52
49
|
end
|
53
|
-
|
50
|
+
|
54
51
|
def test_function_name
|
55
52
|
assert_respond_to(@gcd, :function_name)
|
56
53
|
assert_equal('GetCurrentDirectory', @gcd.function_name)
|
57
54
|
assert_equal('strstr', @str.function_name)
|
58
55
|
end
|
59
|
-
|
56
|
+
|
60
57
|
def test_effective_function_name_default
|
61
58
|
assert_respond_to(@gcd, :effective_function_name)
|
62
59
|
assert_equal('GetCurrentDirectoryA', @gcd.effective_function_name)
|
@@ -72,23 +69,23 @@ class TC_Win32_API < Test::Unit::TestCase
|
|
72
69
|
@gcd = API.new('GetCurrentDirectoryW', 'LP')
|
73
70
|
assert_equal('GetCurrentDirectoryW', @gcd.effective_function_name)
|
74
71
|
end
|
75
|
-
|
72
|
+
|
76
73
|
def test_prototype
|
77
74
|
assert_respond_to(@gcd, :prototype)
|
78
75
|
assert_equal(['L', 'P'], @gcd.prototype)
|
79
76
|
end
|
80
|
-
|
77
|
+
|
81
78
|
def test_return_type
|
82
79
|
assert_respond_to(@gcd, :return_type)
|
83
80
|
assert_equal('L', @gcd.return_type)
|
84
81
|
end
|
85
|
-
|
82
|
+
|
86
83
|
def test_constructor_high_iteration
|
87
84
|
assert_nothing_raised{
|
88
85
|
1000.times{ API.new('GetUserName', 'P', 'P', 'advapi32') }
|
89
86
|
}
|
90
87
|
end
|
91
|
-
|
88
|
+
|
92
89
|
def test_constructor_expected_failures
|
93
90
|
assert_raise(ArgumentError){ API.new }
|
94
91
|
assert_raise(ArgumentError){ API.new('GetUserName', ('L' * 21), 'X') }
|
data/win32-api.gemspec
CHANGED
@@ -2,14 +2,12 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'win32-api'
|
5
|
-
spec.version = '1.4.
|
5
|
+
spec.version = '1.4.9'
|
6
6
|
spec.authors = ['Daniel J. Berger', 'Park Heesob']
|
7
7
|
spec.license = 'Artistic 2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
9
9
|
spec.homepage = 'http://www.rubyforge.org/projects/win32utils'
|
10
|
-
spec.platform = Gem::Platform::RUBY
|
11
10
|
spec.summary = 'A superior replacement for Win32API'
|
12
|
-
spec.has_rdoc = true
|
13
11
|
spec.test_files = Dir['test/test*']
|
14
12
|
spec.extensions = ['ext/extconf.rb']
|
15
13
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
@@ -18,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
18
16
|
spec.required_ruby_version = '>= 1.8.2'
|
19
17
|
spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST', 'ext/win32/api.c']
|
20
18
|
|
21
|
-
spec.add_development_dependency('test-unit', '>= 2.
|
19
|
+
spec.add_development_dependency('test-unit', '>= 2.4.0')
|
22
20
|
|
23
21
|
spec.description = <<-EOF
|
24
22
|
The Win32::API library is meant as a replacement for the Win32API
|
metadata
CHANGED
@@ -1,56 +1,49 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-api
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: false
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 4
|
9
|
-
- 8
|
10
|
-
version: 1.4.8
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.4.9
|
11
5
|
platform: x86-mingw32
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Daniel J. Berger
|
14
8
|
- Park Heesob
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-07-14 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
23
15
|
name: test-unit
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
hash: 15
|
31
|
-
segments:
|
32
|
-
- 2
|
33
|
-
- 1
|
34
|
-
- 2
|
35
|
-
version: 2.1.2
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 2.4.0
|
36
21
|
type: :development
|
37
|
-
|
38
|
-
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 2.4.0
|
28
|
+
description: |2
|
29
|
+
The Win32::API library is meant as a replacement for the Win32API
|
30
|
+
library that ships as part of the standard library. It contains several
|
31
|
+
advantages over Win32API, including callback support, raw function
|
32
|
+
pointers, an additional string type, and more.
|
39
33
|
email: djberg96@gmail.com
|
40
34
|
executables: []
|
41
|
-
|
42
35
|
extensions: []
|
43
|
-
|
44
|
-
extra_rdoc_files:
|
36
|
+
extra_rdoc_files:
|
45
37
|
- README
|
46
38
|
- CHANGES
|
47
39
|
- MANIFEST
|
48
40
|
- ext/win32/api.c
|
49
|
-
files:
|
41
|
+
files:
|
50
42
|
- CHANGES
|
51
43
|
- lib/win32/api.rb
|
52
44
|
- lib/win32/ruby18/win32/api.so
|
53
45
|
- lib/win32/ruby19/win32/api.so
|
46
|
+
- lib/win32/ruby2/win32/api.so
|
54
47
|
- MANIFEST
|
55
48
|
- Rakefile
|
56
49
|
- README
|
@@ -59,43 +52,31 @@ files:
|
|
59
52
|
- test/test_win32_api_function.rb
|
60
53
|
- win32-api.gemspec
|
61
54
|
- ext/win32/api.c
|
62
|
-
has_rdoc: true
|
63
55
|
homepage: http://www.rubyforge.org/projects/win32utils
|
64
|
-
licenses:
|
56
|
+
licenses:
|
65
57
|
- Artistic 2.0
|
58
|
+
metadata: {}
|
66
59
|
post_install_message:
|
67
60
|
rdoc_options: []
|
68
|
-
|
69
|
-
require_paths:
|
61
|
+
require_paths:
|
70
62
|
- lib
|
71
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
hash: 51
|
77
|
-
segments:
|
78
|
-
- 1
|
79
|
-
- 8
|
80
|
-
- 2
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - '>='
|
66
|
+
- !ruby/object:Gem::Version
|
81
67
|
version: 1.8.2
|
82
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
hash: 3
|
88
|
-
segments:
|
89
|
-
- 0
|
90
|
-
version: "0"
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
91
73
|
requirements: []
|
92
|
-
|
93
74
|
rubyforge_project: win32utils
|
94
|
-
rubygems_version:
|
75
|
+
rubygems_version: 2.0.3
|
95
76
|
signing_key:
|
96
|
-
specification_version:
|
77
|
+
specification_version: 4
|
97
78
|
summary: A superior replacement for Win32API
|
98
|
-
test_files:
|
79
|
+
test_files:
|
99
80
|
- test/test_win32_api.rb
|
100
81
|
- test/test_win32_api_callback.rb
|
101
82
|
- test/test_win32_api_function.rb
|