<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>This is a spot where you can get a real slice of my thoughts</description><title>Thoughts Heap</title><generator>Tumblr (3.0; @romanandreg)</generator><link>http://blog.romanandreg.com/</link><item><title>Default mutable values in Python functions are WACK!</title><description>&lt;p&gt;If you use mutable default values on functions, this will keep it state in recurrent calls:&lt;/p&gt;

&lt;pre&gt;&lt;code class="python"&gt;
def myAppend(x, L=[]):
    L.append(x)
    return L

#=============

&gt;&gt;&gt; myAppend(1)
=&gt; [1]
&gt;&gt;&gt; myAppend(2)
=&gt; [1, 2]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That’s seriously messed up o.O&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/487659118</link><guid>http://blog.romanandreg.com/post/487659118</guid><pubDate>Wed, 31 Mar 2010 16:31:46 -0700</pubDate><category>python</category><category>wtf</category><category>wack</category></item><item><title>Use form_for from Rails' console</title><description>&lt;p&gt;As a curious developer, I always like to inspect an objects guts on the console, that way I can now as much as I can from the class without reading the documentation. It was the time for the rails &lt;code&gt;form_for&lt;/code&gt; view helper. I had no idea how to access that from the terminal whatsoever, so I googled a bit and I found &lt;a href="http://errtheblog.com/posts/41-real-console-helpers" target="_blank"&gt;nice&lt;/a&gt; &lt;a href="http://blog.p.latyp.us/2008/03/calling-helpers-in-rails-console.html" target="_blank"&gt;tidbits&lt;/a&gt; that got me going pretty quickly.&lt;/p&gt;

&lt;p&gt;However when you try to use a method like &lt;code&gt;form_for&lt;/code&gt;, a &lt;code&gt;NoMethodError&lt;/code&gt; is being thrown because you are trying to call &lt;code&gt;url_for&lt;/code&gt; for on a nil instance. This is because the default console helper doesn’t have any controller assigned. This can be easily fixed:&lt;/p&gt;

&lt;pre&gt;&lt;code class="ruby"&gt;
helper.controller = ActionController::Integration::Session.new
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;However, when we try again the &lt;code&gt;form_for&lt;/code&gt; method we get a new error.&lt;/p&gt;

&lt;pre&gt;&lt;code class="ruby"&gt;
NoMethodError: undefined method `protect_against_forgery?' for #&lt;ActionController::Integration::Session:0x10608a460&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It seems that for some reason, the &lt;code&gt;ActionController&lt;/code&gt; integration session doesn’t support the forgery protection, because this is not a biggie for what we need we are just going to stub the method, and go our own way.&lt;/p&gt;

&lt;pre&gt;&lt;code class="ruby"&gt;
s = ActionController::Integration::Session.new
class &lt;&lt; s; def protect_against_forgery?; false; end; end
helper.controller = ActionController::Integration::Session.new
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;At this point we thought we were going get away with it… well no, it seems it never stops.&lt;/p&gt;

&lt;pre&gt;&lt;code class="ruby"&gt;
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.&lt;&lt;
    from /Users/roman/Sites/git/work/noomii/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb:32:in `concat'
    from /Users/roman/Sites/git/work/noomii/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:281:in `form_for_without_haml'
    from /Library/Ruby/Gems/1.8/gems/haml-2.2.9/lib/haml/helpers/action_view_mods.rb:170:in `form_for'
    from (irb):16
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The default helper object doesn’t have an initialized output buffer either!… luckily is easy to skip this one as well.&lt;/p&gt;

&lt;pre&gt;&lt;code class="ruby"&gt;
s = ActionController::Integration::Session.new
class &lt;&lt; s; def protect_against_forgery?; false; end; end
helper.controller = ActionController::Integration::Session.new
helper.output_buffer = ''
f = nil
u = User.new
helper.form_for { |_f| f = _f }
f
&gt;&gt; #&lt;Forms::ApplicationFormBuilder:0x105d7d330 @proc=#&lt;Proc:0x0000000105d80648@(irb):16gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Oh the nice smell of victory!&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/482633168</link><guid>http://blog.romanandreg.com/post/482633168</guid><pubDate>Mon, 29 Mar 2010 15:41:00 -0700</pubDate><category>rails</category><category>helpers</category><category>form_for</category></item><item><title>Now we are talking…</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_ktftlepmFL1qzxe9uo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Now we are talking…&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/251406170</link><guid>http://blog.romanandreg.com/post/251406170</guid><pubDate>Fri, 20 Nov 2009 18:29:38 -0800</pubDate></item><item><title>guillee:


I see your puny garbage plate and I raise you a...</title><description>&lt;object width="400" height="336"&gt;&lt;param name="movie" value="http://www.youtube.com/v/SwHVdCqWIQk&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/SwHVdCqWIQk&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1" type="application/x-shockwave-flash" width="400" height="336" allowFullScreen="true" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://blog.gesteves.com/post/247920653/i-see-your-puny-garbage-plate-and-i-raise-you-a" target="_blank"&gt;guillee&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I see your puny garbage plate and I raise you a typical venezuelan street vendor’s burger. This will either kill you or make you immortal. Ingredients (in order):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mayo, ketchup &lt;abbr title="and"&gt;&amp;&lt;/abbr&gt; mustard&lt;/li&gt;
&lt;li&gt;Onions&lt;/li&gt;
&lt;li&gt;Cabbage&lt;/li&gt;
&lt;li&gt;Potato chips&lt;/li&gt;
&lt;li&gt;More mayo, ketchup &lt;abbr title="and"&gt;&amp;&lt;/abbr&gt; mustard&lt;/li&gt;
&lt;li&gt;Avocado&lt;/li&gt;
&lt;li&gt;Tomato&lt;/li&gt;
&lt;li&gt;Hamburger patty&lt;/li&gt;
&lt;li&gt;Chorizo&lt;/li&gt;
&lt;li&gt;Chicken&lt;/li&gt;
&lt;li&gt;Bacon &lt;abbr title="and"&gt;&amp;&lt;/abbr&gt; eggs&lt;/li&gt;
&lt;li&gt;Cheese&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;(Warning: DO NOT eat this.)&lt;/p&gt;
&lt;/blockquote&gt;



&lt;p&gt;Now that IS a HAMBURGER :-D&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/248995805</link><guid>http://blog.romanandreg.com/post/248995805</guid><pubDate>Wed, 18 Nov 2009 16:48:32 -0800</pubDate></item><item><title>Randoms and Haskell</title><description>&lt;p&gt;Right now I’m on &lt;a href="http://book.realworldhaskell.org/read/programming-with-monads.html" target="_blank"&gt;chapter 15 of my RWH book&lt;/a&gt;. This one talks about problems that get complicated without the use of a Monad, one of them is the System.Random API of Haskell. I’m going to start by introducing two typeclasses that this module exports for clarity’s sake:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;RandomGen&lt;/code&gt;: a &lt;code&gt;RandomGen&lt;/code&gt; represents an state that holds the random input, I like to think of it like a stream of some sort (stdin, stdout).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Random a&lt;/code&gt;: This typeclass  is the abstraction of a Random value, all the common types of Haskell implement this typeclass (String, Integer, Float, Int, etc.)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What confused me for sometime, and I actually had to analyze throughly was how the interactions between the Random API and the IO Monad worked.&lt;/p&gt;

&lt;p&gt;The following code was the one that got me thinking:&lt;/p&gt;

&lt;pre&gt;&lt;code class="haskell"&gt;
import System.Random hiding (next)

randomsIO :: Random a =&gt; IO [a]
randomsIO =
    getStdRandom $ \g -&gt;
        let (a, b) = split g
        in (randoms a, b)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Where the IO [a] comes from?, if this anonymous function is returning a type 
&lt;code&gt;([a], RandomGen)&lt;/code&gt; instead of an &lt;code&gt;IO [a]&lt;/code&gt;. This got me really confused, at some point I thought that a &lt;code&gt;StdGen&lt;/code&gt; was an instance of an IO, but realized pretty quickly that IO is not a classtype, but an instance of Monad.&lt;/p&gt;

