<?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>Stok Footage &#187; Ruby</title>
	<atom:link href="http://www.stok.ca/blog/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stok.ca/blog</link>
	<description>Memory Lingers On</description>
	<lastBuildDate>Sun, 22 Jan 2012 15:25:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Chuck Noris on Rails</title>
		<link>http://www.stok.ca/blog/2011/06/08/chuck-noris-on-rails/</link>
		<comments>http://www.stok.ca/blog/2011/06/08/chuck-noris-on-rails/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 02:10:46 +0000</pubDate>
		<dc:creator>MikeStok</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[Food & Drink]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://www.stok.ca/blog/?p=818</guid>
		<description><![CDATA[This evening I got together with a couple of people from work to get some more than trivial experience with Ruby on Rails with them, and try not to come across like a Perl zealot, Ruby weenie, or PyHole &#8211; those types of people whose single minded narrow minded zeal and certitude pretty much turn [...]]]></description>
			<content:encoded><![CDATA[<p>This evening I got together with a couple of people from work to get some more than trivial experience with <a href="http://www.rubyonrails.org">Ruby on Rails</a> with them, and try not to come across like a <a href="http://use.perl.org">Perl</a> zealot, <a href="http://www.ruby-lang.org">Ruby</a> weenie, or PyHole &#8211; those types of people whose single minded narrow minded zeal and certitude pretty much turn me off any technology regardless of its virtues.</p>
<p><a href="http://www.stok.ca/blog/wp-content/uploads/2011/06/IMG_0064.jpg"><img src="http://www.stok.ca/blog/wp-content/uploads/2011/06/IMG_0064-225x300.jpg" alt="" title="Chuck Noris [sic] Roundhouse IPA" width="225" height="300" class="alignleft size-medium wp-image-819" /></a>Someone suggested that we change the venue of our Rails experience from an office at work to a patio at a watering hole.  As Dave and I had planned to sample some <a href="http://tapsbeer.ca/taps-on-queen-beer-selection/">Chuck Noris IPA</a> after the session, we did the agile thing and headed out laptop at the ready.  The three of us made it to Stout on Carlton street in spite of the tropical heat and humidity, the delays on the TTC, and much to my relief there were still <a href="http://beeradvocate.com/articles/384">growlers</a> of Chuck Noris to be had.  Once we arrived we made another quick decision to remain in the air conditioned lounge rather than swelter on the patio.</p>
<p>If there&#8217;s one thing I have learned from <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Walker%2C_Texas_Ranger">Walker Texas Ranger</a> it is that no matter how desperate the situation it can all be resolved in the ten minutes before everyone has to go, so once I was hooked up to the WiFi and the first pint of IPA and some food had been consumed I was able to try a half hour of &#8220;trio programming&#8221; (agile + 50%!) getting a couple of screens going.</p>
<p>Some of the things we learned:</p>
<ul>
<li>rvm is great.</li>
<li>bundler makes it really easy to switch rails versions, particularly when it&#8217;s easier to suspect the new 3.0.8 rather than anyhting we did!</li>
<li>Overconfidence is dangerous &#8211; we made several models, one of which was called Action.  Not a good idea in rails.  <a href="http://oldwiki.rubyonrails.org/rails/pages/ReservedWords">http://oldwiki.rubyonrails.org/rails/pages/ReservedWords</a></li>
<li>rails gives you a lot of functionality for a small investment in code.</li>
<li>Three heads are better than one.</li>
<li>We should try a place called Granite up near Yonge and Eglinton</li>
</ul>
<p>This week is turning out pretty Ruby heavy, yesterday&#8217;s Toronto Ruby Brigade meetup, Chuck on Rails tonight, and a Ruby hacking meetup tomorrow&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stok.ca/blog/2011/06/08/chuck-noris-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>map_by_method and awsome_print</title>
		<link>http://www.stok.ca/blog/2010/08/07/map_by_method-and-awsome_print/</link>
		<comments>http://www.stok.ca/blog/2010/08/07/map_by_method-and-awsome_print/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 01:37:00 +0000</pubDate>
		<dc:creator>MikeStok</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.stok.ca/blog/?p=440</guid>
		<description><![CDATA[I have been playing with some of the gems I installed for my rvm rubies, and the first couple I have looked at are pretty simple &#8211; map_by_method and awsome_print. My trivial code snippet is here: 123456789101112131415161718#!/usr/bin/env ruby # Trivial class with name and gender methods class Person &#160; attr_reader :name, :gender &#160; def initialize&#40;name, [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing with some of the gems I installed for my rvm rubies, and the first couple I have looked at are pretty simple &#8211; <tt>map_by_method</tt> and <tt>awsome_print</tt>.</p>
<p>My trivial code snippet is here:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span><br />
<br />
<span style="color:#008000; font-style:italic;"># Trivial class with name and gender methods</span><br />
<span style="color:#9966CC; font-weight:bold;">class</span> Person<br />
&nbsp; attr_reader <span style="color:#ff3333; font-weight:bold;">:name</span>, <span style="color:#ff3333; font-weight:bold;">:gender</span><br />
<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>name, gender<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@name</span>, <span style="color:#0066ff; font-weight:bold;">@gender</span> = name, gender<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span><br />
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'map_by_method'</span><br />
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'ap'</span><br />
<br />
people = <span style="color:#006600; font-weight:bold;">&#91;</span> Person.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'Mike'</span>, <span style="color:#996600;">'M'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, Person.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'Derek'</span>, <span style="color:#996600;">'M'</span><span style="color:#006600; font-weight:bold;">&#41;</span> &nbsp;<span style="color:#006600; font-weight:bold;">&#93;</span><br />
ap people.<span style="color:#9900CC;">map_by_name</span><br />
ap people.<span style="color:#9900CC;">map_by_name_and_gender</span></div></td></tr></tbody></table></div>
<p>Other blog posts about these gems include <a href="http://rpheath.com/posts/246-map-by-method-gem">http://rpheath.com/posts/246-map-by-method-gem</a> and <a href="http://www.rubyinside.com/awesome_print-a-new-pretty-printer-for-your-ruby-objects-3208.html">http://www.rubyinside.com/awesome_print-a-new-pretty-printer-for-your-ruby-objects-3208.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stok.ca/blog/2010/08/07/map_by_method-and-awsome_print/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cider, rvm, and homebrew</title>
		<link>http://www.stok.ca/blog/2010/07/24/cider-rvm-and-homebrew/</link>
		<comments>http://www.stok.ca/blog/2010/07/24/cider-rvm-and-homebrew/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 23:58:23 +0000</pubDate>
		<dc:creator>MikeStok</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[cider]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://www.stok.ca/blog/?p=423</guid>
		<description><![CDATA[The rails installed by cider is a rails 3 beta. As I want to play with some of the examples for rails 2 I thought I should get the most recent ruby 1.8.7 and try to use rvm&#8217;s gem sets to get myself a rails 2 world set up brew install `brew outdated` rvm install [...]]]></description>
			<content:encoded><![CDATA[<p>The rails installed by cider is a rails 3 beta.  As I want to play with some of the examples for rails 2 I thought I should get the most recent ruby 1.8.7 and try to use rvm&#8217;s gem sets to get myself a rails 2 world set up</p>
<pre>brew install `brew outdated`
rvm install ruby-1.8.7-p299
rvm --default ruby-1.8.7-p299</pre>
<p>Was my first step to this, but when I tried irb this is what I saw:</p>
<pre>ratdog:~ mike$ irb
no such file to load -- map_by_method
ruby-1.8.7-p299 > q</pre>
<p>The cause of this was my <tt>~/.irbrc</tt> which had been set up, and which has a whole bundle of useful gems added into it.  Most of these are worth a post by themselves, but the suspects were:</p>
<ul>
<li>map_by_method</li>
<li>what_methods</li>
<li>awesome_print</li>
<li>net-http-spy</li>
<li>hirb</li>
<li>looksee</li>
<li>wirble</li>
<li>sketches</li>
</ul>
<p>I set up an rvm gemset and started installing gems:</p>
<pre>rvm gemset create rails238
rvm ruby-1.8.7-p299@rails238
gem install map_by_method what_methods awesome_print net-http-spy hirb looksee wirble sketches
gem install rails -v 2.3.8
rvm --default ruby-1.8.7-p299@rails238</pre>
<p>All appeared to go well, until I tried navigating to a demo appliction and look at the environment on the default splash screen, which complained about a missing sqlite3 gem.  The sqlite3 gem wanted at least ruby-1.9.1 installed, so it was time to install another Ruby.</p>
<p>The ruby-1.9.1-p429 had a problem with gems, but a quick trip to Yahoo! revealed this <a href="http://www.pubbs.net/201007/ruby/32029-ruby-core31342-bug-3584-error-loading-gem-paths-on-load-path-in-gemprelude-cant-modify-frozen-string.html">message</a>, so it was time to install another ruby!</p>
<pre>rvm install ruby-1.9.1-p378
rvm use ruby-1.9.1-p378 --default
rvm gemset create rails238
rvm use ruby-1.9.1-p378@rails238 --default
gem install map_by_method what_methods awesome_print net-http-spy hirb looksee wirble sketches
gem install rails -v 2.3.8
gem install sqlite3</pre>
<p>Now I can get to work playing with rails!  The great thing is that I haven&#8217;t compromised my system Ruby, thanks to cider, rvm, and homebrew.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stok.ca/blog/2010/07/24/cider-rvm-and-homebrew/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time to Learn Some More Tools</title>
		<link>http://www.stok.ca/blog/2010/06/29/time-to-learn-some-more-ruby/</link>
		<comments>http://www.stok.ca/blog/2010/06/29/time-to-learn-some-more-ruby/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 22:55:14 +0000</pubDate>
		<dc:creator>MikeStok</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.stok.ca/blog/?p=413</guid>
		<description><![CDATA[For a while now I have been put off programming by my daytime experiences, but a recent Ruby5 podcast has whetted my appetite for fun again. The great thing I found was that the initial install didn&#8217;t quite go smoothly&#8230; [Tue, 29 Jun 2010 07:42:01 -0400] INFO: Starting Chef Solo Run [Tue, 29 Jun 2010 [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now I have been put off programming by my daytime experiences, but a recent <a href="http://ruby5.envylabs.com/episodes/82-episode-80-may-28-2010/stories/692-cider-gem-helps-osx-users-set-up-a-development-environment">Ruby5 podcast</a> has whetted my appetite for fun again.</p>
<p>The great thing I found was that the initial install didn&#8217;t quite go smoothly&#8230;</p>
<pre>[Tue, 29 Jun 2010 07:42:01 -0400] INFO: Starting Chef Solo Run
[Tue, 29 Jun 2010 07:42:11 -0400] INFO: Replacing the run_list with ["homebrew", "homebrew::dbs", "homebrew::misc", "ruby", "ruby::irbrc", "ruby::rails", "ruby::sinatra", "node"] from JSON
[Tue, 29 Jun 2010 07:42:12 -0400] INFO: Setting group to 20 for template[/Users/mike/.cider.profile]
[Tue, 29 Jun 2010 07:42:12 -0400] ERROR: template[/Users/mike/.cider.profile] (/Users/mike/.rvm/gems/ruby-1.8.7-p299/gems/chef-0.8.16/lib/chef/mixin/recipe_definition_dsl_core.rb line 59) had an error:
Operation not permitted - /Users/mike/.cider.profile
/Users/mike/.rvm/gems/ruby-1.8.7-p299/gems/chef-0.8.16/bin/../lib/chef/provider/file.rb:118:in `chown'</pre>
<p>&#8230; so now I have a chance to use rdebug on a real issue, and maybe get to learn something about OS X and the Ruby setup.  I&#8217;m looking forward to <a href="http://www.atmos.org/cider/intro.html">learning more about Cider</a>, and maybe having some fun again.</p>
<p>After a little fooling around with rdebug I decided that the most expedient thing to do was add myself to group 20 and see if Cider would install OK. A quick Yahoo search for adding a user to a group in OS X Snow Leopard led me to <a href="http://www.macosxhints.com/article.php?story=20100609140550467">this post</a>, and with a  quick </p>
<pre>dseditgroup -o edit -u mike -p -a mike -t user staff</pre>
<p>The install seems to be progressing&#8230;</p>
<p><strong>1 July 2010:</strong></p>
<p>My goal was to leave the Snow Leopard install of Ruby alone, and see if I could get the entire thing set up without using sudo.  Unfortunately that meant I had to install rvm (from tarball as OS X doesn&#8217;t have a git by default) and an rvm ruby to get going. When it tried to  install the ~/Developer/&#8230; rvm it fell over.</p>
<p>So&#8230; use sudo to get cider installed as part of the OS X install and see what it does!</p>
<p><strong>2 July 2010:</strong></p>
<p>It looks like it&#8217;s more than just my Ruby which will get dusted off soon, Cider uses <a href="http://rvm.beginrescueend.com/">RVM</a> which allows multiple rubies and gemsets, and <a href="http://mxcl.github.com/homebrew/">Homebrew</a> to manage installed software on OS X.  I ought to know at least what all the programs and gems installed by Cider are, and maybe learn a few of them:</p>
<pre>ratdog:~ mike$ brew list
ack		libevent	node		redis		wget
ctags		markdown	npm		rlwrap
fortune		memcached	postgresql	rpg
git		mongodb		proctools	sqlite
kiwi		mysql		readline	tig</pre>
<pre>ratdog:~ mike$ rvm list

rvm rubies

=> ruby-1.8.7-p248 [ x86_64 ]</pre>
<pre>ratdog:~ mike$ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.0.beta3, 2.3.8)
actionpack (3.0.0.beta3, 2.3.8)
activemodel (3.0.0.beta3)
activerecord (3.0.0.beta3, 2.3.8)
activeresource (3.0.0.beta3, 2.3.8)
activesupport (3.0.0.beta3, 2.3.8)
arel (0.3.3)
awesome_print (0.2.1)
builder (2.1.2)
bundler (0.9.26)
configuration (1.1.0)
engineyard (0.3.2)
erubis (2.6.6)
escape (0.0.4)
heroku (1.9.9)
highline (1.5.2)
hirb (0.3.2)
i18n (0.3.7)
json (1.4.3)
json_pure (1.4.3)
launchy (0.3.5)
looksee (0.2.1)
mail (2.2.5)
map_by_method (0.8.3)
memcache-client (1.8.3)
mime-types (1.16)
net-http-spy (0.2.1)
polyglot (0.3.1)
rack (1.1.0)
rack-mount (0.6.6)
rack-test (0.5.4)
rails (3.0.0.beta3, 2.3.8)
railties (3.0.0.beta3)
rake (0.8.7)
rdoc (2.5.8)
rest-client (1.5.1, 1.4.2)
sinatra (1.0)
sketches (0.1.1)
termios (0.9.4)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.13.7)
treetop (1.4.8)
tzinfo (0.3.22)
what_methods (1.0.1)
wirble (0.1.3)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.stok.ca/blog/2010/06/29/time-to-learn-some-more-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toronto Ruby user group lives again</title>
		<link>http://www.stok.ca/blog/2009/03/19/toronto-ruby-user-group-lives-again/</link>
		<comments>http://www.stok.ca/blog/2009/03/19/toronto-ruby-user-group-lives-again/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 11:48:43 +0000</pubDate>
		<dc:creator>MikeStok</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Toronto]]></category>
		<category><![CDATA[User Groups]]></category>

		<guid isPermaLink="false">http://www.stok.ca/blog/?p=119</guid>
		<description><![CDATA[Last night we had the first meeting of the Toronto Ruby User Group&#8217;s third incarnation. Thanks to Kent Fenwick for taking over the organisation and getting us a space at the University of Toronto. If you&#8217;re interested in Ruby in the Toronto area then http://www.meetup.com/toronto-ruby-meetup/ is the place to look.]]></description>
			<content:encoded><![CDATA[<p>Last night we had the first meeting of the Toronto Ruby User Group&#8217;s third incarnation.  Thanks to Kent Fenwick for taking over the organisation and getting us a space at the University of Toronto.</p>
<p>If you&#8217;re interested in Ruby in the Toronto area then <a href="http://www.meetup.com/toronto-ruby-meetup/">http://www.meetup.com/toronto-ruby-meetup/</a> is the place to look.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stok.ca/blog/2009/03/19/toronto-ruby-user-group-lives-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

