jruby-win32ole 0.8.0 → 0.8.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.
- data/.gitignore +0 -0
- data/Gemfile +0 -0
- data/Rakefile +0 -0
- data/VERSION +1 -1
- data/bin/make_data.rb +0 -0
- data/bin/sample +0 -0
- data/build.xml +0 -0
- data/jruby-win32ole.gemspec +0 -0
- data/lib/jruby-win32ole.rb +1 -15
- data/lib/jruby-win32ole/version.rb +1 -1
- data/lib/racob-x64.dll +0 -0
- data/lib/racob-x86.dll +0 -0
- data/lib/racob.jar +0 -0
- data/lib/win32ole/utils.rb +3 -56
- data/lib/win32ole/win32ole.jar +0 -0
- data/lib/win32ole/win32ole_event.rb +2 -0
- data/lib/win32ole/win32ole_method.rb +3 -0
- data/lib/win32ole/win32ole_param.rb +0 -0
- data/lib/win32ole/win32ole_ruby.rb +0 -0
- data/lib/win32ole/win32ole_type.rb +2 -0
- data/lib/win32ole/win32ole_typelib.rb +2 -0
- data/lib/win32ole/win32ole_variable.rb +15 -2
- data/nbproject/build-impl.xml +0 -0
- data/nbproject/genfiles.properties +0 -0
- data/nbproject/private/config.properties +0 -0
- data/nbproject/private/private.properties +0 -0
- data/nbproject/private/private.xml +0 -0
- data/nbproject/project.properties +2 -2
- data/nbproject/project.xml +0 -0
- data/samples/dir_enum_bench.rb +0 -0
- data/samples/dispatch_bench.rb +0 -0
- data/samples/dump.rb +20 -0
- data/samples/fs.rb +0 -0
- data/samples/small_enum_bench.rb +0 -0
- data/src/org/jruby/ext/win32ole/RubyInvocationProxy.java +0 -0
- data/src/org/jruby/ext/win32ole/RubyWIN32OLE.java +2 -1
- data/src/win32ole/Win32oleService.java +0 -0
- metadata +67 -71
data/.gitignore
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.1
|
data/bin/make_data.rb
CHANGED
File without changes
|
data/bin/sample
CHANGED
File without changes
|
data/build.xml
CHANGED
File without changes
|
data/jruby-win32ole.gemspec
CHANGED
File without changes
|
data/lib/jruby-win32ole.rb
CHANGED
@@ -10,25 +10,11 @@ require 'racob.jar'
|
|
10
10
|
require 'win32ole/win32ole' # <- java native impl of WIN32OLE
|
11
11
|
require 'win32ole/win32ole_ruby' # <- ruby impl of WIN32OLE
|
12
12
|
|
13
|
-
java_import
|
14
|
-
|
15
|
-
java_import org.racob.com.Variant
|
16
|
-
java_import org.racob.com.Automation
|
17
|
-
java_import org.racob.com.ComFailException
|
18
|
-
java_import org.racob.com.ComThread
|
19
|
-
java_import org.racob.com.Dispatch
|
20
|
-
java_import org.racob.com.DispatchEvents
|
21
|
-
java_import org.racob.com.EnumVariant
|
22
|
-
java_import org.racob.com.FuncDesc
|
23
|
-
java_import org.racob.com.TypeInfo
|
24
|
-
java_import org.racob.com.TypeLib
|
25
|
-
java_import org.racob.com.VarDesc
|
26
|
-
java_import org.racob.com.VariantUtilities
|
13
|
+
java_import org.racob.com.Variant # Needed for static native initializer :(
|
27
14
|
|
28
15
|
java_import org.jruby.ext.win32ole.RubyWIN32OLE
|
29
16
|
java_import org.jruby.ext.win32ole.RubyInvocationProxy
|
30
17
|
|
31
|
-
|
32
18
|
require 'win32ole/win32ole_error'
|
33
19
|
require 'win32ole/win32ole_method'
|
34
20
|
require 'win32ole/win32ole_variant'
|
data/lib/racob-x64.dll
CHANGED
Binary file
|
data/lib/racob-x86.dll
CHANGED
Binary file
|
data/lib/racob.jar
CHANGED
Binary file
|
data/lib/win32ole/utils.rb
CHANGED
@@ -2,8 +2,8 @@ require 'win32ole/win32ole_variant'
|
|
2
2
|
|
3
3
|
class WIN32OLE
|
4
4
|
module Utils
|
5
|
-
|
6
|
-
|
5
|
+
java_import org.racob.com.ComFailException
|
6
|
+
java_import org.racob.com.Dispatch
|
7
7
|
|
8
8
|
def SafeStringValue(str)
|
9
9
|
return str if str.kind_of?(::String)
|
@@ -19,44 +19,6 @@ class WIN32OLE
|
|
19
19
|
value
|
20
20
|
end
|
21
21
|
|
22
|
-
# Convert the supplied variant value to an equivalent Ruby value.
|
23
|
-
# If dispose is true then also dispose the variant itself.
|
24
|
-
def from_variant(value)
|
25
|
-
object = VariantUtilities.variant_to_object(value)
|
26
|
-
case object
|
27
|
-
when Dispatch then
|
28
|
-
object = WIN32OLE.new(object)
|
29
|
-
when java.util.Date then
|
30
|
-
object = java_date2ruby_time(object)
|
31
|
-
end
|
32
|
-
|
33
|
-
# Jacob will return null on out of bound dates whereas MRI returns
|
34
|
-
# some date windows normally returns. We will match this.
|
35
|
-
if object.nil? && !value.nil?
|
36
|
-
case value.getvt
|
37
|
-
when Variant::VariantDate, (Variant::VariantDate|Variant::VariantByref) then
|
38
|
-
object = OUT_OF_RANGE_DATE
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
object
|
44
|
-
end
|
45
|
-
|
46
|
-
# Simliar to MRI:vtdate2rbtime but we work with Java date instead of
|
47
|
-
# raw variant type
|
48
|
-
def java_date2ruby_time(date)
|
49
|
-
calendar = Calendar.get_instance
|
50
|
-
calendar.time = date
|
51
|
-
|
52
|
-
Time.local(calendar.get(Calendar::YEAR),
|
53
|
-
calendar.get(Calendar::MONTH),
|
54
|
-
calendar.get(Calendar::DAY_OF_MONTH),
|
55
|
-
calendar.get(Calendar::HOUR_OF_DAY),
|
56
|
-
calendar.get(Calendar::MINUTE),
|
57
|
-
calendar.get(Calendar::SECOND))
|
58
|
-
end
|
59
|
-
|
60
22
|
def methods_with_flag(flag)
|
61
23
|
members = []
|
62
24
|
all_methods(typeinfo_from_ole) do |typeinfo, old_typeinfo, desc, docs, i|
|
@@ -123,7 +85,7 @@ class WIN32OLE
|
|
123
85
|
path = path_reg.open(arch) { |r| r.read(nil) }[1]
|
124
86
|
# puts "PATH = #{path}"
|
125
87
|
begin
|
126
|
-
Automation.loadTypeLib(path)
|
88
|
+
org.racob.com.Automation.loadTypeLib(path)
|
127
89
|
rescue ComFailException => e
|
128
90
|
# puts "Failed to load #{name} fom #{path} because: #{e}"
|
129
91
|
nil
|
@@ -211,20 +173,5 @@ class WIN32OLE
|
|
211
173
|
|
212
174
|
type_details ? type_details : type_string
|
213
175
|
end
|
214
|
-
|
215
|
-
def variable_kind_string(varkind)
|
216
|
-
case varkind
|
217
|
-
when VarDesc::VAR_PERINSTANCE then
|
218
|
-
"PERINSTANCE"
|
219
|
-
when VarDesc::VAR_STATIC then
|
220
|
-
"STATIC"
|
221
|
-
when VarDesc::VAR_CONST then
|
222
|
-
"CONSTANT"
|
223
|
-
when VarDesc::VAR_DISPATCH then
|
224
|
-
"DISPATCH"
|
225
|
-
else
|
226
|
-
"UNKNOWN"
|
227
|
-
end
|
228
|
-
end
|
229
176
|
end
|
230
177
|
end
|
data/lib/win32ole/win32ole.jar
CHANGED
Binary file
|
File without changes
|
File without changes
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class WIN32OLE_VARIABLE
|
2
|
+
java_import org.racob.com.VarDesc
|
3
|
+
|
2
4
|
attr_reader :name
|
3
5
|
|
4
6
|
def initialize(type, var_desc, name)
|
@@ -15,11 +17,22 @@ class WIN32OLE_VARIABLE
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def value
|
18
|
-
from_variant(@var_desc.constant)
|
20
|
+
RubyWIN32OLE.from_variant(JRuby.runtime, @var_desc.constant)
|
19
21
|
end
|
20
22
|
|
21
23
|
def variable_kind
|
22
|
-
|
24
|
+
case varkind
|
25
|
+
when VarDesc::VAR_PERINSTANCE then
|
26
|
+
"PERINSTANCE"
|
27
|
+
when VarDesc::VAR_STATIC then
|
28
|
+
"STATIC"
|
29
|
+
when VarDesc::VAR_CONST then
|
30
|
+
"CONSTANT"
|
31
|
+
when VarDesc::VAR_DISPATCH then
|
32
|
+
"DISPATCH"
|
33
|
+
else
|
34
|
+
"UNKNOWN"
|
35
|
+
end
|
23
36
|
end
|
24
37
|
|
25
38
|
def varkind
|
data/nbproject/build-impl.xml
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
application.title=win32ole
|
2
2
|
application.vendor=Fuebo
|
3
3
|
build.classes.dir=${build.dir}/classes
|
4
|
-
build.classes.excludes=**/*.java,**/*.form
|
4
|
+
build.classes.excludes=**/*.java,**/*.form,**/*.jar
|
5
5
|
# This directory is removed when the project is cleaned:
|
6
6
|
build.dir=build
|
7
7
|
build.generated.dir=${build.dir}/generated
|
@@ -22,7 +22,7 @@ dist.jar=${dist.dir}/win32ole.jar
|
|
22
22
|
dist.javadoc.dir=${dist.dir}/javadoc
|
23
23
|
endorsed.classpath=
|
24
24
|
excludes=**.dll
|
25
|
-
file.reference.jruby.jar
|
25
|
+
file.reference.jruby.jar=../jruby/lib/jruby.jar
|
26
26
|
file.reference.jrwin32ole-lib=lib
|
27
27
|
file.reference.jrwin32ole-src=src
|
28
28
|
file.reference.racob.jar=lib/racob.jar
|
data/nbproject/project.xml
CHANGED
File without changes
|
data/samples/dir_enum_bench.rb
CHANGED
File without changes
|
data/samples/dispatch_bench.rb
CHANGED
File without changes
|
data/samples/dump.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'win32ole'
|
2
|
+
|
3
|
+
name = proc {|a, b| a.name <=> b.name }
|
4
|
+
WIN32OLE_TYPELIB.typelibs.sort(&name).each do |typelib|
|
5
|
+
puts "TYPELIB: #{typelib.name}"
|
6
|
+
typelib.ole_classes.sort(&name).each do |ole_class|
|
7
|
+
puts " CLASS: #{ole_class.name}"
|
8
|
+
puts " GUID : #{ole_class.guid}"
|
9
|
+
puts " PROGID : #{ole_class.progid}"
|
10
|
+
puts " DESCR : #{ole_class.helpstring}"
|
11
|
+
|
12
|
+
ole_class.ole_methods.sort(&name).each do |ole_method|
|
13
|
+
print " #{ole_method.return_type} #{ole_method.name}("
|
14
|
+
print ole_method.params.to_a.inject([]) { |sum, param|
|
15
|
+
sum << "#{param.ole_type} #{param.name}"
|
16
|
+
}.join(", ")
|
17
|
+
puts ")"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/samples/fs.rb
CHANGED
File without changes
|
data/samples/small_enum_bench.rb
CHANGED
File without changes
|
File without changes
|
@@ -63,6 +63,7 @@ public class RubyWIN32OLE extends RubyObject {
|
|
63
63
|
Variant value = enumVariant.nextElement();
|
64
64
|
block.yield(context, fromVariant(runtime, value));
|
65
65
|
}
|
66
|
+
enumVariant.safeRelease();
|
66
67
|
|
67
68
|
return runtime.getNil();
|
68
69
|
}
|
@@ -275,4 +276,4 @@ public class RubyWIN32OLE extends RubyObject {
|
|
275
276
|
|
276
277
|
return id;
|
277
278
|
}
|
278
|
-
}
|
279
|
+
}
|
File without changes
|
metadata
CHANGED
@@ -1,80 +1,80 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jruby-win32ole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 63
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
version: 0.8.
|
6
|
+
- 0
|
7
|
+
- 8
|
8
|
+
- 1
|
9
|
+
version: 0.8.1
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
|
-
- Thomas E. Enebo
|
12
|
+
- Thomas E. Enebo
|
14
13
|
autorequire:
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-11-09 00:00:00 -06:00
|
19
18
|
default_executable:
|
20
19
|
dependencies: []
|
21
20
|
|
22
21
|
description: A Gem for win32ole support on JRuby
|
23
22
|
email: tom.enebo@gmail.com
|
24
23
|
executables:
|
25
|
-
- make_data.rb
|
26
|
-
- sample
|
24
|
+
- make_data.rb
|
25
|
+
- sample
|
27
26
|
extensions: []
|
28
27
|
|
29
28
|
extra_rdoc_files: []
|
30
29
|
|
31
30
|
files:
|
32
|
-
- .gitignore
|
33
|
-
- Gemfile
|
34
|
-
- README
|
35
|
-
- Rakefile
|
36
|
-
- VERSION
|
37
|
-
- bin/make_data.rb
|
38
|
-
- bin/sample
|
39
|
-
- build.xml
|
40
|
-
- jruby-win32ole.gemspec
|
41
|
-
- lib/jruby-win32ole.rb
|
42
|
-
- lib/jruby-win32ole/version.rb
|
43
|
-
- lib/racob-x64.dll
|
44
|
-
- lib/racob-x86.dll
|
45
|
-
- lib/racob.jar
|
46
|
-
- lib/win32ole/utils.rb
|
47
|
-
- lib/win32ole/win32ole.jar
|
48
|
-
- lib/win32ole/win32ole_error.rb
|
49
|
-
- lib/win32ole/win32ole_event.rb
|
50
|
-
- lib/win32ole/win32ole_method.rb
|
51
|
-
- lib/win32ole/win32ole_param.rb
|
52
|
-
- lib/win32ole/win32ole_ruby.rb
|
53
|
-
- lib/win32ole/win32ole_type.rb
|
54
|
-
- lib/win32ole/win32ole_typelib.rb
|
55
|
-
- lib/win32ole/win32ole_variable.rb
|
56
|
-
- lib/win32ole/win32ole_variant.rb
|
57
|
-
- nbproject/build-impl.xml
|
58
|
-
- nbproject/genfiles.properties
|
59
|
-
- nbproject/private/config.properties
|
60
|
-
- nbproject/private/private.properties
|
61
|
-
- nbproject/private/private.xml
|
62
|
-
- nbproject/project.properties
|
63
|
-
- nbproject/project.xml
|
64
|
-
- samples/browser_connect.rb
|
65
|
-
- samples/const_load.rb
|
66
|
-
- samples/dir_enum_bench.rb
|
67
|
-
- samples/dispatch_bench.rb
|
68
|
-
- samples/
|
69
|
-
- samples/
|
70
|
-
- samples/
|
71
|
-
- samples/
|
72
|
-
- samples/
|
73
|
-
- samples/
|
74
|
-
- samples/
|
75
|
-
-
|
76
|
-
- src/org/jruby/ext/win32ole/
|
77
|
-
- src/win32ole/
|
31
|
+
- .gitignore
|
32
|
+
- Gemfile
|
33
|
+
- README
|
34
|
+
- Rakefile
|
35
|
+
- VERSION
|
36
|
+
- bin/make_data.rb
|
37
|
+
- bin/sample
|
38
|
+
- build.xml
|
39
|
+
- jruby-win32ole.gemspec
|
40
|
+
- lib/jruby-win32ole.rb
|
41
|
+
- lib/jruby-win32ole/version.rb
|
42
|
+
- lib/racob-x64.dll
|
43
|
+
- lib/racob-x86.dll
|
44
|
+
- lib/racob.jar
|
45
|
+
- lib/win32ole/utils.rb
|
46
|
+
- lib/win32ole/win32ole.jar
|
47
|
+
- lib/win32ole/win32ole_error.rb
|
48
|
+
- lib/win32ole/win32ole_event.rb
|
49
|
+
- lib/win32ole/win32ole_method.rb
|
50
|
+
- lib/win32ole/win32ole_param.rb
|
51
|
+
- lib/win32ole/win32ole_ruby.rb
|
52
|
+
- lib/win32ole/win32ole_type.rb
|
53
|
+
- lib/win32ole/win32ole_typelib.rb
|
54
|
+
- lib/win32ole/win32ole_variable.rb
|
55
|
+
- lib/win32ole/win32ole_variant.rb
|
56
|
+
- nbproject/build-impl.xml
|
57
|
+
- nbproject/genfiles.properties
|
58
|
+
- nbproject/private/config.properties
|
59
|
+
- nbproject/private/private.properties
|
60
|
+
- nbproject/private/private.xml
|
61
|
+
- nbproject/project.properties
|
62
|
+
- nbproject/project.xml
|
63
|
+
- samples/browser_connect.rb
|
64
|
+
- samples/const_load.rb
|
65
|
+
- samples/dir_enum_bench.rb
|
66
|
+
- samples/dispatch_bench.rb
|
67
|
+
- samples/dump.rb
|
68
|
+
- samples/file_system_object.rb
|
69
|
+
- samples/fs.rb
|
70
|
+
- samples/ie_plus_events.rb
|
71
|
+
- samples/ie_simple.rb
|
72
|
+
- samples/ie_simple_clsid.rb
|
73
|
+
- samples/sbem.rb
|
74
|
+
- samples/small_enum_bench.rb
|
75
|
+
- src/org/jruby/ext/win32ole/RubyInvocationProxy.java
|
76
|
+
- src/org/jruby/ext/win32ole/RubyWIN32OLE.java
|
77
|
+
- src/win32ole/Win32oleService.java
|
78
78
|
has_rdoc: true
|
79
79
|
homepage: http://github.com/enebo/jruby-win32ole
|
80
80
|
licenses: []
|
@@ -83,29 +83,25 @@ post_install_message:
|
|
83
83
|
rdoc_options: []
|
84
84
|
|
85
85
|
require_paths:
|
86
|
-
- lib
|
86
|
+
- lib
|
87
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
88
|
requirements:
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
version: "0"
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
96
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
95
|
requirements:
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
version: "0"
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
segments:
|
99
|
+
- 0
|
100
|
+
version: "0"
|
105
101
|
requirements: []
|
106
102
|
|
107
103
|
rubyforge_project: jruby-win32ole
|
108
|
-
rubygems_version: 1.3.
|
104
|
+
rubygems_version: 1.3.6
|
109
105
|
signing_key:
|
110
106
|
specification_version: 3
|
111
107
|
summary: A Gem for win32ole support on JRuby
|