Class: Watobo::Gui::BrowserPreview
- Inherits:
-
Object
- Object
- Watobo::Gui::BrowserPreview
- Defined in:
- lib/watobo/gui/browser_preview.rb
Instance Attribute Summary collapse
-
#proxy ⇒ Object
Returns the value of attribute proxy.
Instance Method Summary collapse
-
#initialize(proxy) ⇒ BrowserPreview
constructor
A new instance of BrowserPreview.
- #show(request, response) ⇒ Object
Constructor Details
#initialize(proxy) ⇒ BrowserPreview
Returns a new instance of BrowserPreview.
208 209 210 211 212 |
# File 'lib/watobo/gui/browser_preview.rb', line 208 def initialize(proxy) @proxy = proxy @browser = nil end |
Instance Attribute Details
#proxy ⇒ Object
Returns the value of attribute proxy.
185 186 187 |
# File 'lib/watobo/gui/browser_preview.rb', line 185 def proxy @proxy end |
Instance Method Details
#show(request, response) ⇒ Object
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/watobo/gui/browser_preview.rb', line 186 def show(request, response) begin if watoboProxy? then hashid = @proxy.addPreview(response) url = request.url.to_s url += request.query != '' ? '&' : '?' url += "WATOBOPreview=#{hashid}" puts "PreviewURL: #{url}" @browser.navigate(url) if hashid return url else raise "WRONG_PROXY_SETTINGS" end rescue => bang puts bang # puts bang.class # puts bang.backtrace if $DEBUG raise bang end #raise "Wrong Proxy Settings" end |