windows-api 0.3.1 → 0.4.0
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 +6 -0
- data/Rakefile +7 -3
- data/lib/windows/api.rb +8 -4
- data/test/test_windows_api.rb +2 -1
- data/windows-api.gemspec +12 -15
- metadata +4 -3
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 0.4.0 - 18-Oct-2009
|
2
|
+
* Methods that begin with an underscore, such as _umask(), are now preserved.
|
3
|
+
A method alias is also created without an underscore, e.g. umask().
|
4
|
+
* Added the gem task to the Rakefile.
|
5
|
+
* Minor updates to the gemspec.
|
6
|
+
|
1
7
|
== 0.3.1 - 18-Aug-2009
|
2
8
|
* Changed license to Artistic 2.0.
|
3
9
|
* Some gemspec updates, including the addition of a license, an updated
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ require 'rake/testtask'
|
|
4
4
|
require 'rbconfig'
|
5
5
|
include Config
|
6
6
|
|
7
|
-
desc 'Install the windows-api
|
7
|
+
desc 'Install the windows-api library (non-gem)'
|
8
8
|
task :install do
|
9
9
|
sitelibdir = CONFIG["sitelibdir"]
|
10
10
|
installdir = File.join(sitelibdir, 'windows')
|
@@ -13,8 +13,12 @@ task :install do
|
|
13
13
|
FileUtils.cp(file, installdir, :verbose => true)
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
desc 'Build the windows-api gem'
|
17
|
+
task :gem do
|
18
|
+
spec = eval(IO.read('windows-api.gemspec'))
|
19
|
+
Gem::Builder.new(spec).build
|
20
|
+
|
21
|
+
task :install_gem => [:gem] do
|
18
22
|
file = Dir["*.gem"].first
|
19
23
|
sh "gem install #{file}"
|
20
24
|
end
|
data/lib/windows/api.rb
CHANGED
@@ -25,7 +25,7 @@ module Windows
|
|
25
25
|
extend Forwardable
|
26
26
|
|
27
27
|
# The version of the windows-api library
|
28
|
-
VERSION = '0.
|
28
|
+
VERSION = '0.4.0'
|
29
29
|
|
30
30
|
# The methods from Win32::API are delegated to the appropriate object
|
31
31
|
def_delegators(:@api, :function_name, :dll_name, :prototype)
|
@@ -422,9 +422,6 @@ module Windows
|
|
422
422
|
# Use the upper case function equivalent if defined
|
423
423
|
call_func = func_upper || func
|
424
424
|
|
425
|
-
# Remove leading underscores from msvcrt functions
|
426
|
-
func = func[1, func.length] if func[0].chr == '_'
|
427
|
-
|
428
425
|
if @boolean
|
429
426
|
string = <<-EOC
|
430
427
|
module #{Windows::API.auto_namespace}
|
@@ -473,6 +470,13 @@ module Windows
|
|
473
470
|
end
|
474
471
|
}
|
475
472
|
end
|
473
|
+
|
474
|
+
# Create aliases for methods with an underscore that do not
|
475
|
+
# require an underscore, e.g. umask and _umask.
|
476
|
+
if func[0].chr == '_'
|
477
|
+
func_alias = func[1, func.length]
|
478
|
+
string << "alias #{func_alias} #{func}\n"
|
479
|
+
end
|
476
480
|
|
477
481
|
string << 'end'
|
478
482
|
end
|
data/test/test_windows_api.rb
CHANGED
@@ -56,7 +56,7 @@ class TC_Windows_API < Test::Unit::TestCase
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_version
|
59
|
-
assert_equal('0.
|
59
|
+
assert_equal('0.4.0', API::VERSION)
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_full_data_types
|
@@ -85,6 +85,7 @@ class TC_Windows_API < Test::Unit::TestCase
|
|
85
85
|
def test_lower_case_auto_methods
|
86
86
|
assert_respond_to(self, :strstr)
|
87
87
|
assert_respond_to(self, :umask)
|
88
|
+
assert_respond_to(self, :_umask)
|
88
89
|
assert_respond_to(self, :waveOutGetNumDevs)
|
89
90
|
assert_equal('llo', strstr('hello', 'l'))
|
90
91
|
end
|
data/windows-api.gemspec
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
|
3
|
-
|
4
|
-
gem.name
|
5
|
-
gem.version
|
6
|
-
gem.author
|
7
|
-
gem.license
|
8
|
-
gem.email
|
9
|
-
gem.homepage
|
10
|
-
gem.
|
11
|
-
gem.
|
12
|
-
gem.
|
13
|
-
gem.
|
14
|
-
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'windows-api'
|
5
|
+
gem.version = '0.4.0'
|
6
|
+
gem.author = 'Daniel J. Berger'
|
7
|
+
gem.license = 'Artistic 2.0'
|
8
|
+
gem.email = 'djberg96@gmail.com'
|
9
|
+
gem.homepage = 'http://www.rubyforge.org/projects/win32utils'
|
10
|
+
gem.summary = 'An easier way to create methods using Win32::API'
|
11
|
+
gem.test_files = Dir['test/test*.rb']
|
12
|
+
gem.has_rdoc = true
|
13
|
+
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
15
14
|
|
16
15
|
gem.rubyforge_project = 'win32utils'
|
17
16
|
gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
18
17
|
|
19
|
-
gem.add_dependency('win32-api', '>= 1.4.
|
18
|
+
gem.add_dependency('win32-api', '>= 1.4.5')
|
20
19
|
|
21
20
|
gem.description = <<-EOF
|
22
21
|
The windows-api library provides features over and above the basic
|
@@ -26,5 +25,3 @@ spec = Gem::Specification.new do |gem|
|
|
26
25
|
ability to use native Windows type declarations.
|
27
26
|
EOF
|
28
27
|
end
|
29
|
-
|
30
|
-
Gem::Builder.new(spec).build
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: windows-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-18 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.4.
|
23
|
+
version: 1.4.5
|
24
24
|
version:
|
25
25
|
description: " The windows-api library provides features over and above the basic\n interface provided by the win32-api library. Features included automatic\n constant generation, automatic defintion of ANSI and Unicode methods,\n special handling of functions that return a boolean value, and the\n ability to use native Windows type declarations.\n"
|
26
26
|
email: djberg96@gmail.com
|
@@ -71,4 +71,5 @@ signing_key:
|
|
71
71
|
specification_version: 3
|
72
72
|
summary: An easier way to create methods using Win32::API
|
73
73
|
test_files:
|
74
|
+
- test/test_wide_string.rb
|
74
75
|
- test/test_windows_api.rb
|