http://github.com/shri/ironruby/commit/7e0f79ec26bb9ba0e9f5066552bc85fbba2dabbb
Over the past week, I decided to take a look at WIN32OLE, and ended up with most of the basic stuff supported. It builds on top of IronRuby's COM interop support. Features that work are: * Object instantiation with WIN32OLE.new * Calling methods, accessing properties * Converting Ruby type arguments (ie. String, Array, etc) to System.String, System.Array, etc * Enumeration via WIN32OLE#each * Accessing enum values from the type library via WIN32OLE.const_load Events (WIN32OLE_EVENT) are not supported since IronRuby does not support COM events yet. Also, this TODO from win32ole.rb : # TODO - Instead of wrapping the RCWs (runtime-callable-wrapper), we should just # return them directly (and make WIN32OLE an alias for System.__ComObject). We currently # wrap them so that we can cheaply customize the behavior of the resulting object # (for eg, to convert the arguments). # However, all the customizations should be moved into the IronRuby runtime # itself and made to work directly against RCWs. This will allow better cross-language # inteorp of passing RCW arguments, better perf since it will avail of call-site # caching, and object identity. * Merlin/Main/Languages/Ruby/Libs/win32ole.rb<http://github.com/shri/ironruby/tree/7e0f79ec26bb9ba0e9f5066552bc85fbba2dabbb/Merlin/Main/Languages/Ruby/Libs/win32ole.rb> * Merlin/Main/Languages/Ruby/Tests/Interop/com/win32ole_spec.rb<http://github.com/shri/ironruby/tree/7e0f79ec26bb9ba0e9f5066552bc85fbba2dabbb/Merlin/Main/Languages/Ruby/Tests/Interop/com/win32ole_spec.rb> * Merlin/Main/Runtime/Microsoft.Scripting/Utils/CollectionUtils.cs<http://github.com/shri/ironruby/commit/7e0f79ec26bb9ba0e9f5066552bc85fbba2dabbb#diff-2> http://github.com/shri/ironruby/commit/5fb483dd13b8c0c950627e9624973e4fa60cf784 Converts COM interop tests to using win32ole. Hardly any changes were required! The only change required is that win32ole requires using parenthesis to access indexed properties, but the tests used square brackets. For now, I have added support to win32ole for square brackets instead of modifying the tests. Also, WIN32OLE_EVENT does not seem to have any way of unsubscribing from an event. adodb_spec has a weird failure only with non-managled names, and so I have left it using Type.GetTypeFromProgID for now * Merlin/Main/Languages/Ruby/Libs/win32ole.rb<http://github.com/shri/ironruby/commit/5fb483dd13b8c0c950627e9624973e4fa60cf784#diff-0> * Merlin/Main/Languages/Ruby/Tests/Interop/com/apps/adodb_spec.rb<http://github.com/shri/ironruby/commit/5fb483dd13b8c0c950627e9624973e4fa60cf784#diff-1> * Merlin/Main/Languages/Ruby/Tests/Interop/com/apps/excel_spec.rb<http://github.com/shri/ironruby/commit/5fb483dd13b8c0c950627e9624973e4fa60cf784#diff-2> * Merlin/Main/Languages/Ruby/Tests/Interop/com/apps/word_spec.rb<http://github.com/shri/ironruby/commit/5fb483dd13b8c0c950627e9624973e4fa60cf784#diff-3> * Merlin/Main/Languages/Ruby/Tests/Interop/com/com_helper.rb<http://github.com/shri/ironruby/commit/5fb483dd13b8c0c950627e9624973e4fa60cf784#diff-4>
_______________________________________________ Ironruby-core mailing list [email protected] http://rubyforge.org/mailman/listinfo/ironruby-core
