<?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>Nuclear Rooster &#187; ruby</title>
	<atom:link href="http://dev.nuclearrooster.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.nuclearrooster.com</link>
	<description></description>
	<lastBuildDate>Thu, 22 Dec 2011 17:43:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Datamapper validate_within syntax</title>
		<link>http://dev.nuclearrooster.com/2010/04/15/datamapper-validate_within-syntax/</link>
		<comments>http://dev.nuclearrooster.com/2010/04/15/datamapper-validate_within-syntax/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 19:23:58 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[datamapper]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=295</guid>
		<description><![CDATA[I had to dig into the code to figure this one out, a practice which I am finding both more common and convenient, but it is always second to a quick google search. So, here it is, a validates_within example for Datamapper:]]></description>
			<content:encoded><![CDATA[<p>I had to dig into the code to figure this one out, a practice which I am finding both more common and convenient, but it is always second to a quick google search.  So, here it is, a validates_within example for Datamapper:</p>
<pre class="brush: ruby; title: ; notranslate">

class Essay
  include DataMapper::Resource

  property :id, Serial
  property :rating, Integer, :set =&gt; 0..5 #inline validation
  property :technical_score, Integer
  property :style_score, Integer

  # Validation for multiple properties
  validates_within :technical_score, :style_score, :set =&gt; 0..100
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2010/04/15/datamapper-validate_within-syntax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Skipping gem documentation: configure .gemrc to speed up gem installation</title>
		<link>http://dev.nuclearrooster.com/2009/12/06/skipping-gem-documentation-configure-gemrc-to-speed-up-gem-installation/</link>
		<comments>http://dev.nuclearrooster.com/2009/12/06/skipping-gem-documentation-configure-gemrc-to-speed-up-gem-installation/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 19:06:42 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=194</guid>
		<description><![CDATA[The .gemrc file can specify default options for the 'gem' executable, and since I haven't ever looked up ri or rdoc on my local system, I decided to turn these off by default. I've been adding the '--no-ri' and '--no-rdoc' flags for a while, but my laziness just got the better of me. Turning of [...]]]></description>
			<content:encoded><![CDATA[<p>The .gemrc file can specify default options for the 'gem' executable, and since I haven't ever looked up ri or rdoc on my local system, I decided to turn these off by default.  I've been adding the '--no-ri' and '--no-rdoc' flags for a while, but my <a href="http://www.hhhh.org/wiml/virtues.html">laziness just got the better of me</a>.</p>
<p>Turning of the RI and Rdoc documentation speeds up gem installs.  Here, installing capistrano without docs takes about 11 seconds, whereas installing the documenation more than doubles the time to about 24 seconds.</p>
<pre class="brush: bash; title: ; notranslate">
nicks-computer-3:snap nick$ time sudo gem install capistrano --no-ri --no-rdoc
Successfully installed capistrano-2.5.10
1 gem installed

real	0m11.480s
user	0m7.262s
sys	0m0.374s
nicks-computer-3:snap nick$ time sudo gem install capistrano --ri --rdoc
Successfully installed capistrano-2.5.10
1 gem installed
Installing ri documentation for capistrano-2.5.10...
Installing RDoc documentation for capistrano-2.5.10...

real	0m23.974s
user	0m18.956s
sys	0m0.706s
</pre>
<p>If you want to turn off the documentation options, add this line to your ~/.gemrc file:</p>
<pre class="brush: plain; title: ; notranslate">
gem: --no-ri --no-rdoc
</pre>
<p>So that it looks something like this:</p>
<pre class="brush: bash; title: ; notranslate">
nicks-computer-3:snap nick$ cat ~/.gemrc
---
:bulk_threshold: 1000
:backtrace: false
gemcutter_key: XXXXX
gem: --no-ri --no-rdoc
:benchmark: false
:verbose: true
:update_sources: true
:sources:
- http://gems.rubyforge.org/
- http://gems.opscode.com
</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/12/06/skipping-gem-documentation-configure-gemrc-to-speed-up-gem-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going to Gem Med School: Open Source ruby projects with Dr. Nic Williams</title>
		<link>http://dev.nuclearrooster.com/2009/08/07/going-to-gem-med-school-open-source-ruby-projects-with-dr-nic-williams/</link>
		<comments>http://dev.nuclearrooster.com/2009/08/07/going-to-gem-med-school-open-source-ruby-projects-with-dr-nic-williams/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 07:11:37 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[linux / os x]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[runcoderun]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=143</guid>
		<description><![CDATA[Grooving with Dr. Nic, and digging in to some projects Going with the Flow Despite my feelings that the title Dr. should be strictly reserved for those that save lives, Dr. Nic Williams does have plenty of good advice to offer (and he offers it in a nice format on his website). After having made [...]]]></description>
			<content:encoded><![CDATA[<h1>Grooving with Dr. Nic, and digging in to some projects</h1>
<h2>Going with the Flow</h2>
<p>Despite my feelings that the title Dr. should be strictly reserved for those that save lives, Dr. Nic Williams does have plenty of good advice to offer (and he offers it in a nice format on <a href="http://drnicwilliams.com">his website</a>).  After having made some of the same mistakes and asked the same questions he has, I decided to try out the new and improved open-source project workflow.  There are several things to be achieved from these open-source projects:</p>
<ul>
<li>Have fun</li>
<li>Learn something new</li>
<li>Share code</li>
</ul>
<p>There are also some thing that should be avoided, less favorable outcomes:</p>
<ul>
<li>Write code, but don't go the full 9 yards to distribute + share it</li>
<li>Spend too much time on setup/distribution</li>
<li>Tie yourself down with maintaining your projects (they should set you freeeeee!)</li>
</ul>
<p>Two great presentations can help you achieve these goals, and avoid the pitfalls.  The first is a <a href="http://drnicwilliams.com/2009/07/13/futureruby-talk-living-with-1000-open-source-projects/">a great presentation</a> about what an open-source project should be, what it shouldn't be, and how they can make your life better, not worse.</p>
<p>The next presentation is about how to <a href="http://drnicwilliams.com/2008/12/05/my-rubygems-development-tools-and-workflow/">quickly and effectively distribute and share your projects</a>.</p>
<p>In order to get this all down, the good Dr. describes a workflow and a set of tools for each step.</p>
<ul>
<li>Packaging - <a href="http://rubygems.org">RubyGems</a></li>
<li>SCM - <a href="http://github.com>GitHub</a></li>
<li>Public Repostiroy  -  <a href="http://github.com>GitHub</a></li>
<li>Continuous Integration - <a href="http://runcoderun.com">RunCodeRun</a></li>
<li>Blog/Resume Integration - <a href="http://thinkrelevance.rubyforge.org/runcoderun_badge/">RunCodeRun Sexy Blog Badge</a></li>
</ul>
<h2>The Project</h2>
<p>I decided to write a little ruby wrapper for the 'ddate' command, part of the 'util-linux-ng' package, that convert Georgian dates to Discordian dates.  Why?  Because I like it, and if you are going to pick a project to learn on, it might as well be ridiculous.  I got attached enough as it was to this project, even though I don't think anybody could come up with an excuse to use Discordian dates, let alone happen to be using ruby.</p>
</h2>
<p>Snafoos</h2>
<p>One thing that started to bug my is the gem, class, module, and github repository names.  It seems simple enough, but sometimes you are so excited to get you idea down in code that you rush through this first step.  It will be around for a while, and is kind of a pain to change once you get it all set up.  So take a few minutes and think about a name. One without WeIRd caps or anything that might annoy you in the future.</p>
<p>I also found newgem to be a little wonky.  It a nice tool to have around, but I think (rightly so) it is tailored to Dr. Nic's workflows, and might not work for everybody.  </p>
<p>Lastly, I found myself wresting with Hoe.  The 'rake pacakge' task was failing if I added the Hoe require statement, and runcoderun was failing without the statement.  That brings me to a little tangent.  I didn't really dig into what was going on there, but this is an example of something that is unexpectedly not idempotent; you should be able to require and require and require, then run some code and everything should be fine and dandy.  I'm not sure how or why requiring Hoe (when it is clearly used, anyway) would break anything, and it almost annoys me enough to find out.  Almost.</p>
<h2>Good stuff</h2>
<p>I like <a href="http://www.runcoderun.com">RunCodeRun</a>.  It is simple continuous integration that makes sense.  I also like the <a href="http://thinkrelevance.rubyforge.org/runcoderun_badge/">blog badge</a>, although it currently looks horrible on my blog.</p>
<h2>Stuff I'll add</h2>
<p>Speaking of blog badges, I want to see if I can get the <a href="http://wordpress.org/extend/plugins/github-widget/">github projects</a> blog badge working.  Associating myself with a project is another step for creating a fully-rounded project.  This badge helps integrate that step right into the existing workflow.</p>
<p>For learning projects, I plan on adding some non-standard notes to the README, including sections about what I learned and what would have done differently.  Open source the code, and open source the learning process.  Its not like I have any customers to scare away with honest comments.</p>
<p>As Nic Williams said, "Don't attach your self-worth to your code - your code probably isn't that good."  Its true.  I am a better software developer than I am a coder, and I aim to be.  You can write code quite a few different ways and it all compiles down to the same thing.  To me, nailing the workflow and the tools is the hard part, and the part that deserves the most attention.  </p>
<p>Working with software, your code will always improve and you will keep learning new tricks.  But too many people let their workflow and tool-set become stagnant, which can leave you further behind than knowing a few extra tricks in this language or that one.   </p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/08/07/going-to-gem-med-school-open-source-ruby-projects-with-dr-nic-williams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

