<?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</title>
	<atom:link href="http://blog.katipo.co.nz/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>Kakama Technical Overview</title>
		<link>http://blog.katipo.co.nz/2010/06/04/kakama-technical-overview/</link>
		<comments>http://blog.katipo.co.nz/2010/06/04/kakama-technical-overview/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 02:39:27 +0000</pubDate>
		<dc:creator>kieran</dc:creator>
				<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=122</guid>
		<description><![CDATA[I&#8217;ve just posted a technical overview of how Kakama functions. You can view it at Kakama.org
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just posted a technical overview of how Kakama functions. You can view it at <a href="http://kakama.org/en/documentation/topics/show/18-how-kakama-works-a-quick-technical-overview">Kakama.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2010/06/04/kakama-technical-overview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>Using git feature branches to make your master branch commits list concise</title>
		<link>http://blog.katipo.co.nz/2010/03/18/using-git-feature-branches-to-make-your-master-branch-commits-list-concise/</link>
		<comments>http://blog.katipo.co.nz/2010/03/18/using-git-feature-branches-to-make-your-master-branch-commits-list-concise/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 23:18:37 +0000</pubDate>
		<dc:creator>kieran</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[commits]]></category>
		<category><![CDATA[squash]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=112</guid>
		<description><![CDATA[When you&#8217;re starting off, it&#8217;s fairly easy to commit to the master branch. But once your application is released, you probably want to keep things stable on the master branch. So use feature branches.

You do all your work in a feature branch, then pull it into the master branch. There are numerous topics on the [...]]]></description>
			<content:encoded><![CDATA[<p>When you&#8217;re starting off, it&#8217;s fairly easy to commit to the master branch. But once your application is released, you probably want to keep things stable on the master branch. So use feature branches.</p>
<p><span id="more-112"></span></p>
<p>You do all your work in a feature branch, then pull it into the master branch. There are numerous topics on the web for this.</p>
<p>But there is a problem with this approach. When you run `git pull origin my_branch`, you end up creating merge commits. Some get around this with `git rebase`, but then you end up rewriting commit shas. So how do you get a clean history without messing up the master branch?</p>
<p>Use `&#8211;squash`. Here is a simplified example:</p>
<pre>
<div class="codesnip-container" >git checkout -b my_branch
touch File1
git commit -a -m "File 1"
touch File2
git commit -a -m "File 2"
git push origin my_branch
git checkout master
git pull --squash origin my_branch
git commit -a -m "File 1 and 2"</div>
</pre>
<p>Note the last two steps. We use &#8211;squash to compact the feature branch commits. This leaves all changes in the other branch in an uncommitted state (which you can then do one final review on). We then go ahead and make a commit.</p>
<p>The result? One commit in master, containing all code from the feature branch.</p>
<p>Now, the caveat: If you have multiple developers who made commits on this branch, you probably want to leave the commits apart for credits sake. But if you&#8217;re the only one who&#8217;s committed, and you don&#8217;t mind squashing the history, this works great!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2010/03/18/using-git-feature-branches-to-make-your-master-branch-commits-list-concise/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>IE7 and IE8 cannot support URI&#8217;s with underscores</title>
		<link>http://blog.katipo.co.nz/2009/09/28/ie7-and-ie8-cannot-support-uris-with-underscores/</link>
		<comments>http://blog.katipo.co.nz/2009/09/28/ie7-and-ie8-cannot-support-uris-with-underscores/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 23:19:14 +0000</pubDate>
		<dc:creator>kieran</dc:creator>
				<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=93</guid>
		<description><![CDATA[Stumbled upon this. If you&#8217;re going to make a URI (domain or sub domain) with an underscore, think twice. IE7 and IE8 do not support these URI&#8217;s when dealing with cookies.
For more details, see this blog post, detailing the symptoms.
http://blog.patrick-morgan.net/2008/09/problems-with-ie7-sessions-not-saved-in.html
]]></description>
			<content:encoded><![CDATA[<p>Stumbled upon this. If you&#8217;re going to make a URI (domain or sub domain) with an underscore, think twice. IE7 and IE8 do not support these URI&#8217;s when dealing with cookies.</p>
<p>For more details, see this blog post, detailing the symptoms.</p>
<p><a href="http://blog.patrick-morgan.net/2008/09/problems-with-ie7-sessions-not-saved-in.html">http://blog.patrick-morgan.net/2008/09/problems-with-ie7-sessions-not-saved-in.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/09/28/ie7-and-ie8-cannot-support-uris-with-underscores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla vetting new signups</title>
		<link>http://blog.katipo.co.nz/2009/09/21/joomla-vetting-new-signups/</link>
		<comments>http://blog.katipo.co.nz/2009/09/21/joomla-vetting-new-signups/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 04:24:36 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=87</guid>
		<description><![CDATA[A few sites that we have been working on  wanted an extra step with the signup process on their website that requires an additional level of vetting by the site administrator when a new user submits the online form.  To achieve this we made some minor changes to the core code.

The following change [...]]]></description>
			<content:encoded><![CDATA[<p>A few sites that we have been working on  wanted an extra step with the signup process on their website that requires an additional level of vetting by the site administrator when a new user submits the online form.  To achieve this we made some minor changes to the core code.</p>
<p><span id="more-87"></span></p>
<p>The following change removes the activation link from the email issued to the user and sends them an email notification that their application has been received.<br />
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 367) and add:</p>
<div class="codesnip-container" >// Email the user that they have been vetted<br />
$mailfrom = $mainframe-&gt;getCfg(&#8217;mailfrom&#8217;);<br />
$fromname = $mainframe-&gt;getCfg(&#8217;fromname&#8217;);<br />
$email = $euser-&gt;email;<br />
$siteURL = JURI::base();<br />
$subject = &#8220;Vetting Accepted for [sitename]&#8220;;<br />
$message2 = sprintf(JText::_(&#8217;REG_ACTIVATE_COMPLETE_USER&#8217;),$siteURL);<br />
JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message2);<br />
// *** END Email the user that they have been vetted</div>
<p>We also need to change&#8230;</p>
<div class="codesnip-container" >if (JUserHelper::activateUser($activation))</div>
<p>to:</p>
<div class="codesnip-container" >if ($euser = JUserHelper::activateUser($activation))</div>
<p>The next bit of code emails the account activation link and details through to the site administrator, who gets to decide if the application is successful.<br />
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 524) and change to:</p>
<div class="codesnip-container" >// *** Added Site Admin activation link<br />
if ( $useractivation == 1 ){<br />
// $message = sprintf ( JText::_( &#8216;SEND_MSG_ACTIVATE&#8217; ), $name, $sitename, $siteURL.&#8221;index.php?option=com_user&amp;task=activate&amp;activation=&#8221;.$user-&gt;get(&#8217;activation&#8217;), $siteURL, $username, $password);<br />
$message = sprintf ( JText::_( &#8216;SEND_MSG_ACTIVATE&#8217; ), $name, $sitename, $siteURL.&#8221;index.php?option=com_user&amp;task=activate&amp;activation=&#8221;.$user-&gt;get(&#8217;activation&#8217;));<br />
$message2 = sprintf ( JText::_( &#8216;SEND_MSG_USER&#8217; ), $name, $sitename, $siteURL, $username, $password);<br />
} else {<br />
$message = sprintf ( JText::_( &#8216;SEND_MSG&#8217; ), $name, $sitename, $siteURL);<br />
$message2 = &#8221;;<br />
}<br />
// *** END Added Site Admin activation link</div>
<p>We then need to pass both user and admin notifications through to the script that generates and sends emails.<br />
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 548) Added:</p>
<div class="codesnip-container" >// *** Added send User AND Admin notification<br />
JUtility::sendMail($mailfrom, $fromname, $mailfrom, $subject, $message);<br />
JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message2);<br />
// JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message); // old line<br />
// *** END Added send User AND Admin notification</div>
<p>Joomla now issues 2 emails when the signup form is submitted, rather than the usual one.</p>
<p>Some final changes are needed to the language files on the site, so that the email notifications make sense.  Make the following changes. From the root of your Joomla site, go to</p>
<p>/language/en-GB/en-GB.com_user.ini (approx line 84) and change:</p>
<div class="codesnip-container" >REG_ACTIVATE_COMPLETE=The Account has been successfully activated. The user has been sent an email and they now can log in.</div>
<p>/language/en-GB/en-GB.com_user.ini (approx line 85) and change:</p>
<div class="codesnip-container" >REG_ACTIVATE_COMPLETE_USER=Congratulations, your application to join the [sitename] website has been approved.\n\nYou can now use the login details you entered when registered to log in at %s</div>
<p>/language/en-GB/en-GB.com_user.ini (approx line 92) and change:</p>
<div class="codesnip-container" >REG_COMPLETE_ACTIVATE=Your account has been created and now is awaiting the vetting process &#8211; you should get an email containing your username and password. Once you are vetted you will use these to login.</div>
<p>/language/en-GB/en-GB.com_user.ini (approx line 120) and change:</p>
<div class="codesnip-container" >SEND_MSG_ACTIVATE=The following person %s has registered at %s. Their account activation link is that needs to be copied into your browser:\n%s\n\nAfter activation they will be able to login.</div>
<div class="codesnip-container" >SEND_MSG_USER=Hello %s,\n\nThank you for registering at %s. Your account is currently waiting to be vetted.\nYou will be notified by email once it is approved by an administrator.\nYou may then login to %s using the following username and password:\n\nUsername: %s\nPassword: %s</div>
<p>Finally, the User() helper function needs to be updated so that the activation confirmation email is sent to the user in question rather than the user currently logged into joomla (eg site administrator):  To do that, go to:</p>
<div class="codesnip-container" >/libraries/joomla/user/helper.php (line 72) Added:<br />
// *** Added send confirmation to user not admin<br />
// return true;<br />
return $user;<br />
// *** END Added send confirmation to user not admin</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/09/21/joomla-vetting-new-signups/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Access Keys to a Joomla 1.5 Website.</title>
		<link>http://blog.katipo.co.nz/2009/09/21/adding-access-keys-to-a-joomla-1-5-website/</link>
		<comments>http://blog.katipo.co.nz/2009/09/21/adding-access-keys-to-a-joomla-1-5-website/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 03:22:56 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=82</guid>
		<description><![CDATA[Developing in Joomla sometimes throws up minor issues with solutions so  simple that you wonder why they&#8217;re not in the core code.  While putting  together the Rangitikei District Council&#8217;s website we discovered that  there&#8217;s no easy way to set up Navigation Access Keys in Joomla 1.5, as  per the New Zealand [...]]]></description>
			<content:encoded><![CDATA[<p>Developing in Joomla sometimes throws up minor issues with solutions so  simple that you wonder why they&#8217;re not in the core code.  While putting  together the Rangitikei District Council&#8217;s website we discovered that  there&#8217;s no easy way to set up Navigation Access Keys in Joomla 1.5, as  per the New Zealand Government Web Standards  (<a href="http://webstandards.govt.nz/8-4-navigation-access-keys/">http://webstandards.govt.nz/8-4-navigation-access-keys/</a>).  The keys are  a great navigation aid to non-mouse users and are recommended by w3c  (<a href="http://www.w3.org/WAI/WCAG20/quickref/#keyboard-operation">http://www.w3.org/WAI/WCAG20/quickref/#keyboard-operation</a>).<br />
To add Access Keys to a Joomla site you need to hack at the core code of  your Joomla install.  There are some basic instructions on the Joomla  documentation site at <a href="http://docs.joomla.org/Adding_Access_Keys">http://docs.joomla.org/Adding_Access_Keys</a>.  This  sets up a new &#8220;Accessibility Access Key&#8221; field in the System Parameters  dropdown that&#8217;s available when you edit an menu item, allowing you to  simply enter the keystroke you want to associate with that menu link on  your site.</p>
<p>The hack makes it easy to add as many access keys as you need, and you  can offer more than just the basic keystroke options set on most  government websites.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/09/21/adding-access-keys-to-a-joomla-1-5-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Have fun testing your application with Cucumber</title>
		<link>http://blog.katipo.co.nz/2009/09/04/having-fun-testing-your-application-with-cucumber/</link>
		<comments>http://blog.katipo.co.nz/2009/09/04/having-fun-testing-your-application-with-cucumber/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 04:13:40 +0000</pubDate>
		<dc:creator>kieran</dc:creator>
				<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=73</guid>
		<description><![CDATA[My experience with Cucumber. It's simple and has such a flexible style of feature testing, that writing tests hasn't been easier!]]></description>
			<content:encoded><![CDATA[<p>When I started on a new Ruby on Rails project at Katipo Communications, I evaluated a range of testing libraries, and decided on <a href="http://cukes.info/">Cucumber</a>. It&#8217;s simple and has a flexible style of feature testing. For more info about it, see the <a href="http://wiki.github.com/aslakhellesoy/cucumber">Cucumber Wiki Documentation</a>. In this post, I&#8217;ll detail some of my experiences with it for other developers who are considering using it.</p>
<p><span id="more-73"></span></p>
<p><strong>Experience with Cucumber</strong></p>
<p>Cucumber has been working out really well, and was very easy to get started with.</p>
<pre>
<div class="codesnip-container" >sudo gem install cucumber
cd ~/Work/app
script/generate cucumber</div>
</pre>
<p>That&#8217;ll install a new environment with the config.gem lines needed. It&#8217;ll also setup a features directory. Open that up, and start writing specs for your app. Simple!</p>
<p>Once I had all the basic step definitions for logging in, logging out, and various paths setup for login page, homepage, etc, writing new features was fairly easy, and executing them is just as easy (rake cucumber). Take for example, the following feature relating to session management.</p>
<pre>
<div class="codesnip-container" >Scenario: Login with correct details
  When I go to login
  And I fill in "Username" with "jane"
  And I fill in "Password" with "test"
  And I press "Login"
  Then I should see "Successfully logged in."</div>
</pre>
<p>Very straightforward and easy to read. And as such, the natural language of it means clients and other developers are able to see exactly what has been implemented, and that it is working as expected.</p>
<p>It&#8217;s running the entire test suite is fairly fast too (granted, it&#8217;s still quite small). I&#8217;m testing the core functionality of the new application so far, and it only takes ~40s to run all the features when using &#8216;progress&#8217; output (the  F..F..E  style output that test/unit does). The more verbose &#8216;pretty&#8217; output is nice, but quickly fills the terminal, so very easy to miss errors as they happen until the end, and also adds processing time (10s cut off when I switched to progress mode).</p>
<p>At one point in development, I had to test outgoing emails. Thankfully, Cucumber has a really great addition, called <a href="http://github.com/bmabey/email-spec">email-spec</a> by Ben Mabey. Writing a Cucumber feature for these emails was painless. Here is a snippet from one of the password reset features.</p>
<pre>
<div class="codesnip-container" >Scenario: Request Reset with correct email
  When I request a password reset for "example@example.com"
  Then I should receive an email
  When I open the email
  And I follow "Continue to reset your password" in the email
  Then I should see "Change My Password"</div>
</pre>
<p>I&#8217;ve made a few contributions to the email-spec project, which have been included in the latest release, enabled email testing for people other than yourself  ( When they open the email&#8230; Then they should see &#8230;  etc). Makes writing tests even easier.</p>
<p><strong>Other Thoughts</strong></p>
<p>I did find that you duplicate a lot when it comes to adding paths because Cucumber is framework independent. For example, if you have a &#8216;<em><strong>map.resources :events</strong></em>&#8216; Cucumber won&#8217;t provide you with paths like &#8216;the events index&#8217; or &#8216;add a new event&#8217; automatically. Would make a handy Cucumber addition though. In addition, because Cucumber uses Webrat, which has no idea how to interact with Javascript, you still need to fall back to the slow Selenium testing if you&#8217;re application relies on Javascript.</p>
<p><strong>Conclusion</strong></p>
<p>Cucumber has been really great and I&#8217;m happy to keep using it. If you&#8217;ve used Cucumber before, or are going to try it, or perhaps your didn&#8217;t like it and went with something else, let me know in the comments. I&#8217;m always happy to hear other peoples experiences.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/09/04/having-fun-testing-your-application-with-cucumber/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
