<?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>Katipo Developers Blog &#187; ruby on rails</title>
	<atom:link href="http://blog.katipo.co.nz/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.katipo.co.nz</link>
	<description></description>
	<lastBuildDate>Fri, 04 Jun 2010 02:39:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A more concise way to call single test file in ruby</title>
		<link>http://blog.katipo.co.nz/2010/04/25/a-more-concise-way-to-call-single-test-files-in-ruby/</link>
		<comments>http://blog.katipo.co.nz/2010/04/25/a-more-concise-way-to-call-single-test-files-in-ruby/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 03:52:12 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=118</guid>
		<description><![CDATA[I&#8217;ve been working with Rails and Ruby since 2006 and I&#8217;m surprised I hadn&#8217;t put this together for myself:

$ cd test # from your rails app root
$ ruby unit/a_model_test.rb

As compared to:

$ ruby -I"lib:test" "/usr/local/Cellar/ruby-enterprise-edition/1.8.7-20090928/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/a_model_test.rb"

Definitely a hand to forehead moment when I read that! Found it in a comment here:
https://rails.lighthouseapp.com/projects/16213/tickets/8
*Assumes your ruby command is set [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with Rails and Ruby since 2006 and I&#8217;m surprised I hadn&#8217;t put this together for myself:</p>
<pre>
<div class="codesnip-container" >$ cd test # from your rails app root
$ ruby unit/a_model_test.rb</div>
</pre>
<p>As compared to:</p>
<pre>
<div class="codesnip-container" >$ ruby -I"lib:test" "/usr/local/Cellar/ruby-enterprise-edition/1.8.7-20090928/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/a_model_test.rb"</div>
</pre>
<p>Definitely a hand to forehead moment when I read that! Found it in a comment here:</p>
<p><a href="https://rails.lighthouseapp.com/projects/16213/tickets/8">https://rails.lighthouseapp.com/projects/16213/tickets/8</a></p>
<p>*Assumes your ruby command is set up correctly in your shell&#8217;s environment, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2010/04/25/a-more-concise-way-to-call-single-test-files-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MongoDB on Mac OS X using Homebrew</title>
		<link>http://blog.katipo.co.nz/2010/03/16/installing-mongodb-on-mac-os-x-using-homebrew/</link>
		<comments>http://blog.katipo.co.nz/2010/03/16/installing-mongodb-on-mac-os-x-using-homebrew/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 01:20:42 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[Homebrew]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=108</guid>
		<description><![CDATA[I&#8217;ve moved from MacPorts to Homebrew which includes a recipe for installing MongoDB. After installing Homebrew, just run this as your normal user:
brew install mongodb
If you prefer to store your MongoDB data all under your home directory, you might find Mislav&#8217;s gist suits your needs instead:
http://gist.github.com/265272
If you prefer installing from source, check out this post:
http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x
Enjoy.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve moved from MacPorts to <a href="http://github.com/mxcl/homebrew">Homebrew</a> which includes a recipe for installing MongoDB. After installing Homebrew, just run this as your normal user:</p>
<div class="codesnip-container" >brew install mongodb</div>
<p>If you prefer to store your MongoDB data all under your home directory, you might find Mislav&#8217;s gist suits your needs instead:</p>
<p><a href="http://gist.github.com/265272">http://gist.github.com/265272</a></p>
<p>If you prefer installing from source, check out this post:</p>
<p><a href="http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x">http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x</a></p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2010/03/16/installing-mongodb-on-mac-os-x-using-homebrew/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three ways to increase New Relic RPM&#8217;s usefulness</title>
		<link>http://blog.katipo.co.nz/2010/03/03/three-ways-to-increase-new-relic-rpms-usefulness/</link>
		<comments>http://blog.katipo.co.nz/2010/03/03/three-ways-to-increase-new-relic-rpms-usefulness/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 04:13:07 +0000</pubDate>
		<dc:creator>kieran</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[new relic]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=104</guid>
		<description><![CDATA[Three recent and little known features of New Relic RPM which help increase usefulness.]]></description>
			<content:encoded><![CDATA[<p>Here at Katipo, we&#8217;re using New Relic RPM to monitor our deployed <a href="http://kete.net.nz">Kete</a> applications, to help make things as fast as possible. In order to make New Relic as useful as possible, I&#8217;ve been trying out three New Relic RPM features, some available in only the latest versions of RPM, on one of those sites. These recent and little-known features aren&#8217;t enabled by default, so I&#8217;m going to run you through them and how to set them up in this post.</p>
<p>If you don&#8217;t yet use New Relic RPM, you can get a Lite account for free by going to <a href="http://newrelic.com">newrelic.com</a>, where you can also test drive New Relic RPM on a real application. <span id="more-104"></span></p>
<p><strong>Custom request parameters</strong></p>
<p>New Relic does it&#8217;s best to record as much information about the current request as possible. The URL, split down into controller, action, id etc, the request referrer, GET and POST data&#8230;. but there is data that it doesn&#8217;t know about. Things like the current locale, the user who is currently logged in, or custom session params. Thankfully, there is a solution.</p>
<p>New Relic RPM contains a method for adding custom data to each transaction or error that is sent to it&#8217;s servers. Utilize this method inside of a before_filter in your application controller, and you&#8217;ll be gathering that extra data in no time. Here is the code we use.</p>
<blockquote>
<pre># Collect additional debug details for New Relic RPM is available
# Do this after all other before filters so details are present
before_filter :set_new_relic_custom_parameters
def set_new_relic_custom_parameters
  return unless defined?(NewRelic)
  NewRelic::Agent.add_custom_parameters(
    :locale =&gt; (I18n.locale if I18n.locale),
    :account =&gt; (logged_in? ? current_user.login : 'guest'),
    :return_to =&gt; (session[:return_to] if session[:return_to])
  )
end
private :set_new_relic_custom_parameters</pre>
</blockquote>
<p>Now, whenever RPM sends information about slow web requests or error reports, you&#8217;ll have more data to help replicate the issue.</p>
<p><strong>Passenger Queue Wait</strong></p>
<p>Sometimes the slowness might not be your app, but your app server. How do you tell if it&#8217;s serving requests fast enough? New Relic RPM now has the ability to report how long your visits were waiting in the &#8216;queue&#8217;, that is, the time between requesting the site and Apache actually processing that request. Getting this working is fairly simple.</p>
<blockquote><p>RequestHeader set X-REQUEST_START &#8220;%t&#8221;</p></blockquote>
<p>Simply set that in either your main apache.conf file, the VirtualHost directive, or a Directory directive.</p>
<p>Also, ensure that the headers Apache module is enabled. On Debian, you can do this by running the following as root.</p>
<blockquote><p># a2enmod headers</p></blockquote>
<p>That&#8217;s all it takes. Now, when RPM sends along information, it&#8217;ll send how long each request stayed in the queue, and display it at New Relic RPM&#8217;s web interface, on all graphs as &#8216;Queue Wait&#8217;. This should give you an indication of whether your application server is performing well.</p>
<p><span style="text-decoration: underline;"><span style="color: #000000;">Important Note:</span></span> If you run your application across multiple machines, each machine needs this header, and the clock on each machine must be synced with NTP or similar, or you&#8217;ll end up with very incorrect queue times. Users who run the entire site off one box need not worry about this issue.</p>
<p><strong>Garbage Collection delays</strong></p>
<p>I&#8217;m not going to go into much detail about Ruby Garbage collection here. Google &#8216;Ruby Garbage Collection&#8217; if you want to know more. Put simply though, in Ruby, while Garbage Collection runs, it stops the processing of your app. This could lead to slow page requests if it garbage collector, or GC, runs multiple times in the same request.</p>
<p>There are ways to tweak this using settings, but how do you know if it&#8217;s a problem to begin with? If you use Ruby Enterprise Edition, or another version of Ruby with the Railsbench GC patches compiled in, then all you need is the following line in your application.</p>
<blockquote><p>GC.enable_stats if defined?(GC) &amp;&amp; GC.respond_to?(:enable_stats)</p></blockquote>
<p>For Ruby on Rails users, you can stick that at the bottom of your config/environment.rb file. Basically, if GC is defined, and responds to the correct method, then use it. RPM will send this information back to New Relic, where you can view how long GC took in each of your requests, and deal with it accordingly.</p>
<p><strong>Conclusion</strong></p>
<p>Well, that&#8217;s all for now. Please feel free to share any additional features which help make New Relic even more useful in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2010/03/03/three-ways-to-increase-new-relic-rpms-usefulness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from Github to Gemcutter</title>
		<link>http://blog.katipo.co.nz/2010/01/19/migrating-from-github-to-gemcutter/</link>
		<comments>http://blog.katipo.co.nz/2010/01/19/migrating-from-github-to-gemcutter/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 02:53:29 +0000</pubDate>
		<dc:creator>kieran</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[gemcutter]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=100</guid>
		<description><![CDATA[Quick quote to migrating your gem list from Github to Gemcutter, the newest (and soon, only) gem hoster on the scene.]]></description>
			<content:encoded><![CDATA[<p>For those of you who follow this sort of thing, <a href="http://github.com">Github</a> shut down their gem building. Thankfully, a newer and easier gem hoster, <a href="http://gemcutter.org">Gemcutter</a>, appeared on the scene not long before that happened. The idea behind it, for those who haven&#8217;t heard of it, is that you manage your own gem building. Gemcutter doesn&#8217;t wait for your Gem spec to change before it makes a new gem. You simply build it locally, and push it to Gemcutter, using a handy gem they provide that extends Rubygems &#8216;gem&#8217; console command.</p>
<p>But Github was building gems for some time, and due to it&#8217;s continuing popularity, many well known Ruby on Rails developers and companies switched permanently to Github for their gem building/hosting at the time, so it&#8217;s likely that quite a few gems you&#8217;ve got installed are from Github.</p>
<p>To help transition over from Github to Gemcutter, <a href="http://github.com/maxim">Maxim Chernyak</a> wrote a great utility called <a href="http://github.com/maxim/off_github">off_github</a>, which looks at your list of gems, and tells you which ones you&#8217;re installed from Github, and whether they can be reinstalled from Gemcutter. It saves a lot of time and effort  than having to do it manually. So here&#8217;s how to get started&#8230;.</p>
<p><span id="more-100"></span>Firstly, lets get the latest version of Rubygems. This may not be needed for the off_github gem to function, but it pays to keep this up to date to prevent any issues with newer gems. Usually, you&#8217;ll want Rubygems version 1.3.0 or higher. At the time of this post, the current version is 1.3.5.</p>
<blockquote><p>$ gem &#8211;version<br />
1.2.1<br />
$ [sudo] gem update &#8211;system<br />
&#8230;&#8230;<br />
$ gem &#8211;version<br />
1.3.5</p></blockquote>
<p>Once that&#8217;s done, install the off_github gem. To do that, add Gemcutter as a source and run the gem install command.</p>
<blockquote><p>$ gem sources -a http://gemcutter.org<br />
$ [sudo] gem install off_github</p></blockquote>
<p><strong>Note: </strong>Rubyforge gems now points to Gemcutter, so the gem source adding isn&#8217;t technically needed to install off_github. That said, the off_github gem still checks for the Gemcutter source (it&#8217;s a bit outdated) and won&#8217;t work without it, so to get around it, install it before running, and you can remove it afterwards.</p>
<p>Now go ahead and run the off_github command. If you don&#8217;t use sudo to install gems, then be sure to add &#8211;no-sudo the end.</p>
<blockquote><p>$ off_github [--no-sudo]</p></blockquote>
<p>This&#8217;ll go ahead and return a list of gems that were installed from Github, what there Gemcutter gem name is, and the action it&#8217;ll take on that gem (usually reinstall). It&#8217;ll then ask you if you want to install. Type &#8216;Y&#8217;, hit enter, and then choose y/n/a at each prompt.</p>
<p>If everything went smoothly, you&#8217;re all done. You can now go ahead and delete both the Github and Gemcutter sources.</p>
<blockquote><p>$ gem sources -r http://gems.github.com<br />
$ gem sources -r http://gemcutter.org</p></blockquote>
<p>So know, you should have Rubyforge as your only gem source.</p>
<blockquote><p>$ gem sources<br />
*** CURRENT SOURCES ***<br />
http://gems.rubyforge.org</p></blockquote>
<p><strong>Additional Material:</strong></p>
<ul>
<li><a href="# http://www.rubypulse.com/episode-0.16_off_github.html">http://www.rubypulse.com/episode-0.16_off_github.html</a></li>
<li><a href="# http://www.rubypulse.com/episode-0.16.1_off_github_revisited.html">http://www.rubypulse.com/episode-0.16.1_off_github_revisited.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2010/01/19/migrating-from-github-to-gemcutter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make Rails logger available in code normally outside of logger scope</title>
		<link>http://blog.katipo.co.nz/2009/01/24/make-rails-logger-available-in-code-normally-outside-of-logger-scope/</link>
		<comments>http://blog.katipo.co.nz/2009/01/24/make-rails-logger-available-in-code-normally-outside-of-logger-scope/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 23:19:40 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=55</guid>
		<description><![CDATA[Here&#8217;s a quick one.  Say you are debugging a bit of code in a plugin that doesn&#8217;t fall under the Rails app you are working on&#8217;s ActiveSupport context and thus &#8220;logger.debug&#8221; is not available to you.
You could write up your own logging mechanism, with or without using the Logger gem.  However, if what [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick one.  Say you are debugging a bit of code in a plugin that doesn&#8217;t fall under the Rails app you are working on&#8217;s ActiveSupport context and thus &#8220;logger.debug&#8221; is not available to you.</p>
<p>You could write up your own logging mechanism, with or without using the Logger gem.  However, if what you are working on is run by the Rails app and thus has the apps global constants available, you could simply tie it into the existing logger object in the Rails app like so in your file:</p>
<div class="codesnip-container" >logger = RAILS_DEFAULT_LOGGER</div>
<p>Then you can use logger.debug, logger.info, etc. to your heart&#8217;s content.  One caveat, if you are working on a gem or a something more general that won&#8217;t necessarily always be run in the context of Rails, then you will want to pull your use of logger out before distributing your code.  Otherwise you add a dependency on Rails that you may not intend.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/01/24/make-rails-logger-available-in-code-normally-outside-of-logger-scope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Gist commands to emacs</title>
		<link>http://blog.katipo.co.nz/2009/01/15/adding-gist-commands-to-emacs/</link>
		<comments>http://blog.katipo.co.nz/2009/01/15/adding-gist-commands-to-emacs/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 20:26:22 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=54</guid>
		<description><![CDATA[You have to give Logical Awesome credit for how much work they do to integrate GitHub&#8217;s services with tools that developers use.
The Gist service is a good example.  First they added command line support for it, then they simultaneously added in-editor support in Textmate, vim, and my own personal favorite emacs.  The blog [...]]]></description>
			<content:encoded><![CDATA[<p>You have to give <a href="http://logicalawesome.com/">Logical Awesome</a> credit for how much work they do to integrate <a href="http://github.com/">GitHub&#8217;s</a> services with tools that developers use.</p>
<p>The <a href="http://gist.github.com/">Gist</a> service is a good example.  First they added command line support for it, then they simultaneously added in-editor support in <a href="http://github.com/blog/233-gist-support-for-textmate">Textmate</a>, <a href="http://github.com/mattn/gist-vim">vim</a>, and my own personal favorite <a href="http://github.com/defunkt/gist.el/tree/master">emacs</a>.  The blog post announcing gist support in emacs and vim is <a href="http://github.com/blog/234-gist-vim-and-gist-el">here</a>.</p>
<p>So how do you add the gist support to emacs?  </p>
<p>First, you&#8217;ll need an account on github.com and have set up your ~/.gitconfig as outlined in <a href="http://github.com/blog/180-local-github-config">here</a>.</p>
<p>Then download or clone the gist.el file from <a href="http://github.com/defunkt/gist.el">http://github.com/defunkt/gist.el</a>, copy only the gist.el file from that repository to someplace in your <a href="http://www.emacswiki.org/emacs/LoadPath">emacs load path</a> (in my case /Users/walter/Library/Preferences/Aquamacs Emacs/ because I use <a href="http://aquamacs.org/">Aquamacs</a> on a Mac), and add a line to your ~/.emacs file or in my case /Users/walter/Library/Preferences/Aquamacs Emacs/Preferences.el that looks like this:</p>
<div class="codesnip-container" >(require &#8216;gist)</div>
<p>Then you have to either restart your emacs program or do M-x load-library and answer prompt with gist for the new gist commands to be available.</p>
<p>Now you have M-x commands like these:</p>
<dl>
<dt>gist-view-gist</dt>
<dd>view gists after they&#8217;re posted</dd>
<dt>gist-region</dt>
<dd>Post the current region as a new paste at gist.github.com<br />
Copies the URL into the kill ring.</dd>
<dt>gist-region-private</dt>
<dd>Post the current region as a new private paste at gist.github.com<br />
Copies the URL into the kill ring.</dd>
<dt>gist-buffer</dt>
<dd>Post the current buffer as a new paste at gist.github.com.<br />
Copies the URL into the kill ring.</dd>
<dt>gist-buffer-private</dt>
<dd>Post the current buffer as a new private paste at gist.github.com.<br />
Copies the URL into the kill ring.</dd>
<dt>gist-region-or-buffer</dt>
<dd>Post either the current region, or if mark is not set, the current buffer as a new paste at gist.github.com<br />
Copies the URL into the kill ring.</dd>
<dt>gist-region-or-buffer-private</dt>
<dd>you can probably guess&#8230;</dd>
<dt>gist-fetch</dt>
<dd>Given an gist id, fetches a Gist and inserts it into a new buffer<br />
If the Gist already exists in a buffer, switches to it.</dd>
</dl>
<p>Very useful stuff for collaboration, but without leaving your editor.</p>
<p>Enjoy,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/01/15/adding-gist-commands-to-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;and&#8221; and &#8220;or&#8221; use versus &#8220;&amp;&amp;&#8221; and &#8220;&#124;&#124;&#8221; in ruby</title>
		<link>http://blog.katipo.co.nz/2008/09/09/and-and-or-use-versus-and-in-ruby/</link>
		<comments>http://blog.katipo.co.nz/2008/09/09/and-and-or-use-versus-and-in-ruby/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 22:48:20 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=50</guid>
		<description><![CDATA[A natural inclination when one starts programming in Ruby is to use &#8220;and&#8221; and &#8220;or&#8221; instead of the &#8220;&#38;&#38;&#8221; and &#8220;&#124;&#124;&#8221; to increase readability.  However, &#8220;and&#8221; is not a drop in syntactic synonym with &#8220;&#38;&#38;&#8221; and the same goes for &#8220;or&#8221;.
James pointed out a good blog post that explains the issues around order of [...]]]></description>
			<content:encoded><![CDATA[<p>A natural inclination when one starts programming in Ruby is to use &#8220;and&#8221; and &#8220;or&#8221; instead of the &#8220;&amp;&amp;&#8221; and &#8220;||&#8221; to increase readability.  However, &#8220;and&#8221; is not a drop in syntactic synonym with &#8220;&amp;&amp;&#8221; and the same goes for &#8220;or&#8221;.</p>
<p>James pointed out a good blog post that explains the issues around order of precedence with these operators:</p>
<p><a href="http://blog.jayfields.com/2007/08/ruby-operator-precedence-of-and-which.html">http://blog.jayfields.com/2007/08/ruby-operator-precedence-of-and-which.html</a></p>
<p>It&#8217;s worth reading the comments.</p>
<p>It should also be noted that the Ruby on Rails source style guide has a preference for &#8220;&amp;&amp;&#8221; and &#8220;||&#8221;:<br />
<a href="http://rails.lighthouseapp.com/projects/8994/source-style">http://rails.lighthouseapp.com/projects/8994/source-style</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2008/09/09/and-and-or-use-versus-and-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How much disk space does your Rails Database use?</title>
		<link>http://blog.katipo.co.nz/2007/10/14/how-much-disk-space-does-your-rails-database-use/</link>
		<comments>http://blog.katipo.co.nz/2007/10/14/how-much-disk-space-does-your-rails-database-use/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 22:26:48 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=40</guid>
		<description><![CDATA[The other day I was asked how much disk space a particular Kete project&#8217;s production database used.  I didn&#8217;t have an answer, so I started searching for one.
In my case, the db software is MySQL and getting a report about various aspects of a db&#8217;s tables boils down to this query:
show table status;
The output [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was asked how much disk space a particular Kete project&#8217;s production database used.  I didn&#8217;t have an answer, so I started searching for one.</p>
<p>In my case, the db software is MySQL and getting a report about various aspects of a db&#8217;s tables boils down to this query:</p>
<div class="codesnip-container" >show table status;</div>
<p>The output of this query has way more information than I need, plus to get the total number of bytes used you have to add all the values up anyway, so I decided to make a rake task to make this repeatable and return something succinct.</p>
<p>I have added the new rake task to the Kete app&#8217;s codebase.  If you aren&#8217;t a Kete user, but need this functionality for your Ruby on Rails app, you can find it here:</p>
<p><a href="http://svn.kete.net.nz/projects/kete/trunk/lib/tasks/db-disk-usage-report.rake">http://svn.kete.net.nz/projects/kete/trunk/lib/tasks/db-disk-usage-report.rake</a></p>
<p>Note there is a formatting method taken from the Rails Helpers, I would love to not duplicate this definition.  If anyone has a recommendation for the best way to pull this method into this rake task, I would appreciate it.  Probably a simple include statement, but I didn&#8217;t get around to figuring out the correct incantation.</p>
<p>I would also love to hear how best to make this handle other database software, for example PostgreSQL, too.</p>
<p>Cheers,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/10/14/how-much-disk-space-does-your-rails-database-use/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server Setup and Deployment for Rails using Capistrano, Mongrel, and Nginx using Mac OS X for Development and Debian Etch for Production</title>
		<link>http://blog.katipo.co.nz/2007/10/14/server-setup-and-deployment-for-rails-using-capistrano-mongrel-and-nginx-using-mac-os-x-for-development-and-debian-etch-for-production/</link>
		<comments>http://blog.katipo.co.nz/2007/10/14/server-setup-and-deployment-for-rails-using-capistrano-mongrel-and-nginx-using-mac-os-x-for-development-and-debian-etch-for-production/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 22:12:44 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=30</guid>
		<description><![CDATA[As previously mentioned, I have written a guide on how to set up Kete (also applicable to other Rails apps though Kete includes some extra required software and niceties to make it easier) for Development on Mac OS X.  This guide also includes best practices for Deployment.  So the following guide can be [...]]]></description>
			<content:encoded><![CDATA[<p>As previously mentioned, I have written a guide on how to set up Kete (also applicable to other Rails apps though Kete includes some extra required software and niceties to make it easier) for Development on Mac OS X.  This guide also includes best practices for Deployment.  So the following guide can be seen as the first half of the story:</p>
<p><a href="http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x">http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x</a></p>
<p>But what about the host that you are deploying to?  I cover that for Debian Etch in the following guide:</p>
<p><a href="http://kete.net.nz/documentation/topics/show/15-preparing-a-debian-etch-host-to-be-deployed-to-for-kete">http://kete.net.nz/documentation/topics/show/15-preparing-a-debian-etch-host-to-be-deployed-to-for-kete</a></p>
<p>You might also be curious what software Kete requires.  Here&#8217;s a breakdown:</p>
<p><a href="http://kete.net.nz/documentation/topics/show/19-technical-requirements">http://kete.net.nz/documentation/topics/show/19-technical-requirements</a></p>
<p>Cheers,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/10/14/server-setup-and-deployment-for-rails-using-capistrano-mongrel-and-nginx-using-mac-os-x-for-development-and-debian-etch-for-production/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing the Kete Stack on Mac OS X, including MacPorts, Ruby on Rails, Ruby-Zoom, and Zebra</title>
		<link>http://blog.katipo.co.nz/2007/10/14/installing-the-kete-stack-on-mac-os-x-including-macports-ruby-on-rails-ruby-zoom-and-zebra/</link>
		<comments>http://blog.katipo.co.nz/2007/10/14/installing-the-kete-stack-on-mac-os-x-including-macports-ruby-on-rails-ruby-zoom-and-zebra/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 22:06:30 +0000</pubDate>
		<dc:creator>walter</dc:creator>
				<category><![CDATA[kete development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=37</guid>
		<description><![CDATA[I&#8217;ve added a guide over at Kete.net.nz for how to install Kete for development on Mac OS X.  You can find hit here:
http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x
If anything doesn&#8217;t work for you, please let me know.
Cheers,
Walter
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added a guide over at Kete.net.nz for how to install Kete for development on Mac OS X.  You can find hit here:</p>
<p><a href="http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x">http://kete.net.nz/documentation/topics/show/16-creating-a-kete-development-environment-on-mac-os-x</a></p>
<p>If anything doesn&#8217;t work for you, please let me know.</p>
<p>Cheers,<br />
Walter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2007/10/14/installing-the-kete-stack-on-mac-os-x-including-macports-ruby-on-rails-ruby-zoom-and-zebra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