&lt;p&gt;The best way to figure this out was checking the types of &lt;code&gt;getStdRandom&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;getStdRandom :: (StdGen -&gt; (a, StdGen)) -&gt; IO a&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;getStdRandom&lt;/code&gt; receives as it’s first parameter, a function that receives a &lt;code&gt;StdGen&lt;/code&gt; and then return a tuple with the first position being some value of an anonymous type and second position being a (probably altered) StdGen, the return of the &lt;code&gt;getStdRandom&lt;/code&gt; is whatever the parameter function returned on the first parameter of the tupple, wrapped in an IO Monad.&lt;/p&gt;

&lt;p&gt;So the only way to work with a random function, is with the use of a &lt;code&gt;getStdRandom&lt;/code&gt; like interface, why is that?. I’m assuming this is a way to provide “factory functions” for random generated data, a pretty clever choice (yet confusing, at least for me). Another important reason is that this way it will keep things pure, you don’t have to use the IO Monad on the random functions definitions.&lt;/p&gt;

&lt;p&gt;Haskell is fun :-).&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/245157579</link><guid>http://blog.romanandreg.com/post/245157579</guid><pubDate>Sun, 15 Nov 2009 13:12:00 -0800</pubDate><category>haskell</category><category>basics</category><category>random</category><category>monads</category></item><item><title>chiguire:


El último mes pasó bastante rápido, ¿no? Un mes no...</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_kq3mudRPfm1qz748do1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://blog.ciroduran.com/post/242558463/el-ultimo-mes-paso-bastante-rapido-no-un-mes-no" target="_blank"&gt;chiguire&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;El último mes pasó bastante rápido, ¿no? Un mes no es mucho tiempo, pero es un hecho que la expectativa de vida (en los Estados Unidos) es de solamente 936 meses. Realmente la vida la veo distinta cuando puedo ver toda mi vida ante mi en la forma de 936 puntitos.&lt;/p&gt;
&lt;p&gt;Si cada punto representa un mes de tu vida tomada secuencialmente de izquierda a derecha, de arriba a abajo, he aquí algunos hitos/estadísticas interesantes.&lt;/p&gt;
&lt;p&gt;[…]&lt;/p&gt;
&lt;p&gt;&lt;b&gt;¡Ahora mueve ese culo y haz algo este mes!&lt;/b&gt;&lt;/p&gt;
&lt;/blockquote&gt;



&lt;p&gt;Wow… this is kinda heavy, I’ve spent 8 of those blobs learning Haskell :-s&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/242805087</link><guid>http://blog.romanandreg.com/post/242805087</guid><pubDate>Fri, 13 Nov 2009 11:26:02 -0800</pubDate></item><item><title>An implementation of a jQuery plugin using BDD</title><description>&lt;p&gt;On Web apps, sometimes we want to avoid unnecessary requests, one of those situations happens when there is a form that represents a record, and the values of this record haven’t changed. On these cases you would like the user to send an update request only when the values of the record’s form actually changed, this technique is called “dirty form”, and is a very common practice.&lt;/p&gt;

&lt;p&gt;I checked out some of the &lt;a href="http://www.elctech.com/articles/dirtyform-watching-for-form-changes-with-jquery" target="_blank"&gt;plugins&lt;/a&gt; out there to solve this problem, however, the functionality was sometimes sketchy. That’s why I started to implement my own solution, with a BDD approach using &lt;a href="http://github.com/nathansobo/screw-unit" target="_blank"&gt;Screw.Unit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this post we will be covering some BDD practices, and at the same time I will be explaining what this plugins may offer to your plugin toolbox. Let’s start by pointing out the structure of a jQuery plugins project:&lt;/p&gt;

&lt;pre&gt;
&lt;code&gt;jquery-plugins/
|-- lib/
|-- spec/
`-- vendor/&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;In the &lt;code&gt;lib/&lt;/code&gt; folder we will have all the plugins we would like to develop, the &lt;code&gt;spec/&lt;/code&gt; folder will have all the test-related files and the   &lt;code&gt;vendor/&lt;/code&gt; folder we will store all the frameworks needed in order to run the specs. In this project we will be using the &lt;a href="http://docs.jquery.com/Plugins/livequery" target="_blank"&gt;livequery&lt;/a&gt; plugin, the &lt;a href="http://github.com/nathansobo/screw-unit" target="_blank"&gt;Screw.Unit&lt;/a&gt; test framework and the &lt;a href="http://github.com/andykent/smoke/" target="_blank"&gt;Smoke&lt;/a&gt; mocking framework.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;spec/&lt;/code&gt; folder will be composed (at least) by this two core files:&lt;/p&gt;

&lt;pre&gt;
&lt;code&gt;spec/
  |-- suite.html
  `-- spec_helper.js&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;suite.html&lt;/code&gt; file will contain all the HTML scenarios needed for the jQuery plugins to work. This will look something like this (read the HTML comments):&lt;/p&gt;

&lt;pre&gt;
&lt;code class="html"&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;!-- first we import the jQuery framework --&gt;
    &lt;script src="../vendor/screw-unit/lib/jquery-1.3.2.js"&gt;&lt;/script&gt;

    &lt;!-- All vendor/ js files go here --&gt;
    &lt;script src="../vendor/jquery.livequery.js"&gt;&lt;/script&gt;

    &lt;!-- We import all the files needed by Screw.Unit --&gt;
    &lt;script src="../vendor/screw-unit/lib/jquery.fn.js"&gt;&lt;/script&gt;
    &lt;script src="../vendor/screw-unit/lib/jquery.print.js"&gt;&lt;/script&gt;
    &lt;script src="../vendor/screw-unit/lib/screw.builder.js"&gt;&lt;/script&gt;
    &lt;script src="../vendor/screw-unit/lib/screw.matchers.js"&gt;&lt;/script&gt;
    &lt;script src="../vendor/screw-unit/lib/screw.events.js"&gt;&lt;/script&gt;
    &lt;script src="../vendor/screw-unit/lib/screw.behaviors.js"&gt;&lt;/script&gt;

    &lt;!-- We import all the files needed by Smoke --&gt;
    &lt;script src="../vendor/smoke/lib/smoke.core.js"&gt;&lt;/script&gt;
    &lt;script src="../vendor/smoke/lib/smoke.mock.js"&gt;&lt;/script&gt;
    &lt;script src="../vendor/smoke/lib/smoke.stub.js"&gt;&lt;/script&gt;
    &lt;script src="../vendor/smoke/plugins/screw.mocking.js"&gt;&lt;/script&gt;

    &lt;!-- Here we include all our plugins from the lib/ folder --&gt;
    &lt;script src="../lib/jquery.when_changed.js"&gt;&lt;/script&gt;

    &lt;!-- We import all the spec files from the spec/ folder --&gt;
    &lt;script src="spec_helper.js"&gt;&lt;/script&gt;
    &lt;script src="jquery.when_changed_spec.js"&gt;&lt;/script&gt;

    &lt;!-- We include the stylesheet from Screw.Unit to have nice looking test results --&gt;
    &lt;link rel="stylesheet" href="../vendor/screw-unit/lib/screw.css"&gt;

    &lt;!-- 
    We create a class scenario that will hold all the DOM needed for a test suite to work, but hides it from the 
    test HTML 
    --&gt;
    &lt;style&gt;
      .scenario {
        position: absolute; 
        left: -9999
      }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;!-- This will be the place were all the test will grab the elements --&gt;
    &lt;div id="sandbox" class="scenario"&gt;&lt;/div&gt;

    &lt;!-- 
      We will have clean states (fixtures) for the plugins, all of them will
      have the postfix "-clean-state" to specify that this is a virgin state of a test environment
      In this example, for each test case we execute, the  "when-changed-clean-state" contents will be assigned to the 
      "sandbox" content.
    --&gt;
    &lt;div id="when-changed-clean-state" class="scenario"&gt;
      &lt;form method="GET"&gt;
        &lt;input type="text" name="text" value="some value"&gt;
        &lt;textarea name="textarea"&gt;some value&lt;/textarea&gt;
        &lt;input type="checkbox" name="checkbox" value="1" checked&gt;
        &lt;input type="radio" name="radio" class="first" value="one" checked&gt;
        &lt;input type="radio" name="radio" class="second" value="two"&gt;
        &lt;select name="select"&gt;
          &lt;option value="1" class="one" selected&gt;One&lt;/option&gt;
          &lt;option value="2" class="two"&gt;Two&lt;/option&gt;
        &lt;/select&gt;
      &lt;/form&gt;
    &lt;/div&gt;

  &lt;/body&gt;
