<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Railized - Home</title>
  <id>tag:railized.com,2008:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://railized.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://railized.com/" rel="alternate" type="text/html"/>
  <updated>2008-06-09T02:34:10Z</updated>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2008-06-09:21</id>
    <published>2008-06-09T02:06:00Z</published>
    <updated>2008-06-09T02:34:10Z</updated>
    <link href="http://railized.com/2008/6/9/firefox-3-download-day" rel="alternate" type="text/html"/>
    <title>Firefox 3 Download Day</title>
<content type="html">
            &lt;p&gt;I have made my pledge for Firefox 3 Download Day.&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;http://www.spreadfirefox.com/node&amp;amp;#38;id=0&amp;amp;#38;t=269&quot;&gt;&lt;img title=&quot;Download Day&quot; src=&quot;http://www.spreadfirefox.com/files/images/affiliates_banners/sns_badge1_en.png&quot; alt=&quot;Download Day&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2008-04-20:20</id>
    <published>2008-04-20T05:06:00Z</published>
    <updated>2008-04-21T05:18:08Z</updated>
    <category term="rails,autotest,rspec"/>
    <link href="http://railized.com/2008/4/20/running-autotest-with-rspec-gem" rel="alternate" type="text/html"/>
    <title>Running Autotest with Rspec gem</title>
<content type="html">
            &lt;p&gt;Recently I have decided to use the gem version of rspec instead of the plugin version. When I tried run autotest within the project root folder I got the following error.&lt;/p&gt;


&lt;pre&gt;
script/spec:3:in `require': no such file to load  spec (LoadError)
        from script/spec:3
&lt;/pre&gt;

	&lt;p&gt;The error was caused by line 3 of file script/spec.&lt;/p&gt;


&lt;pre&gt;
&lt;code class=&quot;ruby&quot;&gt;
1 #!/usr/bin/env ruby
2 $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + &quot;/../vendor/plugins/rspec/lib&quot;))
3 require 'spec'
4 exit ::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(ARGV, STDERR, STDOUT))
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;It&#8217;s trying to load spec file from the project plugins directory which is not available. To fix this problem just change the second line of the code to:&lt;/p&gt;


&lt;pre&gt;
&lt;code class=&quot;ruby&quot;&gt;
1 #!/usr/bin/env ruby
2 require 'rubygems'
3 require 'spec'
4 exit ::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(ARGV, STDERR, STDOUT))
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Then start autotest from the project root directory and it should now run without errors.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2008-02-17:17</id>
    <published>2008-02-17T10:31:00Z</published>
    <updated>2008-03-01T08:09:53Z</updated>
    <category term="rails"/>
    <link href="http://railized.com/2008/2/17/wrong-argument-error-when-running-rails-1-1-6-with-ruby-1-8-6" rel="alternate" type="text/html"/>
    <title>Wrong argument error when running Rails 1.1.6 with Ruby 1.8.6</title>
<content type="html">
            &lt;p&gt;If you encounter the following error when you start your rails version 1.1.6 application and you are using ruby 1.8.6.&lt;/p&gt;


&lt;pre&gt;
ArgumentError (wrong number of arguments (1 for 0)):
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:551:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:551:in `new'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:551:in `scramble41'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:141:in `real_connect'    /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:330:in `connect'  /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:87:in `initialize'
&lt;/pre&gt;

	&lt;p&gt;it&#8217;s actually due to changes in Digest initialization method. The new method no longer supports instantiation with parameters. The offending code is in&lt;/p&gt;


&lt;pre&gt;
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb

at line 551 within method 'scramble41(password, message)'
&lt;/pre&gt;

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;
    s1 = Digest::SHA1.new(password).digest
    s2 = Digest::SHA1.new(s1).digest
    x = Digest::SHA1.(message + s2).digest
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;To resolve, just change the code to the following&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;
    s1 = Digest::SHA1.digest(password)
    s2 = Digest::SHA1.digest(s1)
    x = Digest::SHA1.digest(message + s2)
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Alternatively you can upgrade your rails version to 1.2.x.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2008-02-09:15</id>
    <published>2008-02-09T06:44:00Z</published>
    <updated>2008-04-21T05:16:58Z</updated>
    <category term="development"/>
    <category term="rails"/>
    <link href="http://railized.com/2008/2/9/building-a-rails-application-part-1-getting-started" rel="alternate" type="text/html"/>
    <title>Building a Rails application - Part 1 Getting Started</title>
