użyj przeglądarki jako GUI w Ruby

W vbscript często używa się przeglądarki (IE) jako GUI. Zobacz poniższy przykład, w którym prosi o nazwę i zwraca ją do skryptu. W Rubim masz kilka GUI, takich jak Tcl i Shoes, ale zastanawiam się, jak to zrobić w przeglądarce. Jakie jest najprostsze rozwiązanie Ruby? Więc nie ma żadnych exta klejnotów ani pakietów, nie ma serwera, który jest już uruchomiony.

Oto próbka vbscript

Set web = CreateObject("InternetExplorer.Application")
If web Is Nothing Then
  msgbox("Error while loading Internet Explorer")
  Wscript.Quit
Else
  with web
    .Width = 300
    .Height = 175
    .Offline = True
    .AddressBar = False
    .MenuBar = False
    .StatusBar = False
    .Silent = True
    .ToolBar = False
    .Navigate "about:blank"
    .Visible = True
  end with
End If

'Wait for the browser to navigate to nowhere
Do While web.Busy
  Wscript.Sleep 100
Loop

'Wait for a good reference to the browser document
Set doc = Nothing
Do Until Not doc Is Nothing
  Wscript.Sleep 100
  Set doc = web.Document
Loop

'Write the HTML form
doc.Write "Give me a name<br><form><input type=text name=name ><input type=button name=submit id=submit value='OK' onclick='javascript:submit.value=""Done""'></form>"
Set oDoc = web.Document
Do Until oDoc.Forms(0).elements("submit").Value <> "OK"
  Wscript.Sleep 100
  If web Is Nothing or Err.Number <> 0 Then
    msgbox "Window closed"
    Wscript.Quit
  End If
Loop
name = oDoc.Forms(0).elements("name").value
oDoc.close
set oDoc = nothing
web.quit
set web = nothing
Wscript.echo "Hello " & name

questionAnswers(4)

yourAnswerToTheQuestion