
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Able Technology &#187; rails</title>
	<atom:link href="http://www.abletech.co.nz/tag/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abletech.co.nz</link>
	<description>Web Application Programmers and Consultants</description>
	<lastBuildDate>Sun, 11 Jul 2010 22:05:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Installing Ruby Enterprise Edition on Mac OSX</title>
		<link>http://www.abletech.co.nz/2009/06/ree-on-mac-osx/</link>
		<comments>http://www.abletech.co.nz/2009/06/ree-on-mac-osx/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 09:33:49 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=335</guid>
		<description><![CDATA[This is quite trivial and very easy. I wanted to use the same version of ruby on my mac as is running on our production servers (Ruby Enterprise Edition). Firstly, do a gem list and keep this information. You will need to reinstall all your gems once you have successfully installed REE. Download REE from [...]]]></description>
			<content:encoded><![CDATA[<p>This is quite trivial and very easy. I wanted to use the same version of ruby on my mac as is running on our production servers (Ruby Enterprise Edition).</p>
<p>Firstly, do a
<pre>gem list</pre>
<p> and keep this information. You will need to reinstall all your gems once you have successfully installed REE.</p>
<p>Download REE from <a href="http://www.rubyenterpriseedition.com/">http://www.rubyenterpriseedition.com/</a></p>
<pre>tar xvfz ruby-enterprise-X.X.X</pre>
<pre>sudo ./ruby-enterprise-X.X.X/installer</pre>
<p>I suggest changing the default location to just /opt/ruby-enterprise &#8211; as you are unlikely to need to roll back the symbolic links in your development environment.</p>
<p>Once it is installed, then you need to make sure that you use it for all your gems, ruby, rake tasks. To do this we will sym link in all the executables into /usr/bin</p>
<p>Find any previous versions of ruby</p>
<pre>whereis ruby</pre>
<p> and
<pre>which ruby</pre>
<p>Cleanup &#8211; backup and remove any old versions and the associated ruby, gems, rake, irb, cap, capify, erb so they are not on your path.</p>
<p>Then sym link from /usr/bin to  opt/ruby-enterprise/bin with all the executables that you may require&#8230;.</p>
<pre>
sudo ln -s -f /opt/ruby-enterprise/bin/ruby /usr/bin/ruby
sudo ln -s -f /opt/ruby-enterprise/bin/cap    /usr/bin/cap
sudo ln -s -f /opt/ruby-enterprise/bin/capify /usr/bin/capify
sudo ln -s -f /opt/ruby-enterprise/bin/erb    /usr/bin/erb
sudo ln -s -f /opt/ruby-enterprise/bin/gem    /usr/bin/gem
sudo ln -s -f /opt/ruby-enterprise/bin/irb    /usr/bin/irb
sudo ln -s -f /opt/ruby-enterprise/bin/rails  /usr/bin/rails
sudo ln -s -f /opt/ruby-enterprise/bin/rake   /usr/bin/rake
sudo ln -s -f /opt/ruby-enterprise/bin/rdoc   /usr/bin/rdoc
</pre>
<p>Do a gem list to see what ruby-enterprise came bundled with.</p>
<p>Now you will need to install all your gems again &#8211; that you noted earlier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/06/ree-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>False-positive validation warnings</title>
		<link>http://www.abletech.co.nz/2009/03/false-positive-validation-warnings/</link>
		<comments>http://www.abletech.co.nz/2009/03/false-positive-validation-warnings/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 00:48:21 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=197</guid>
		<description><![CDATA[I had been getting some validation warnings when running some of my specs. The W3 validator confirmed that my xHTML was valid. ignoring attempt to close div with input opened at byte 6028, line 108 closed at byte 6131, line 109 attributes at open: {"class"=>"form_field"} text around open: "r\">\n \n\n scenarios(:abletech_pre_clicked_links).id response.headers['Content-Type'] = :xml end [...]]]></description>
			<content:encoded><![CDATA[<p>I had been getting some validation warnings when running some of my specs. The W3 validator confirmed that my xHTML was valid.</p>

<textarea name="code" class="ruby">
ignoring attempt to close div with input
  opened at byte 6028, line 108
  closed at byte 6131, line 109
  attributes at open: {"class"=>"form_field"}
  text around open: "r\"></div></div>\n    <div class=\"form_fie"
  text around close: "mit\" value=\"Log in\"></input>\n</div>\n</di"
</textarea>

<p>After some googling of the problem, it turns out there is a difference between how xhtml and html documents are handled. Essentially, you need to tell the parser that the document is xHTML rather than HTML. More details <a href="http://marklunds.com/articles/one/336">here</a>, <a href="http://weblog.jamisbuck.org/2007/1/4/assert_xml_select">here</a>, and <a href="http://dev.rubyonrails.org/ticket/1937">here</a>.</p>

<p>The solution is to tell RSpec that the document is XML based. The options given in the links above work for RUnit based tests. Taking a look at the rspec source, it is checking to see if the response is XML based by noting the Content-Type header record. So, here's the solution I used:</p>

<textarea name="code" class="ruby">
before(:each) do
  get :new, :id => scenarios(:abletech_pre_clicked_links).id
  response.headers['Content-Type'] = :xml
end
</textarea>

<p>Now, when I run my specs, it correctly parses the response as XHTML and passes validation without any warnings.</p>

<textarea name="code" class="ruby">
it 'should show two forms' do
  response.should have_tag('div.form_step', 2)
end
</textarea>

]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/03/false-positive-validation-warnings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
