Hi Michael,

On Sat, Jan 03, 2009 at 10:31:38AM -0800, Bissquitt wrote:
> 
> Regarding documentation, I read the Tutorial all the way through but
> it only hit on a few specific examples leaving out other commands all
> together. I've visited MANY ruby and watir sites and never once saw
> the .span command (does it just search for <span> tags? guess ill
> google it after this post) I never even found a site listing all the
> watir commands ( http://us.php.net/manual/en/function.abs.php ) as an
> example.

This is in the Watir wiki, which seems to be down at the moment, so
here's an alternative link: http://tinyurl.com/watirmethods

> In addition there are SO MANY tutorials and such online that
> are all very poorly done it makes finding a good one via google a
> needle in a haystack scenario. ie (oh great, you showed me that
> specific command, but showed me nothing about how that command works
> so unless I want to use it exactly the way you used it, its useless).

I wouldn't go so far as to call the tutorials "poorly done" but most
Watir tutorials do seem to be written with non-programmers in mind.
That said, Ruby is a full-fledged language, much like Java and C++ are,
so it would be out of scope for a Watir tutorial or Excel automation
tutorial to teach you language basics too.

However, if you installed Ruby using the one-click installer, you
already have most of the documentation you need in your computer.  To
see the APIs, you can use either fxri (a graphical interface to the
language documentation) or the rubygems rdoc server (a daemon that you
can access as http://localhost:8808/ through your browser).  I can't
give the exact location since I don't have access to a Windows computer
right now, but all of these are somewhere in the Ruby folder in the
Start Menu.  A copy of the Pickaxe book mentioned earlier should be in
there too.

> What on earth does .succ! do? It never tells me. The site, and most
> that ive seen, are written not to target new people and tutor them but
> to target advanced users with a more "so heres a cool way to approach
> the problem" approach. A simple "ok, here is the the excel class, here
> are the comands in it and what they do, here is a syntax example"
> would be far more helpful as it doesn't leave anything out. I'm still
> not sure if its possible to return what row the active cell is on.

Ruby interacts with Excel using an OLE automation object, which is more
of a Microsoft thing than a Ruby thing.  It is documented here:

http://msdn.microsoft.com/en-us/library/aa272268(office.11).aspx

> I don't quite follow your first example since I am barely familiar
> with ruby syntax (though it appears to be similar to java) what is the
> |s| ?

This is part of block syntax.  Look it up in the Pickaxe inside the
chapter called "Containers, Blocks, and Iterators".

> I'm guessing span just looks for span tags?

Yes.

> I'm also guessing that (:id, /ctl/) looks for any span tag with an id
> matching /ctl/ ? (this is where im not following you as much)

Yes.

> what does the : in your example do?

It references the id symbol.  Without going into too much detail,
span(:id, /ctl/) is more efficient than span('id', /ctl/) due to the way
Ruby allocates memory for strings.  Don't worry too much about this,
just use it (and don't mix up symbols and strings).

> what exactly is the second
> argument doing, what are the slashes?

The slashes denote a regular expression, which means that it will match
any span whose id attribute contains 'ctl'.  You can compare this to
span(:id, 'ctl'), which will match only the span whose id attribute is
exactly equal to 'ctl'.

> and what does the .text at the end do?

It's a method call that returns the text inside the span tag.

> Sorry for being rather dense but I have barely delt with web
> programming before. I've spent my life doing C++, Java, and BASIC so
> I'm pretty much trying to stumble into a final product as gracefully
> as I can.

Don't overthink it.  With Ruby, you're still dealing with objects,
classes and methods, so your experience with OOP concepts should help
you.


HTH,
Anna


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to