我想使用鞋子来下载用户在 edit_line 中输入的网站正文。我怎样才能使这项工作?谁能帮助解释为什么下面的代码不起作用?它只是弹出一个新窗口,并不会从输入的文本中下载该站点....
到目前为止,这是我的代码:
Shoes.app do
stack (:left => 175, :top => 200) do
para "Enter a url:"
flow do
@url = edit_line
button "OK" do
window do
stack do
title "Searching site", :size => 16
@status = para "One moment..."
# Search site for query and print body
download @url.text do |site|
@status.text = "Body: " + site.response.body.inspect
end
end
end
end
end
end
end