summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-03 06:07:24 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-03 06:07:24 +0000
commit93ae434772f0607ebdfc848836c35aaeda7d5f38 (patch)
tree73cc132cc60474a3c1c20a953fceafedd0165207
parent1f67ebd5a70284c797a43330f5d7768e19302762 (diff)
* ext/win32ole/lib/win32ole.rb :add WIN32OLE#methods. WIN32OLE might work
well with did_you_mean gem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/win32ole/lib/win32ole.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/win32ole/lib/win32ole.rb b/ext/win32ole/lib/win32ole.rb
new file mode 100644
index 0000000..30319b5
--- /dev/null
+++ b/ext/win32ole/lib/win32ole.rb
@@ -0,0 +1,25 @@
+begin
+ require 'win32ole.so'
+rescue LoadError
+ # do nothing
+end
+
+if defined?(WIN32OLE)
+ # WIN32OLE
+ class WIN32OLE
+
+ #
+ # By overriding Object#methods, WIN32OLE might
+ # work well with did_you_mean gem.
+ # This is exprimental.
+ #
+ # require 'win32ole'
+ # dict = WIN32OLE.new('Scripting.Dictionary')
+ # dict.Ade('a', 1)
+ # #=> Did you mean? Add
+ #
+ def methods(*args)
+ super + ole_methods.map(&:name)
+ end
+ end
+end