<?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>Self As Team</title>
	<atom:link href="http://blog.intraspectivecorp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.intraspectivecorp.com</link>
	<description>Dallas based Ruby on Rails and Java Consulting</description>
	<lastBuildDate>Mon, 21 Sep 2009 02:06:42 +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>Tweets to Make You Look Up</title>
		<link>http://blog.intraspectivecorp.com/2009/09/16/tweets-to-make-you-look-up/</link>
		<comments>http://blog.intraspectivecorp.com/2009/09/16/tweets-to-make-you-look-up/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 21:20:52 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[space]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/?p=65</guid>
		<description><![CDATA[As a space junkie, I frequent nasa.gov and astronomy picture of the day sites to marvel at the universe and our attempts to learn and explore it.  One of my favorite sites is the venerable Heavens Above created and run by Chris Peat.  If you haven&#8217;t checked it out, please do so soon [...]]]></description>
			<content:encoded><![CDATA[<p>As a space junkie, I frequent <a href="http://nasa.gov">nasa.gov</a> and <a href="http://antwrp.gsfc.nasa.gov/apod/astropix.html">astronomy picture of the day</a> sites to marvel at the universe and our attempts to learn and explore it.  One of my favorite sites is the venerable <a href="http://www.heavens-above.com/">Heavens Above</a> created and run by Chris Peat.  If you haven&#8217;t checked it out, please do so soon as it gives lots of very useful information for observing satellites such as space shuttles, international space station (which is large enough to be seen in the daylight hours), Hubble space telescope and hundreds of others.  If you register with the site or plug in your location, you can get lists of dates/times to see things like the space station fly overhead.  My kids think I&#8217;m a genius because I&#8217;ve been known to look down at my watch during dinner and announce that the ISS is about to fly overhead &#8211; we all run outside and I start a countdown and poof &#8211; right on cue &#8211; a big bright star starts a lazy, 5 minute pass overhead.  All thanks to Chris Peat&#8217;s great web site.  You can even get star maps and ground track paths to help you get oriented.</p>
<p>I sometimes forget to check the site so I setup an automatic twitter feed to send me reminders.  Was very easy to do &#8230;<br />
<span id="more-65"></span></p>
<p>The toughest thing about Heavens Above  is remembering to check it frequently.  This got me thinking &#8211; &#8220;wouldn&#8217;t it be nice if I got a text message about 10 minutes prior to a pass?&#8221;.  After thinking about it and looking around on the heavens above site, I concluded there wasn&#8217;t any api or service I could coax to do this, I decided to write a quick and dirty script.  I also found an <a href="http://blech.vox.com/library/post/moreabovelondon.html">blog</a> describing some work that Paul Mison had done at Hackday London a few years ago.  (I rarely have unique ideas&#8230;).  The gist is this, periodically, check for ISS passes over a particular location (Richardson, Texas in this case) and within about 15 minutes of the event, send an update to twitter listing time and starting location (sky direction).  I then could follow this twitter account (with mobile updates on) and now I can get notifications about when to look up and wave to our brave ISS crew (I even saw the ISS through the glare of lights at a high school football game).</p>
<p>The script is written in ruby and is setup to run as a cron job on one of my servers.  It uses specific latitude and longitude and time zone to pull visible passes for the ISS from heavens above.  It grinds up the html using Hpricot and looks for any passes with a magnitude greater then -1.0 (our seeing is better than that in Richardson but I wanted to limit the number of tweets.  To reduce the number of hits on Heavens Above, the script caches the information in a config file and only returns to  heavens above when it has tweeted about an event.  The specifics of lat/long and twitter account are stored in a config file so this can be used for other locations as well.  I&#8217;ve posted the hack on <a href="http://github.com/dhainlin/ISS-Tweets">github</a>.</p>
<p>If you live in/around Richardson, you can follow the <a href="http://twitter.com/richardsontxiss">richardsontxiss twitter</a> account and it will send you tweets when you can see the ISS.  It doesn&#8217;t take weather into account, but we are more likely to have clear weather than not.  The next passes aren&#8217;t until the 24th  so be patient if you do follow this.  They do have gaps in time where there are few passes but then there will be a storm of great opportunities within a few short days. </p>
<p>If you are wondering what your latitude and longitude is, there is a nifty hack you can use to get it from a google map.  Center the map on your location and enter the following in the browser url line: </p>
<pre style="color: green; font-size: smaller;">javascript:void(prompt('',gApplication.getMap().getCenter()));</pre>
<p>This will prompt you with the coordinates of the currently centered location on the map.  Cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2009/09/16/tweets-to-make-you-look-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mategem and ruby switcher</title>
		<link>http://blog.intraspectivecorp.com/2009/09/14/mategem-and-ruby-switcher/</link>
		<comments>http://blog.intraspectivecorp.com/2009/09/14/mategem-and-ruby-switcher/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 20:07:34 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/?p=63</guid>
		<description><![CDATA[Been having lots of fun playing with different versions of ruby using the ruby_switcher shell trickery.  This is works great but it broke my slightly tweaked version of mategem (a shortcut for pulling up the gem source in text mate using bash&#8217;s auto-complete trick).  I am working on a more complete workaround but [...]]]></description>
			<content:encoded><![CDATA[<p>Been having lots of fun playing with different versions of ruby using the ruby_switcher shell trickery.  This is works great but it broke my slightly tweaked version of mategem (a shortcut for pulling up the gem source in text mate using bash&#8217;s auto-complete trick).  I am working on a more complete workaround but in the mean time, I needed to replace the gem environment gemdir command with the hardcoded path to my main ruby gems directory.  This works for the nominal case again but the longer term solution is to have the auto complete work across multiple gem directories (again based on the gem environment as established by ruby switcher.  I&#8217;ll post more when I figure it out (or remember to).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2009/09/14/mategem-and-ruby-switcher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leopard&#8217;s Growl</title>
		<link>http://blog.intraspectivecorp.com/2009/08/17/leopards-growl/</link>
		<comments>http://blog.intraspectivecorp.com/2009/08/17/leopards-growl/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 20:24:57 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/?p=60</guid>
		<description><![CDATA[I&#8217;m setting up a new MacBook Pro and everything is going so much better than on a previous configuration (with a vendor supplied mac ports, etc&#8230;) but that is another story.  I was setting up autotest and growl and ran into the same issues that I discovered with Leopard and growlnotify (see here, here [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m setting up a new <a href="http://www.apple.com/macbookpro/">MacBook Pro</a> and everything is going so much better than on a previous configuration (with a vendor supplied mac ports, etc&#8230;) but that is another story.  I was setting up <a href="http://www.zenspider.com/ZSS/Products/ZenTest/">autotest</a> and <a href="http://growl.info/">growl</a> and ran into the same issues that I discovered with Leopard and growlnotify (see <a href="http://hasseg.org/blog/?p=111">here</a>, <a href="http://blog.aisleten.com/2008/02/21/installing-growlnotify-and-autotest-for-bdd-use-with-rspec-on-leopard/">here</a> and <a href="http://groups.google.com/group/growldiscuss/browse_thread/thread/f1e63a1e04c30cd1/a3d0cb3bceecf32b">here</a>).  Anyway, none of the suggested configs worked  at all this time around.</p>
<p>So I played around with the settings and ended up with this config which (knock on wood) seems to work pretty well.</p>
<p>I started with the following versions:</p>
<ol>
<li>Leopard 10.5.8</li>
<li>ZenTest 4.1.4</li>
<li>Growl 1.1.6</li>
<li>autotest-growl gem 0.1.6</li>
<li>autotest-fsevent 0.1.1</li>
<li>autotest-rails 4.1.0</li>
</ol>
<p>I didn&#8217;t need to make any adjustments to the growl configuration (via System Preferences) as reported in some solutions.  </p>
<p>I added the following to the ~/.autotest file<br />
<code><br />
require 'autotest/growl'<br />
require 'autotest/fsevent'<br />
Autotest::Growl::show_modified_files = true<br />
Autotest::Growl::remote_notification = false<br />
Autotest.add_hook :initialize do |at|<br />
  %w{.git .svn .hg .DS_Store ._* log}.each {|exception|at.add_exception(exception)}<br />
end<br />
</code></p>
<p>I added some appropriately named images to the suggested ~/.autotest-growl directory per the really good (don&#8217;t skip over them, lots to learn if you have used an older config) <a href="http://github.com/svoop/autotest-growl">instructions</a>.</p>
<p>I then renamed the growlnotify app in /usr/local/bin to /usr/local/bin/growlnotify.wrapper (make sure it is executable with chmod if needed) and added the following wrapper (taken from <a href="http://craigjolicoeur.com/blog/problem-with-growlnotify-on-os-x-leopard">Craig P Jolicoeu&#8217;s</a> suggestion) as /usr/local/bin/growlnotify</p>
<p><code><br />
#!/bin/bash<br />
exec /usr/local/bin/growlnotify.wrapped -w "$@" &#038;<br />
</code></p>
<p>That was it, autotest (and other apps) growl everytime now.  Pretty easy (after I tried three or four other things that didn&#8217;t work).  It seems the networked approaches with -H and other configs didn&#8217;t really work for me.  The simplified wrapper seems to be all that is needed.</p>
<p>The other reported issues about growl not working if configured near the dock didn&#8217;t seem to cause me any issues (dock is on the bottom, growl is lower left).</p>
<p>Now my little robot friend (autotest) keeps me honest without fail. </p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2009/08/17/leopards-growl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Please don&#8217;t waste our time</title>
		<link>http://blog.intraspectivecorp.com/2009/08/12/please-dont-waste-our-time/</link>
		<comments>http://blog.intraspectivecorp.com/2009/08/12/please-dont-waste-our-time/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 19:47:51 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/?p=55</guid>
		<description><![CDATA[I am sure I have my annoying ways of working but there is one thing that drives me nuts about some of the teams I&#8217;ve worked with. 
Showing up to a meeting late.
The thing I like about scrum is even though we meet daily, we end up with fewer planned meetings (lots of ad-hoc white [...]]]></description>
			<content:encoded><![CDATA[<p>I am sure I have my annoying ways of working but there is one thing that drives me nuts about some of the teams I&#8217;ve worked with. </p>
<p>Showing up to a meeting late.</p>
<p>The thing I like about scrum is even though we meet daily, we end up with fewer planned meetings (lots of ad-hoc white board sessions but they are very focused and productive).  The thing I don&#8217;t like about scrum is having to wait for 5 or 10 minutes for the team to assemble.  Sure there are things you can try and do to stop this behavior.  I hate the idea of a &#8216;late jar&#8217; where you contribute $1/minute you are late (donated to charity or food for the sprint review, etc) because if you agreed to attend a meeting at a certain time, then get there on time.  On high performing teams, this isn&#8217;t as much of an issue.  In some of the dysfunctional teams I&#8217;ve worked on, this is chronic.</p>
<p>I suggest that if you have 10AM meeting, then at 9:58, head over to the meeting rather than wait until 10:05 to go.  Sure, you&#8217;ll wait around for 30 seconds or so but at least your team won&#8217;t be waiting on you.</p>
<p>Should be low-hanging fruit but is never seems to get picked.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2009/08/12/please-dont-waste-our-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rails + emacs + windoze = less fail</title>
		<link>http://blog.intraspectivecorp.com/2009/08/10/rails-emacs-windoze-less-fail/</link>
		<comments>http://blog.intraspectivecorp.com/2009/08/10/rails-emacs-windoze-less-fail/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 22:55:07 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/2009/08/10/rails-emacs-windoze-less-fail/</guid>
		<description><![CDATA[Have spent the last few days working in Vista rather than OS X and it was looking fairly bleak until I spent some time updating my favorite editor.  I have never liked full blown IDE&#8217;s (like Eclipse) for rails work.  My first editor and still favorite is emacs.  Textmate keeps my fingers [...]]]></description>
			<content:encoded><![CDATA[<p>Have spent the last few days working in Vista rather than OS X and it was looking fairly bleak until I spent some time updating my favorite editor.  I have never liked full blown IDE&#8217;s (like Eclipse) for rails work.  My first editor and still favorite is emacs.  Textmate keeps my fingers humming on OS X but emacs is also running somewhere too.  On windows, emacs is the main tool but I never really invested the time to update it (was running 21.x and 22.x versions which is quite old).  So I spent some time this weekend to update it to 23.1.50 and add the ruby and rails modes.  After some missteps, I finally have a fairly nice environment with pretty nice rails support.  It even has snippets and quick navigation and refactoring (quickly create partials or helpers for example).   I even have the &#8216;railscast&#8217; theme so it looks pretty nice (at least what I&#8217;m used to on my Mac). </p>
<p>I can&#8217;t wait to go back to the Mac but at least I can be more productive while I&#8217;m slumming in Vista.  The LONG delay on starting ruby processes (like tests, console, etc&#8230;) is sapping my will to live tho&#8230;  </p>
<p>The info on rails and emacs on the web was pretty good but if someone wants my formula, I&#8217;ll be glad to post it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2009/08/10/rails-emacs-windoze-less-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitting in the Ant Nest</title>
		<link>http://blog.intraspectivecorp.com/2009/07/24/sitting-in-the-ant-nest/</link>
		<comments>http://blog.intraspectivecorp.com/2009/07/24/sitting-in-the-ant-nest/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 14:33:14 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/?p=37</guid>
		<description><![CDATA[Developing projects using ant is pretty easy and straight forward. One convention I like to follow is to organize each component in the system to have its own local build file.  These builds can be aggregated by higher level builds very simply.  This gives great flexibility while developing since you can build only [...]]]></description>
			<content:encoded><![CDATA[<p>Developing projects using ant is pretty easy and straight forward. One convention I like to follow is to organize each component in the system to have its own local build file.  These builds can be aggregated by higher level builds very simply.  This gives great flexibility while developing since you can build only what you need while working on it and yet you (or continuous integration) can easily perform a full build/test. If you have lots of similar components, your ant scripts might begin to have lots of duplication in them unless you start refactoring the common pieces into includes.  In the old days (prior to ant 1.6), there wasn&#8217;t an obvious way to include fragements.  While reviewing some open source projects back in 1995 I stumbled across the xml include technique (below) that I&#8217;ve used a few times.  I had forgotten about this until I was recently asked to make some recommendations on an older project&#8217;s build approach.<br />
<span id="more-37"></span></p>
<p>Assuming you have a bunch of web applications and a few common infra components. All of the web applications would have had the same (more or less) build file so you could refactor most of it into a common_build.xml.  Since we were using ant 1.5X we used the little XML include trick to declare and use a new element.  This lets the XML parser do the work of inserting the xml fragment into our build scripts.</p>
<p>For example, a web application&#8217;s build script would start like this.</p>
<p><code><br />
&lt;?xml version="1.0"?&gt;<br />
&lt;!DOCTYPE project [<br />
	&lt;!ENTITY common SYSTEM "file:../../common_build.xml"&gt;<br />
]&gt;<br />
&lt;project name="defects" default="build" basedir="."&gt;<br />
&amp;common;<br />
&lt;!-- other ant properties and targets go here... --&gt;<br />
...<br />
</code></p>
<p>The common build script looks like this (it is only an xml fragment).</p>
<p><code><br />
&lt;property file="local_build.properties" /><br />
&lt;property file="../local_build.properties" /><br />
&lt;property file="../../local_build.properties" /><br />
&lt;property file="build.properties" /><br />
&lt;property file="../../common_build.properties" /><br />
</code></p>
<p><code><br />
&lt;property name="log.template.file" value="template_log4j.properties" /><br />
</code></p>
<p><code><br />
&lt;path id="master.classpath"><br />
	&lt;pathelement location="${target}" /><br />
	&lt;fileset dir="${lib}"><br />
		&lt;include name="*.jar" /><br />
	&lt;/fileset><br />
	&lt;fileset dir="${target}"><br />
		&lt;include name="*.jar" /><br />
	&lt;/fileset><br />
&lt;/path><br />
...<br />
</code></p>
<p>If this were setup in a directory structure like the following, you could apply this include trick in each of the webapps build scripts.</p>
<p><img src="http://blog.intraspectivecorp.com/wp-content/uploads/2009/07/ant_nest.png" alt="ant_nest_example" title="ant_nest_example" width="317" height="258" class="alignnone size-full wp-image-45" /></p>
<p>The common_build.xml is located in the root of the project.  The webapps (for example, app1) have a build script that includes it.  The build script in the webapps directory simply knows how to build each app.  The core and common components probably don&#8217;t include the common_build.xml because they do something significantly different.</p>
<p>This approach works very well for situations where you need to build more than two very similar components.  It isn&#8217;t a perfect solution tho as the syntax is somewhat confusing and not very intention revealing. </p>
<p>I should note, that I didn&#8217;t invent this but I can&#8217;t remember where I saw this used first.   It was likely on an Apache open source project. It is now mentioned on the Ant <a href="http://ant.apache.org/faq.html#xml-entity-include">FAQ</a>.</p>
<p>Also, since Ant 1.6, there is a new &lt;include&gt; task which is even more flexible since it lets you use ant properties in the file name. This approach is much better than the xml trick.  </p>
<p>Reusing build script fragments is a great way to DRY up your configuration and ensure more consistency.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2009/07/24/sitting-in-the-ant-nest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bitten by HABTM Again</title>
		<link>http://blog.intraspectivecorp.com/2009/07/23/bitten_by_habtm_again/</link>
		<comments>http://blog.intraspectivecorp.com/2009/07/23/bitten_by_habtm_again/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 18:10:45 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[associations]]></category>
		<category><![CDATA[audit]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/?p=34</guid>
		<description><![CDATA[I while back needed to add an audit trail to an older project.  I found the acts as audited plugin and put it into play and it is great.  I added my models to it and added a way to review the audit trail online  &#8211; all good &#8211; until&#8230;
I started added [...]]]></description>
			<content:encoded><![CDATA[<p>I while back needed to add an audit trail to an older project.  I found the <a href="http://opensoul.org/2006/7/21/acts_as_audited">acts as audited plugin</a> and put it into play and it is great.  I added my models to it and added a way to review the audit trail online  &#8211; all good &#8211; until&#8230;</p>
<p>I started added audits for my model <strong>associations</strong>. This went well until I wanted to audit a has and belongs to many (HABTM) association which as you know, doesn&#8217;t have to have a backing model (it simply relies on a join table that is named a particular way).  Sigh.  On a few HABTM as sociations, I actually had a model but our smarted myself (and followed an older web recipe) and created the model without id&#8217;s.  These associations do not work with this plugin.</p>
<p>No way to get there from here exept to convert HABTM to has many through.  Further evidence why HABTM is shortcut that only leads to pain later if you need to extend the associations (like adding audit trails). </p>
<p>Avoid HABTM and your life will be better&#8230;. just imagine having to convert 10 or more association tables to models on a production system that has 1000&#8217;s of parent objects.  You see any fun in that? The <a href="http://gilesbowkett.blogspot.com/2009/07/do-you-believe-in-magic.html">superstitious</a> would call how HABTM handles join objects as &#8216;magic&#8217; which isn&#8217;t really very accurate.  It is simply a conventional shortcut.  My big problem with it is the lack of flexibility it gives you &#8211; it is one of those box-canyon paradigms that is hard to get out of.</p>
<p>Oh and another note, if you add acts_as_audited to your project late in the game, you may run into problems with migrations if any migrations load data. The reason is a fresh checkout will bring the audit code which will perform audits even on migrated data and since early migrations don&#8217;t have the audit table loaded yet (it is a later migration), you can&#8217;t migrate data. Sure you can just do a rake db:schema:load but that will leave you without some of your migration data.</p>
<p>An easy solution is to simply rename the acts as audited migration to be your first migration (mung the date in the file name). This tricks  the migration to run first and all should be fine&#8230; Note, this even works if you have previously migrated and then do an update to get this new &#8216;old&#8217; migration &#8211;  the migration still runs even though it is out of sequence thanks to the schema_migrations table which keeps up with what migrations have been run.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2009/07/23/bitten_by_habtm_again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silly Simple Git Initialization for your Rails Projects</title>
		<link>http://blog.intraspectivecorp.com/2009/07/06/silly-simple-git-initialization-for-your-rails-projects/</link>
		<comments>http://blog.intraspectivecorp.com/2009/07/06/silly-simple-git-initialization-for-your-rails-projects/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 16:44:03 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/?p=19</guid>
		<description><![CDATA[Simple script to 'git' your rails going.]]></description>
			<content:encoded><![CDATA[<p>It is such a joy to have such great technologies at our fingertips.  Ruby on Rails can be a fantastic productivity booster for projects but I often find I get huge benefits from it for simply exploring ideas or working up a quick functional prototype.  By adding on things like <a href="http://blog.intraspectivecorp.com/2008/03/01/boost-team-productivity-and-consistency-by-developing-and-using-rails-generators/">customized generators that suit your client&#8217;s configuration</a> and customizable menus, you can get to a workable prototype in record time (minutes to hours).  </p>
<p>Part of the benefit of working with rails projects is the speed with which you can refactor and scaffold your way into different configurations.  This can sometimes get you into trouble if an experiment or plugin doesn&#8217;t work.  The best solution I&#8217;ve found for this is to <strong>ALWAYS</strong> initialized your fresh rails project into a <a href="http://git-scm.com/">git</a> repository.  This is like having infinite  idea or skill mulligan&#8217;s for your project &#8211; a great safety net that let&#8217;s you go fast without fear.</p>
<p><a href="http://railscasts.com">Ryan Bates&#8217;s</a> excellent screen cast series had a nice review of using <a href="http://railscasts.com/episodes/96-git-on-rails">git with rails</a> and one of the commenters (<a href="http://notahat.com/">Pete Yandell</a>) offered a script to simplify life.  This script sets up a standard rails project into git with the proper ignores.  I modified the original script slightly to avoid placing .gitignore files into the empty directories within the .git directory.  This is a harmless change but it seems cleaner to me. Here is my version of it:</p>
<p><code><br />
#!/bin/sh<br />
cat <<EOF > .gitignore<br />
log/*.log<br />
tmp/**/*<br />
db/*.sqlite3<br />
coverage<br />
doc/app/*<br />
EOF<br />
find . -type d -empty -exec touch {}/.gitignore \;<br />
git init<br />
echo "TODO - provide project README" > README<br />
git add .<br />
git commit -a -m "Initial import."<br />
</code><br />
(here&#8217;s the <a href="http://gist.github.com/141509">gist</a>)</p>
<p>This script works great (on OS X anyway) for setting up a project in git. This allows me to extend the &#8216;prototype&#8217; from hours to multiple days if I need to without losing control or risking breaking the whole thing with a laps of concentration.  I can create branches for experimental ideas and quickly switch back and forth.  As long as my migrations are current and especially if I&#8217;m using data generators like <a href="http://populator.rubyforge.org/">populator</a>, I can switch between branches to show my client a few different ideas or behaviors within seconds.  </p>
<p>It is so great to have a (revisable) history of what I&#8217;ve done on a project.  I can also quickly stash an idea away to work on it later.  No matter what I do on the prototype, I can always recover back to some previous spot without much fuss or concern. </p>
<p>This technique works so well because it is all self contained within your rails directory and because it is such a low-overhead and fast approach. </p>
<p>The approach works like this:</p>
<ol>
<li>rails some_new_project</li>
<li>cd some_new_project</li>
<li>git-rails</li>
<li>work on project for minutes or weeks with frequent checkins</li>
<li>create branches, rebase, squash commits, what ever &#8211; repeat previous steps
<li>if want to keep it, move it to a public repo, if not simply rm -rf the entire directory&#8230;</li>
</ol>
<p>Rails and git are really two powerful tools that have greatly revolutionized my personal work flow.  I get to move quickly and with the assurance that I can undo any bad ideas.  Infinite idea mulligans.  I also get to practice using git even if my client is stuck on subversion (or worse).  I highly recommend ALWAYS setting up your rails projects this way.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2009/07/06/silly-simple-git-initialization-for-your-rails-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic Project Documentation</title>
		<link>http://blog.intraspectivecorp.com/2008/08/05/automatic-project-documentation/</link>
		<comments>http://blog.intraspectivecorp.com/2008/08/05/automatic-project-documentation/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 11:16:10 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[team]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/?p=12</guid>
		<description><![CDATA[I&#8217;m a big believer in project transparency.  I also like to utilize a hub and spoke model where a central project intranet site is available for the team to pull from rather than relying on emails or file stores.  A simple wiki with a landing page is all you really need.  Especially [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big believer in project transparency.  I also like to utilize a hub and spoke model where a central project intranet site is available for the team to pull from rather than relying on emails or file stores.  A simple wiki with a landing page is all you really need.  Especially if your client is phobic about using hosted tools (e.g., Mingle/Campfile).  With a team portal, keeping the content up to date should be automatic if the content is derived from your code. Wouldn&#8217;t it be nice if documentation about your project was always up to date?  Wouldn&#8217;t it be even nicer if this documentation could include easy to digest change logs, list of todos/notes and other information?  Well, this post will show you how easy it is to do just that.</p>
<p><span id="more-12"></span></p>
<p>What am I talking about? I&#8217;ll use the work I&#8217;m currently doing for my client to illustrate.  We have a rails RDOC oriented README_FOR_APP page that has includes for things like change log, metrics, notes/todos and the like.  These elements are built by our cruise control process (we simply added a few extra statements in the rake file that cruse fires off).<br />
Ok so how hard is this to do?</p>
<p>The answer is it is very simple. Here is the blow by blow&#8230;</p>
<p>1. set you project up to run under cruise control.</p>
<p>2. By default, cruise wants to run your <code>rake test</code> task.  So you need to create a new super task for cruise to run. In you project Rakefile, add a new build task  to run your tests and then generate the documentation.</p>
<p>3. Edit your <code><strong>doc/README_FOR_APP</strong></code> with useful information.  When you want to include some of the generated files like the changelog, you simply add <code>:include:filename</code>.  As an example, here is the project readme file&#8230;</p>
<pre>= Some Project - Prototype
You can visit the current prototype by going to our
demo [http://url.to.the.site/] site.

== Notes

:include:notes.txt

== Statistics

:include:stats.txt

(LOC = Lines of Code)

== CHANGELOG

:include:CHANGELOG</pre>
<p>Pretty simple&#8230;</p>
<p>4. Modify cruise to use your new rake task.</p>
<p>5. Set up a symlink in project facing web server directory to point to your cruise directory. For example in ~dhainlin/public_html I did something like <code>ln -s /var/cruise/cruisecontrolrb-1.2.1/projects/sample/work sample</code> which created a directory called sample.  This essentially creates a permalink for your project documentation.</p>
<p>6. Browse to your new docs and enjoy fresh, always current information.</p>
<p>Hope this is useful. If you have questions or problems, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2008/08/05/automatic-project-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powerful Results with Google Charts</title>
		<link>http://blog.intraspectivecorp.com/2008/07/15/powerful-results-with-google-charts/</link>
		<comments>http://blog.intraspectivecorp.com/2008/07/15/powerful-results-with-google-charts/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 22:03:00 +0000</pubDate>
		<dc:creator>David Hainlin</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[burn down]]></category>
		<category><![CDATA[google charts]]></category>
		<category><![CDATA[information radiator]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.intraspectivecorp.com/2008/07/15/powerful-results-with-google-charts/</guid>
		<description><![CDATA[I was working on a scrum team that wanted to make our burn down charts available on our wiki.  We tried the movable type chart plugins and they worked ok but we lacked the control we needed.  I had heard about google charts and after looking into them I realized that we might [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a scrum team that wanted to make our burn down charts available on our wiki.  We tried the movable type chart plugins and they worked ok but we lacked the control we needed.  I had heard about google charts and after looking into them I realized that we might be able to coax these to produce the charts we were missing.  To my surprise this was quite easy to prototype but a little harder to do in practice.   The nice thing about the google charts, is they are essentially image tags with specifically built URL&#8217;s.  Constructing the URL can be a challenge but in general the performance we observed was great and the price (free) can&#8217;t be beat. You can read more about it <a href="http://code.google.com/apis/chart/" title="Google Chart API" target="_blank">here</a>.</p>
<p><span id="more-11"></span></p>
<p>Before I get into how this could be used, take a look at some examples in this sample gallery.</p>
<table>
<tr>
<td><img src="http://chart.apis.google.com/chart?cht=bvs&amp;chco=4d89f9&amp;chd=t:120,100,90,95,70,40,30&amp;chs=100x100" /></td>
<td><img src="http://chart.apis.google.com/chart?cht=lxy&amp;chs=200x125&amp;chd=t:0,30,60,70,90,95,100|20,30,40,50,60,70,80|10,30,40,45,52|100,90,40,20,10|-1|5,33,50,55,7&amp;chco=3072F3,ff0000,00aaaa&amp;chls=2,4,1&amp;chm=s,FF0000,0,-1,5|s,0000ff,1,-1,5|s,00aa00,2,-1,5" /></td>
</tr>
<tr>
<td><img src="http://chart.apis.google.com/chart?cht=p3&amp;chd=s:Uf9a&amp;chs=250x100&amp;chl=January|February|March|April" /></td>
<td><img src="http://chart.apis.google.com/chart?cht=t&amp;chs=200x100&amp;chd=s:TEXAS&amp;chco=ffffff,2020ff&amp;chld=TX&amp;chtm=usa&amp;chf=bg,s,EAF7FE" /></td>
</tr>
<tr>
<td><img src="http://chart.apis.google.com/chart?cht=lc&amp;chd=s:99,cefhjkqwrlgYcfgc,QSSVXXdkfZUMRTUQ,HJJMOOUbVPKDHKLH,AA&amp;chco=000000,000000,000000,000000,000000&amp;chls=1,1,0|1,1,0|1,1,0|1,4,0&amp;chs=200x125&amp;chxt=x,y&amp;chxl=0:|Sep|Oct|Nov|Dec|1:||50|100&amp;chg=25,25&amp;chm=b,76A4FB,0,1,0|b,224499,1,2,0|b,FF0000,2,3,0|b,80C65A,3,4,0" /></td>
<td><img src="http://chart.apis.google.com/chart?cht=lc&amp;chd=s:pqokeYONOMEBAKPOQVTXZdecaZcglprqxuux393ztpoonkeggjp&amp;chco=676767&amp;chls=4.0,3.0,0.0&amp;chs=200x125&amp;chxt=x,y&amp;chxl=0:|1|2|3|4|5|1:|0|50|100&amp;chf=c,lg,90,76A4FB,0.5,ffffff,0|bg,s,EFEFEF" /></td>
</tr>
</table>
<h4>Ok, how does this help?</h4>
<p>First thing to note is the above samples are all generated on the fly using the google chart api.  If you look at the image url&#8217;s you&#8217;ll see that all of the chart parameters/colors/data/format etc&#8230; are provided on the url line to google.  This is simple but you obviously don&#8217;t want to do this by hand.  This is where you can get creative.  Say you have a web based data source (say one that stores project story points by sprint), you could coax that web service to produce json or xml data to your static page which could run some embedded javascript to produce a url to the Google charts API.  Not totally trivial but since there are no server side elements (other than your feed), you can do this with minimal infrastructure.</p>
<p>I experimented with a simple rails app that allowed us to record the story point progress and plans on a few sprints.  One of the side effects is it could produce nice looking burn down charts by generating the necessary url to feed to google charts.  I&#8217;ll try to post more about this later with some examples (sanitized).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intraspectivecorp.com/2008/07/15/powerful-results-with-google-charts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

