<?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>pedant.dk &#187; ruby</title>
	<atom:link href="http://www.pedant.dk/category/coding/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pedant.dk</link>
	<description>Honesty in small things is not a small thing</description>
	<lastBuildDate>Thu, 05 Aug 2010 16:11:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>gemcutter: the missing manual</title>
		<link>http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/</link>
		<comments>http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 19:20:27 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=713</guid>
		<description><![CDATA[Thanks to Jakob Kruse  I now know how to operate RubyGems and gemcutter on windows. Here&#8217;s what I did:
1:I downloaded the 1.8.6 ruby installer here
2: I installed gemcutter like this:

gem update --system
gem install gemcutter
gem tumble
gem install jspec

this let me use gemcutter on windows using the current one-click installer  
]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://www.kruse-net.dk">Jakob Kruse </a> I now know how to operate RubyGems and gemcutter on windows. Here&#8217;s what I did:</p>
<p>1:I downloaded the 1.8.6 ruby installer <a href="http://www.ruby-lang.org/en/downloads/">here</a></p>
<p>2: I installed gemcutter like this:</p>
<pre class="brush: bash;">
gem update --system
gem install gemcutter
gem tumble
gem install jspec
</pre>
<p>this let me use gemcutter on windows using the current one-click installer <img src='http://www.pedant.dk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>adventures with mingw , ruby,java, rhino and jspec</title>
		<link>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/</link>
		<comments>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 23:09:06 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=689</guid>
		<description><![CDATA[update 2009-10-21: This post is a writeup of my early experiences with gemcutter and rubygems. The strange runtime error I did not understand was probably related to that I needed to update rubygems to 1.3.5.  I now know how to use gemcutter from ruby1.8.6 using the oneclick installer .
I have been using jspec on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>update 2009-10-21: This post is a writeup of my early experiences with gemcutter and rubygems. The strange runtime error I did not understand was probably related to that I needed to update rubygems to 1.3.5.  <a href="http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/">I now know how to use gemcutter from ruby1.8.6 using the oneclick installer</a> .</strong></p>
<p>I have been using <a href="http://github.com/visionmedia/jspec/tree/3.x">jspec</a> on macosx for a while  and decided to give it a try on windows vista today. Installing jspec on macosx and linux can be done using the instructions <a href="http://github.com/visionmedia/jspec/blob/3.x/README.md">here</a> .</p>
<p>I want to run the automated jspec tests available via rhino at a client site. Sadly , I am forced to use windows there, so I have given some thought on how to make jspec run on windows.</p>
<p>First of all you need to install ruby.  I used the automated 1.8.6 One-Click Installer available <a href="http://www.ruby-lang.org/en/downloads/">here</a> . After installing i ran</p>
<p><code lang="bash"><br />
gem update<br />
</code></p>
<p>the instructions in the README file for jspec currently states that I should install gemcutter and install jspec via that . I was not able to do that on windows  ( my system decided to report an obscure runtime error that I did not understand). So i decided to do this instead:</p>
<p><code lang="bash"><br />
gem sources -a http://gems.github.com<br />
gem install visionmedia-jspec<br />
</code></p>
<p>I let gem install the required dependencies visionmedia-commander and visionmedia-bind. After this I had the jspec script available. Sadly this gave me version 2.7.2 (I noticed \ruby\lib\ruby\gems\1.8\gems\visionmedia-jspec-2.7.2 ) <a href="http://gemcutter.org/gems/jspec">The listing on gemcutter</a>  told me that a version 2.11.10 is a avaiable , so I decided to dig deeper. Maybe I could make gemcutter work anyway?</p>
<p>After a little browsing on github.com I found the <a href="http://github.com/oneclick/rubyinstaller/">oneclick installer</a> </p>
<p>I cloned this repo using git  </p>
<p>using the following command:<br />
<code lang="bash"><br />
git clone git://github.com/oneclick/rubyinstaller.git<br />
</code></p>
<p> and pressed </p>
<p><code lang="bash"><br />
rake ruby19<br />
</code></p>
<p>This project creates a sandbox that compiles a working ruby environment using <a href="http://mingw.org/">mingw</a>. </p>
<p>After contemplating the insanity of what I was doing for a couple of minutes (remember : installing a working ruby on linux is a single shell command) I grabbed some coca cola and started browsing through the source code for ruby distro while the rubyinstall was compiling. I looked a bit at ruby.c and  vm_exec.c  and had grim flashbacks to my c days. Luckily the compile finished and I copied ruby19_mingw to my c:\ drive and set it up on my PATH variable. Then I could check which version I was using:</p>
<p><code lang="bash"><br />
C:\>ruby -v<br />
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]<br />
</code></p>
<p>Now I was able to do:<br />
<code lang="bash"><br />
gem install gemcutter<br />
gem tumble<br />
gem install jspec<br />
</code></p>
<p>(Note that there is  information sent to the terminal during these steps)</p>
<p>Now for the interesting part(!) jspec was working , so I could do this:</p>
<p><code lang="bash"><br />
jspec init SolitaireCipher --freeze<br />
</code></p>
<p>This created a directory where I can train doing the <a href="http://www.rubyquiz.com/quiz1.html">SolitaireCipher</a> using javascript. I renamed lib/yourlib.core.js to lib/SolitaireCipher.js  and spec/spec.core.js to spec/spec.SolitaireCipher.js and spec/spec.dom.html accordingly.</p>
<p>After 20 mins of fiddling I managed to get some running tests in a browser by opening spec.dom.html. Then I decided I want to automate the tests using <a href="http://www.mozilla.org/rhino/download.html">mozilla rhino</a>. After installing rhino , I could run automated tests like this</p>
<p><code lang="bash"><br />
 cd c:\projects\SolitaireCipher<br />
 jspec --rhino<br />
</code></p>
<p>This opens up a proces that listens to file changes in the lib and spec folders. All very well &#8211; untill I discovered that jspec currently uses ANSI codes to render colors to the terminal screens. ANSI codes are not supported on windows vista (something with ANSI.SYS being obsoleted), so if I want the nice colors then I need an alternative terminal than my command prompt in vista.</p>
<p>I found rxvt available from <a href="http://code.google.com/p/msysgit/downloads/list">PortableGit</a> on google code. This renders the colors just nicely &#8211; but has some other drawbacks. If I just use rxvt for rendering feedback from the jspec tests, then it seems to work though. </p>
<p>One thing to note is that rhino needs the java sdk to be installed and js.jar needs to be on your CLASSPATH. when starting jspec from rxvt on the msys from PortableGit, then CLASSPATH could be set like this (assuming rhino is installed in c:\tools ):</p>
<p><code lang="bash"><br />
export CLASSPATH=/c/tools/rhino1_7R2/js.jar<br />
</code></p>
<p>I probably want to avoid using rxvt on PortableGit too much . There are some major flaws listed <a href="http://code.google.com/p/msysgit/wiki/WhyIsRxvtNotTheDefault">here</a> .</p>
<p>Maybe I should look into doing a adobe air frontend for jspec? </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>unclebob does the prime factor kata</title>
		<link>http://www.pedant.dk/2009/10/11/unclebob-does-the-prime-factor-kata/</link>
		<comments>http://www.pedant.dk/2009/10/11/unclebob-does-the-prime-factor-kata/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:13:28 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=686</guid>
		<description><![CDATA[update 2009-11-12: There is an updated version here
unclebob doing the prime factor kata:

]]></description>
			<content:encoded><![CDATA[<p><strong>update 2009-11-12: There is an updated version <a href="http://katas.softwarecraftsmanship.org/?p=71&#038;cpage=1#comment-43">here</a></strong></p>
<p><a href="http://twitter.com/unclebobmartin">unclebob</a> doing the prime factor kata:</p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="370" id="viddler"><param name="movie" value="http://www.viddler.com/player/ce8c2038/" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="http://www.viddler.com/player/ce8c2038/" width="437" height="370" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddler" ></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/10/11/unclebob-does-the-prime-factor-kata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