&lt;/html&gt;
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;spec_helper.js&lt;/code&gt; file will have all the common setup for the test environment.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
// This function well put the HTML contents of the clean-state we are working on to the sandbox
function resetDOM(id) {
  $("#sandbox").html($("#" + id  + "-clean-state").html());
}

// If we want to put some global setup and teardown code, here is the place to put it
// for setup, inside the before block
// for teardown, inside the after block
Screw.Unit(function() {

  before(function() { 
  });

  after(function(){
  });

});
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;So, now that we have established our test environment, its time to do the implementation of the plugin, we start by defining the specs for it on the &lt;code&gt;spec/jquery.when_changed_spec.js&lt;/code&gt; file, this file will represent the tests made to the &lt;code&gt;lib/jquery.when_changed.js&lt;/code&gt; file.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
Screw.Unit(function(){

  describe("$.fn.whenChanged", function(){
    
    // We establish a new clean state for each test case
    // with a resetDOM invocation before each spec.
    before(function(){
      resetDOM("when-changed");
    });

    describe("invoked on an input:text", function(){
      it("should invoke the given function when value has changed on keyup");
      it("should not invoke the given function when value has not changed on keyup");
      it("should not consider new blank text on the edges as a new text");
      it("should call the reverse callback when the value returns to the same");
    });

  });

});  
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;So, in the given spec file we specified (for now) the behavior of the plugin when we are interacting with an input text field. we expand this definitions by giving actual test code to each spec.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
describe("invoked on an input:text", function(){
  
  // first we define the setup for each spec, assign the plugin behavior to an input
  before(function(){
    // When the value of the input:text change it's original value, an alert will be called.
    $("#sandbox input:text").whenChanged(function(){
      window.alert("The input text has changed it's value");
    });
  });
  
  it("should invoke the given function when value has changed on keyup", function(){
    mock(window).should_receive("alert").exactly(1).with_arguments("The input text has changed it's value");
    // the event checking will be raised by a keyup event
    $("#sandbox input:text").val("some random value different than the original").trigger("keyup");
  });
});
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;On the previous code, we are using the &lt;a href="http://github.com/andykent/smoke/" target="_blank"&gt;Smock’s&lt;/a&gt; method &lt;code&gt;mock&lt;/code&gt;, this will do a temporary replacement of the &lt;code&gt;window.alert&lt;/code&gt; function, and will check that this is being called exactly 1 time, and with the argument “The input text has changed it’s value”. This way we can check that the callback assigned on the &lt;code&gt;whenChanged&lt;/code&gt; invocation was actually being called when necessary. Next step is to implement a whenChanged function that is simple enough to make the spec pass.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
(function($){
  
  $.fn.whenChanged = function(callback) {
    // we store the old values on each element
    $(this).each(function(){
      $(this).data("jquery.whenChanged.oldValue", $(this).val());
    });
    
    // we assign a keyup event binding using livequery
    $(this).livequery("keyup", function(){
      var oldValue = $(this).data("jquery.whenChanged.oldValue");
      var newValue = $(this).val();
      if (oldValue !== newValue) {
        callback.apply(this);
      }
    });
    
    return this;
  };
  
})(jQuery);
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;So we implemented the most simple solution possible that makes our specs run (Just check the suite.html file on a browser and you should have the feedback right away), now we continue developing adding more specs and changing the code as we go.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
it("should not invoke the given function when value has not changed on keyup", function(){
  mock(window).should_receive("alert").exactly(0);
  $(this).trigger("keyup");
});
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;We added other method that didn’t need any code to be changed, in this case we are checking that &lt;code&gt;window.alert&lt;/code&gt; is not being called at all. Awesome let’s continue with the next spec.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
it("should not consider new blank text on the edges as a new text", function(){
  mock(window).should_receive("alert").exactly(0);
  $(this).val("  some value   ").keyup();
});
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;At this point, this specs fails with our current implementation, we are not stripping the spaces on the border, this can be fixed easily.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
$.fn.whenChanged = function(callback) {

  $(this).each(function(){
    // NOTICE: Invoking $.trim here!
    $(this).data("jquery.whenChanged.oldValue", $.trim($(this).val()));
  });
  
  $(this).livequery("keyup", function(){
    var oldValue = $(this).data("jquery.whenChanged.oldValue");
    // NOTICE: Invoking $.trim here!
    var newValue = $.trim($(this).val());
    if (oldValue !== newValue) {
      callback.apply(this);
    }
  });
  
  return this;
};
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;Now that we have stripped the spaces on the old value storage, when we check the stripped new value, it will still be the same as the old value and the callback won’t be called. Finally we have to add the reverse callback functionality.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;

before(function(){
  // When the value of the input:text change it's original value, an alert will be called.
  $("#sandbox input:text").whenChanged(
    function(){
      window.alert("The input text has changed it's value");
    },
    function(){
      window.alert("The input returned to the same value");
    }
  );
})

it("should call the reverse callback when the value returns to the same", function(){
  mock(window).should_receive("alert").exactly(1).with_arguments("The input text has changed it's value");
  $(this).val("Changing input value").keyup();
  mock(window).should_receive("alert").exactly(1).with_arguments("The input returned to the same value");
  $(this).val("some value").keyup();
});
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;So at this point, this spec will break previous specs, this is because the alert function is being called, even when the value is not changed, so &lt;code&gt;mock(window).should_receive("alert").exactly(0)&lt;/code&gt; won’t work.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
// NOTICE: we change this to alert with an specific argument.

it("should not invoke the given function when value has not changed on keyup", function(){
  mock(window).should_receive("alert").exactly(0).with_arguments("The input text has changed it's value");
  $(this).trigger("keyup");
});

it("should not consider new blank text on the edges as a new text", function(){
  mock(window).should_receive("alert").exactly(0).with_arguments("The input text has changed it's value");
  $(this).val("  some value   ").keyup();
});
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;At the same time we need to add a new callback parameter to the &lt;code&gt;whenChanged&lt;/code&gt; method.&lt;/p&gt;

&lt;pre&gt;
&lt;code class="javascript"&gt;
$.fn.whenChanged = function(callback, reverseCallback) {
  $(this).each(function(){
    $(this).data("jquery.whenChanged.oldValue", $.trim($(this).val()));
  });

  // we assign a keyup event binding using livequery
  $(this).livequery("keyup", function(){
    var oldValue = $(this).data("jquery.whenChanged.oldValue");
    var newValue = $.trim($(this).val());
    if (oldValue !== newValue) {
      callback.apply(this);
    }
    else {
      reverseCallback.apply(this);
    }
  });

  return this;
};  
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;Now this code should run successfully and we now have covered our bases with &lt;code&gt;input:text&lt;/code&gt; selectors, I could talk about how added support to other form input types, but I rather not in order to keep this short. Some thoughts I can share though is that the &lt;code&gt;whenChanged&lt;/code&gt; method changed &lt;em&gt;A LOT&lt;/em&gt;, after realizing that each type of input has it’s own gotchas, I created an specific &lt;code&gt;whenChange&lt;/code&gt; method for each kind of form element. All in all… I was always sure that nothing broke on this process because the specs always told me if anything I was doing added any bug. Uhmmm the smell of &lt;em&gt;good test code&lt;/em&gt; on late nights is incredible.&lt;/p&gt;

&lt;p&gt;I hope this post can help you get some guidelines on how to get started with development of Javascript code using BDD, one word of caution though: testing effects in Javascript is a nasty challenge, you may like to pass an option to your method specifying if you want effects or not. check your code doesn’t depend on &lt;code&gt;setTimeout&lt;/code&gt; invocations, take my word, is a &lt;em&gt;BIG PAIN&lt;/em&gt; to test that.&lt;/p&gt;

