<?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>Justin Leitgeb &#187; Ruby</title>
	<atom:link href="http://justinleitgeb.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://justinleitgeb.com</link>
	<description>Perspectives on Ruby and OOP from a developer in NY</description>
	<lastBuildDate>Sun, 05 Sep 2010 04:43:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Rails 3.0 upgrade: Watch out for differences in mass assignment checks on has_many :through associations</title>
		<link>http://justinleitgeb.com/2010/09/rails-3-0-upgrade-watch-out-for-differences-in-mass-assignment-checks-on-has_many-through-associations/</link>
		<comments>http://justinleitgeb.com/2010/09/rails-3-0-upgrade-watch-out-for-differences-in-mass-assignment-checks-on-has_many-through-associations/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 04:43:23 +0000</pubDate>
		<dc:creator>Justin Leitgeb</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://justinleitgeb.com/?p=115</guid>
		<description><![CDATA[While porting a small Rails application, Listable, to Rails 3.0, I found an interesting difference in the behavior of the two frameworks: attr_accessible on a model used for a join relation between two entities works when using &#8216;&#60;&#60;&#8217; to add records in Rails 3.0, while in Rails prior to 3.0 it is silently ignored.   [...]]]></description>
			<content:encoded><![CDATA[<p>While porting a small Rails application, Listable, to Rails 3.0, I found an interesting difference in the behavior of the two frameworks: attr_accessible on a model used for a join relation between two entities works when using &#8216;&lt;&lt;&#8217; to add records in Rails 3.0, while in Rails prior to 3.0 it is silently ignored.   It took me a moment to figure out what was happening, so I figured I&#8217;d leave a note here in case it helps someone else in porting their app to the newest Rails framework.</p>
<p>Taking a step back, here is a simple case that demonstrates the difference between Rails version 2 and Rails version 3 with respect to &lt;&lt; (aliased as &#8216;concat&#8217; and &#8216;push&#8217; in the ActiveRecord framework) when adding to a collection established using has_many :through.  Given three models: User, List, and UserListLink (which has foreign keys for user and list):</p>
<pre>class User &lt; ActiveRecord::Base</pre>
<pre style="padding-left: 30px;">has_many :user_list_links, :dependent =&gt; :destroy</pre>
<pre style="padding-left: 30px;">has_many :lists, :through =&gt; :user_list_links</pre>
<pre>end</pre>
<pre>class List &lt; ActiveRecord::Base</pre>
<pre style="padding-left: 30px;">has_many :user_list_links, :dependent =&gt; :destroy</pre>
<pre style="padding-left: 30px;">has_many :users, :through =&gt; :user_list_links</pre>
<pre>end</pre>
<pre>class UserListLink &lt; ActiveRecord::Base</pre>
<pre style="padding-left: 30px;">belongs_to :user</pre>
<pre style="padding-left: 30px;">belongs_to :list</pre>
<pre>end</pre>
<p>In both Rails 2 and 3, the following works:</p>
<pre>u = User.create</pre>
<pre>l = List.create</pre>
<pre>u.lists &lt;&lt; l</pre>
<p>However, if you add attr_accessible [] to UserListLink, under Rails 3 the UserListLink that is automatically generated will have nil/null values for both list_id and user_id. You&#8217;ll see the expected message in the Rails log, &#8220;WARNING: Can&#8217;t mass-assign protected attributes: list_id, user_id&#8221;, which indicates that Rails uses mass assignment to create this intermediary object. In my case, removing the attr_accessible line in my code allowed &#8216;&lt;&lt;&#8217; to work as it did before upgrading to Rails 3.</p>
<p>I&#8217;m not sure how I feel about the change in behavior in ActiveRecord 3 where mass assignment protection is triggered by the &#8216;concat&#8217; method on a has_many :through relationship.  I suppose whether or not this is &#8216;correct&#8217; behavior depends on whether there is a chance for user-generated data to be passed into the attribute hash used to construct the intermediary object.  If so, this is probably a nice fix in ActiveRecord 3.    Otherwise, though, it may help to bypass the mass assignment check when saving intermediary objects using concat.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinleitgeb.com/2010/09/rails-3-0-upgrade-watch-out-for-differences-in-mass-assignment-checks-on-has_many-through-associations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In the Kitchen: What&#8217;s behind Clean.ly</title>
		<link>http://justinleitgeb.com/2009/12/in-the-kitchen-whats-behind-clean-ly/</link>
		<comments>http://justinleitgeb.com/2009/12/in-the-kitchen-whats-behind-clean-ly/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 12:13:40 +0000</pubDate>
		<dc:creator>Justin Leitgeb</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://justinleitgeb.com/?p=103</guid>
		<description><![CDATA[The App that I submitted for the NYC BigApps contest has been getting some attention after it was mentioned in Wired and I wanted to write about the technology that I used to create it.  The core of the application is built using Ruby on Rails, and it talks to a MySQL database using ActiveRecord. [...]]]></description>
			<content:encoded><![CDATA[<p>The App that I submitted for <a href="http://www.nycbigapps.com/" target="_blank">the NYC BigApps contest</a> has been getting some attention after <a href="http://www.wired.com/epicenter/2009/12/new-york-citys-best-apps/" target="_blank">it was mentioned in Wired</a> and I wanted to write about the technology that I used to create it.  The core of the application is built using Ruby on Rails, and it talks to a MySQL database using ActiveRecord.  More interestingly, though, I added some other technologies to make pages load fast and to help scale the searching engine beyond what MySQL is able to achieve.  For this, I leveraged <a href="http://www.sphinxsearch.com/" target="_blank">Sphinx search</a> as well as <a href="http://varnish.projects.linpro.no/" target="_blank">varnish page caching</a>.</p>
<p>First, my goal in creating <a href="http://clean.ly" target="_blank">Clean.ly</a> was to add a layer of information on top of the NYC restaurant data to make them more interesting and useful.  Geocoding the restaurant addresses was a first step in this process, which was easily accomplished using the Google API.  Next, I grabbed some other information about the restaurants, including type of food, from other freely available sources on the web.</p>
<p>For these data mining tasks, I needed to serialize a bunch of operations to make sure I didn&#8217;t go over API quotas.  I also wanted to create a system that could accept data from different inputs without much trouble later.  To meet these needs, I used a Kestrel queue to serialize HTTP retrievals from various providers.</p>
<p>Once I had the necessary data in place, Sphinx was an obvious choice to bring these data in front of the user on demand.</p>
<p>For those of you who have used the fulltext searching engine in Sphinx, it&#8217;s easy to envision how restaurant searching based on name or &#8220;tag&#8221; (such as type of food) would work.  A lesser known fact about Sphinx is that in the newest releases, simple geodistance calculations are supported.  The only real trick in implementing this part of the Clean.ly was that the latitude and longitude obtained from Google had to be converted to radians before piping them to the Sphinx indexer.  After that, I had near-instant results with distance calculations from an input address, making it possible for users to search for restaurants close to where they want to eat.</p>
<p>Once I had geodist calculations in Sphinx working, I wanted to make sure that pages loaded quickly.  Since Clean.ly doesn&#8217;t really have user-modifiable content, I immediately thought of page caching.  In other work that I&#8217;ve done scaling high-performance web sites, I had implemented Varnish, a reverse page caching daemon, and had great success.  It&#8217;s an extremely elegant and easy-to-use program which I&#8217;d highly recommend checking out for anyone interested in scaling high volume web sites.</p>
<p>Implementing Varnish for Clean.ly turned out to be a fairly straight-forward task. Clean.ly only has one server, a small instance on EC2 that I also use to host a variety of other small Rails projects.  Varnish proxies port 80 on this instance to another port where Apache is listening, and it short-circuits and returns results for pages stored in the page cache.</p>
<p>In another post, I&#8217;d like to go into more detail on using Varnish with Rails applications.  For now, though, I hope that you enjoy using <a href="http://clean.ly" target="_blank">Clean.ly</a>.  Be sure to check it out, as well as <a href="http://www.nycbigapps.com/application-gallery" target="_blank">the other great submissions</a> to the NYC BigApps contest.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinleitgeb.com/2009/12/in-the-kitchen-whats-behind-clean-ly/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Recent post featured on Rails Envy</title>
		<link>http://justinleitgeb.com/2009/10/recent-post-featured-on-rails-envy/</link>
		<comments>http://justinleitgeb.com/2009/10/recent-post-featured-on-rails-envy/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 13:13:18 +0000</pubDate>
		<dc:creator>Justin Leitgeb</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://justinleitgeb.com/?p=91</guid>
		<description><![CDATA[Those of you who do Ruby development are probably familiar with the popular podcast &#8220;Rails Envy&#8220;.  A recent episode featured a blog post that I wrote on iPhone development with the lightweight Ruby web framework &#8220;Sinatra&#8221;.  Check it out when you get a chance, as it has some good information on other up-and-coming Ruby libraries.]]></description>
			<content:encoded><![CDATA[<p>Those of you who do Ruby development are probably familiar with the popular podcast &#8220;<a href="http://railsenvy.com" target="_blank">Rails Envy</a>&#8220;.  A recent episode featured a blog post that I wrote on iPhone development with the lightweight Ruby web framework &#8220;Sinatra&#8221;.  <a href="http://railsenvy.com/2009/10/16/episode-096" target="_blank">Check it out</a> when you get a chance, as it has some good information on other up-and-coming Ruby libraries.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinleitgeb.com/2009/10/recent-post-featured-on-rails-envy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SubwayDelay iPhone app released</title>
		<link>http://justinleitgeb.com/2009/10/subwaydelay-iphone-app-released/</link>
		<comments>http://justinleitgeb.com/2009/10/subwaydelay-iphone-app-released/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 13:04:28 +0000</pubDate>
		<dc:creator>Justin Leitgeb</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://justinleitgeb.com/?p=80</guid>
		<description><![CDATA[The SubwayDelay iPhone application provides NYC subway riders with up-to-the-minute information on which trains might be running late based on  MTA-provided service alerts.]]></description>
			<content:encoded><![CDATA[<p>Last night my iPhone app &#8220;<a href="http://subwaydelay.com" target="_blank">SubwayDelay</a>&#8221; was released.  SubwayDelay provides NYC subway riders with up-to-the-minute information on which trains might be running late, based on the MTA-provided service alerts.  Debating  if you should jump on the C train instead of waiting for the A?  Open up SubwayDelay as you&#8217;re headed to the station and you&#8217;ll see the latest service alerts from the lines you&#8217;re interested in.  SubwayDelay allows you to keep a list of &#8220;favorite&#8221; lines so that they&#8217;re close at hand as you&#8217;re headed to the station near your apartment or work place.</p>
<p>SubwayDelay is not affiliated with the MTA.  Unfortunately, the MTA has yet to release easy access to data on service alerts.  This application rests on <a href="http://mtafeeds.com" target="_blank">MTA Feeds</a> (another site that I created), which provides free access to the MTA data in an easy-to-consume format for transit software developers and subway riders.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinleitgeb.com/2009/10/subwaydelay-iphone-app-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails tip: keep rake tasks short</title>
		<link>http://justinleitgeb.com/2009/09/rails-tip-keep-rake-tasks-short/</link>
		<comments>http://justinleitgeb.com/2009/09/rails-tip-keep-rake-tasks-short/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 12:00:49 +0000</pubDate>
		<dc:creator>Justin Leitgeb</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rake]]></category>

		<guid isPermaLink="false">http://justinleitgeb.com/?p=51</guid>
		<description><![CDATA[Writing short Rake tasks that operate on objects in your codebase rather than defining long task bodies with supporting procedural methods often requires a shift in thinking about your Rake tasks and how it relates to the objects in your codebase.  The effort is worthwhile, however, as you add new classes and more precisely define the interfaces of existing classes in your system in order to achieve a more maintainable system.]]></description>
			<content:encoded><![CDATA[<p><a href="http://rake.rubyforge.org/" target="_blank">Rake (Ruby Make)</a> is often used in Rails projects for tasks that don&#8217;t need to be invoked through a web interface.  Examples of when it may come in handy include running data import tasks manually by administrators or automating tasks through cron.  Since it is so easy to start adding piles of code to a rake task to get a particular chore accomplished, two things often happen which decrease the quality of a project&#8217;s code: 1) tests are left by the wayside and 2) opportunities to expand the flexibility of classes and the project code base itself are lost as code is added to the body of the rake task.</p>
<p>In other words, software engineering best-practices often go out the window as Rake tasks are built, leading to missed opportunities for software reusability and increased maintenance costs.  In my experience, it&#8217;s only a bit more effort to turn the effort of writing a one-off Rake task into an opportunity to expand on the reusable components already in your system.</p>
<p>When I&#8217;ve coded maintenance scripts in Rake, two of the signs that a task needs refactoring are length of the task itself and the number methods that have to be defined in the namespace to support the method.  A task, just like any other method, should do just one thing.  If the Rake task is so long that it scrolls off the screen, opportunities for error are high and the next person working on the code is much more likely to start from scratch rather than sort things out in the method body.</p>
<p>The same applies to Rake tasks that require the presence of lots of other methods defined loosely inside of the namespace.  Defining methods in the Rake namespace for munging data or doing other task setup usually means that these methods aren&#8217;t formally tested anywhere.  In many cases, it also indicates that opportunities to hide complexity by using an Object-Oriented interface are being lost.</p>
<p>I&#8217;ve found that Rake tasks often descend into a mass of procedural code to manage data.  Part of the strength of Ruby is the set of tools it provides for defining objects that we can use to hide complexity, leading to more maintainable code.  It&#8217;s a shame to not use these tools when it only takes a short amount of time to think about how your task could be decomposed into a set of methods to be invoked on new or existing objects.</p>
<p>It takes some practice to think about writing good object-oriented code in short Rake tasks.  One of the hurdles is thinking of your task in terms of the existing objects in your codebase.  These may be existing models, in which case you have a pre-existing place to put code that would be more <a href="http://en.wikipedia.org/wiki/Cohesion_(computer_science)" target="_blank">cohesive</a> than just including it in the namespace of your Rakefile.  In other cases, you may have to define new classes (often under the &#8220;lib&#8221; folder of your project) to best encapsulate the data that you have to act upon.</p>
<p>Writing short Rake tasks that operate on objects in your codebase rather than defining long task bodies with supporting procedural methods often requires a shift in thinking about your Rake tasks and how it relates to the objects in your codebase.  The effort is worthwhile, however, as you add new classes and more precisely define the interfaces of existing classes in your system in order to achieve a more maintainable system.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinleitgeb.com/2009/09/rails-tip-keep-rake-tasks-short/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone app development with Ruby web services</title>
		<link>http://justinleitgeb.com/2009/09/iphone-app-development-with-ruby-web-services/</link>
		<comments>http://justinleitgeb.com/2009/09/iphone-app-development-with-ruby-web-services/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 13:00:48 +0000</pubDate>
		<dc:creator>Justin Leitgeb</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[sinatra]]></category>

		<guid isPermaLink="false">http://justinleitgeb.com/?p=65</guid>
		<description><![CDATA[The availability of elegant Web service frameworks like Sinatra, key-value storage systems such as Tokyo Cabinet, and tools such as Core Data in the iPhone development kit can be composed to create flexible and scalable web services that extend to mobile devices, as I found in my recent development of SubwayDelay.]]></description>
			<content:encoded><![CDATA[<p>I recently submitted SubwayDelay, an application I wrote to help NYC subway riders figure out the best train to take, to the App review process.  The application should be available in the App Store in about two weeks.  In this blog post, I&#8217;ll discuss some things that I learned while creating the application, which interacts with a web service built in Ruby.  In particular, I&#8217;ll touch on creating web services with Sinatra and key-value storage systems, and on using some of the new features of iPhone OS 3.0, including Core Data.  Finally, I&#8217;ll give some pointers on navigating the technical material from Apple related to more obscure parts of the App submission process.</p>
<h2>Sinatra + Tokyo Cabinet</h2>
<p>SubwayDelay requires a server to communicate with the iPhone application.  Instead of going with the popular Ruby on Rails stack, I decided to use a lighter-weight alternative called Sinatra.  Sinatra is great when you don&#8217;t need the overhead of Rails&#8230; it&#8217;s easy to figure out what&#8217;s going on in the framework since the codebase is small, and I&#8217;ve successfully used it in several cases where a web service component is needed.  For the user-visible web pages, I used Haml and Sass instead of the usual ERB since I find those DSL implementations a bit more succinct.</p>
<p>More importantly, in this application I was faced with data that would steadily increase in size.  I wanted to make sure that application performance remained constant, without becoming steadily worse as the size of data increased.  With AT&amp;T&#8217;s current network woes, the last thing I wanted was to cause users to wait extra time for their app to load because of slow delivery speed of my web stack!</p>
<p>For readers interested in things like computational complexity, this meant that I was looking to make sure that the algorithms would be able to complete in <a href="http://en.wikipedia.org/wiki/Constant_time" target="_blank">constant time</a>.  In order to achieve this, I realized that a Hash-type data store would come in handy.  I used Tokyo Cabinet with Tokyo Tyrant, which serializes and deserializes small Ruby Hash objects as my application needs them.</p>
<p>The result was an application that was extremely quick to develop, and which should have great scaling properties.</p>
<h2>Core Data on iPhone</h2>
<p>When I was approximately halfway through developing my iPhone application, which stores user preferences, Apple released iPhone OS 3.0.  Among many improvements to the toolkit was Core Data, a feature which had only been available previously on Mac OS X for desktop computers.  Essentially, Core Data is an Object-Relational Mapping system.  It enables the user to set up a backend data store using sqlite, and helps with flushing changes, selecting objects, and instantiating the correct models for your application.</p>
<p>I realized immediately that it was exactly what I was looking for to handle storing the basic data that I needed to maintain.  I took a step back, realizing that it would probably delay the release by a few days, and dug into the Core Data learning materials on the Apple Developers web site and the sample applications.  In the end, the slight detour was well worth the effort.  I have an application that adheres to the data store that Apple suggests, and the fact that Core Data integrates well into the strict MVC framework on the iPhone was icing on the cake.  I&#8217;d recommend a similar approach to anyone currently working on an iPhone application.</p>
<h2>Apple Developer Docs and App Submission</h2>
<p>As a Ruby developer, I&#8217;m used to being able to Google just about any problem that I come across and find a solution on the web.  With the iPhone, this isn&#8217;t necessarily the case.  The NDA that Apple had in place during early App development stifled some important discussion.  Now that this has been lifted, the Internet is starting to fill up with more useful information for the iPhone developer.  In particular I&#8217;ve been impressed with <a href="http://stackoverflow.com" target="_blank">StackOverflow.com</a> for relevant and helpful exchanges among developers.</p>
<p>There are still substantial deficits in information on the web, though, especially in things like the provisioning process.  It also complicates matters a bit because I believe that Apple has made some very slight changes to their tools, rendering some public web pages obsolete.  What I found in the end is that if you follow the yellow brick road laid out by Apple, things tend to fall into place.  Having trouble getting your keys in place to release the application?  Read the HowTo guide in iTunes Connect a couple of times and nine out of ten times the suggested approach will just work.  Afterwards, maybe there will be some useful information to be gleaned by general Googling, but try to restrain yourself and you may end up fixing things faster by just reading the Apple docs closely.  They really are very well written and comprehensive.</p>
<h2>Conclusion</h2>
<p>The availability of elegant Web service frameworks like Sinatra, key-value storage systems such as Tokyo Cabinet, and tools such as Core Data in the iPhone development kit can be composed to create flexible and scalable web services that extend to mobile devices, as I found in my recent development of <a href="http://subwaydelay.com" target="_blank">SubwayDelay</a>.  Any other tools that have come in handy for you in building apps using a similar stack?  Let me know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinleitgeb.com/2009/09/iphone-app-development-with-ruby-web-services/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby memcache client patched to allow packets larger than 1MB</title>
		<link>http://justinleitgeb.com/2009/08/ruby-memcache-client-patched-to-allow-packets-larger-than-1mb/</link>
		<comments>http://justinleitgeb.com/2009/08/ruby-memcache-client-patched-to-allow-packets-larger-than-1mb/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 13:00:56 +0000</pubDate>
		<dc:creator>Justin Leitgeb</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://justinleitgeb.com/?p=43</guid>
		<description><![CDATA[A patch that I made to the Ruby memcache client to optionally accept packets greater than 1 MB has been accepted by the package maintainer and should be included in the next release.]]></description>
			<content:encoded><![CDATA[<p><a href="http://bit.ly/BYQMN" target="_blank">A patch that I made to the Ruby memcache client</a> to optionally accept packets greater than 1 MB has been accepted by the package maintainer and should be included in the next release.  This change adds a new configuration option to specify if the client should check the size of the incoming packet.  Previous versions of the Ruby memcached client raised an error if the packet size was over 1 MB.  This made sense with the traditional memcached server as <a href="http://code.sixapart.com/svn/memcached/trunk/server/slabs.c" target="_blank">it has a 1MB slab size by default</a>.  This limit doesn&#8217;t make sense with Tokyo Tyrant, which is a daemon allowing access to a Tokyo Cabinet key-value database via the Memcached protocol.</p>
<p>I&#8217;m still not confident that the semantics of the ruby memcache client are what one would want for use with persistent key-value stores.  In particular, I haven&#8217;t delved into the code enough to figure out if the cases where failure occurs in the memcache client should be different based on the type of key-value storage system being used.  Since the ruby memcache client is so widely installed, it seems like being able to specify different behavior for failure cases would be a great help for people using different forms of key-value storage systems with the memcached protocol.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinleitgeb.com/2009/08/ruby-memcache-client-patched-to-allow-packets-larger-than-1mb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NYC.rb Lightning Talk on Feedtosis</title>
		<link>http://justinleitgeb.com/2009/07/nyc-rb-lightning-talk-on-feedtosis/</link>
		<comments>http://justinleitgeb.com/2009/07/nyc-rb-lightning-talk-on-feedtosis/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 03:15:31 +0000</pubDate>
		<dc:creator>Justin Leitgeb</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://justinleitgeb.com/?p=5</guid>
		<description><![CDATA[This evening I gave a short talk at NYC.rb on Feedtosis, my ruby library for efficiently finding new information on RSS and Atom feeds.  I wrote this library for some side projects where I needed to quickly figure out which feed entries are new among lots of different feeds.  It helps by hiding the details [...]]]></description>
			<content:encoded><![CDATA[<p>This evening I gave a short talk at <a href="http://nycruby.org/wiki/" target="_blank">NYC.rb</a> on <a href="http://github.com/jsl/feedtosis/tree/master" target="_blank">Feedtosis</a>, my ruby library for efficiently finding new information on RSS and Atom feeds.  I wrote this library for some side projects where I needed to quickly figure out which feed entries are new among lots of different feeds.  It helps by hiding the details of using HTTP conditional retrieval (using Etag and last_modified tags) for RSS and Atom feeds, and also by taking care of figuring out which feed entries are new.</p>
<p>Although there are other libraries out there that do some of the same things, I decided to write this library after some careful thought because nothing else really had the right balance of features that I needed in terms of abstraction of the details of new feed detection and conditional GET.  Feedtosis is also lightweight in that it delegates the heavy lifting of actually making HTTP requests and normalizing feeds to the very capable ruby libraries taf2-curb and FeedNormalizer respectively.  In Feedtosis I tried to follow a Unix-like philosophy of building utilities that only solve one particular problem, while allowing composition with other minimal utilities in order to create robust systems.  I hope that you find it useful!  Feel free to forward me any comments, and please post any issues that you have with the library on its <a href="http://github.com/jsl/" target="_blank">GitHub page</a>.</p>
<p>In case you&#8217;d like to see the material from the presentation, check out the attached <a href="http://justinleitgeb.com/wp-content/uploads/2009/07/Feedtosis.pdf">Presentation PDF</a> or <a href="http://justinleitgeb.com/wp-content/uploads/2009/07/Feedtosis.pptx">Powerpoint</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinleitgeb.com/2009/07/nyc-rb-lightning-talk-on-feedtosis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
