== win32ole-pp - Pretty Printer for WIN32OLE

=== DESCRIPTION

win32ole-pp provides smart #to_s and pretty printer for WIN32OLE object.

This library helps to develop/debug WIN32OLE applications.

=== SYNOPSIS

require "pp"
require "win32ole"

require "rubygems"
require "win32ole_pp"

ie = WIN32OLE.new('InternetExplorer.Application')

puts ie #=> #<WIN32OLE:0x2962380: IWebBrowser2>

pp ie #=> #<WIN32OLE:0x2962380: IWebBrowser2
# AddressBar=true,
# Application=#<WIN32OLE:0x296150c: IWebBrowser2>,
# Busy=false,
# Container=nil,
# FullName="C:\\Program Files\\Internet Explorer\\iexplore.exe",
# FullScreen=false,
# HWND=19923710,
# Height=903,
# Left=0,
# LocationName="",
# LocationURL="",
# MenuBar=true,
# Name="Microsoft Internet Explorer",
# Offline=false,
# Parent=#<WIN32OLE:0x29610ac: IWebBrowser2>,
# Path="C:\\Program Files\\Internet Explorer\\",
# ReadyState=0,
# RegisterAsBrowser=false,
# RegisterAsDropTarget=true,
# Resizable=false,
# Silent=false,
# StatusBar=true,
# StatusText="",
# TheaterMode=false,
# ToolBar=1,
# Top=0,
# TopLevelContainer=true,
# Visible=false,
# Width=1096>


nav = ie.ole_method("Navigate")

puts nav #=> #<WIN32OLE_METHOD:0x295b3dc: VOID Navigate([in] BSTR URL,
# [in, optional] VARIANT Flags, [in, optional] VARIANT TargetFrameName,
# [in, optional] VARIANT PostData, [in, optional] VARIANT Headers)>

pp nav #=> #<WIN32OLE_METHOD:0x295b3dc: Navigate
# name="Navigate",
# dispid=104,
# helpstring="Navigates to a URL or file.",
# helpcontext=0,
# helpfile="",
# invoke_kind="FUNC",
# invkind=1,
# return_type="VOID",
# return_type_detail=["VOID"],
# return_vtype=24,
# size_opt_params=4,
# size_params=5,
# offset_vtbl=44,
# visible?=true,
# event?=false,
# event_interface=nil,
# params=
# [#<WIN32OLE_PARAM:0x295a66c: URL
# name="URL",
# ole_type="BSTR",
# ole_type_detail=["BSTR"],
# default=nil,
# input?=true,
# output?=false,
# optional?=false,
# retval?=false>,
# #<WIN32OLE_PARAM:0x295a644: Flags
# name="Flags",
# <snip>


ie.Navigate("http://www.ruby-lang.org/")
sleep(1) while ie.ReadyState !=4

news = ie.document.getElementById("news")
puts news #=> #<WIN32OLE:0x29286d0: DispHTMLDivElement>

pp news #=> #<WIN32OLE:0x29286d0: DispHTMLDivElement
# accessKey="",
# align="",
# all=#<WIN32OLE:0x29a7bc4: DispHTMLElementCollection>,
# attributes=#<WIN32OLE:0x29a7b88: DispHTMLAttributeCollection>,
# behaviorUrns=#<WIN32OLE:0x29a7b4c: IHTMLUrnCollection>,
# canHaveChildren=true,
# canHaveHTML=true,
# childNodes=#<WIN32OLE:0x29a7ac0: DispDOMChildrenCollection>,
# children=#<WIN32OLE:0x29a7a84: DispHTMLElementCollection>,
# <snip>

ul = news.getElementsByTagName("ul").Item(0)
ul.childNodes.each do |e|
puts e.innerText
end


=== REQUIREMENTS

* pp (standard library)
* win32ole (standard library)

=== INSTALL

gem install win32ole-pp

=== COPYRIGHT

Copyright (c) 2007 MIYAMUKO Katsuyuki.

win32ole-pp is released under an MIT license.
See License.txt[link:files/License_txt.html] for full license.


=== OTHER STUFF

Author:: MIYAMUKO Katsuyuki <mailto:[email protected]>
Home URL:: http://win32ole-pp.rubyforge.org
Project URL:: http://rubyforge.org/projects/win32ole-pp
Blog (Japanese):: id:miyamuko[http://d.hatena.ne.jp/miyamuko/]