&lt;p&gt;Good luck with your BDD sessions.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/201309897</link><guid>http://blog.romanandreg.com/post/201309897</guid><pubDate>Wed, 30 Sep 2009 17:08:23 -0700</pubDate><category>jquery</category><category>plugins</category><category>BDD</category><category>tutorial</category><category>javascript</category><category>screw.unit</category></item><item><title>"Object is not missing &lt;ClassName&gt;!" + Amazon::S3</title><description>&lt;p&gt;Today at the office, we had one of the weirdest Rails errors I have ever encountered&lt;/p&gt;
&lt;blockquote&gt;rails-project/vendor/rails/activesupport/lib/active_support/dependencies.rb:417:in `load_missing_constant’: Object is not missing constant Photo! (ArgumentError)&lt;/blockquote&gt;
&lt;p&gt;We looked up into the stack trace and we found the problem was being caused by this line:&lt;/p&gt;
&lt;blockquote&gt;vendor/rails/activerecord/lib/active_record/base.rb:2195:in `compute_type’&lt;/blockquote&gt;
&lt;p&gt;When we checked the code, we found a dead-end with a class_eval invocation (oh meta-programming damn you on debugging times)&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;# Returns the class type of the record using the current module as a prefix. So descendants of
# MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.
def compute_type(type_name)
  modularized_name = type_name_with_module(type_name)
  silence_warnings do
    begin
      class_eval(modularized_name, __FILE__, __LINE__)
    rescue NameError
      class_eval(type_name, __FILE__, __LINE__)
    end
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This error was caused in the first place because we created a new environment for running the app, we checked the files on config/environments/ to see the differences between them; we didn’t find that many, commenting the few lines that were different didn’t make any change.&lt;/p&gt;
&lt;p&gt;A (very long) while later, &lt;b&gt;we noticed that the config/amazon_s3.yml file didn’t have a set of keys for the environment we were trying to run, after adding them everything went by pretty smoothly&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;What pissed me off (&lt;a href="http://www.ideesign.com.br/pedro/?p=33" target="_blank"&gt;and probably this guy as well&lt;/a&gt;) is that the error displayed didn’t make any sense at all, wtf is “Object is not missing constant Photo!”?, seriously? &lt;a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/305480" target="_blank"&gt;I investigated a bit further&lt;/a&gt; and it seems to be related with the autoload feature of the Rails framework, geez thanks for the cryptic error message ¬¬&lt;/p&gt;
&lt;p&gt;I hope this info helps some unfortunate developer out there.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/184040716</link><guid>http://blog.romanandreg.com/post/184040716</guid><pubDate>Wed, 09 Sep 2009 16:50:30 -0700</pubDate><category>bug</category><category>rails</category><category>amazons3</category></item><item><title>The jQuery DSL</title><description>&lt;p&gt;For the last 4 months I’ve been using jQuery for Javascript development. To be honest, I didn’t got started before with jQuery because it didn’t seem too practical to me (no Class approach), but after looking carefully at the plugin model, it was truly a revelation of a good API for development.&lt;/p&gt;
&lt;p&gt;So I started to accommodate to the jQuery’s way of things, and one of the API’s that got my interest in the past 2 months was the &lt;i&gt;traversal&lt;/i&gt; one. I mean, what were those methods .find(), .end() and .endSelf(). Why I would go and use those methods when my standard code was always like:&lt;/p&gt;
&lt;pre&gt;&lt;code class="javascript"&gt;$("#container .sub-container .items").click(..);
$("#container .sub-container .other-items").hover(..);
$("#container form.create-item").ajaxForm(..);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and never needed them. I guessed that the way I was doing things wasn’t the jQuery’s way; I mean, I could rewrite the previous code like this instead:&lt;/p&gt;
&lt;pre&gt;&lt;code class="javascript"&gt;$("#container").
  find(".subcontainer").
    
    find(".items").
      click(..).
    end().
    
    find(".other-items").
      hover(..).
    end().
    
  end().
  
  find("form.create-item").
    ajaxForm().
  end().