<content type="html">
            &lt;p&gt;I am going to write a series of post as I embark on my journey to create my own web 2.0 start up. I will not disclose what I&#8217;m working on at this moment, but I will write as much as I can on the tools, libraries and methods I will be using. Where possible I&#8217;ll list down the steps and my though process. I hope this can serve as a reference for anyone who wants to build his/her own web application using Rails.&lt;/p&gt;


	&lt;h3&gt;Getting started&lt;/h3&gt;


&lt;ol&gt;
    &lt;li&gt;
&lt;strong&gt;Domain name&lt;/strong&gt; &lt;br /&gt;
This is one of the hardest part. To find a good domain name is difficult nowadays. &lt;a href=&quot;http://www.instantdomainsearch.com&quot;&gt;Instant Domain Search&lt;/a&gt; is a very nice tool for searching domain. Lucky for me, I&#8217;m able to get hold of a good domain name for my app. (I will disclose my domain when it&#8217;s ready, in the mean time stay tuned)
    &lt;/li&gt;
   &lt;li&gt;
&lt;strong&gt;Hardware and OS&lt;/strong&gt; &lt;br /&gt;
I will be using my MacBook which is still running on Tiger at the moment. I would not be upgrading to Leopard in the near future and I think Tiger is good enough to do my work.
   &lt;/li&gt;
   &lt;li&gt;
&lt;strong&gt;Text editor&lt;/strong&gt;&lt;br /&gt;
I have been hacking in &lt;a href=&quot;http://macromates.com/&quot;&gt;TextMate&lt;/a&gt; for some time and I love it. It&#8217;s shipped with Ruby and Rails bundles. Go ahead and download a trial version and give a try (only for Mac). If you are already hacking in TextMate, you may want to download the &lt;a href=&quot;http://alternateidea.com/blog/articles/2006/01/03/textmate-vibrant-ink-theme-and-prototype-bundle&quot;&gt;Textmate Vibrant Ink Theme and Prototype Bundle&lt;/a&gt; 
   &lt;/li&gt;
&lt;/ol&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2008-01-20:14</id>
    <published>2008-01-20T08:34:00Z</published>
    <updated>2008-01-20T08:34:57Z</updated>
    <category term="ajax"/>
    <category term="design"/>
    <category term="rails"/>
    <link href="http://railized.com/2008/1/20/ajax-autocomplete-highlighting" rel="alternate" type="text/html"/>
    <title>Ajax autocomplete highlighting</title>
<content type="html">
            &lt;p&gt;Autocomplete text field is a very useful feature to speed up form completion and help minimize errors. It&#8217;s even better if you can highlight the keywords within the dropdown list to help user search for the right choice. Here&#8217;s how to implement keyword highlighting in rails.&lt;/p&gt;


	&lt;p&gt;&lt;img src=&quot;http://railized.com/assets/2008/1/20/autocomplete.jpg&quot; /&gt;&lt;/p&gt;


	&lt;p&gt;1. First add the necessary javascripts to make the text field into an autocomplete text field.&lt;/p&gt;


form
&lt;pre&gt;
&amp;lt;%= text_field_tag 'country', '', :id =&amp;gt; 'country' %&amp;gt;
&amp;lt;div id=&quot;country_autocomplete&quot; style=&quot;display:none&quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
//&amp;lt;![CDATA[
var country_auto_completer = new Ajax.Autocompleter('country', 'country_auto_complete', 
  '/countries/auto_complete_for_country', frequency:0.2})
//]]&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;

	&lt;p&gt;2. Then in the controller add in the method to find the list of items base on the keywords and assign the keyword to an instance variable (this is needed for the highlighting).&lt;/p&gt;


controller
&lt;pre&gt;
def auto_complete_for_country
  @keyword = params[:country]
  @countries = Country.find(:all, :conditions =&amp;gt; ['name like ?', &quot;%params[:country]%&quot;])
  render(:partial =&amp;gt; 'auto_complete')
