jruby-win32ole 0.8.2 → 0.8.3

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.1
1
+ 0.8.3
data/bin/sample CHANGED
File without changes
@@ -1,5 +1,5 @@
1
1
  module JRuby
2
2
  module WIN32OLE
3
- VERSION = "0.8.2"
3
+ VERSION = "0.8.3"
4
4
  end
5
5
  end
Binary file
Binary file
Binary file
Binary file
@@ -5,7 +5,6 @@ import org.racob.com.EnumVariant;
5
5
  import org.racob.com.Variant;
6
6
  import java.util.Calendar;
7
7
  import java.util.Date;
8
- import java.util.List;
9
8
  import org.jruby.Ruby;
10
9
  import org.jruby.RubyArray;
11
10
  import org.jruby.RubyClass;
@@ -73,23 +72,21 @@ public class RubyWIN32OLE extends RubyObject {
73
72
  @JRubyMethod(required = 3)
74
73
  public IRubyObject _getproperty(ThreadContext context, IRubyObject dispid,
75
74
  IRubyObject args, IRubyObject argTypes) {
76
- RubyArray argsArray = args.convertToArray();
77
- Object[] objectArgs = makeObjectArgs(argsArray);
78
- int dispatchId = (int) RubyInteger.num2long(dispid);
75
+ Object[] objectArgs = makeObjectArgs(args.convertToArray());
76
+ int id = (int) RubyInteger.num2long(dispid);
77
+ Ruby runtime = context.getRuntime();
79
78
 
80
- if (objectArgs.length == 0) {
81
- return fromObject(context.getRuntime(), Dispatch.callO(dispatch, dispatchId));
82
- }
79
+ if (objectArgs.length == 0) return fromObject(runtime, dispatch.callO(id));
83
80
 
84
- return fromVariant(context.getRuntime(),
85
- Dispatch.call(dispatch, dispatchId, objectArgs));
81
+ return fromVariant(runtime, dispatch.call(id, objectArgs));
86
82
  }
87
83
 
88
84
  @JRubyMethod(required = 1, rest = true)
89
85
  public IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
90
86
  String id = args[0].convertToString().asJavaString();
87
+ String progId = toProgID(id);
91
88
 
92
- dispatch = new Dispatch(toProgID(id));
89
+ dispatch = new Dispatch(progId);
93
90
 
94
91
  return this;
95
92
  }