end();&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Of course at first sight it didn’t look that good, but I was not too sure that it didn’t look bad either, it was just different. So I just let time tell me if it was good enough. I left that implementation and came back a month later, the &lt;b&gt;WTF/min&lt;/b&gt; were almost none, I did still understand the code right away, it actually looked like a CSS funky syntax to me.&lt;/p&gt;
&lt;p&gt;After deciding that it was indeed a good way to do things, I just started to look at the &lt;b&gt;pros &amp; cons&lt;/b&gt; of this funky syntax vs the normal syntax I used before. This is what I got&lt;/p&gt;
&lt;p&gt;Funky syntax Pro’s&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The order of the code is in a hierarchical way, representing the DOM position. &lt;/li&gt;
&lt;li&gt;If the main container is not there (e.g #container) the child selectors will not be called, making the code “more efficient”.&lt;/li&gt;
&lt;li&gt;When multiple elements have the same behavior, a new HTML class that represented the behavior is exposed. For example, if you require 2 out of 3 forms in a container to be an AJAX form, you wouldn’t replicate the same instructions to each selector, instead you will create a common selector for the 2 forms by adding a new HTML class.&lt;/li&gt;
&lt;li&gt;The lookup for elements will be faster on every nesting, that is because the lookup will be done from the parent, not from the main document.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Funky syntax Con’s&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;.live() method wouldn’t work, this method only works on un-nested selectors. However, you may use the livequery plugin.&lt;/li&gt;
&lt;li&gt;Initially it is a difficult syntax for other developers, 3 out of 4 developers in my team did say that it was confusing, but as I stated before, probably is more &lt;i&gt;different&lt;/i&gt; than confusing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Classic syntax Pro’s&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Would be the approach used by most of developers.&lt;/li&gt;
&lt;li&gt;.live() can be used without any problems.&lt;/li&gt;
&lt;li&gt;Probably there are other benefits that I’m taking from granted ¬_¬.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Classic syntax Con’s&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A lookup from the HTML document for every element.&lt;/li&gt;
&lt;li&gt;Lookups are being made even when there is no parent element. (This could be easily avoided with an if statement, but still). &lt;/li&gt;
&lt;li&gt;It’s harder to spot the &lt;b&gt;common behavior, different selectors&lt;/b&gt; factor.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see, there are some benefits and some pros attached to the use of this jQuery DSL; I don’t know if this is the way to go but I’m certain that I’m not the first one who came up with this (I haven’t read any book of jQuery yet). If you could leave some thoughts about what is the one you prefer and why, it would give much value to this discussion.&lt;/p&gt;
&lt;p&gt;Until next time.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/182142626</link><guid>http://blog.romanandreg.com/post/182142626</guid><pubDate>Mon, 07 Sep 2009 11:27:30 -0700</pubDate><category>jquery</category><category>dsl</category><category>javascript</category><category>thoughts</category></item><item><title>(ActiveRecord::Callbacks + acts_as_taggable).gotcha?</title><description>&lt;p&gt;Have you ever been in a situation where you have this strange bug, that takes you more time than expected to find out what (tha hell) is  going on? That happened to us (me and my team) last Rails Rumble when we were trying to have some stuff done after the creation of an element that had some tags associated to it.&lt;/p&gt;
&lt;p&gt;The code looked something like the following:&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;## app/models/entry.rb
class Entry &lt; ActiveRecord::Base
  
  ##################
  ### Extensions ###
  ##################
  acts_as_taggable
  
  #################
  ### Callbacks ###
  #################
  after_create :do_something_with_tags
  
  def do_something_with_tags
    self.tags.each do |tag|
      # do something with tag
    end
  end
  
  protected :do_something_with_tags
  
end

## app/controllers/entries_controller.rb
class EntriesController &lt; ApplicationController
  # ...
  def create
    @entry = Entry.new(params[:entry])
    entry.tag_list = params[:tags]
    if entry.save
      # success
    else
      # failure
    end
  end
  # ...
end&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The problem was that the &lt;b&gt;do_something_with_tags&lt;/b&gt; callback was not doing what it supposed to. At first we thought it was a problem with our implementation, but after some debugger sessions, we found out what the real problem was. The &lt;b&gt;tags&lt;/b&gt; array didn’t correspond with the value of the the &lt;b&gt;tag_list&lt;/b&gt; that was being assigned on the controller level.&lt;/p&gt;
&lt;p&gt;After having some thoughts I decided to go inside the acts_as_taggable_redux source code (the version of acts_as_taggable that we were using), and I found something pretty peculiar related to the tag creation; This tags were being created on an &lt;b&gt;after_save&lt;/b&gt; callback. The extract of the acts_as_taggable looked something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;def acts_as_taggable(options = {})
  has_many :taggings, :as =&gt; :taggable, :dependent =&gt; :destroy, :include =&gt; :tag
  has_many :tags, :through =&gt; :taggings, :order =&gt; 'LOWER(name) asc', :select =&gt; "DISTINCT tags.*"

  after_save :update_tags

  extend ActiveRecord::Acts::Taggable::SingletonMethods
  include ActiveRecord::Acts::Taggable::InstanceMethods
end&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can tell, an after_save was invoking this callback &lt;b&gt;update_tags&lt;/b&gt;; after looking more closely, this method was the one that created the tag list, (the one we needed for our custom callback &lt;b&gt;do_something_with_tags&lt;/b&gt; to work). So I checked in &lt;a target="_blank" title="ActiveRecord::Callbacks" href="http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html"&gt;the Rails documentation&lt;/a&gt; page the precedence of callbacks just to be sure which one was being invoked first. Our main problem was that our callback was an &lt;b&gt;after_create&lt;/b&gt;, and those get executed &lt;i&gt;after&lt;/i&gt; the &lt;b&gt;after_save&lt;/b&gt; callbacks.&lt;/p&gt;
&lt;p&gt;To solve this issue, we simply called the &lt;b&gt;update_tags&lt;/b&gt; callback directly on the first line of our callback, making the final &lt;b&gt;do_something_with_tags&lt;/b&gt; look something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;def do_something_with_tags
  update_tags # invoke callback by hand
  self.tags.each do |tag|
    # do something with tag
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Because the acts_as_taggable library is so well implemented (at least the redux version, I’m not sure about others), the second time the &lt;b&gt;update_tags&lt;/b&gt; method was being invoked simply returned without repeating the process of tag creation again.&lt;/p&gt;
&lt;p&gt;Small issues like this are the ones that keep you having debugging fun for hours. I hope this may help you if you are this kind of trouble.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/176944361</link><guid>http://blog.romanandreg.com/post/176944361</guid><pubDate>Tue, 01 Sep 2009 00:06:00 -0700</pubDate><category>rails</category><category>gotcha</category><category>ruby</category></item><item><title>Rails Rumble 2009: The competition</title><description>&lt;p&gt;So… it happened, the last weekend was the &lt;a target="_blank" title="Rails Rumble Page" href="http://r09.railsrumble.com"&gt;Rails Rumble&lt;/a&gt;, a really kick ass event that made me squeeze all my skills and drop all my social life for 48 hours. I learned a lot of lessons (some the hard way).&lt;/p&gt;
&lt;h3&gt;The Event Organization.&lt;/h3&gt;
&lt;p&gt;The competition organization was OUTSTANDING, starting with the registration/team page, everything worked really well. At the competition, the little details stand out pretty quickly, and they made me &lt;a target="_blank" title="Shouldn't you be rumbling?" href="http://img.skitch.com/20090825-86d886shpekmym3gdy2qmew9nw.jpg"&gt;laugh&lt;/a&gt; &lt;a target="_blank" title="That cat has some talent eh?" href="http://skitch.com/romanandreg/bhctr/freaking-rumble-organization-team"&gt;a lot&lt;/a&gt;. Big brags for you guys.&lt;/p&gt;
&lt;p&gt;I’ve read the post from the &lt;a target="_blank" title="Intredia Blog Post" href="http://intridea.com/2009/8/24/thingivore-rails-rumble-post-mortem"&gt;intredia guys&lt;/a&gt;, it got me thinking that it will also be a good thing to share some “Good Idea, Bad Idea” &lt;a target="_blank" title="Good Idea, Bad Idea" href="http://www.youtube.com/watch?v=f8PhzrmBgMI"&gt;thougths&lt;/a&gt; (of course, I’m not going to repeat what they have told you already).&lt;/p&gt;
&lt;h3&gt;1. Good Idea: Know your plugins&lt;/h3&gt;
&lt;p&gt;For the love of God, be sure that the plugins you are planning to use actually do what you are expecting them to do. It happened that I wanted to do (and at the end DID!)  a twitter authentication for the system, I didn’t wanted to use TwitterAuth because it is to invasive, it assumes things, makes a lot of stuff and I don’t feel comfortable with it.&lt;/p&gt;
&lt;p&gt;I thought.. “Gee this oauth-plugin looks awesome, and it has support for Twitter too!”, what I found out after actually trying to use it (on the rumble) was that it is not intended to do authentication, it’s intended only to use the Twitter API via oauth.&lt;/p&gt;
&lt;p&gt;Don’t get me wrong, the plugin is AWESOME in what it does, It was actually my fault because I didn’t pay attention to their README when they said:&lt;/p&gt;
&lt;blockquote&gt;It requires an authentication framework such as acts_as_authenticated, restful_authentication or restful_open_id_authentication&lt;/blockquote&gt;
&lt;p&gt;At some point, I didn’t assume that the purpose of the plugin didn’t include authentication. So remember, think it twice before using planning to use plugin you don’t know that well (a.k.a used before).&lt;/p&gt;
&lt;h3&gt;2. Bad Idea: Don’t use an editor that you are still learning how to use.&lt;/h3&gt;
&lt;p&gt;This recommendation has a little bit of it’s history, it turns out that since 3 weeks ago, I dished Textmate in favor of Vim (Don’t throw tomatoes at me please!, I don’t regret it, say whatever you want :-p), Textmate is awesome, but when I started to use Vim, I felt all the love right away (after customizing a little bit of course).&lt;/p&gt;
&lt;p&gt;The problem was that, to use this editor you need to learn and use &lt;b&gt;a lot of commands&lt;/b&gt;. At Sunday afternoon, when your brain is starting to throw SEGFAULTS because you haven’t slept that well, the Vim goodness didn’t flow (I guess this happens when you are still thinking on the commands before actually using them on normal basis).&lt;/p&gt;
&lt;h3&gt;3. Good Idea: Provision your workspace with all the fast food, energy drinks and snacks you can suffice.&lt;/h3&gt;
&lt;p&gt;You know it, body needs food to do it’s thing… FullThrotle drinks kept me up on night time.&lt;/p&gt;
&lt;h3&gt;4. Bad Idea (If you are actually planning to win): Go without a sys-admin and a designer&lt;/h3&gt;
&lt;p&gt;The perfect balance is 2 proficient Ruby coders, 1 sys-admin, and a Heck of a good designer, with that you should have all your needs covered (ah… and of course a good project to do).&lt;/p&gt;
&lt;p&gt;Besides that I have a really good war story related to ActiveRecord callbacks caveats (I will have a blog post for this soon, promise), and &lt;a title="Paperback: A post mortem evaluation for judges" href="http://blog.romanandreg.com/post/171389201/paperback-rails-rumble-2009" target="_blank"&gt;the post-mortem evaluation of Paperback for judges&lt;/a&gt;, the app that we intended to create and partially did.&lt;/p&gt;
&lt;p&gt;Thank you RailsRumble team for such a fun and great time, I had a blast… see you next year.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/171390590</link><guid>http://blog.romanandreg.com/post/171390590</guid><pubDate>Tue, 25 Aug 2009 09:28:08 -0700</pubDate><category>rails</category><category>rumble</category><category>paperback</category></item><item><title>RailsRumble 2009. Paperback: A Post Mortem evaluation</title><description>&lt;p&gt;So, to make life easier to the judges of my application, I will straight down the main features and the issues I’ve found along the way. We start now.&lt;/p&gt;
&lt;h3&gt;What it supposed to be.&lt;/h3&gt;
&lt;p&gt;&lt;a title="Paperback Page" href="http://paperback.r09.railsrumble.com/signin" target="_blank"&gt;Paperback&lt;/a&gt; in &lt;b&gt;one sentence&lt;/b&gt;: “A day activity log manager with twitter-like interface”.&lt;/p&gt;
&lt;p&gt;Paperback may look very similar to twitter when you log in, please be patient enough to pass through that. Paperback is intended to do something different.&lt;/p&gt;
&lt;h4&gt;1. You use Paperback when you are stating some activity you are doing in your day to day work&lt;/h4&gt;
&lt;p&gt;You will have the entries organized by date, so you can navigate to an specific day and see what you did for audit purposes.&lt;/p&gt;
&lt;h4&gt;2. You can categorize the entries&lt;/h4&gt;
&lt;p&gt;Some entries are related to projectX, some others to bug #123 of projectY. With categorization is easy for you to check entries  related to an specific activity.&lt;/p&gt;
&lt;h4&gt;3. You specify time factor to the entries:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;You can state an entry representing an activity that took you H hours and M minutes to complete&lt;/li&gt;
&lt;li&gt;You can state an entry representing an activity that you think will take you H hours and M minutes to complete&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This way, you can do time estimates on your entries, and actually get some useful insight data out of it. Sadly , we didn’t have enough time to represent good charts about that data we are recollecting :-(.&lt;/p&gt;
&lt;h4&gt;4. Entries can be Todo items:&lt;/h4&gt;
&lt;p&gt;Entries that had an estimation date could happen to be &lt;b&gt;todos&lt;/b&gt;, so you could go to a pending page when you see all this entry representing a todo list instead of an activity log entry date. The only way you could  check an entry as completed, was when you specify the actual time you took to finish it.&lt;/p&gt;
&lt;h4&gt;5. The social twitter factor&lt;/h4&gt;
&lt;p&gt;Normally you would use this as an activity log, but what would happen if people actually care of what you are doing, say your supervisor or team members?. I wanted to use twitter for this, but I considered that people that followed me for other reasons (social life, ruby community, etc) wouldn’t care about my progress on the bug #123 from the project XYZ. With Paperback we made explicit in which channels I want to follow a person.&lt;/p&gt;
&lt;h4&gt;6. Keep your identity&lt;/h4&gt;
&lt;p&gt;As I said before, We wanted to use twitter for this, and in some cases we still want to, that’s why we use the Twitter authentication in the first place, to keep the identity you have from twitter. We added OpenID just to support more ways to get you in the project for judging purposes, as soon as the competition ends, the OpenID authentication will go out.&lt;/p&gt;
&lt;h3&gt;What we have.&lt;/h3&gt;
&lt;p&gt;Sadly everything is not there, as its supposed to be on the final product, but we are proud to say that at least the core features are there, not polished nor well designed, but there.&lt;/p&gt;
&lt;h4&gt;The bad&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Header titles… there is not a single one, it hurts so bad to see it&lt;/li&gt;
&lt;li&gt;The update entry feedback is not well behaved, the entry will be updated, but you won’t be able to see it that well.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;The Ugly&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;We didn’t specify user Timezones, we gather the info from OpenID and Twitter, but we didn’t actually assign the Timezone to the framework, you will find out pretty quickly if you are way off UTC (as in my case)&lt;/li&gt;
&lt;li&gt;Public pages are not working, a last minute change added the current_user username on the rightbar, when there is no authenticated user it stills try to get the username, causing a NoMethodFoundError on the Nil class.&lt;/li&gt;
&lt;li&gt;The update process won’t work if you don’t specify a valid command, as soon as you hit update, you will see the throbber rolling and rolling.&lt;/li&gt;
&lt;li&gt;The OpenID process seems to fail, probably a last minute change added a bug&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To finish the entry, I will post a short screencast showing some of the features, we hope you find this product helpful, we surely do, Thanks for syntoynizying.&lt;/p&gt;
&lt;p&gt;
&lt;object height="345" width="560" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"&gt;
&lt;param name="flashvars" value="i=6440"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="src" value="http://screenr.com/Content/assets/screenr_0817090731.swf"&gt;
&lt;embed height="345" width="560" src="http://screenr.com/Content/assets/screenr_0817090731.swf" allowfullscreen="true" flashvars="i=6440" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/171389201</link><guid>http://blog.romanandreg.com/post/171389201</guid><pubDate>Tue, 25 Aug 2009 09:25:00 -0700</pubDate><category>paperback</category><category>railsrumble</category><category>rails</category></item><item><title>gesteves:

Make Bono History print:

Bono, the lead singer for...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kodsw4UyxA1qz4ueho1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://blog.gesteves.com/post/162994860/make-bono-history" target="_blank"&gt;gesteves&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.nodaysoff.com/shop.php?caption=Make%20Bono%20History&amp;desc=300%20x%20240mm.%20Unframed%20typographic%20print.%20Hand%20printed%20by%20Adams%20of%20Rye%20on%20Fenner%20Colourset%20120gsm%20uncoated%20paper%20(100%%20recycled).%20Edition%20of%2060.%20Signed%20and%20numbered.&amp;code=NDOpr009&amp;price=20&amp;large=image%20library/SHOP/Print09.jpg" target="_blank"&gt;Make Bono History print&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Bono, the lead singer for U2, is performing a concert in Ireland. As part of his promotion for the anti-poverty campaign in which he plays such a prominent part, he stops singing and starts clicking his fingers, repeating the action every three seconds. The crowd falls silent, and after a while, Bono speaks:&lt;/p&gt;
&lt;p&gt;&lt;q&gt;Every time I click my fingers, a child dies unnecessarily from a preventable disease.&lt;/q&gt;&lt;/p&gt;
&lt;p&gt;After he has been doing this for a few minutes to a largely silent and transfixed audience, someone helpfully shouts out:&lt;/p&gt;
&lt;p&gt;&lt;q&gt;Stop clicking your fucking fingers then.&lt;/q&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;</description><link>http://blog.romanandreg.com/post/163077192</link><guid>http://blog.romanandreg.com/post/163077192</guid><pubDate>Fri, 14 Aug 2009 14:52:58 -0700</pubDate></item><item><title>My Crush On Vim &lt;3</title><description>&lt;p&gt;So it has been a while since I don’t talk about vi/vim… I sadly had at some point to leave behind my goal to use vi/vim to work in more important things in the office.&lt;br/&gt;&lt;br/&gt;But last week I regained my will to learn vim; and a lot of people at the office asked me why I do this… well what I’ve tell to them (and to myself) is that I needed to learn it because I don’t know in which platform I will be working at some point and Vim is one of those editors that is reliable on most of them (and is not made in Java).&lt;br/&gt;&lt;br/&gt;So, one of the reasons I didn’t use Vim (even if I learned many of the commands) is that I didn’t know how to manage multiple files at the same time, after making a serious commitment to learn how to manage multiple files on the Vim environment, I got almost all my bases covered.&lt;br/&gt;&lt;br/&gt;What I’m going to do know is give you all the steps I did in order to get familiar with vim, and finally what got me to use it as a replacement of TextMate (sometimes I go back to use some special features of TextMate, not that often though).&lt;br/&gt;&lt;br/&gt;First of all, find yourself a good reference to get started, whatever works best for you… most of the tutorials are free, some of them are not. I did buy the book from O’Reilly&lt;a target="_blank" title="amazon link" href="http://www.amazon.com/gp/product/059652983X/ref=s9_simz_gw_s0_p14_i1?pf_rd_m=ATVPDKIKX0DER&amp;pf_rd_s=center-1&amp;pf_rd_r=1A1MA6DXYHTCMFVAGEE3&amp;pf_rd_t=101&amp;pf_rd_p=470938131&amp;pf_rd_i=507846"&gt; Learning the vi and Vim Editors&lt;/a&gt;, because I wanted a well structured set of contents to learn from, I can say that is a great book to get started on the Vi field, and to get to know how to use the niceties of Vim. However, this book is mainly for first-time users, most of the high advanced stuff is online, but in order to understand that, first you need to understand the basics that this books covers.&lt;br/&gt;&lt;br/&gt;After spending like 3 months reading (and practicing) all the commands and exercises from the O’Reilly Book, I started to look out how I could integrate easily my work environment with the Vim editor. Thanks to the developers of the &lt;a target="_blank" title="Rails vim webpage" href="http://rails.vim.tpope.net/"&gt;rails.vim&lt;/a&gt;, &lt;a target="_blank" title="NERDTree vim.org link" href="http://www.vim.org/scripts/script.php?script_id=1658"&gt;NERDTree&lt;/a&gt; and &lt;a target="_blank" title="FuzzyFinder vim.org link" href="http://www.vim.org/scripts/script.php?script_id=1984"&gt;FuzzyFinder&lt;/a&gt; plugins, it was not hard enough to get the Vim editor to work along. Also there were some good references from &lt;a target="_blank" title="AkitaOnRails Post about Vim" href="http://akitaonrails.com/2009/01/04/rails-on-vim-in-english"&gt;Fabio Akita (akitaonrails)&lt;/a&gt;, &lt;a target="_blank" title="Griffing::Blog post about vim and ruby" href="http://griffin.oobleyboo.com/archive/vim-tricks-for-ruby-and-rails-developers/"&gt;Jason Stirk&lt;/a&gt; and &lt;a target="_blank" title="The Bucklogs Here post about vim" href="http://weblog.jamisbuck.org/2008/10/10/coming-home-to-vim"&gt;Jamis Buck&lt;/a&gt; from the Ruby/Rails Community that helped me a lot in the process of installing all the things I needed.&lt;/p&gt;
&lt;p&gt;After learning a lot of the cool stuff about navigation between files using ctags and the rails.vim plugin (watching the Fabio Akita screencast), I felt like I was about to stop using TextMate, there was just a really small thing holding me back. I really didn’t like the themes of vim; that’s why I took the time and effort to learn how to do colorschemas in Vim, and created the sunburst theme for the vim (the one I normally use in TextMate); The result… pure awesomeness, if you would like to use it, don’t hesitate to download it from &lt;a target="_blank" title="Sunburst theme for Vim" href="http://gist.github.com/166145"&gt;this gist I made&lt;/a&gt;. Here is an &lt;a target="_blank" title="Sunburst theme for Vim Screenshot" href="http://img.skitch.com/20090811-ti4b27qbftjybmau32ruygjjwx.jpg"&gt;screenshot&lt;/a&gt; to get you convinced ;-).&lt;br/&gt;&lt;br/&gt;To summarize, the steps to get started wih Vim (on the Mac) are:&lt;br/&gt;&lt;br/&gt;1. Download and install &lt;a target="_blank" title="MacVim Page" href="http://code.google.com/p/macvim/"&gt;MacVim&lt;/a&gt;.&lt;br/&gt;2. Download the .vim configuration files from github, either &lt;a target="_blank" title="roman's vimfiles project on github " href="http://github.com/roman/vimfiles/tree/master"&gt;from my account&lt;/a&gt; or the one from &lt;a target="_blank" title="Fabio Akita's vimfiles github project" href="http://github.com/akitaonrails/vimfiles/tree/master"&gt;Fabio Akita&lt;/a&gt; (mine is a fork of his with a few other niceties).&lt;br/&gt;3. Follow the directions on the README of the github project.&lt;br/&gt;4. Start coding, you have everything you need there.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/160800533</link><guid>http://blog.romanandreg.com/post/160800533</guid><pubDate>Tue, 11 Aug 2009 14:59:44 -0700</pubDate><category>vim</category><category>tutorial</category><category>vi</category></item><item><title>chiguire:

darkana:

Help the #freemediave campaign on twitter....</title><description>&lt;img src="http://24.media.tumblr.com/Li1vYqhocqpbl0tfQ3voomwWo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://blog.ciroduran.com/post/155279285/darkana-help-the-freemediave-campaign-on" target="_blank"&gt;chiguire&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://darkana.tumblr.com/post/155180282/help-the-freemediave-campaign-on-twitter-where" target="_blank"&gt;darkana&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Help the #freemediave campaign on twitter. Where in Venezuela the government is closing down radio stations, takes away 2 coffee plants and tries to approve the Law against media crimes (among other things). The translation of the law can be found here: &lt;a href="http://artists4freedom.net/2009/08/chavez-kills-the-radio-star/" target="_blank"&gt;&lt;a href="http://artists4freedom.net/2009/08/chavez-kills-the-radio-star/" target="_blank"&gt;http://artists4freedom.net/2009/08/chavez-kills-the-radio-star/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Join us in letting everyone know.&lt;/p&gt;
&lt;p&gt;Thanks to Artists 4 freedom for the link.&lt;/p&gt;
&lt;p&gt;Photo found in &lt;a href="http://ihasahotdog.com" target="_blank"&gt;&lt;a href="http://ihasahotdog.com" target="_blank"&gt;http://ihasahotdog.com&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;</description><link>http://blog.romanandreg.com/post/155677149</link><guid>http://blog.romanandreg.com/post/155677149</guid><pubDate>Tue, 04 Aug 2009 08:04:23 -0700</pubDate><category>venezuela</category><category>help</category><category>politics</category></item><item><title>walruz: Creating Basic Authorization Policies</title><description>&lt;p&gt;&lt;a href="http://blog.romanandreg.com/post/142419061/walruz-introduction" target="_blank"&gt;Last post&lt;/a&gt; we checked the architecture of the &lt;b&gt;walruz&lt;/b&gt; authorization framework, now we will continue on the implementation of basic policies. Creation of Authorization Policies.&lt;/p&gt;
&lt;p&gt;To create a policy you have to create a class that extends from the &lt;code&gt;Walruz::Policy&lt;/code&gt; class, once that is done, you’ll need to define the &lt;code&gt;authorized?&lt;/code&gt; method. This method will receive 2 parameters: the actor, and the subject.&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;class ActorIsAdmin &lt; Walruz::Policy

  def authorized?(actor, _)
    actor.admin?
  end

end

class ActorIsSubject &lt; Walruz::Policy

  def authorized?(actor, subject)
    actor == subject
  end

end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the example above, we define the most common policies, the first one is the “current user is admin” policy, in this policy we ignore completely the subject because it won’t affect the nature of the policy.&lt;/p&gt;
&lt;p&gt;The second one is the “actor is subject”, you may not see the utility of this one after we use it (and ooh boy… we are going to use it a lot!).&lt;/p&gt;
&lt;h4&gt;Using the Authorization Policies&lt;/h4&gt;
&lt;p&gt;So, suppose we have the “all well known” User class, and we want to check if a User can be read, modified, updated or destroyed by the current authenticated user. The User class would go as follow:&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;class User &lt; ActiveRecord::Base
  include Walruz::Actor
  include Walruz::Subject  

  ######################
  ### Authorizations ###
  ######################
  
  UserReadPolicy = Walruz::Utils.any(ActorIsSubject, ActorIsAdmin)  

  check_authorizations :read =&gt; UserReadPolicy

end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So the code above states that a &lt;code&gt;User&lt;/code&gt; is an &lt;i&gt;Actor&lt;/i&gt; (an entity that wants to execute some action in other entity), and at the same time a &lt;i&gt;Subject&lt;/i&gt; (an entity that wants to be accessed in some way). It also defines some authorization policies associated to a label (in this case the action name). In this example &lt;code&gt;Walruz::Utils.any&lt;/code&gt; let’s us define a composition of policies, this method will join a collection of policies together by a logical &lt;i&gt;or&lt;/i&gt; statement.&lt;/p&gt;
&lt;p&gt;There are several ways to check if an &lt;i&gt;Actor&lt;/i&gt; can perform some action on a &lt;i&gt;Subject&lt;/i&gt;, but for now, we are going to use the most basic one: the &lt;code&gt;can?&lt;/code&gt; method.&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;def show(user)
 if current_user.can?(:read, user)
    render user
  else
    render :template =&gt; 'public/unauthorized'
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the declaration of the &lt;code&gt;UserReadPolicy&lt;/code&gt; we define that a &lt;code&gt;User&lt;/code&gt; “A” can be read by another &lt;code&gt;User&lt;/code&gt; “B” if either “A” is “B”, or “A” is an admin user. We are checking that conditions are met when we execute the &lt;code&gt;current_user.can?(:read, user)&lt;/code&gt; statement.&lt;/p&gt;
&lt;p&gt;Let’s extend our example a little bit, and Add a friendship relationship between users:&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;class User &lt; ActiveRecord::Base
  include Walruz::Actor
  include Walruz::Subject
  
  ####################
  ### Associations ###
  ####################
  
  has_many :friendships
  has_many :friends, :through =&gt; :friendships, :class =&gt; 'User', :foreign_key =&gt; 'friender_id'
  
  ######################
  ### Authorizations ###
  ######################
  
  UserReadPolicy = Walruz::Utils.any(ActorIsSubject, ActorIsAdmin)  

  check_authorizations :read =&gt; UserReadPolicy
  
  ########################
  ### Instance Methods ###
  ########################
  
  def become_friend_of(another_user)
    Friendship.create!(:friender =&gt; self, :friendee =&gt; another_user)
    Friendship.create!(:friender =&gt; another_user, :friendee =&gt; self)
  end
  
end

class Friendship &lt; ActiveRecord::Base
  
  belongs_to :friender
  belongs_to :friendee
  
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let’s say we want to enable friends to see each other records, right now it’s not possible with the policies stated, but this can be easily achievable with a new &lt;b&gt;walruz&lt;/b&gt; policy.&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;class UserIsFriend &lt; Walruz::Policy
  
  def authorized?(current_user, another_user)
    another_user.friends.include?(current_user)
  end
  
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once we create the new policy, we add it to the UserReadPolicy composition.&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;class User &lt; ActiveRecord::Base
  ...
  UserReadPolicy = Walruz::Utils.any(ActorIsSubject, UserIsFriend, ActorIsAdmin)
  ...
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you may already noticed, the name of this new policy is different from the previous ones (this new one starts with “User” instead of “Actor”), this is because, in this policy the class of the &lt;i&gt;Subject&lt;/i&gt; is important for the use of it. As a rule of thumb, if the subject is an important deal on the policy class, you should always start the name of the policy with the class of the &lt;i&gt;Subject&lt;/i&gt;; that way it will become more easier to merge different policies together; but more on that later.&lt;/p&gt;
&lt;p&gt;That’s all for this episode now, next post we are going to do some more fancy stuff with the policies of this episode and going to extend the example a little bit more, until then.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/142567714</link><guid>http://blog.romanandreg.com/post/142567714</guid><pubDate>Wed, 15 Jul 2009 21:39:00 -0700</pubDate><category>basics</category><category>ruby</category><category>walruz</category><category>policies</category></item><item><title>walruz: Simple but powerful authorization framework in Ruby</title><description>&lt;p&gt;You have been there already… your kick-ass app suddenly becomes an insatiable beast  when you have to add special conditions for authorized access, roles types, etc. And as soon as a new kind of user is added, or new more specific conditions are created for the existing authorizations, you just want to shoot your application just to put it out of its misery.&lt;/p&gt;
&lt;p&gt;Well it doesn’t have to be that way anymore…&lt;/p&gt;
&lt;h4&gt;Introducing &lt;b&gt;walruz&lt;/b&gt;.&lt;/h4&gt;
&lt;p&gt;&lt;b&gt;walruz&lt;/b&gt; is an authorization framework that helps you on that creepy process of adding new authorization policies to your application, without having to change each piece of code that is related to it.&lt;/p&gt;
&lt;p&gt;You see, the authorization process is divided in two sub-processes, the authorization checking and the action execution. &lt;b&gt;walruz&lt;/b&gt; divides this 2 processes so that you can change without pain, the checking implementation from the execution implementation.&lt;/p&gt;
&lt;h4&gt;
&lt;b&gt;walruz&lt;/b&gt; Architecture.&lt;/h4&gt;
&lt;p&gt;In order to understand how &lt;b&gt;walruz&lt;/b&gt; works, we need to clarify the architecture it has in order to achieve it’s goals. We have the three following components.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;Subject.&lt;/b&gt; Object that is going to be managed (Posts, Profiles, Todos).&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Actor&lt;/b&gt;. Entity that wants to perform an &lt;i&gt;action&lt;/i&gt; on a subject (User, Admin).&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Policy.&lt;/b&gt; A set of rules that tells if the Actor can perform the desired &lt;i&gt;action&lt;/i&gt; on the Subject.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The framework represent this concepts with the following modules/classes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Walruz::Subject.&lt;/code&gt; Module that when it is included makes the class a subject.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Walruz::Actor.&lt;/code&gt; Module that when it is included makes the class an actor.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Walruz::Policy.&lt;/code&gt; Class that will hold the authorization checking process.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is all for now folks… I will be explaining the framework in short post, so that we don’t make this a very long hard read process.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;A word of notice:&lt;/b&gt; The purpose of this series of posts is to serve as a tutorial to learn step by step all the goodies of the &lt;b&gt;walruz&lt;/b&gt; framework. If you want something more technical, I suggest you read the README document that comes with the walruz gem. To install just do &lt;code&gt;sudo gem install walruz&lt;/code&gt;, or download from &lt;a href="http://github.com/noomii/walruz" target="_blank"&gt;github&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.romanandreg.com/post/142567714/walruz-creating-basic-authorization-policies" target="_self"&gt;Next Post: How to create and use authorization policies.&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/142419061</link><guid>http://blog.romanandreg.com/post/142419061</guid><pubDate>Wed, 15 Jul 2009 16:56:00 -0700</pubDate><category>walruz</category><category>ruby</category><category>authorization</category><category>framework</category><category>introduction</category></item><item><title>Updates approaching</title><description>&lt;p&gt;Hello guys… I’m adding this post just to apologize with the readers of this blog (If there’s any besides me). I started to work almost 2 months ago in this place called &lt;a target="_blank" href="http://noomii.com"&gt;noomii&lt;/a&gt; and I have been really busy afterwards. Anyways! I have been doing some interesting stuff with Ruby and I will be posting new API soon-ish enough.&lt;/p&gt;
&lt;p&gt;Peace out.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/142402435</link><guid>http://blog.romanandreg.com/post/142402435</guid><pubDate>Wed, 15 Jul 2009 16:20:35 -0700</pubDate><category>reporting</category><category>misc</category></item><item><title>"Rule of thumb… whenever you query with datetime, date, or time attributes in Rails, transform..."</title><description>“Rule of thumb… whenever you query with datetime, date, or time attributes in Rails, transform them first to UTC.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Me&lt;/em&gt;</description><link>http://blog.romanandreg.com/post/141187918</link><guid>http://blog.romanandreg.com/post/141187918</guid><pubDate>Mon, 13 Jul 2009 20:24:14 -0700</pubDate></item><item><title>Rails had improved A LOT since last visit</title><description>&lt;p&gt;GameParticipation on schema.rb&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;
  create_table "game_participations", :force =&gt; true do |t|
    t.integer  "giver_id"
    t.integer  "receiver_id"
    t.integer  "game_id"
    t.datetime "activated_at"
    t.date     "occurs_on"
    t.datetime "created_at"
    t.datetime "updated_at"
  end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
ActiveRecord::HasManyThroughSourceAssociationNotFoundError in 'Game#is_participating? should return false when the user is not participating on the game'
Could not find the source association(s) :participant or :participants in model GameParticipation.  Try 'has_many :participants, :through =&gt; :participations, :source =&gt; '.  Is it one of :game, :giver, or :receiver?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What impress me about this error, is the las part of the last sentence “Is it one of :game, :giver, or :receiver?”…  If they wouldn’t add the last sentence, my first question would be “WTF is source?”, this meaningful error helped me save some time.&lt;/p&gt;
&lt;p&gt;Good Job Rails Team \m/.&lt;/p&gt;</description><link>http://blog.romanandreg.com/post/115157982</link><guid>http://blog.romanandreg.com/post/115157982</guid><pubDate>Fri, 29 May 2009 21:12:17 -0700</pubDate></item></channel></rss>