end
&lt;/pre&gt;

	&lt;p&gt;3. In the view, create the highlighting effect by replacing all keywords within the country names  with &#8216;&lt;strong&gt;keyword&lt;/strong&gt;&#8217; using the &#8216;strong&#8217; tag.&lt;/p&gt;


view (_auto_complete.rhtml)
&lt;pre&gt;
&amp;lt;ul&amp;gt;
&amp;lt;% for country in @countries do -%&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;%=h(country.name).gsub(Regexp.new(&quot;(#{@keyword})&quot;, true), '&amp;lt;strong&amp;gt;\1&amp;lt;/strong&amp;gt;') %&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2008-01-14:13</id>
    <published>2008-01-14T02:43:00Z</published>
    <updated>2008-01-14T02:49:39Z</updated>
    <category term="development"/>
    <link href="http://railized.com/2008/1/14/installing-git-on-mac-os-x" rel="alternate" type="text/html"/>
    <title>Installing Git on Mac OS X</title>
<content type="html">
            &lt;p&gt;Recently there&#8217;s a trend in the rails community switching from &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt; to &lt;a href=&quot;http://git.or.cz/&quot;&gt;Git&lt;/a&gt;. If you want to give that a try and you are using a Mac, the easiest way to install Git is using macports.&lt;/p&gt;


&lt;pre&gt;
sudo port install git-core
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-09-24:11</id>
    <published>2007-09-24T12:31:00Z</published>
    <updated>2007-09-24T12:47:02Z</updated>
    <link href="http://railized.com/2007/9/24/code-xtreme-apps-part-2" rel="alternate" type="text/html"/>
    <title>Code Xtreme Apps Part 2</title>
<content type="html">
            &lt;p&gt;The competition is over and I&#8217;m impressed what my team, Jason and JT has developed within the 24hrs code jamming. You can try out the application &lt;a href=&quot;http://team05.temasek.net/team05-9/appserver/&quot;&gt;here&lt;/a&gt;. The objective of the application is to allow anyone to share their itineraries and let anyone going to any cities to plan for their own itinerary based on the information they get from our site. It&#8217;s simple and easy to use. Currently there are limited data and you can search for itineraries for Singapore, 1or 2 days with tags &#8216;arts&#8217;. Overall it&#8217;s a good experience and we were lucky to be short listed for presentation today. I do hope we can win but even if we don&#8217;t I would still like to improve on it and launch it.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-09-21:10</id>
    <published>2007-09-21T13:52:00Z</published>
    <updated>2007-09-21T14:07:22Z</updated>
    <category term="rails"/>
    <link href="http://railized.com/2007/9/21/code-xtreme-apps" rel="alternate" type="text/html"/>
    <title>Code Xtreme Apps</title>
<content type="html">
            &lt;p&gt;I will be heading for my first coding competition (&lt;a href=&quot;http://www.itsc.org.sg/prevEvent.do?eventKey=9&quot;&gt;Code Xtreme Apps&lt;/a&gt;) tomorrow at &lt;span class=&quot;caps&quot;&gt;SMU&lt;/span&gt;. It&#8217;s a 24hrs coding compeition and it&#8217;s the first of it&#8217;s kind in Singapore. I&#8217;m quite excited about it and looking forward to it. There are total of 73 teams and I believe it will be a tough fight with some of the best rails developer from Singapore and around the regions. Well I do hope I can win but mostly I&#8217;m taking it as more of an experience and fun kind of feeling to the competition.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-09-03:9</id>
    <published>2007-09-03T14:49:00Z</published>
    <updated>2007-09-03T15:10:22Z</updated>
    <category term="database"/>
    <category term="erlang"/>
    <link href="http://railized.com/2007/9/3/a-document-database-server-accessible-via-a-restful-json-api" rel="alternate" type="text/html"/>
    <title>A document database server, accessible via a RESTful JSON API.</title>
<content type="html">
            &lt;p&gt;&lt;a href=&quot;http://couchdb.com&quot;&gt;Couchdb&lt;/a&gt; seems like an very interesting alternative data storage server. What interests me is it uses a RESTful &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; api to retrieve and update data. There are no database schema and changes to the data structure can be make without effecting previous records. It uses Javascript to build a view model. Moreover the database is implemented in &lt;a href=&quot;http://www.erlang.org&quot;&gt;Erlang&lt;/a&gt;, the next language I&#8217;m going to pick up.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-08-31:8</id>
    <published>2007-08-31T04:01:00Z</published>
    <updated>2007-09-01T07:18:59Z</updated>
    <category term="Programming"/>
    <link href="http://railized.com/2007/8/31/convention-over-configuration-the-smarter-choice" rel="alternate" type="text/html"/>
    <title>Convention over configuration - the smarter choice</title>
<content type="html">
            &lt;p&gt;I was debugging a Java legacy system and found out that the error was due to configuration. Yeah.. I forgot to change the configuration that maps to the database and I cost me 1 day to debug!. I guess I&#8217;m too used to rails way of doing things now. Convention over configuration, definitely the smarter choice!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-08-08:7</id>
    <published>2007-08-08T07:34:00Z</published>
    <updated>2007-09-01T07:17:41Z</updated>
    <link href="http://railized.com/2007/8/8/using-raspell-with-your-own-custom-dictionary" rel="alternate" type="text/html"/>
    <title>Using raspell with your own custom dictionary</title>
<content type="html">
            &lt;p&gt;A good search engine should be smart enough to detect spelling errors and provide suggestions. For example if you misspelled a word when using Google search, it will ask &lt;strong&gt;Do you mean:...&lt;/strong&gt;. It will be cool to have such feature for our own search engine. So I started to explore possible solutions what works will rails and came upon this blog post by &lt;a href=&quot;http://blog.evanweaver.com/articles/2007/03/10/add-gud-spelning-to-ur-railz-app-or-wharever&quot;&gt;Evan Weaver&lt;/a&gt;. He has implemented a ruby gem &lt;a href=&quot;http://blog.evanweaver.com/files/doc/fauna/raspell/files/README.html&quot;&gt;raspell&lt;/a&gt; to interface with &lt;a href=&quot;http://aspell.net&quot;&gt;Aspell&lt;/a&gt;. That sounds like a good solution and I decided to check it out.&lt;/p&gt;


	&lt;h3&gt;1. Installing Aspell&lt;/h3&gt;


	&lt;p&gt;As mentioned in Evan&#8217;s post to install Aspell just type the following command from terminal:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
sudo port install aspell aspell-dict-en
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;This will install both the aspell library and aspell English dictionary.&lt;/p&gt;


	&lt;h3&gt;2. Install raspell&lt;/h3&gt;


	&lt;p&gt;This is straight forward.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
sudo gem install raspell --with-opt-dir=/opt/local
&lt;/code&gt;
&lt;/pre&gt;

	&lt;h3&gt;3. Setting up your own dictionary&lt;/h3&gt;


	&lt;p&gt;For my case I needed aspell to check against my own custom dictionary. I create a text file containing the list of words with each word on a new line save it as wordlist. e.g.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
John
Simon
Mae
Tim
Louis
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Then run it with the following command.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
aspell --lang=en create master ./en_SG-name.rws &amp;lt; wordlist
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Note that for the language option I&#8217;m using &#8216;en&#8217; which is the standard code for English. If you are generating a word list in other languages you will have to change lang option accordingly. The name of the output file is important because Aspell only pick up dictionary file in a certain naming format. The dictionary file should start with the language code then follow by a country code which is optional. For my case I have chosen SG because I do not want to override the default en dictionaries from Aspell. The &#8216;name&#8217; after the &#8217;-&#8217; is actually the jargon. So if you are generating a word list of street names in US you might want to name you dictionary as en_US-street.rws. Once you have generated the dictionary you will have to place it in Aspell default dictionary directory.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
sudo mv en_SG-name.rws /opt/local/share/aspell/
&lt;/code&gt;
&lt;/pre&gt;

Because Aspell will only look for dictionaries with .multi file extension in the default directory. I&#8217;ll need to create a en_SG-name.multi file for my new dictionary 
&lt;pre&gt;
&lt;code&gt;
sudo vi /opt/local/share/aspell/en_SG-name.multi
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;and add the following line.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
add en_SG-name.rws
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;You can add multiple dictionary to this file. If you needed the common English dictionary together with your custom one. Just add it accordingly.&lt;/p&gt;


	&lt;h3&gt;4. Using your own dictionary in ruby.&lt;/h3&gt;


	&lt;p&gt;Finally to use the dictionary I have just created.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
require 'rubygems'
require 'raspell'

sp = Aspell.new('en_SG', 'name')
sp.suggest('Mea')
=&amp;gt; [&quot;Mae&quot;]
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;The first parameter is the language part of the file name and the second is the jargon. So if you have named your dictionary as en_US-street.multi then you will need to initialize it with&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
sp = Aspell.new('en_US', 'street')
&lt;/code&gt;
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-08-02:6</id>
    <published>2007-08-02T05:31:00Z</published>
    <updated>2007-09-01T07:16:22Z</updated>
    <link href="http://railized.com/2007/8/2/sphinx-nginx-of-full-text-search" rel="alternate" type="text/html"/>
    <title>Sphinx - nginx of full text search</title>
<content type="html">
            &lt;p&gt;I got to know &lt;a href=&quot;http://www.sphinxsearch.com/&quot;&gt;Sphinx&lt;/a&gt; a Russian search engine from &lt;a href=&quot;http://blog.evanweaver.com/articles/2007/07/09/ultrasphinx-searching-the-world-in-231-seconds&quot;&gt;Snax&lt;/a&gt;. This could be an alternative to &lt;a href=&quot;http://ferret.davebalmain.com/trac/&quot;&gt;ferret&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-07-22:5</id>
    <published>2007-07-22T02:09:00Z</published>
    <updated>2008-03-07T15:52:20Z</updated>
    <category term="Mac"/>
    <category term="Rspec"/>
    <link href="http://railized.com/2007/7/22/setting-up-rspec-autotest-and-growl-on-mac-os-x" rel="alternate" type="text/html"/>
    <title>Setting up Rspec, Autotest and Growl on Mac OS X</title>
<content type="html">
            p&gt;
We have recently decided to use
&lt;span class=&quot;caps&quot;&gt;BDD&lt;/span&gt;
for our upcoming projects. To make testing more fun and efficient I have hook up Growl with ZenTest’s autotest to display test results from Rspec. Some of the following instructions is taken from
&lt;a href=&quot;http://wincent.com/knowledge-base/Setting_up_autotest_to_use_Growl&quot;&gt;http://wincent.com/knowledge-base/Setting_up_autotest_to_use_Growl&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;What follows are the instructions to install the software to setup your own if you like to try out.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;a href=&quot;http://growl.info/&quot;&gt;Growl&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&quot;http://www.zenspider.com/ZSS/Products/ZenTest/&quot;&gt;ZenTest&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&quot;http://rspec.rubyforge.org/index.html&quot;&gt;Rspec&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Installing Growl&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
Download the dmg package from
&lt;a href=&quot;http://growl.info/&quot;&gt;Growl&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Open the disk image, and double click in the Growl.prefPane icon.&lt;/li&gt;
&lt;li&gt;
Next is to install
&lt;a href=&quot;http://growl.info/documentation/growlnotify.php&quot;&gt;growlnotify&lt;/a&gt;
. Double click on the Growl disk image again if you have close it and execute the following commands from a terminal
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;
&lt;code&gt; cd /Volumes/Growl/Extras/growlnotify
 sudo ./install.sh
 cd
 hdiutil detach /Volumes/Growl &lt;/code&gt;
&lt;/pre&gt;
&lt;h3&gt;Installing ZenTest&lt;/h3&gt;
&lt;p&gt;ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails. For our purpose we will be using autotest. The latest version of ZenTest has added rspec support and it’ll auto detect rspec and run tests in the background whenever there’s any changes to the specs.&lt;/p&gt;
&lt;p&gt;Installing ZenTest is easy just run the following command:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt; sudo gem install ZenTest &lt;/code&gt;
&lt;/pre&gt;
&lt;h3&gt;Installing Rspec&lt;/h3&gt;
&lt;p&gt;
To test rails with rspec you will need to install
&lt;a href=&quot;http://rspec.rubyforge.org/documentation/rails/install.html&quot;&gt;rspec and rspec_on_rails plugins&lt;/a&gt;
. Run the following command from your project root directory.
&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt; script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec
 script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails &lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;After you have installed the plugins you will need to run following command once to bootstrap your Rails app with RSpec.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt; script/generate rspec &lt;/code&gt;
&lt;/pre&gt;
&lt;h3&gt;Customize Autotest&lt;/h3&gt;
&lt;p&gt;The last step is to customize Autotest. Download the following 2 images and save them under ~/.autotest_images (create this directory if it does not exist). You can also create your own images if you want.&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;http://blog.spiragram.com/assets/2007/7/22/pass.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;http://blog.spiragram.com/assets/2007/7/22/fail.png&quot; alt=&quot;&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;Open your favorite editor and copy and paste the code, then save the file as .autotest under your user home directory.&lt;/p&gt;
&lt;pre&gt;
&lt;code class=&quot;ruby&quot;&gt; module Autotest::Growl

   def self.growl title, msg, img, pri=0, sticky=&quot;&quot;
     system &quot;growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}&quot;
   end

  Autotest.add_hook :ran_command do |at|
    results = [at.results].flatten.join(&quot;\n&quot;)
    output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+not implemented)?/) 
      if output
        if $~[2].to_i &gt; 0
          growl &quot;FAIL&quot;, &quot;#{output}&quot;, &quot;~/.autotest_images/fail.png&quot;, 2
       else
         growl &quot;Pass&quot;, &quot;#{output}&quot;, &quot;~/.autotest_images/pass.png&quot; 
       end
     end
   end 
 end &lt;/code&gt;
&lt;/pre&gt;
&lt;h3&gt;Configure Growl&lt;/h3&gt;
&lt;p&gt;Finally you can configure growl to with different display style via System Preference -&gt; Growl. Try out all the different display style to see which one you prefer. Personally I like “Music Video”.&lt;/p&gt;
&lt;p&gt;Once you have setup all the above. Run autotest under your project root directory and you will see Growl in action. Have fun!!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-07-21:4</id>
    <published>2007-07-21T18:15:00Z</published>
    <updated>2007-09-01T07:12:38Z</updated>
    <link href="http://railized.com/2007/7/21/internet-wasteland" rel="alternate" type="text/html"/>
    <title>Internet Wasteland</title>
<content type="html">
            &lt;p&gt;
Check out this geek song
&lt;a href=&quot;http://www.eddyboston.com/InternetWasteland&quot;&gt;Internet Wasteland&lt;/a&gt;
by Eddy Boston. It has Ruby on Rails in the lyrics.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://railized.com/">
    <author>
      <name>tohchye</name>
    </author>
    <id>tag:railized.com,2007-07-11:3</id>
    <published>2007-07-11T10:06:00Z</published>
    <updated>2007-09-01T07:11:08Z</updated>
    <category term="rails"/>
    <link href="http://railized.com/2007/7/11/sending-emails-using-gmail-smtp-with-actionmailer" rel="alternate" type="text/html"/>
    <title>Sending emails using GMail smtp with ActionMailer</title>
<content type="html">
            &lt;p&gt;
If you have been following our blog you should have read the post
&lt;a href=&quot;http://blog.spiragram.com/2007/7/6/swiss-army-knife-2-0&quot;&gt;Swiss Amry Knife 2.0&lt;/a&gt;
. We have recently switch our mail server to Google Apps. This is nice but that also means we have to change our ActionMailer server settings to GMail’s smtp server and this pose a problem. Because default ActionMailer does not support
&lt;span class=&quot;caps&quot;&gt;&lt;span class=&quot;caps&quot;&gt;SSL&lt;/span&gt;&lt;/span&gt;
authentication which is required by GMail. I tried searching for a solution and lucky enough I managed to came across this
&lt;a href=&quot;http://www.stephenchu.com/2006/06/how-to-use-gmail-smtp-server-to-send.html&quot;&gt;post&lt;/a&gt;
and got to work! Check out the link if you are facing the same problem.
&lt;/p&gt;
          </content>  </entry>
</feed>