@@ -126,14 +123,15 @@ public class RubyWIN32OLE extends RubyObject {
126
123
  public IRubyObject op_aref(ThreadContext context, IRubyObject property) {
127
124
  String propertyName = property.asJavaString();
128
125
 
129
- return fromVariant(context.getRuntime(), Dispatch.get(dispatch, propertyName));
126
+ return fromVariant(context.getRuntime(), dispatch.get(propertyName));
130
127
  }
131
128
 
132
129
  @JRubyMethod(name = "[]=", required = 2)
133
130
  public IRubyObject op_aset(ThreadContext context, IRubyObject property, IRubyObject value) {
134
131
  String propertyName = property.asJavaString();
135
132
 
136
- Dispatch.put(dispatch, propertyName, toObject(value));
133
+ dispatch.put(propertyName, toObject(value));
134
+
137
135
  return context.getRuntime().getNil();
138
136
  }
139
137
 
@@ -154,7 +152,7 @@ public class RubyWIN32OLE extends RubyObject {
154
152
  Object[] objectArgs = makeObjectArgs(args, 1);
155
153
  int[] errorArgs = new int[objectArgs.length];
156
154
 
157
- Dispatch.invoke(dispatch, methodName, Dispatch.Put, objectArgs, errorArgs);
155
+ dispatch.invoke(methodName, Dispatch.Put, objectArgs, errorArgs);
158
156
  return context.getRuntime().getNil();
159
157
  }
160
158
 
@@ -164,10 +162,9 @@ public class RubyWIN32OLE extends RubyObject {
164
162
  int dispatchId = (int) RubyInteger.num2long(dispid);
165
163
  Object[] objectArgs = makeObjectArgs(argsArray);
166
164
  int[] errorArgs = makeErrorArgs(objectArgs.length);
167
- Variant returnValue = Dispatch.invoke(dispatch, dispatchId, dispatchType,
165
+ Variant returnValue = dispatch.invoke(dispatchId, dispatchType,
168
166
  objectArgs, errorArgs);
169
167
 
170
- System.out.println("INVOKEINTERNAL: " + returnValue);
171
168
  return fromVariant(context.getRuntime(), returnValue);
172
169
  }
173
170
  private int[] makeErrorArgs(int size) {
@@ -201,10 +198,10 @@ public class RubyWIN32OLE extends RubyObject {
201
198
 
202
199
  private IRubyObject invokeMethodOrGet(ThreadContext context, String methodName, IRubyObject[] args) {
203
200
  if (args.length == 1) { // No-arg call
204
- return fromObject(context.getRuntime(), Dispatch.callO(dispatch, methodName));
201
+ return fromObject(context.getRuntime(), dispatch.callO(methodName));
205
202
  }
206
203
  return fromVariant(context.getRuntime(),
207
- Dispatch.callN(dispatch, methodName, makeObjectArgs(args, 1)));
204
+ dispatch.callN(methodName, makeObjectArgs(args, 1)));
208
205
  }
209
206
 
210
207
  @Override
@@ -300,8 +297,8 @@ public class RubyWIN32OLE extends RubyObject {
300
297
  }
301
298
 
302
299
  public static String toProgID(String id) {
303
- if (id != null && id.startsWith("{{") && id.endsWith("}}")) {
304
- return id.substring(2, id.length() - 2);
300
+ if (id != null && id.startsWith("{") && id.endsWith("}")) {
301
+ return "clsid:" + id.substring(1, id.length() - 1);
305
302
  }
306
303
 
307
304
  return id;
metadata CHANGED
@@ -1,80 +1,81 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-win32ole
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 57
4
5
  prerelease: false
5
6
  segments:
6
- - 0
7
- - 8
8
- - 2
9
- version: 0.8.2
7
+ - 0
8
+ - 8
9
+ - 3
10
+ version: 0.8.3
10
11
  platform: ruby
11
12
  authors:
12
- - Thomas E. Enebo
13
+ - Thomas E. Enebo
13
14
  autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-12-19 00:00:00 -06:00
18
+ date: 2010-12-27 00:00:00 -06:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
21
22
  description: A Gem for win32ole support on JRuby
22
23
  email: tom.enebo@gmail.com
23
24
  executables:
24
- - make_data.rb
25
- - sample
25
+ - make_data.rb
26
+ - sample
26
27
  extensions: []
27
28
 
28
29
  extra_rdoc_files: []
29
30
 
30
31
  files:
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
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/dump.rb
69
+ - samples/file_system_object.rb
70
+ - samples/fs.rb
71
+ - samples/ie_plus_events.rb
72
+ - samples/ie_simple.rb
73
+ - samples/ie_simple_clsid.rb
74
+ - samples/sbem.rb
75
+ - samples/small_enum_bench.rb
76
+ - src/org/jruby/ext/win32ole/RubyInvocationProxy.java
77
+ - src/org/jruby/ext/win32ole/RubyWIN32OLE.java
78
+ - src/win32ole/Win32oleService.java
78
79
  has_rdoc: true
79
80
  homepage: http://github.com/enebo/jruby-win32ole
80
81
  licenses: []
@@ -83,25 +84,29 @@ post_install_message:
83
84
  rdoc_options: []
84
85
 
85
86
  require_paths:
86
- - lib
87
+ - lib
87
88
  required_ruby_version: !ruby/object:Gem::Requirement
89
+ none: false
88
90
  requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- segments:
92
- - 0
93
- version: "0"
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 0
96
+ version: "0"
94
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
+ none: false
95
99
  requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- segments:
99
- - 0
100
- version: "0"
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ hash: 3
103
+ segments:
104
+ - 0
105
+ version: "0"
101
106
  requirements: []
102
107
 
103
108
  rubyforge_project: jruby-win32ole
104
- rubygems_version: 1.3.6
109
+ rubygems_version: 1.3.7
105
110
  signing_key:
106
111
  specification_version: 3
107
112
  summary: A Gem for win32ole support on JRuby