<?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>Ed Schmalzle &#187; Ruby</title>
	<atom:link href="http://www.edschmalzle.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edschmalzle.com</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 22:59:46 +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>TIL Ruby ObjectSpace#define_finalizer</title>
		<link>http://www.edschmalzle.com/2012/01/19/til-ruby-objectspacedefine_finalizer/</link>
		<comments>http://www.edschmalzle.com/2012/01/19/til-ruby-objectspacedefine_finalizer/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 22:41:43 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[TIL]]></category>

		<guid isPermaLink="false">http://www.edschmalzle.com/?p=179</guid>
		<description><![CDATA[I ran into a situation recently where I was writing a library that utilized large files. Specifically a GTFS feed parser. I wanted to cache the files away someplace so I could safely access them for the life of an object, but I didn&#8217;t want to leave them hanging around afterwards. I couldn&#8217;t do all [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a situation recently where I was writing a library that utilized large files. Specifically a <a href="https://developers.google.com/transit/gtfs/">GTFS</a> feed parser. I wanted to cache the files away someplace so I could safely access them for the life of an object, but I didn&#8217;t want to leave them hanging around afterwards. I couldn&#8217;t do all my work inside a block passed to <code>Dir.mktmpdir</code> because I was planning on accessing the cache when necessary (not just one big up front parsing operation).</p>

<p>This got me wondering: &#8220;does Ruby have finalizers?&#8221;. It turns out it does in the form of <code>ObjectSpace#define_finalizer</code>. It&#8217;s worth mentioning that there are some tricks to using them which are nicely documented on Mike Perham&#8217;s blog <a href="http://www.mikeperham.com/2010/02/24/the-trouble-with-ruby-finalizers/">here</a>.</p>

<p>The gist of it is this: don&#8217;t create finalizers which hold a reference to the instance they&#8217;re finalizing or it just won&#8217;t work. I&#8217;m glad I found that blog post before I started coding because I would have certainly fallen into the trap he describes. It probably doesn&#8217;t help that the ruby doc examples don&#8217;t include any examples of adding a finalizer in a class definition.</p>

<p>So all of this works out pretty nicely and leaves me with code looking something like this:</p>

<script src="https://gist.github.com/1643503.js"> </script>
]]></content:encoded>
			<wfw:commentRss>http://www.edschmalzle.com/2012/01/19/til-ruby-objectspacedefine_finalizer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My RDoc Setup</title>
		<link>http://www.edschmalzle.com/2010/03/08/my-rdoc-setup/</link>
		<comments>http://www.edschmalzle.com/2010/03/08/my-rdoc-setup/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 04:55:40 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[RubyGems]]></category>
		<category><![CDATA[Self Reference]]></category>

		<guid isPermaLink="false">http://www.edschmalzle.com/?p=103</guid>
		<description><![CDATA[I used to keep rdoc and ri turned off to speed up gem installs via my .gemrc config. This became problematic recently when I was planning on doing some work while traveling, and knew I wouldn&#8217;t have an always on internet connection to get my documentation fix. I recalled a post by Jason Seifer I [...]]]></description>
			<content:encoded><![CDATA[<p>I used to keep rdoc and ri turned off to speed up gem installs via my .gemrc config. This became problematic recently when I was planning on doing some work while traveling, and knew I wouldn&#8217;t have an always on internet connection to get my documentation fix. I recalled a <a href="http://jasonseifer.com/2009/02/22/offline-gem-server-rdocs">post</a> by Jason Seifer I had seen that described how to generate your docs with a better template and host them as a passenger application. I decided to use that as a starting point to getting my docs generated in a format I liked and setting things up so that they would always be generated that way.</p>

<p>Jason&#8217;s instructions tell us to install the &#8220;hanna&#8221; template via <code>gem install mislav-hanna</code> which is out of date, so we will use the most current instructions from the gems <a href="http://github.com/mislav/hanna">github page</a> to install the template. No big deal, just drop the github username from the gem install command like this&#8230;</p>

<script src="http://gist.github.com/326240.js?file=gistfile1.sh"></script>

<p>The &#8220;hanna&#8221; template absolutely kills the default rdoc template. You&#8217;ve probably seen it around being used by various projects and there&#8217;s no reason not to use it locally.</p>

<p>Next I updated my .gemrc to ignore ri and to use the &#8220;hanna&#8221; template for rdocs.</p>

<script src="http://gist.github.com/326218.js?file=gistfile1.yml"></script>

<p>Finally I re-generated my rdocs by running:</p>

<script src="http://gist.github.com/326221.js?file=gistfile1.sh"></script>

<p>I ignored the rest of the steps in the aforementioned post as I don&#8217;t really feel the need to be running a passenger instance just to serve rubygems docs. I generally just run <code>gem server</code> whenever I need to access my local docs.</p>

<p>My solution is barely more than what you get out of the box with rubygems but with just a few changes I find myself much happier with my local docs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edschmalzle.com/2010/03/08/my-rdoc-setup/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Deploying Sinatra with Passenger on Dreamhost</title>
		<link>http://www.edschmalzle.com/2009/06/29/deploying-sinatra-with-passenger-on-dreamhost/</link>
		<comments>http://www.edschmalzle.com/2009/06/29/deploying-sinatra-with-passenger-on-dreamhost/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 23:07:38 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>

		<guid isPermaLink="false">http://test.nerded.net/?p=12</guid>
		<description><![CDATA[If the following is true: You want to deploy a Sinatra application with Passenger on Dreamhost You&#8217;re using a Dreamhost shared hosting account You&#8217;re application relies on gems that aren&#8217;t installed globally on Dreamhost You&#8217;ve got the gems you need installed locally like this Then you&#8217;ll want to include something like this in your rackup [...]]]></description>
			<content:encoded><![CDATA[<p>If the following is true:</p>

<ol class="circle">
    <li>You want to deploy a Sinatra application with Passenger on Dreamhost</li>
    <li>You&#8217;re using a Dreamhost shared hosting account</li>
    <li>You&#8217;re application relies on gems that aren&#8217;t installed globally on Dreamhost</li>
    <li>You&#8217;ve got the gems you need installed locally like <a href="http://wiki.dreamhost.com/index.php/RubyGems">this</a></li>
</ol>

<p style="margin-top: 15px;">Then you&#8217;ll want to include something like this in your rackup file:</p>

<script src="http://gist.github.com/137958.js"></script>

<p>This will make sure your locally installed gems will be available to your application. Maybe my google skills are getting rusty, but it took me a while to find this solution. <a href="http://groups.google.com/group/phusion-passenger/browse_thread/thread/8bad6d58f88fdbe2">Here&#8217;s</a> the original source.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edschmalzle.com/2009/06/29/deploying-sinatra-with-passenger-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DVD backup file cleanup</title>
		<link>http://www.edschmalzle.com/2009/02/07/dvd-backup-file-cleanup/</link>
		<comments>http://www.edschmalzle.com/2009/02/07/dvd-backup-file-cleanup/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 01:26:10 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://test.nerded.net/?p=55</guid>
		<description><![CDATA[I wanted to clean up my file share of dvd backups and move to use one file type. I chose iso because it makes it easy to burn them without using anything special, and boxee recognizes iso files. So in a couple minutes I came up with this quick and dirty ruby script&#8230; Assumptions&#8230; 1) [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to clean up my file share of dvd backups and move to use one file type. I chose iso because it makes it easy to burn them without using anything special, and <a href="http://www.boxee.tv">boxee</a> recognizes iso files. So in a couple minutes I came up with this quick and dirty ruby script&#8230;</p>

<script src="http://gist.github.com/60182.js"></script>

<p>Assumptions&#8230; 1) The scripts working directory is the directory you have all your movie files in. 2) You&#8217;ve added the .dvdmedia extension to folders containing the &#8216;VIDEO_TS&#8217; folder.</p>

<p>It wouldn&#8217;t be hard to make this a little more user friendly and not dependent on the .dvdmedia file extension, but I already had manually added it on all those folders to make them play nice with OS X.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edschmalzle.com/2009/02/07/dvd-backup-file-cleanup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iCraig Update</title>
		<link>http://www.edschmalzle.com/2008/12/01/icraig-update/</link>
		<comments>http://www.edschmalzle.com/2008/12/01/icraig-update/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 01:24:56 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Craigslist]]></category>
		<category><![CDATA[Heroku]]></category>
		<category><![CDATA[iCraig]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://test.nerded.net/?p=51</guid>
		<description><![CDATA[iCraig is down! Heroku has turned out to be a less than reliable hosting provider, which is fine given that they&#8217;re hosting my site for free. I&#8217;m working on figuring out whether I should continue hosting at Heroku, or move to greener pastures. Update: I moved to HostingRails.com and things are much better. Only gripe [...]]]></description>
			<content:encoded><![CDATA[<p>iCraig is down! Heroku has turned out to be a less than reliable hosting provider, which is fine given that they&#8217;re hosting my site for free. I&#8217;m working on figuring out whether I should continue hosting at Heroku, or move to greener pastures.</p>

<p>Update: I moved to HostingRails.com and things are much better. Only gripe is the slight delay when going to the app for the first time which is a result of mod_rails spinning up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edschmalzle.com/2008/12/01/icraig-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing&#8230; iCraig</title>
		<link>http://www.edschmalzle.com/2008/11/21/announcing-icraig/</link>
		<comments>http://www.edschmalzle.com/2008/11/21/announcing-icraig/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 01:23:28 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Craigslist]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://test.nerded.net/?p=47</guid>
		<description><![CDATA[I just released my first public Rails application/iPhone web application. It&#8217;s called iCraig and was really a case of &#8220;scratching your own itch&#8221;. I can&#8217;t stand using the craigslist web page from my iPhone, and iCraig helps ease that pain. Check it out at iCraig.org]]></description>
			<content:encoded><![CDATA[<p>I just released my first public Rails application/iPhone web application. It&#8217;s called iCraig and was really a case of &#8220;scratching your own itch&#8221;. I can&#8217;t stand using the craigslist web page from my iPhone, and iCraig helps ease that pain. Check it out at <a href="http://www.icraig.org">iCraig.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edschmalzle.com/2008/11/21/announcing-icraig/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

