summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-05 01:02:04 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-05 01:02:04 +0000
commit6bac2765a7f8098d40bd369568d6cf308976c8d4 (patch)
tree4e36f1619c4a9f2590186ce23c252504a452e3ac /ext/win32ole
parent62cec32902b3d1cabdc68c12384ef1453862f53e (diff)
ext/win32ole/lib/win32ole.rb (metods): rescue WIN32OLEQueryInterfaceError.
test/win32ole/test_win32ole.rb: add test for WIN32OLE#methods git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/lib/win32ole.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/win32ole/lib/win32ole.rb b/ext/win32ole/lib/win32ole.rb
index be9d0d4e9b..635510b277 100644
--- a/ext/win32ole/lib/win32ole.rb
+++ b/ext/win32ole/lib/win32ole.rb
@@ -19,7 +19,15 @@ if defined?(WIN32OLE)
# #=> Did you mean? Add
#
def methods(*args)
- super + ole_methods.map(&:name)
+ super + ole_methods_safely.map(&:name)
+ end
+
+ private
+
+ def ole_methods_safely
+ ole_methods
+ rescue WIN32OLEQueryInterfaceError
+ []
end
end
end