<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using a Proxy with Cucumber, Webrat and Mechanize</title>
	<atom:link href="http://otaqui.com/blog/458/using-a-proxy-with-cucumber-webrat-and-mechanize/feed/" rel="self" type="application/rss+xml" />
	<link>http://otaqui.com/blog/458/using-a-proxy-with-cucumber-webrat-and-mechanize/</link>
	<description>Pete Otaqui's blog about web development and everything else</description>
	<lastBuildDate>Thu, 21 Jul 2011 12:50:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: matth</title>
		<link>http://otaqui.com/blog/458/using-a-proxy-with-cucumber-webrat-and-mechanize/comment-page-1/#comment-2007</link>
		<dc:creator>matth</dc:creator>
		<pubDate>Fri, 09 Jul 2010 14:47:22 +0000</pubDate>
		<guid isPermaLink="false">http://otaqui.com/blog/?p=458#comment-2007</guid>
		<description>Hi, nice blog!

You can also add this to your world so you need only set it once.

class MechanizeWorld &lt; Webrat::MechanizeSession

	def mechanize

		return @mechanize unless @mechanize.nil?

		@mechanize = Mechanize.new

	    # Get proxy from http_porxy environment var
	    if ENV[&#039;http_proxy&#039;] != nil
	      proxy = URI.parse(ENV[&#039;http_proxy&#039;])
	      @mechanize.set_proxy(proxy.host, proxy.port)
	    end    

	    @mechanize

	end
	
end

World do
  MechanizeWorld.new
end</description>
		<content:encoded><![CDATA[<p>Hi, nice blog!</p>
<p>You can also add this to your world so you need only set it once.</p>
<p>class MechanizeWorld &lt; Webrat::MechanizeSession</p>
<p>	def mechanize</p>
<p>		return @mechanize unless @mechanize.nil?</p>
<p>		@mechanize = Mechanize.new</p>
<p>	    # Get proxy from http_porxy environment var<br />
	    if ENV[&#039;http_proxy&#039;] != nil<br />
	      proxy = URI.parse(ENV[&#039;http_proxy&#039;])<br />
	      @mechanize.set_proxy(proxy.host, proxy.port)<br />
	    end    </p>
<p>	    @mechanize</p>
<p>	end</p>
<p>end</p>
<p>World do<br />
  MechanizeWorld.new<br />
end</p>
]]></content:encoded>
	</item>
</channel>
</rss>

