summaryrefslogtreecommitdiff
path: root/ext/win32ole/sample/ienavi2.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-12-31 17:44:20 +0900
committergit <svn-admin@ruby-lang.org>2024-01-28 15:25:36 +0000
commit3ad54239b529b1b4b96d06117e8039c1d57f1e89 (patch)
tree771542a04801f4210a28384aa80cd606af5d5a5e /ext/win32ole/sample/ienavi2.rb
parent703ad99bf8de24137a8d635c13d6c7c8bc6b1f56 (diff)
[ruby/win32ole] [DOC] Move sample to toplevel
https://github.com/ruby/win32ole/commit/70ea60c4d2
Diffstat (limited to 'ext/win32ole/sample/ienavi2.rb')
-rw-r--r--ext/win32ole/sample/ienavi2.rb41
1 files changed, 0 insertions, 41 deletions
diff --git a/ext/win32ole/sample/ienavi2.rb b/ext/win32ole/sample/ienavi2.rb
deleted file mode 100644
index 3248393077..0000000000
--- a/ext/win32ole/sample/ienavi2.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: false
-require 'win32ole'
-
-class IEHandler
- attr_reader :loop
- def initialize
- @urls = []
- @loop = true
- end
- def method_missing(event, *args)
- case event
- when "BeforeNavigate2"
- puts "Now Navigate #{args[1]}..."
- end
- end
- def onNavigateComplete2(pdisp, url)
- @urls << url
- end
- def onOnQuit
- puts "Now Stop IE..."
- @loop = false
- end
- def put_urls
- puts "You Navigated the URLs ..."
- @urls.each_with_index do |url, i|
- puts "(#{i+1}) #{url}"
- end
- end
-end
-
-ie = WIN32OLE.new('InternetExplorer.Application')
-ie.visible = true
-ie.gohome
-
-ev = WIN32OLE_EVENT.new(ie)
-ev.handler = IEHandler.new
-
-while (ev.handler.loop)
- WIN32OLE_EVENT.message_loop
-end
-ev.handler.put_urls