[Wtr-general] Warnings: already initialized constant when executing watir scripts
Charley Baker
charley.baker at gmail.com
Fri Dec 8 10:43:31 EST 2006
Ruby's require is case sensitive. Whether that's a good thing or not, it's
something to be aware of when requiring files. Require will load a file into
your ruby space once whether it's a ruby file or a dll or other binary
library, load is another method that will pull the file in everytime it's
called, and include is a way to pull in a namespace.
require 'watir' # <- pull in watir.rb
include Watir # <- add the Watir namespace defined in watir.rb as module
Watir
# so that now you can say ie = IE.new instead of
qualifying
# the module where IE lives -- Watir::IE
There are good descriptions of these basics in the Ruby pickaxe book:
http://www.rubycentral.com/book/tut_modules.html
and on the Ruby faq site:
http://www.rubycentral.com/faq/rubyfaq.html
-Charley
On 12/7/06, Avinash <forum-watir-users at openqa.org> wrote:
>
> Thank you. That did it. Fixed the casing (require 'watir') and all is
> well.
>
> So why does the casing matter? While we are on this topic, what is the
> difference between include and require?
> --
> Avinash
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15840#15840
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/ceccdf35/attachment.html
More information about the Wtr-general
mailing list