Confirmed. It really behaves like that.
Željko: http://highline.rubyforge.org/
grundic: The problem is not related with Watir itself, but it is related with another library called s4t-utils (http://s4t-utils.rubyforge.org/), which also has a "ask" method behaving similar to HighLine's "ask". s4t-utils is a dependendent of gem "user-choices", which in turn is dependent of "commonwatir" which is a Watir's dependency. So, after you issue "require 'watir'", then s4t-utils is loaded thus "ask" method is overridden.
You could use HighLine.new.ask instead of just "ask" to solve the problem:
require "highline/import"
comp = ask("Company? ") { |q| q.default = "MySuperCompany" }
puts comp
require 'watir'
comp = ask("Company? ") { |q| q.default = "MySuperCompany" }
puts comp
comp = HighLine.new.ask("Company? ") { |q| q.default = "MySuperCompany" }
puts comp
Produces:
Company? |MySuperCompany| my
my
[Company? ] => my
my
Company? |MySuperCompany| my
my
Jarmo Pertman