<?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>Dr Nic &#187; Link</title>
	<atom:link href="http://drnicwilliams.com/category/link/feed/" rel="self" type="application/rss+xml" />
	<link>http://drnicwilliams.com</link>
	<description>Ruby makes Rails, Javascript makes Ajax, Dr Nic makes Magic</description>
	<lastBuildDate>Tue, 03 Aug 2010 23:44:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Future proofing your Ruby code. Ruby 1.9.1 is coming.</title>
		<link>http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/</link>
		<comments>http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 04:37:49 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Cucumber]]></category>
		<category><![CDATA[Gems]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/?p=368</guid>
		<description><![CDATA[Bugger. I&#8217;m a Ruby monogamist. I use the Ruby that comes with Leopard (ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]). Oh sure I&#8217;ve cheated on my Ruby a couple of times. It was just sex, I didn&#8217;t fall in love, I promise. My machine has had various versions of jRuby, Rubinius and MacRuby installed at various [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2010/06/01/validate-and-save-your-ruby-in-textmate-with-secret-rubinus-superpowers/' rel='bookmark' title='Permanent Link: Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers'>Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers</a> <small>In some TextMate bundles, if you save a file it...</small></li><li><a href='http://drnicwilliams.com/2009/11/04/hacking-someones-gem-with-github-and-gemcutter/' rel='bookmark' title='Permanent Link: Hacking someone&#8217;s gem with github and gemcutter'>Hacking someone&#8217;s gem with github and gemcutter</a> <small> Ever used a rubygem, found a bug, and just...</small></li><li><a href='http://drnicwilliams.com/2009/10/07/hash-bang-cucumber/' rel='bookmark' title='Permanent Link: hash bang cucumber'>hash bang cucumber</a> <small>I don&#8217;t know if this is a good idea or...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://img.skitch.com/20081210-qu1ekkhmbtyfjwbchbmwe89gru.png" width="550" height="133"></p>
<p>Bugger.</p>
<p>I&#8217;m a Ruby monogamist. I use the Ruby that comes with Leopard (<code>ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]</code>). Oh sure I&#8217;ve cheated on my Ruby a couple of times. It was just sex, I didn&#8217;t fall in love, I promise. </p>
<p>My machine has had various versions of jRuby, Rubinius and MacRuby installed at various times, but I don&#8217;t think it&#8217;s ever had two working copies of Ruby MRI (Matz Ruby Implementation) at a time.</p>
<p>Ok, that&#8217;s a lie. On Christmas Day 2007, Matz released Ruby 1.9. Yes I was a deviant. I installed it. But I didn&#8217;t inhale. <code>ruby19</code> sat on my filesystem outside the $PATH. It was a trophy not a tool.</p>
<p>My Ruby monogamy was working out perfectly for me, whilst I collected futurist and novelty Ruby implementations as a passive hobby, until yesterday when I saw the above tweet.</p>
<p>That&#8217;s a bit of a bugger. I mean, why was he playing with Ruby 1.9.1 anyway?</p>
<p>Or perhaps having multiple version of Ruby on one computer isn&#8217;t some illicit activity. <em>Everyone else is doing it, Your Honour.</em></p>
<p>I still didn&#8217;t care for having multiple ruby versions lying around in my path; but I had to fix <a href="http://rubigen.rubyforge.org">rubigen</a>. I just wanted a way to fix bugs against ruby 1.9+ and move on with my life. I didn&#8217;t want to have to do any manual work in order to set this up. Surely someone else has solved this problem already?</p>
<p><span id="more-368"></span></p>
<h3 id="multiruby">MultiRuby</h3>
<p>Yes. Ryan Davis did <a href="http://blog.zenspider.com/2007/12/testing-for-ruby-18-and-19-usi.html">solve this problem already</a>. You can follow his instructions and get most of the answers I needed. Except as of today, multiruby wasn&#8217;t pulling down my nemesis ruby 1.9.1 prerelease versions, just the latest 1.9.0 version. (update: <a href="http://www.rubyinside.com/ruby-191-released-first-production-release-of-the-fastest-ruby-ever-1480.html">1.9.1 is out</a>; installation instructions below are updated)</p>
<p>Also, I couldn&#8217;t figure out how to setup rubygems and I couldn&#8217;t figure out how install all the fun gems that my code needed. Ryan fixed me up with this answer too.</p>
<p>MultiRuby is really nice in that it installs all the version of ruby into a safe place (<code>~/.multiruby/</code>) and has nice ways to add and remove versions of ruby that you want to test against. To run the tests for rubigen I ran the following code. It takes about 30 minutes from scratch.</p>
<pre>sudo gem install ZenTest
multiruby -e "p 1+1"
multiruby_setup mri:svn:tag:v1_8_6_114
multiruby_setup mri:svn:tag:v1_9_1_0

multiruby_setup update:rubygems
multiruby -S gem install --no-ri --no-rdoc --development test-unit rspec mocha rails
</pre>
<p>To get the full list of available ruby tagged releases, ask the SVN repo:</p>
<pre>svn list http://svn.ruby-lang.org/repos/ruby/tags
</pre>
<p>Sometimes I got time out errors on the gem installs</p>
<pre>ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    timed out (http://gems.rubyforge.org/gems/rails-2.2.2.gem)
</pre>
<p>The next section helps fix this if it occurs for you.</p>
<h3 id="sake_tasks_to_help_with_multiruby">Sake tasks to help with multiruby</h3>
<p>Whilst <code>multiruby_setup</code> comes with some useful helpers, and hoe generates a helpful &#8216;rake multi&#8217; runner for test/unit tests of hoe gems, I wanted more helpers. These have been compiled as sake tasks in <a href="http://github.com/drnic/sake-tasks">http://github.com/drnic/sake-tasks</a>.</p>
<p>To install them from scratch (<a href="http://drnicwilliams.com/2008/08/19/my-attempt-at-sake-task-management/">initial blog post</a>):</p>
<pre>sudo gem install sake
cd /tmp
git clone git://github.com/drnic/sake-tasks.git
cd sake-tasks
rake install:all
</pre>
<p>You can toss away the repo after installing the sake tasks.</p>
<h3 id="installing_gems_into_multiruby">Installing gems into multiruby</h3>
<p>Each version of ruby has its own rubygems cache. To install a gem into each ruby version:</p>
<pre>sake multiruby:gems:install GEM=gemname
sake multiruby:gems:install GEMS=gem1,gem2
</pre>
<p>Want to see what gems were installed for each version of ruby?</p>
<pre>multiruby -S gem list
</pre>
<h3 id="running_tests">Running tests</h3>
<p>If you use hoe, and your tests are traditional <code>test/unit</code> tests, then hoe comes with a very helpful <code>rake multi</code> task.</p>
<p>For everyone else, use the following sake tasks:</p>
<pre>sake multiruby       # Runs any tests or specs in current project against multiruby
sake multiruby:spec  # Runs specs in current project against multiruby
sake multiruby:test  # Runs tests in current project against multiruby
</pre>
<h3 id="miscellaneous_multiruby_management">Miscellaneous MultiRuby management</h3>
<p>When I was fixing rubigen, I had some failing tests against 1.9.0-5 but not against 1.9.1, so I decided I hated 1.9.0 and stopped running tests against it. You can stop supporting a version of ruby with:</p>
<pre>multiruby_setup rm:1.9.0-5
</pre>
<p>Not sure what versions of ruby you&#8217;re supporting?</p>
<pre>multiruby_setup list
</pre>
<h3 id="cucumber">Cucumber</h3>
<p>Theoretically you could try something like (after installing cucumber gem into multiruby):</p>
<pre>multiruby -S cucumber features
multiruby -S cucumber --format progress features
</pre>
<p>My scenarios are failing at the moment. All of them. And the log/stdout files are overwriting each other in the tmp folder. To isolate it down to one scenario you&#8217;d try something like:</p>
<pre>multiruby -S cucumber features/executable_generator.feature:7
</pre>
<p>You can now easily isolate and run a specific cucumber scenario against a specific ruby version by copy+pasting from the output of the above line. For example:</p>
<pre>~/.multiruby/install/v1_8_6_114/bin/ruby -S cucumber features/executable_generator.feature:7
</pre>
<p>Perhaps this is too much information. I&#8217;m still getting cucumber + multiruby working together, so I&#8217;ll add new ideas to the bottom of this post as I figure them out.</p>
<h3>Running rake tasks</h3>
<p>I&#8217;ve been poking around a bunch of other people&#8217;s gems seeing how many gems current pass against ruby 1.9.1 (answer: not many). When I came across nokogiri, I found that I needed to trigger the build steps of the C code first before running the tests. The simplest way to do this was via its own rake tasks.</p>
<pre>multiruby -S rake clean test</pre>
<p>Here we are calling the &#8216;clean&#8217; task first, so that the C code is rebuilt from scratch for each new ruby version. BTW, there are 6 failing tests for v1_9_1_preview2.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2010/06/01/validate-and-save-your-ruby-in-textmate-with-secret-rubinus-superpowers/' rel='bookmark' title='Permanent Link: Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers'>Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers</a> <small>In some TextMate bundles, if you save a file it...</small></li><li><a href='http://drnicwilliams.com/2009/11/04/hacking-someones-gem-with-github-and-gemcutter/' rel='bookmark' title='Permanent Link: Hacking someone&#8217;s gem with github and gemcutter'>Hacking someone&#8217;s gem with github and gemcutter</a> <small> Ever used a rubygem, found a bug, and just...</small></li><li><a href='http://drnicwilliams.com/2009/10/07/hash-bang-cucumber/' rel='bookmark' title='Permanent Link: hash bang cucumber'>hash bang cucumber</a> <small>I don&#8217;t know if this is a good idea or...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>iPhone dev podcast about fmdb-migration-manager and rbiphonetest</title>
		<link>http://drnicwilliams.com/2008/11/04/iphone-dev-podcast-about-fmdb-migration-manager-and-rbiphonetest/</link>
		<comments>http://drnicwilliams.com/2008/11/04/iphone-dev-podcast-about-fmdb-migration-manager-and-rbiphonetest/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 23:51:18 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Interviews]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/?p=320</guid>
		<description><![CDATA[Radio is where ugly people go. Podcasts is where ugly, niche people go. It doesn&#8217;t get much uglier and nicher than talking about iPhone dev; and the tale of one desperate man X on a desperate journey Y with his desperate sidekick Z, where: X = Dr Nic Y = iPhone development Z = Ruby [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2008/11/10/to-webkit-or-not-to-webkit-within-your-iphone-app/' rel='bookmark' title='Permanent Link: To WebKit or not to WebKit within your iPhone app?'>To WebKit or not to WebKit within your iPhone app?</a> <small> I know HTML. Its on my CV. Expert level....</small></li><li><a href='http://drnicwilliams.com/2008/07/04/unit-testing-iphone-apps-with-ruby-rbiphonetest/' rel='bookmark' title='Permanent Link: Unit Testing iPhone apps with Ruby: rbiphonetest'>Unit Testing iPhone apps with Ruby: rbiphonetest</a> <small> Everything to love about Ruby: the concise, powerful language;...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Radio is where ugly people go. Podcasts is where ugly, niche people go. It doesn&#8217;t get much uglier and nicher than talking about iPhone dev; and the tale of one desperate man X on a desperate journey Y with his desperate sidekick Z, where:</p>
<ol>
<li>X = Dr Nic</li>
<li>Y = iPhone development</li>
<li>Z = Ruby</li>
</ol>
<p>From the <a href="http://www.mobileorchard.com/iphone-development-podcast-2-dr-nic-williams/">Mobile Orchard news desk</a>:</p>
<p><img height="150" width="113" class="alignleft frame" alt="drnic.png" src="http://www.mobileorchard.com/wp-content/uploads/2008/11/drnic.png"/></p>
<blockquote><p>Dr. Nic talks about his <a href="http://github.com/drnic/fmdb-migration-manager">migration manager</a> for updating SQLite iPhone databases, trying to get Ruby onto an iPhone, using <a href="http://github.com/drnic/rbiphonetest/">Ruby to unit-test Objective-C</a> iPhone code, his company <a href="http://mocra.com">Mocra</a>, and the Mobile Orchard Podcast’s lavish recording studios.</p></blockquote>
<p>Dan Grigsby is the interviewer and post-production guy for the interview, and so it is entirely his handy work that it seems like I&#8217;m the only one talking for 15 minutes. The original interview took 4 hours and it was mostly him talking. He&#8217;s quite a chatterbox. I barely got a word in edgewise. [1]</p>
<p>Dan also created this list of &#8220;things we talked about&#8221;:</p>
<ol>
<li>0:00: Migrations for SQLite</li>
<li>5:18: Getting Ruby onto an iPhone</li>
<li>5:59: Nu &#8211; Lisp-based language that sits atop Obj-C and would work on the iPhone</li>
<li>7:37: Unit testing Obj-C from Ruby</li>
<li>8:12: Webkit UIs</li>
<li>12:31: Mocra / “Used my blog for evil”</li>
</ol>
<p><a href="http://www.mobileorchard.com/iphone-development-podcast-2-dr-nic-williams/"><img alt="" src="http://img.skitch.com/20081103-ft9pt2tfg8pekbj7hu2y8jijb2.png" title="Mobile Orchard" class="alignright" width="354" height="107" /></a><br />
Go to <a href="http://www.mobileorchard.com/iphone-development-podcast-2-dr-nic-williams/">Mobile Orchard</a> (or Mobile Awkward it is accidently called at the end of the interview) to <a href="http://www.mobileorchard.com/iphone-development-podcast-2-dr-nic-williams/">cop a listen</a>.</p>
<p>[1] This paragraph starts well and ends with blatant falsehoods.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2008/11/10/to-webkit-or-not-to-webkit-within-your-iphone-app/' rel='bookmark' title='Permanent Link: To WebKit or not to WebKit within your iPhone app?'>To WebKit or not to WebKit within your iPhone app?</a> <small> I know HTML. Its on my CV. Expert level....</small></li><li><a href='http://drnicwilliams.com/2008/07/04/unit-testing-iphone-apps-with-ruby-rbiphonetest/' rel='bookmark' title='Permanent Link: Unit Testing iPhone apps with Ruby: rbiphonetest'>Unit Testing iPhone apps with Ruby: rbiphonetest</a> <small> Everything to love about Ruby: the concise, powerful language;...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2008/11/04/iphone-dev-podcast-about-fmdb-migration-manager-and-rbiphonetest/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Unit Testing iPhone apps with Ruby: rbiphonetest</title>
		<link>http://drnicwilliams.com/2008/07/04/unit-testing-iphone-apps-with-ruby-rbiphonetest/</link>
		<comments>http://drnicwilliams.com/2008/07/04/unit-testing-iphone-apps-with-ruby-rbiphonetest/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 19:26:02 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Gems]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/?p=287</guid>
		<description><![CDATA[Everything to love about Ruby: the concise, powerful language; the sexy testing frameworks; and finally, the people. Everything to love about Objective-C: hmmm; well&#8230;; and finally, its the only high-level language you can use to write iPhone apps. On iPhone 2.0, to arrive on the 11th of July, you cannot run RubyCocoa. But you can [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2010/06/01/validate-and-save-your-ruby-in-textmate-with-secret-rubinus-superpowers/' rel='bookmark' title='Permanent Link: Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers'>Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers</a> <small>In some TextMate bundles, if you save a file it...</small></li><li><a href='http://drnicwilliams.com/2009/03/30/closing-in-on-the-dream-one-click-to-deploy-rails-apps/' rel='bookmark' title='Permanent Link: Closing in on The Dream: &#8220;one-click-to-deploy Rails apps&#8221;'>Closing in on The Dream: &#8220;one-click-to-deploy Rails apps&#8221;</a> <small> Got a simple app you want to build? Allocate...</small></li><li><a href='http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/' rel='bookmark' title='Permanent Link: Future proofing your Ruby code. Ruby 1.9.1 is coming.'>Future proofing your Ruby code. Ruby 1.9.1 is coming.</a> <small> Bugger. I&#8217;m a Ruby monogamist. I use the Ruby...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://img.skitch.com/20080703-mqpqqhdk4e49x3yhhb8t2g9rjg.jpg" alt="rbiphonetest logo" style="float: right" /></p>
<p>Everything to love about <strong>Ruby</strong>: the concise, powerful language; the sexy testing frameworks; and finally, the people.</p>
<p>Everything to love about <strong>Objective-C</strong>: hmmm; well&#8230;; and finally, its the only high-level language you can use to write iPhone apps.</p>
<p>On iPhone 2.0, to arrive on the 11th of July, you cannot run RubyCocoa. But you can run it on your Mac, so let&#8217;s use it to unit test your Objective-C classes. This tutorial shows you how to get started using a new project <a href="http://github.com/drnic/rbiphonetest/">rbiphonetest</a> [<a href="http://github.com/drnic/rbiphonetest">GitHub</a> | <a href="http://drnic.lighthouseapp.com/projects/13763-rbiphonetest">Lighthouse</a> | <a href="http://groups.google.com/group/rbiphonetest">Google Group</a>]</p>
<p>If you followed some of my <a href="http://summize.com/search?q=iphoneruby">recent tweets</a>, this project was previously called &#8220;iphoneruby&#8221;. And alas, the screencast also calls it &#8220;iphoneruby&#8221; but that was a crap name. People thought it was a way to run Ruby on the iphone. I can&#8217;t do that yet. So, a far better name is &#8216;rbiphonetest&#8217;. [track on <a href="http://summize.com/search?q=rbiphonetest">summize</a>]</p>
<p>Even if you&#8217;ve never touched Objective-C, Cocoa, the iPhone SDK, nor RubyCocoa I recommend watching the video anyway. It should give you hope that if you make the transition to iPhone development you don&#8217;t have to go alone without Ruby: your trusty swiss army knife of language/libraries/tools.</p>
<p>The screencast is also available in <a href="http://drnicwilliams.com/wp-content/uploads/2008/06/rbiphonetest-introduction.mov">high-def video</a> (55Mb QuickTime)</p>
<p><object width="550" height="393"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1262916&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" /><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1262916&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="550" height="393"></embed></object><br /><a href="http://www.vimeo.com/1262916?pg=embed&amp;sec=1262916">Unit Testing iPhone apps using Ruby</a> from <a href="http://www.vimeo.com/user289979?pg=embed&amp;sec=1262916">Dr Nic</a> on <a href="http://vimeo.com?pg=embed&amp;sec=1262916">Vimeo</a>.</p>
<h2 id="installation_and_usage">Installation and Usage</h2>
<p>To summarize the video, but change &#8216;iphoneruby&#8217; to &#8216;rbiphonetest&#8217;, you install the framework via RubyGems:</p>
<pre>sudo gem install rbiphonetest</pre>
<p>Then change to your project&#8217;s folder and install the test framework:</p>
<pre>rbiphonetest .</pre>
<p>Finally, for each generic, non-UIKit-framework-using class you want to test:</p>
<pre>script/generate model WidgetModel</pre>
<p>Then write your tests in <code>test/test_widget_model.rb</code></p>
<h2 id="supported_cocoa_iphone_frameworks">Supported Cocoa &amp; iPhone frameworks</h2>
<p>The mysterious, magical premise upon which rbiphonetest depends is possibly erroneous: that your Objective-C class can be compiled and tested against your OS X/Intel frameworks, and if your tests pass you assume you can then compile and include your class with the the iPhone/ARM frameworks.</p>
<p>I&#8217;m willing to go with this assumption until its proven dangerously flawed by some angry 20-year veteran of NextStep/Cocoa/iPhone. But really, how different could NSString be on the iPhone versus your Mac?</p>
<p>Fortunately there is one way to check for significant differences between your available Mac-based frameworks, such as Cocoa, and the iPhone-based frameworks, such as UIKit. We need to compare the framework names, header files and method signatures.</p>
<p>So for example, you cannot currently unit test any class that depends on/includes the UIKit framework. <em>Why?</em> It doesn&#8217;t exist on your Mac, so the Mac/Intel compiler cannot link it in. We&#8217;re compiling and running our tests with RubyCocoa, which itself is built against the Mac/Intel frameworks, not the iPhone frameworks. Hell, <a href="http://chopine.be/lrz/">Laurent</a> doesn&#8217;t even own an iPhone <img src='http://drnicwilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  [Laurent is the Apple-employee maintainer of <a href="http://rubycocoa.sourceforge.net/HomePage">RubyCocoa</a> and the newer <a href="http://trac.macosforge.org/projects/ruby/wiki/MacRuby">MacRuby</a>]</p>
<p>Similarly, its no use including/linking the Cocoa framework into your Objective-C class. <em>Why?</em> It doesn&#8217;t exist on the iPhone. It has its own UI frameworks, collectively called &#8216;UIKit&#8217;.</p>
<p>So for the moment we cannot test UI-related, iPhone-API-specific code. But we can test generic Objective-C. That&#8217;s better than a kick in the teeth. Surely. I mean, in the teeth&#8230; that&#8217;d friggin&#8217; hurt.</p>
<p>&#8220;Fair enough Dr Nic, so which frameworks <em>can</em> my code use and yet still unit test it with your oh-so-special test library thingy?&#8221; Keep your pants on, I&#8217;m getting there. [<a href="#keep-your-pants-on">ref</a>]</p>
<p>To the best of my ability, I&#8217;ve compared the two sets of frameworks and listed the available Frameworks that are available on both the iPhone and your Mac. There are about a dozen. The most important is called &#8216;Foundation&#8217;. It holds gold nuggets like &#8216;NSString&#8217;. </p>
<p>The list of <a href="http://github.com/drnic/rbiphonetest/wikis/platform-differences">platform differences</a> is on the wiki as a reference.</p>
<p>Note, this list doesn&#8217;t guarantee that any two framework classes &#8211; the iPhone and matching Mac framework &#8211; will behave the same. This list is compiled by finding the set of Frameworks with the same name on both platforms, e.g. Foundation.</p>
<p>Then it compares the set of public header files (Foundation.framework/Headers/*.h files) This comparison is by method signature. It pulls all lines from each header that start with + or &#8211; (+ is a class method and &#8211; is an instance method in Objective-C) and compares the two lists. If there is a single difference in the method signatures of the header files in the two platforms it is marked on the wiki page. You&#8217;ll need to look at the two header files yourself to see the differences. Some header files are ugly. C-based anything starts ugly and goes down from there, I think.</p>
<h2 id="python_testing_of_iphone_objective_c">Python testing of iPhone Objective-C?</h2>
<p>In the Python world there is PyObjC, a bridge-based twin to RubyCocoa. If you are a Python developer you could easily port this project to use PyObjC I would think. Ping me if you are attempting this and need any help.</p>
<h2 id="summary">Summary</h2>
<p>I think this project can give Ruby developers a happy place to work from as they write their Objective-C/iPhone code. You still need to wire up your UI views and controller classes manually, but if you push all the &#8220;oooh that code really needs some tests&#8221; classes away from the UI-dependent frameworks then you can hook it up to rbiphonetest and write your tests in Ruby.</p>
<p>Currently the generator creates test/unit test stubs. I personally then add the Shoulda gem into my test_helper.rb for my apps. If an rspec and/or test/spec developer can help with adding support to the generators I&#8217;m certain the large rspec user-base would be happy campers.</p>
<p>Similarly, someone might like to investigate using MacRuby to run the tests instead of RubyCocoa. Fast tests vs slow tests. You choose.</p>
<h3>What the?</h3>
<p>Sometimes I re-read what I&#8217;ve written and notice things that don&#8217;t seem to make sense, but are in my vocabulary nonetheless. Yep, the things you learn living in Australia.</p>
<p><strong id="keep-your-pants-on">&#8220;Keep your pants on&#8221;</strong> &#8211; this seems to imply that until I mentioned otherwise you were about to take your pants off. Hardly relevant at any stage during this article, we&#8217;d both agree. Most code-based blog articles are &#8220;pants on&#8221;. This phrase means &#8220;don&#8217;t get upset&#8221;. You can try to figure out how you go from &#8220;don&#8217;t get upset&#8221; to &#8220;keep your pants on&#8221;. I have no idea.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2010/06/01/validate-and-save-your-ruby-in-textmate-with-secret-rubinus-superpowers/' rel='bookmark' title='Permanent Link: Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers'>Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers</a> <small>In some TextMate bundles, if you save a file it...</small></li><li><a href='http://drnicwilliams.com/2009/03/30/closing-in-on-the-dream-one-click-to-deploy-rails-apps/' rel='bookmark' title='Permanent Link: Closing in on The Dream: &#8220;one-click-to-deploy Rails apps&#8221;'>Closing in on The Dream: &#8220;one-click-to-deploy Rails apps&#8221;</a> <small> Got a simple app you want to build? Allocate...</small></li><li><a href='http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/' rel='bookmark' title='Permanent Link: Future proofing your Ruby code. Ruby 1.9.1 is coming.'>Future proofing your Ruby code. Ruby 1.9.1 is coming.</a> <small> Bugger. I&#8217;m a Ruby monogamist. I use the Ruby...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2008/07/04/unit-testing-iphone-apps-with-ruby-rbiphonetest/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
<enclosure url="http://drnicwilliams.com/wp-content/uploads/2008/06/rbiphonetest-introduction.mov" length="60255710" type="video/quicktime" />
		</item>
		<item>
		<title>Using Ruby within TextMate snippets and commands</title>
		<link>http://drnicwilliams.com/2008/06/11/using-ruby-within-textmate-snippets-and-commands/</link>
		<comments>http://drnicwilliams.com/2008/06/11/using-ruby-within-textmate-snippets-and-commands/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 01:51:56 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Link]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/?p=279</guid>
		<description><![CDATA[I didn&#8217;t know you could run Ruby within TextMate snippets. As a consequence, a lot of the TextMate bundles I work on either have simplistic Snippets or the advanced code is run via Commands with code pushed into explicit Ruby files in the Support folder. But sometimes I just want a clever snippet. For example, [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2010/08/01/packaging-textmate-bundles-in-os-x-dmgs/' rel='bookmark' title='Permanent Link: Packaging TextMate bundles in OS X DMGs'>Packaging TextMate bundles in OS X DMGs</a> <small>Last week Engine Yard released a CLI for their Engine...</small></li><li><a href='http://drnicwilliams.com/2010/06/01/validate-and-save-your-ruby-in-textmate-with-secret-rubinus-superpowers/' rel='bookmark' title='Permanent Link: Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers'>Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers</a> <small>In some TextMate bundles, if you save a file it...</small></li><li><a href='http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/' rel='bookmark' title='Permanent Link: Future proofing your Ruby code. Ruby 1.9.1 is coming.'>Future proofing your Ruby code. Ruby 1.9.1 is coming.</a> <small> Bugger. I&#8217;m a Ruby monogamist. I use the Ruby...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t know you could run Ruby within TextMate snippets. As a consequence, a lot of the TextMate bundles <a href="http://github.com/search?q=drnic+tmbundle">I work on</a> either have simplistic Snippets or the advanced code is run via Commands with code pushed into explicit Ruby files in the Support folder.</p>
<p>But sometimes I just want a clever snippet. For example, I want the &#8216;cla&#8217; snippet to use the current filename to create the default class name instead of the current &#8216;ClassName&#8217; default. I want default foreign key names to be meaningful.</p>
<p>I&#8217;ve now figured this out (thanks to Ciaran Walsh), and &#8230;</p>
<p>Um, lost already? Ok, let me show you via screencast on <strong>Snippets and Commands with Ruby</strong> (<a href='http://drnicwilliams.com/wp-content/uploads/2008/06/textmate-snippets-running-ruby.mov'>QuickTime (11Mb)</a>):</p>
<p><object width="550" height="393"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1152272&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" /><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1152272&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="550" height="393"></embed></object><br /><a href="http://www.vimeo.com/1152272?pg=embed&#038;sec=1152272">TextMate Snippets running Ruby</a> from <a href="http://www.vimeo.com/user289979?pg=embed&#038;sec=1152272">Dr Nic</a> on <a href="http://vimeo.com?pg=embed&#038;sec=1152272">Vimeo</a>.</p>
<h3>Want to learn more about living with TextMate and Ruby?</h3>
<p>The TextMate website has a <a href="http://macromates.com/screencasts">series of videos</a>, including one by the Ruby.tmbundle&#8217;s own <a href="http://blog.grayproductions.net">James Edward Gray II</a> (JEG2).</p>
<p>In addition, there is the latest <a href="http://peepcode.com/products/textmate-for-rails-2">TextMate for Rails 2</a> Peepcode written by myself and spoken by Geoffrey Grosenbach. Its cheap at $9, good value at $15.50, and perhaps overpriced in the $20-$30 range. Lucky its only $9. </p>
<h3>The snippets used throughout the video</h3>
<p>The current Ruby.tmbundle snippet (activated via &#8216;cla&#8217;):</p>
<pre>class ${1:ClassName}
	$0
end</pre>
<p>An attempt to use regular expressions to convert the filename to a classname:</p>
<pre>class ${1:${TM_FILENAME/[[:alpha:]]+|(_)/(?1::\u$0)/g}}
	$0
end</pre>
<p>The final snippet, with embedded Ruby to do the heavy lifting (note: added &#8216;singluarize&#8217; to the snippet):</p>
<pre>
class ${1:`#!/usr/bin/env ruby
    require 'rubygems'
    require "active_support"
    puts ENV['TM_FILENAME'].gsub(/\.rb$/, '').camelize.singularize
    `}
	$0
end</pre>
<p>Add this to your own Ruby.tmbundle, or <a href="http://github.com/drnic/ruby-tmbundle">clone mine</a> (which is a clone of the original <a href="http://macromates.com/svn/Bundles/trunk/Bundles/Ruby.tmbundle">subversion repo</a>).</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2010/08/01/packaging-textmate-bundles-in-os-x-dmgs/' rel='bookmark' title='Permanent Link: Packaging TextMate bundles in OS X DMGs'>Packaging TextMate bundles in OS X DMGs</a> <small>Last week Engine Yard released a CLI for their Engine...</small></li><li><a href='http://drnicwilliams.com/2010/06/01/validate-and-save-your-ruby-in-textmate-with-secret-rubinus-superpowers/' rel='bookmark' title='Permanent Link: Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers'>Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers</a> <small>In some TextMate bundles, if you save a file it...</small></li><li><a href='http://drnicwilliams.com/2008/12/11/future-proofing-your-ruby-code/' rel='bookmark' title='Permanent Link: Future proofing your Ruby code. Ruby 1.9.1 is coming.'>Future proofing your Ruby code. Ruby 1.9.1 is coming.</a> <small> Bugger. I&#8217;m a Ruby monogamist. I use the Ruby...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2008/06/11/using-ruby-within-textmate-snippets-and-commands/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
<enclosure url="http://drnicwilliams.com/wp-content/uploads/2008/06/textmate-snippets-running-ruby.mov" length="11969747" type="video/quicktime" />
		</item>
		<item>
		<title>Get ready for the TextMate &#8220;Trundle to Rails 2.0 Bundle&#8221;</title>
		<link>http://drnicwilliams.com/2008/01/31/get-ready-for-the-textmate-trundle-to-rails-20-bundle/</link>
		<comments>http://drnicwilliams.com/2008/01/31/get-ready-for-the-textmate-trundle-to-rails-20-bundle/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 03:11:59 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[Trick]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2008/01/31/get-ready-for-the-textmate-trundle-to-rails-20-bundle/</guid>
		<description><![CDATA[Have you noticed lately that the Rails TextMate git pull origin two_point_oohbundle (also installed with e &#8211; the Text Editor for Windows) isn&#8217;t quite as helpful as it once was &#8211; guiding and amplifying your rails app development. Your resourceful/restful rails apps are now filled with named routes, but none of the helpers (link_to, redirect_to, [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2010/08/01/packaging-textmate-bundles-in-os-x-dmgs/' rel='bookmark' title='Permanent Link: Packaging TextMate bundles in OS X DMGs'>Packaging TextMate bundles in OS X DMGs</a> <small>Last week Engine Yard released a CLI for their Engine...</small></li><li><a href='http://drnicwilliams.com/2010/06/01/validate-and-save-your-ruby-in-textmate-with-secret-rubinus-superpowers/' rel='bookmark' title='Permanent Link: Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers'>Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers</a> <small>In some TextMate bundles, if you save a file it...</small></li><li><a href='http://drnicwilliams.com/2010/03/15/using-coffeescript-in-rails-and-even-on-heroku/' rel='bookmark' title='Permanent Link: Using CoffeeScript in Rails and even on Heroku'>Using CoffeeScript in Rails and even on Heroku</a> <small>I&#8217;m pretty excited about CoffeeScript as a clean-syntax replacement for...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<div>
<a style="float: right; padding: 5px" href='http://drnicwilliams.com/2008/01/31/get-ready-for-the-textmate-trundle-to-rails-20-bundle/attachment/257/' rel='attachment wp-att-257' title='logo_bundle.png'><img src='http://drnicwilliams.com/wp-content/uploads/2008/01/logo_bundle.png' alt='logo_bundle.png' /></a></p>
<p>Have you noticed lately that the Rails <a href="http://macromates.com">TextMate</a> git pull origin two_point_oohbundle (also installed with <a href="http://www.e-texteditor.com/">e &#8211; the Text Editor</a> for Windows) isn&#8217;t quite as helpful as it once was &#8211; guiding and amplifying your rails app development.
</div>
<p>Your resourceful/restful rails apps are now filled with named routes, but none of the helpers (link_to, redirect_to, etc) use them. The default view template was still <code>rhtml</code> for a long time (latest svn trunk fixes this to be <code>html.erb</code>, though Marc Jeanson is having a crack at supporting both through a per-project config file). </p>
<p>Or perhaps you were hoping for some snippets for new features of Rails 2.0: assert_difference (asd), assert_select (ass), respond_to (rst). </p>
<p><strong>Or just maybe, you&#8217;ve been updating your local bundle to Rails 2.0 already?</strong> Please say yes, please say yes. If you are saying &#8220;yes&#8221;, read at the bottom for how/where to send me the patches. If you are saying &#8220;no&#8221;, read at the bottom for how/where to start creating patches and sending them to me.</p>
<h3>Firstly, DHH didn&#8217;t write the Rails bundle</h3>
<p>I didn&#8217;t know this &#8211; I just assumed the guy who created Rails and helped promote TextMate also created the Ruby on Rails TextMate bundle. Instead if was WWF&#8217;s &#8220;The Rock&#8221; himself <a href="http://blog.inquirylabs.com/category/software-engineering/">Duane Johnson</a> (figurines sold separately, and may look different to the real Duane Johnson who writes Rails code instead of prancing around in his underpants with other adult males in confined spaces).</p>
<p>The TextMate SVN logs say that it the bundle was first committed in Jan 2005. Its now Jan 2008. That&#8217;s three years of maintaining a suite of code that thousands of people take for granted every day writing Rails code. What a champion.</p>
<p>Like the Australian Cricket team&#8217;s wicketkeeper, <a href="http://en.wikipedia.org/wiki/Adam_Gilchrist">Adam Gilchrist</a>, he&#8217;s also retiring at the top of his game.</p>
<h3>New Maintainer&#8230; me</h3>
<p>Instead of maintaining my own projects, I&#8217;ve decided to maintain this one. I love the TextMate bundles. Before I had a Mac, I <a href="http://drnicwilliams.com/category/radrails/">ported them across to RadRails</a> and many RadRailers entered a golden era of snippet happiness.</p>
<p>My bundle-fu may not be the equivalent of Bruce Lee, but I&#8217;m keen to see my favourite Rails tool live on strong.</p>
<h3>Bleeding edge bundle</h3>
<p>Whilst the TextMate SVN administrators process the maintainer change request (Allan is on holidays somewhere and he took the house keys with him), you might think all is lost!</p>
<p>Never. </p>
<p>The straight-off-the-cow bleeding edge Rails bundle can be accessed via Git. Specifically the branch <a href="http://github.com/drnic/ruby-on-rails-tmbundle/tree/two_point_ooh">two_point_ooh</a>.</p>
<p>So, let&#8217;s all do away with our pre-existing Rails bundle and live on the edge.</p>
<pre>
cd ~/"Library/Application Support/TextMate/Bundles/"
mv "Ruby on Rails.tmbundle" "RoR.tmbundle.orig"
git clone git://github.com/drnic/ruby-on-rails-tmbundle.git "Ruby on Rails.tmbundle"
cd "Ruby on Rails.tmbundle"
git checkout --track -b two_point_ooh origin/two_point_ooh
git pull
</pre>
<p>Now, back in TextMate, go to menu &#8220;Bundles&#8221; > &#8220;Bundle Editor&#8221; > &#8220;Reload Bundles&#8221;.</p>
<p>You, my friend, are sitting pretty.</p>
<h3>Upgrading to when newer blood is on the bleeding edge</h3>
<p>Coming back for more?</p>
<pre>
cd ~/"Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle"
git checkout two_point_ooh  # optional; only if you changed to another branch etc
git pull
</pre>
<p>Now, back in TextMate, go to menu &#8220;Bundles&#8221; > &#8220;Bundle Editor&#8221; > &#8220;Reload Bundles&#8221;.</p>
<p>Bathe yourself in glory. Splash it all over yourself.</p>
<h3>Submitting patches</h3>
<p>If you go into TextMate, launch the Bundle Editor (Cmd+Alt+Ctrl+B) and change something in the Ruby on Rails bundle, then files will added/changed within your local git clone. </p>
<p>What I mean is, you can very simply submit patches now. [When I say "simply", I mean, "I think this is the best approach but I could be completely wrong here..."] Git is so cool that I don&#8217;t know what its doing most of the time; but let&#8217;s hang in there as a team.</p>
<pre>
cd ~/"Library/Application Support/TextMate/Bundles/Ruby on Rails.tmbundle"
git add .   # to add any new files/snippets/commands you created; TextMate uses one file per snippet
git commit -a -m "Useful message about this patch goes here"
git diff -p HEAD^ HEAD
</pre>
<p>[Theoretically] this creates a patch based on your most recent commit. So you can easily create patches for changes even if your repository and the remote/central/bleeding edge repository look different.</p>
<p>If your patch was created over several commits, then replace HEAD^ with HEAD~4, if there were 4 commits.</p>
<p>I think. God I could be wrong about this though.</p>
<p>Just try your best and if it works, let me know and I&#8217;ll remove all this &#8220;I don&#8217;t know what I&#8217;m talking about&#8221; text and future readers will think I know everything. Web 2.0 rocks.</p>
<h3>Send patches to&#8230;</h3>
<p>Me <a href="mailto:drnicwilliams@gmail.com">drnicwilliams@gmail.com</a> <strong>[update] </strong>or via the <strong>new</strong> <a href="http://groups.google.com/group/rails-textmate">Google Group</a>.</p>
<p><strong>Update:</strong> Note there is a new Google Group (<a href="http://groups.google.com/group/rubyonrails-textmate">rails-textmate</a>) created in Feb 2009 due to Spam and loss of admin control on original group.</p>
<p>Want to fork the git repo? Use a free account at <a href="http://gitorious.org/">Gitorious</a> or <a href="http://github.com">GitHub</a>.</p>
<table style="background-color: #fff; padding: 5px;" cellspacing=0>
<tr>
<td>
  <img src="http://groups.google.com/groups/img/3nb/groups_bar.gif" height=26 width=132 alt="Google Groups">
  </td>
</tr>
<tr>
<td style="padding-left: 5px;font-size: 125%">
  <b>Ruby on Rails: TextMate</b>
  </td>
</tr>
<tr>
<td style="padding-left: 5px">
  <a href="http://groups.google.com/group/rails-textmate">Visit this group</a>
  </td>
</tr>
</table>
<h3>Trundle to Rails 2.0 Bundle</h3>
<p>Arguably, we just keep patching the bundle forever and bleeding edges will continue to live happily within the blood and muck of said existence.</p>
<p>But, lots of other people want nicely zipped up bundles. No doubt &#8220;e &#8211; the Text Editor&#8221; will want a &#8220;released&#8221; version so they can clean it of all the ugly things they can&#8217;t yet replicate like Macros. And eventually I&#8217;ll push it all down to the SVN repo and it will be released with future TextMate upgrades.</p>
<p>So, there will be a &#8220;Rails 2.0 compatible&#8221; grand opening one day soon. Probably before 14th of March 2008, when I&#8217;m giving a &#8220;What&#8217;s new in Rails 2.0?&#8221; talk at QCON London. Showing off the new bundle will be sweet. </p>
<p>That gives us 6 wks to refactor this bundle to make it a shining example of all that is wonderful in Rails 2.0. Every patch helps.</p>
<p>[Please consider Rails 1.2.6 and before developers when conceiving of patches, and please consult your doctor if pain persists.]</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2010/08/01/packaging-textmate-bundles-in-os-x-dmgs/' rel='bookmark' title='Permanent Link: Packaging TextMate bundles in OS X DMGs'>Packaging TextMate bundles in OS X DMGs</a> <small>Last week Engine Yard released a CLI for their Engine...</small></li><li><a href='http://drnicwilliams.com/2010/06/01/validate-and-save-your-ruby-in-textmate-with-secret-rubinus-superpowers/' rel='bookmark' title='Permanent Link: Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers'>Validate and Save your Ruby in TextMate &#8211; with secret Rubinus superpowers</a> <small>In some TextMate bundles, if you save a file it...</small></li><li><a href='http://drnicwilliams.com/2010/03/15/using-coffeescript-in-rails-and-even-on-heroku/' rel='bookmark' title='Permanent Link: Using CoffeeScript in Rails and even on Heroku'>Using CoffeeScript in Rails and even on Heroku</a> <small>I&#8217;m pretty excited about CoffeeScript as a clean-syntax replacement for...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2008/01/31/get-ready-for-the-textmate-trundle-to-rails-20-bundle/feed/</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
		<item>
		<title>Magic Wiggly Lines =&gt; GuessMethod, by Chris Shea</title>
		<link>http://drnicwilliams.com/2007/07/23/magic-wiggly-lines-guessmethod-by-chris-shea/</link>
		<comments>http://drnicwilliams.com/2007/07/23/magic-wiggly-lines-guessmethod-by-chris-shea/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 07:44:02 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Link]]></category>
		<category><![CDATA[Magic Wiggly Lines]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Trick]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/07/23/magic-wiggly-lines-guessmethod-by-chris-shea/</guid>
		<description><![CDATA[If you ever make time to code just for pleasure, then method_missing and const_missing are just begging for abuse. Chris Shea has come up with GuessMethod &#8211; a very cool hack that now deprecates my concept of Magic Wiggly Lines &#8211; a spell-checker for runtime code. What&#8217;s it do? Cop a squiz at this genius&#8230; [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/' rel='bookmark' title='Permanent Link: Dr Nic&#8217;s Magic Show at RejectConf2007'>Dr Nic&#8217;s Magic Show at RejectConf2007</a> <small>Update: there is a patch available for edge rails to...</small></li><li><a href='http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/' rel='bookmark' title='Permanent Link: Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;'>Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;</a> <small>At this point in time there’s no facility in Rails...</small></li><li><a href='http://drnicwilliams.com/2007/04/12/spring-collection-the-modular-magic-models/' rel='bookmark' title='Permanent Link: Spring Collection &#8211; the Modular Magic Models'>Spring Collection &#8211; the Modular Magic Models</a> <small>Dr Nic&#8217;s Magic Models are like cheating on your taxes...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>If you ever make time to code just for pleasure, then <code>method_missing</code> and <code>const_missing</code> are just begging for abuse.</p>
<p><a href="http://ruby.tie-rack.org/">Chris Shea</a> has come up with <a href="http://ruby.tie-rack.org/9/guessmethod-002/">GuessMethod</a> &#8211; a very cool hack that now deprecates my concept of <a href="http://drnicwilliams.com/2007/03/22/meta-magic-in-ruby-presentation/">Magic Wiggly Lines</a> &#8211; <strong>a spell-checker for runtime code.</strong></p>
<p>What&#8217;s it do? Cop a squiz at this genius&#8230;</p>
<pre class="syntax">
$ gem install guessmethod -y
$ irb
> require 'rubygems'
> require 'guessmethod'
> class Object; include GuessMethod; end  # though this could go in the guessmethod.rb file in the gem
> class Product; def name; "Some product"; end; end
> Prodct.nw.nae
<span class="ident">attention</span>: replacing non-existant constant <span class="constant">Prodct</span> with <span class="constant">Product</span> for <span class="constant">Object</span>
<span class="ident">attention</span>: sending <span class="symbol">new</span> instead of <span class="symbol">nw</span> to <span class="constant">Product:Class</span>
<span class="ident">attention</span>: sending <span class="symbol">name</span> instead of <span class="symbol">nae</span> to <span class="constant">#&lt;Product:0x144ff10>:Product</span>
=> "Some product"
</pre>
<p>That&#8217;s going straight into my <a href="http://drnicwilliams.com/2006/10/12/my-irbrc-for-consoleirb/">.irbrc</a> file. My bad spelling, coupled with my British/Australian English, will never slow me down again!</p>
<p>UPDATE: actually, it doesn&#8217;t like being in the .irbrc file for Rails console; so in the config/environments/development.rb files will have to do for the moment.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/' rel='bookmark' title='Permanent Link: Dr Nic&#8217;s Magic Show at RejectConf2007'>Dr Nic&#8217;s Magic Show at RejectConf2007</a> <small>Update: there is a patch available for edge rails to...</small></li><li><a href='http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/' rel='bookmark' title='Permanent Link: Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;'>Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;</a> <small>At this point in time there’s no facility in Rails...</small></li><li><a href='http://drnicwilliams.com/2007/04/12/spring-collection-the-modular-magic-models/' rel='bookmark' title='Permanent Link: Spring Collection &#8211; the Modular Magic Models'>Spring Collection &#8211; the Modular Magic Models</a> <small>Dr Nic&#8217;s Magic Models are like cheating on your taxes...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/07/23/magic-wiggly-lines-guessmethod-by-chris-shea/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>OpenID for WordPress</title>
		<link>http://drnicwilliams.com/2007/07/03/openid-for-wordpress/</link>
		<comments>http://drnicwilliams.com/2007/07/03/openid-for-wordpress/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 12:07:57 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Link]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/07/03/openid-for-wordpress/</guid>
		<description><![CDATA[This blog &#8211; nay, this InterTubes HomePage &#8211; runs on WordPress. This website allows you to comment. Like a blog. Let&#8217;s call it a blog. That&#8217;s shorter than &#8220;website&#8221;. To comment you&#8217;ve got to fill in your name and email and website every&#8230; single&#8230; time&#8230; Well, I don&#8217;t have to, because I have an account. [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/' rel='bookmark' title='Permanent Link: One year on the InterTubes'>One year on the InterTubes</a> <small>Dumping thoughts onto the InterTubes, aka blogging, is fun. And...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This blog &#8211; nay, this <em>InterTubes HomePage</em> &#8211; runs on WordPress.</p>
<p>This website allows you to comment. Like a blog. Let&#8217;s call it a blog. That&#8217;s shorter than &#8220;website&#8221;.</p>
<p>To comment you&#8217;ve got to fill in your name and email and website every&#8230; single&#8230; time&#8230; </p>
<p>Well, I don&#8217;t have to, because I have an account. </p>
<p>So I completely forgot about everyone else&#8217;s plight. That is, until one young soldier <a href="http://www.pinupgeek.com">Rodney Ramdas</a>, ask a good question:</p>
<blockquote><p>hey is there an openid enabled commenting thingy [for your blog]?</p></blockquote>
<p><a class="imagelink" href="http://openid.net/" title="OpenId logo"><img id="image206" src="http://drnicwilliams.com/wp-content/uploads/2007/07/openid-logo.gif" alt="OpenId logo" /></a></p>
<p>So I found <a href="http://verselogic.net/projects/wordpress/wordpress-openid-plugin/">OpenId plugin for WordPress</a>.</p>
<p>Now you can <a href="http://drnicwilliams.com/wp-login.php">create an account</a> on my site using OpenID and never have to fill all that crap in again.</p>
<p><strong>UPDATE:</strong> See comments below for how to use your blog domain name/url as your OpenID url. As it is this url that is appearing below people&#8217;s names, and that&#8217;s not what you want. That is, I can use <code>drnicwilliams.com</code> as my OpenID, even though it is actually <code>http://drnicwilliams.myopenid.com/</code>. </p>
<p>You can check that you&#8217;ve setup up your blog as your OpenID with <a href="http://www.openidenabled.com/resources/openid-test/diagnose-server/">this helper site</a>.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/' rel='bookmark' title='Permanent Link: One year on the InterTubes'>One year on the InterTubes</a> <small>Dumping thoughts onto the InterTubes, aka blogging, is fun. And...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/07/03/openid-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Functional Testing using a Matrix to cover all edge cases [video]</title>
		<link>http://drnicwilliams.com/2007/05/22/functional-testing-using-a-matrix-to-cover-all-edge-cases-video/</link>
		<comments>http://drnicwilliams.com/2007/05/22/functional-testing-using-a-matrix-to-cover-all-edge-cases-video/#comments</comments>
		<pubDate>Tue, 22 May 2007 07:12:46 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Link]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[RejectConf]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/05/22/functional-testing-using-a-matrix-to-cover-all-edge-cases-video/</guid>
		<description><![CDATA[I&#8217;ve been a fan of Ryan Davis&#8216; (zenspider) and Eric Hodel&#8216; ZenTest library (including its autotest CI tool for rails and gems), and their Hoe gem, the Rubyforge gem, etc ever since I figured out what they did. (Side note: how to setup rubyforge gem) Over the last month, Ryan mentioned &#8220;functional testing by a [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2009/03/26/testing-outbound-emails-with-cucumber/' rel='bookmark' title='Permanent Link: Testing outbound emails with Cucumber'>Testing outbound emails with Cucumber</a> <small> My testimonial for Cucumber still stands even in 2009....</small></li><li><a href='http://drnicwilliams.com/2008/12/05/my-rubygems-development-tools-and-workflow/' rel='bookmark' title='Permanent Link: My RubyGems development tools and workflow'>My RubyGems development tools and workflow</a> <small> The Open Source Developers Conference (osdc) is a nifty...</small></li><li><a href='http://drnicwilliams.com/2008/07/04/unit-testing-iphone-apps-with-ruby-rbiphonetest/' rel='bookmark' title='Permanent Link: Unit Testing iPhone apps with Ruby: rbiphonetest'>Unit Testing iPhone apps with Ruby: rbiphonetest</a> <small> Everything to love about Ruby: the concise, powerful language;...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a fan of <a href="http://blog.zenspider.com">Ryan Davis</a>&#8216; (zenspider) and <a href="http://blog.segment7.net">Eric Hodel</a>&#8216; ZenTest library (including its autotest CI tool for rails and gems), and their <a href="http://seattlerb.rubyforge.org/hoe/">Hoe</a> gem, the Rubyforge gem, etc ever since I figured out what they did. (Side note: how to <a href="http://newgem.rubyforge.org/rubyforge.html">setup rubyforge gem</a>)</p>
<p>Over the last month, Ryan mentioned &#8220;functional testing by a matrix&#8221; in <a href="http://blog.zenspider.com/archives/2007/04/functional_test_matrix.html">four</a> <a href="http://blog.zenspider.com/archives/2007/04/functional_test_matrix_cont_sorta.html">great</a> <a href="http://blog.zenspider.com/archives/2007/04/functional_test_matrix_a_visualization.html">blog</a> <a href="http://blog.zenspider.com/archives/2007/05/functional_test_matrix_gets_a_nice_little_boost.html">articles</a>.</p>
<p>Ryan shows this off at RejectConf; its 16 minutes but definitely worth your time to investigate, as I think this will be awesome for ensuring basic edge cases are thoroughly tested. Can a guest create something? Can a member delete something?</p>
<p>It is hard to see the code on the screen, but look at the blog posts linked above to get the gist of what is being shown.</p>
<p>People were really interested this as you can tell by the huge number of questions, despite this being the last of many many presentations.</p>
<p><embed style="width:500px; height:376px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-2381939140760426511&#038;hl=en" flashvars=""> </embed></p>
<p>This stuff looks primed for a sweet generator to create the test file.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2009/03/26/testing-outbound-emails-with-cucumber/' rel='bookmark' title='Permanent Link: Testing outbound emails with Cucumber'>Testing outbound emails with Cucumber</a> <small> My testimonial for Cucumber still stands even in 2009....</small></li><li><a href='http://drnicwilliams.com/2008/12/05/my-rubygems-development-tools-and-workflow/' rel='bookmark' title='Permanent Link: My RubyGems development tools and workflow'>My RubyGems development tools and workflow</a> <small> The Open Source Developers Conference (osdc) is a nifty...</small></li><li><a href='http://drnicwilliams.com/2008/07/04/unit-testing-iphone-apps-with-ruby-rbiphonetest/' rel='bookmark' title='Permanent Link: Unit Testing iPhone apps with Ruby: rbiphonetest'>Unit Testing iPhone apps with Ruby: rbiphonetest</a> <small> Everything to love about Ruby: the concise, powerful language;...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/05/22/functional-testing-using-a-matrix-to-cover-all-edge-cases-video/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Railsconf =&gt; 4 tracks; JavaOne =&gt; simultaneous 14 tracks!!</title>
		<link>http://drnicwilliams.com/2007/04/27/javaone-on-myconfplan/</link>
		<comments>http://drnicwilliams.com/2007/04/27/javaone-on-myconfplan/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 16:55:09 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Link]]></category>
		<category><![CDATA[MyConfPlan]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/27/javaone-on-myconfplan/</guid>
		<description><![CDATA[MyConfPlan now includes all the sessions for next month&#8217;s JavaOne conference. It is huge! 400+ sessions, with up to 14 simultaneous sessions. I&#8217;m going to JavaOne 2007 Remember to go see Charles Nutter&#8217;s JRuby session. Related posts:MyConfPlan sale &#8211; less than 12 hours to go The auction for MyConfPlan has less than 12 hours to...MyConfPlan [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/29/myconfplan-sale-less-than-12-hours-to-go/' rel='bookmark' title='Permanent Link: MyConfPlan sale &#8211; less than 12 hours to go'>MyConfPlan sale &#8211; less than 12 hours to go</a> <small>The auction for MyConfPlan has less than 12 hours to...</small></li><li><a href='http://drnicwilliams.com/2007/08/23/myconfplan-for-sale/' rel='bookmark' title='Permanent Link: MyConfPlan for Sale &#8211; for Charity'>MyConfPlan for Sale &#8211; for Charity</a> <small> MyConfPlan allows conference attendees to view conference sessions, pick...</small></li><li><a href='http://drnicwilliams.com/2007/05/03/12-new-railsconf-sessions/' rel='bookmark' title='Permanent Link: 12 new Railsconf sessions'>12 new Railsconf sessions</a> <small>The expansion of the Railsconf schedule has added a dozen...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://myconfplan.com">MyConfPlan</a> now includes all the sessions for next month&#8217;s JavaOne conference. It is huge! 400+ sessions, with up to 14 simultaneous sessions. </p>
<h1><a href="http://myconfplan.com/conferences/JavaOne2007">I&#8217;m going to JavaOne 2007</a></h1>
<p>Remember to go see Charles Nutter&#8217;s <a href="http://myconfplan.com/conference_sessions/66-JRuby-on-Rails--Agility-for-the-Enterprise">JRuby session</a>.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/29/myconfplan-sale-less-than-12-hours-to-go/' rel='bookmark' title='Permanent Link: MyConfPlan sale &#8211; less than 12 hours to go'>MyConfPlan sale &#8211; less than 12 hours to go</a> <small>The auction for MyConfPlan has less than 12 hours to...</small></li><li><a href='http://drnicwilliams.com/2007/08/23/myconfplan-for-sale/' rel='bookmark' title='Permanent Link: MyConfPlan for Sale &#8211; for Charity'>MyConfPlan for Sale &#8211; for Charity</a> <small> MyConfPlan allows conference attendees to view conference sessions, pick...</small></li><li><a href='http://drnicwilliams.com/2007/05/03/12-new-railsconf-sessions/' rel='bookmark' title='Permanent Link: 12 new Railsconf sessions'>12 new Railsconf sessions</a> <small>The expansion of the Railsconf schedule has added a dozen...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/04/27/javaone-on-myconfplan/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;Reads -&gt; slaves, writes -&gt; master&#8221; plugin</title>
		<link>http://drnicwilliams.com/2007/04/15/acts_as_readonlyable/</link>
		<comments>http://drnicwilliams.com/2007/04/15/acts_as_readonlyable/#comments</comments>
		<pubDate>Sun, 15 Apr 2007 21:20:14 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Link]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/15/acts_as_readonlyable/</guid>
		<description><![CDATA[Another solution to multiple connections in Rails has been put together by the Revolution Health team. Look at this sweet database.yml syntax: dbs: database: master_db host: master-host read_only: database: slave_db host: slave-host ActsAsReadonlyable adds support of multiple read-only slave databases to ActiveRecord models. When a model is marked with acts_as_readonlyable, some of AR finders are [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/' rel='bookmark' title='Permanent Link: Dr Nic&#8217;s Magic Show at RejectConf2007'>Dr Nic&#8217;s Magic Show at RejectConf2007</a> <small>Update: there is a patch available for edge rails to...</small></li><li><a href='http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/' rel='bookmark' title='Permanent Link: Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;'>Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;</a> <small>At this point in time there’s no facility in Rails...</small></li><li><a href='http://drnicwilliams.com/2006/09/21/dr-nic-magic-models-validate-anything-anytime-anywhere/' rel='bookmark' title='Permanent Link: [ANN] Dr Nic&#8217;s Magic Models 0.8 &#8211; Validate Anything, Anytime, Anywhere'>[ANN] Dr Nic&#8217;s Magic Models 0.8 &#8211; Validate Anything, Anytime, Anywhere</a> <small>Ladies and Gentlemen, welcome one and all to the greatest...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Another solution to <a href="http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/">multiple connections</a> in Rails has been put together by the <a href="http://revolutiononrails.blogspot.com/">Revolution Health team</a>.</p>
<p>Look at this sweet database.yml syntax:</p>
<pre>
dbs:

  database: master_db
  host: master-host

  read_only:
    database: slave_db
    host: slave-host
</pre>
<blockquote><p><strong>ActsAsReadonlyable</strong> adds support of multiple read-only slave databases to ActiveRecord models. When a model is marked with <strong>acts_as_readonlyable</strong>, some of AR finders are overridden to run against a slave DB. The supported finders are find, find_by_sql, count_by_sql, find_[all_]by_*, and reload.
</p></blockquote>
<p><a href="http://revolutiononrails.blogspot.com/2007/04/plugin-release-actsasreadonlyable.html">README</a> all about it.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/' rel='bookmark' title='Permanent Link: Dr Nic&#8217;s Magic Show at RejectConf2007'>Dr Nic&#8217;s Magic Show at RejectConf2007</a> <small>Update: there is a patch available for edge rails to...</small></li><li><a href='http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/' rel='bookmark' title='Permanent Link: Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;'>Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;</a> <small>At this point in time there’s no facility in Rails...</small></li><li><a href='http://drnicwilliams.com/2006/09/21/dr-nic-magic-models-validate-anything-anytime-anywhere/' rel='bookmark' title='Permanent Link: [ANN] Dr Nic&#8217;s Magic Models 0.8 &#8211; Validate Anything, Anytime, Anywhere'>[ANN] Dr Nic&#8217;s Magic Models 0.8 &#8211; Validate Anything, Anytime, Anywhere</a> <small>Ladies and Gentlemen, welcome one and all to the greatest...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/04/15/acts_as_readonlyable/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
