<?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>Cylence, Inc. &#187; Ruby on Rails</title>
	<atom:link href="http://blog.cylence.com/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cylence.com</link>
	<description>Elegance in Technology</description>
	<lastBuildDate>Wed, 30 Jun 2010 05:20:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Listing Social Networks in Ruby</title>
		<link>http://blog.cylence.com/2010/06/25/listing-social-networks-in-ruby/</link>
		<comments>http://blog.cylence.com/2010/06/25/listing-social-networks-in-ruby/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 06:03:04 +0000</pubDate>
		<dc:creator>Ryan Cross</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Sinatra]]></category>

		<guid isPermaLink="false">http://blog.cylence.com/?p=150</guid>
		<description><![CDATA[I spent a little time tonight working on The Enclave's new member page.  The site overall is the most beautiful thing in the world, but I have been using it as an excuse to plan more with Sinatra.
Tonight, I found the need to provide a way for our members to list their social networks [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a little time tonight working on <a href="http://enclavecoop.com">The Enclave's</a> new <a href="http://enclavecoop.com/members">member page</a>.  The site overall is the most beautiful thing in the world, but I have been using it as an excuse to plan more with <a href="http://www.sinatrarb.com/">Sinatra</a>.</p>
<p>Tonight, I found the need to provide a way for our members to list their social networks should they choose to do so.  The obvious way was to add a list of anchor tags.  I found this to be rather distasteful.  I mean, we are dealing with Ruby here, right?  So, I started by considering what I wanted the UI code to look like.  Would do I want to have to work with on a weekly basis.  I came up with the following:</p>
<p><script src="http://gist.github.com/453831.js"></script></p>
<p>This would allow me to add as many usernames and networks as I desired.  Perfect!  So I began to work on the code that would make this function as intended.  I came up with the following:</p>
<p><script src="http://gist.github.com/453827.js"></script></p>
<p>So, basically, I list all of the networks I want to use.  This list not only includes the URL (and a place holder for the username), but any prefix or suffix for the displayed username for which I might find a need (i.e.: Twitter's "@" in "@slant")  Next, the script iterates through my list, catching each network as it does so.  Each time the script reaches a network, it proceeds through each username in the list, building an appropriate anchor tag for each one.</p>
<p><script src="http://gist.github.com/453837.js"></script></p>
<p>In the end, you have a beautiful categorized list of usernames, each linking to their respective page.</p>
<div class="wp_syntax">
<div class="code">linkedin: <a href="http://www.linkedin.com/in/ryanlcross">ryanlcross</a> | facebook: <a href="http://www.facebook.com/rcross">rcross</a> | twitter: <a href="http://twitter.com/slant">@slant</a>, <a href="http://twitter.com/cylenceweb">@cylenceweb</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.cylence.com/2010/06/25/listing-social-networks-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Journey to Snow Leopard</title>
		<link>http://blog.cylence.com/2009/09/07/journey-to-snow-leopard/</link>
		<comments>http://blog.cylence.com/2009/09/07/journey-to-snow-leopard/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 19:44:17 +0000</pubDate>
		<dc:creator>Ryan Cross</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[snowleopard]]></category>

		<guid isPermaLink="false">http://blog.cylence.com/?p=103</guid>
		<description><![CDATA[Like many, I was in my local Apple Store on August 28th to pick up their newest operating system update, Snow Leopard. Despite hearing about some compatibility issues, my inner-first-adopter got the better of me and since it was basically the beginning of a weekend, I began down the path of the upgrade.
Luckily, I walked [...]]]></description>
			<content:encoded><![CDATA[<p>Like many, I was in my local Apple Store on August 28th to pick up their newest operating system update, <a href="http://www.apple.com/macosx/">Snow Leopard</a>. Despite hearing about some compatibility issues, my inner-first-adopter got the better of me and since it was basically the beginning of a weekend, I began down the path of the upgrade.</p>
<p>Luckily, I walked out of the installation process unscathed for the most part with only a few minor issues to deal with.  One example would be that <a href="http://www.modrails.com/">Phusion Passenger</a> was no longer working &#8211; but mongrel was &#8211; so that was livable.  Realizing that I'd not yet setup a decent database for development since getting my new MacBook Pro, I set to work on basically reinstalling the entire Rails stack to ensure that everything would be ready to roll when I get back to work on Monday.</p>
<p>I found a few fantastic resources to guide me through the majority of what I was looking to do including <a href="http://hivelogic.com/">Hivelogic's</a> guide on <a href="http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/">Compiling Ruby, RubyGems, and Rails on Snow Leopard</a> as well as another guide on <a href="http://hivelogic.com/articles/compiling-git-on-snow-leopard/">Compiling Git on Snow Leopard</a>.  I also found some great information on <a href="http://www.hypertopic.org/index.php/Step-by-step_Install_Guide_for_Leopard">installing PostgreSQL on Snow Leopard</a>. Lastly, I discovered a very <a href="http://www.icoretech.org/2009/08/how-to-install-pg-postgresql-gem-on-snow-leopard-64-bit/">short guide</a> on compiling the PostgreSQL RubyGem for use on Snow Leopard (enabling 64bit compatibility).</p>
<p>Equipped with these guides, I successfully got everything upgraded and am now waiting for all of the other 10.6 bugs to pop up!</p>
<p>edit: A <a href="http://afreshcup.com/2009/09/02/migrating-to-snow-leopard-for-rails-development-a-definitive-guide/">definitive guide</a> in deed. I just found a guide for those of you who want to install things like MySQL and SQLite as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cylence.com/2009/09/07/journey-to-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presentation at Refresh Denver</title>
		<link>http://blog.cylence.com/2008/09/22/presentation-at-refresh-denver/</link>
		<comments>http://blog.cylence.com/2008/09/22/presentation-at-refresh-denver/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 19:14:35 +0000</pubDate>
		<dc:creator>Ryan Cross</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[refreshdenver]]></category>

		<guid isPermaLink="false">http://blog.cylenceweb.com/?p=76</guid>
		<description><![CDATA[Last week, Jay Graves and myself presented the differences between Ruby on Rails and Django at Refresh Denver.  We decided on a common database schema, functionality and design.  We then each built the same application in our respective frameworks.
During the presentation, we each explained our frameworks on a surface level followed by a brief demonstration [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, <a href="http://jay.skabber.com/">Jay Graves</a> and myself <a href="http://refreshdenver.org/2008/09/09/september-17-battle-royale-django-vs-rails/">presented</a> the differences between <a href="http://rubyonrails.org/">Ruby on Rails</a> and <a href="http://www.djangoproject.com/">Django</a> at <a href="http://www.refreshdenver.com/">Refresh Denver</a>.  We decided on a common database schema, functionality and design.  We then each built the same application in our respective frameworks.</p>
<p>During the presentation, we each explained our frameworks on a surface level followed by a brief demonstration of how each framework accomplished a few of the things that our applications did.</p>
<p>Jay's presentation can be found <a href="http://www.slideshare.net/skabber/introduction-to-django-presentation">here</a> and his Django application <a href="http://github.com/skabber/spamstr-django/">here</a>.</p>
<p>My presentation can be found <a href="http://www.slideshare.net/slant/overview-of-ruby-on-rails-presentation/">here</a> and my Rails application <a href="http://github.com/cylence/spamstr-rails/">here</a>.</p>
<p>Overall, I absolutely believed this presentation to be a success!  I'd like to see other frameworks and languages go head to head like this in the future.  I feel like the ability to see two frameworks side by side was a real benefit, allowing a clearer look at how each works with respect to the other.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cylence.com/2008/09/22/presentation-at-refresh-denver/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Hash#values</title>
		<link>http://blog.cylence.com/2008/07/28/using-hashvalues/</link>
		<comments>http://blog.cylence.com/2008/07/28/using-hashvalues/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 22:54:31 +0000</pubDate>
		<dc:creator>Ryan Cross</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[hash]]></category>

		<guid isPermaLink="false">http://blog.cylenceweb.com/?p=13</guid>
		<description><![CDATA[This is minor, but I thought it was interesting nonetheless.
I needed to iterate through the values of a Hash.  So I called .values on the Hash in question.  What was interesting about this had nothing to do with the results of calling this method, but instead what it was actually doing to the [...]]]></description>
			<content:encoded><![CDATA[<p>This is minor, but I thought it was interesting nonetheless.</p>
<p>I needed to iterate through the values of a Hash.  So I called <code>.values</code> on the Hash in question.  What was interesting about this had nothing to do with the results of calling this method, but instead what it was actually doing to the Hash.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&gt;&gt;</span> myhash = <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:first</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;one&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:second</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;two&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:third</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;three&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>:second<span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;two&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:first</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;one&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:third</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;three&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>The <code>myhash</code> how has a class of <code>Hash</code>, which is to be expected, since that's what I gave it.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&gt;&gt;</span> myhash.<span style="color:#9966CC; font-weight:bold;">class</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC00FF; font-weight:bold;">Hash</span></pre></div></div>

<p>When <code>.values</code> is called, it returns all of the values in the Hash.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&gt;&gt;</span> myhash.<span style="color:#9900CC;">values</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;one&quot;</span>, <span style="color:#996600;">&quot;two&quot;</span>, <span style="color:#996600;">&quot;three&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span></pre></div></div>

<p>You may have noticed this in that last example, but when <code>.values</code> was called on that Hash, the class of the result changed altogether.  Let's examine the class of this Hash while we are calling <code>.values</code> on it.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&gt;&gt;</span> myhash.<span style="color:#9900CC;">values</span>.<span style="color:#9966CC; font-weight:bold;">class</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">Array</span></pre></div></div>

<p>So calling <code>.values</code> on the Hash literally built an Array with the values from the preceding Hash!</p>
<p>Read more about <a href="http://www.ruby-doc.org/core/classes/Hash.html#M000178">Hash#values</a> in the <a href="http://www.ruby-doc.org/core/">Ruby Documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cylence.com/2008/07/28/using-hashvalues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Aliases</title>
		<link>http://blog.cylence.com/2008/07/28/git-aliases/</link>
		<comments>http://blog.cylence.com/2008/07/28/git-aliases/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 22:39:46 +0000</pubDate>
		<dc:creator>Ryan Cross</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://blog.cylenceweb.com/?p=7</guid>
		<description><![CDATA[There has been talk about how to shorten Git commands, mostly in an effort to assist those of us who are coming from Subversion.  One proposed solution has been to use the alias mechanism native to your shell environment.
Another solution does exist.  This one is internal to git itself.  Due to that [...]]]></description>
			<content:encoded><![CDATA[<p>There has been talk about how to shorten Git commands, mostly in an effort to assist those of us who are coming from Subversion.  One proposed solution has been to use the alias mechanism native to your shell environment.</p>
<p>Another solution does exist.  This one is internal to git itself.  Due to that fact, the two main benefits are a shorter load time when starting a new shell (since you're not dealing with alias entries in your .profile script) and easier git-centric configuration.</p>
<p>Simply add the following to <code>~/.gitconfig</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[alias]
  co = checkout
  st = status
  br = branch
  ba = branch -a</pre></div></div>

<p>Now instead of typing <code>git checkout branch</code> you only need to type <code>git co branch</code>.  You can customized these as much as you'd like, adding other commands as well, as long as the command after the equals sign is a valid git command.</p>
<p>The obvious down side to this method is that you have to type <code>git</code> before these aliases.  Using the other method, you do not.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cylence.com/2008/07/28/git-aliases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
