<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>restorm.com - general</title>
  <id>tag:labs.restorm.com,2008:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.7.3">Mephisto Noh-Varr</generator>
  <link href="http://labs.restorm.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://labs.restorm.com/" rel="alternate" type="text/html"/>
  <updated>2008-08-05T12:53:07Z</updated>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>niko</name>
    </author>
    <id>tag:labs.restorm.com,2008-08-05:21</id>
    <published>2008-08-05T12:44:00Z</published>
    <updated>2008-08-05T12:53:07Z</updated>
    <link href="http://labs.restorm.com/2008/8/5/cache-proxy-when-procastination-is-usefull" rel="alternate" type="text/html"/>
    <title>Cache proxy: When procastination is usefull</title>
<content type="html">
            &lt;p&gt;Have you ever been in the situation that you&#8217;re caching a part of the view and only want to execute the corresponding controller-code in case the cache expired and you really need it? Meet &lt;a href=&quot;http://gist.github.com/4064&quot;&gt;cache_proxy.rb&lt;/a&gt;. CacheProxy transparently defers code execution until you first try to access the proxy.&lt;/p&gt;


	&lt;p&gt;This idea is not new: http://caboose.org/articles/2006/6/23/caching-and-mvc-keeping-code-local. I only read the article after the first implementation. And CacheProxy is much more elegant than using plain blocks.&lt;/p&gt;


	&lt;p&gt;Have fun!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>niko</name>
    </author>
    <id>tag:labs.restorm.com,2008-07-20:20</id>
    <published>2008-07-20T14:02:00Z</published>
    <updated>2008-07-20T14:08:15Z</updated>
    <category term="stuff"/>
    <link href="http://labs.restorm.com/2008/7/20/new-rake-and-cap-bash-completion-scripts" rel="alternate" type="text/html"/>
    <title>New rake and cap bash-completion scripts</title>
<content type="html">
            &lt;p&gt;As you all know, hackers are lazy. They are so lazy, that they work today to spare some work tomorrow. And they do this every day.&lt;/p&gt;


	&lt;p&gt;I&#8217;m shure, there are working bash completion scripts for rake and cap, but the ones I downloaded didn&#8217;t work that well.&lt;/p&gt;


	&lt;p&gt;So today I spend some hours hacking new completion scripts to save me (and you) some seconds of typing tomorrow. And the day after. It sums up, you know? At least in theory.&lt;/p&gt;


	&lt;p&gt;So without further fuzz, here you are: http://github.com/niko/rake_and_cap_completion/tree/master&lt;/p&gt;


	&lt;p&gt;Have fun!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>floere</name>
    </author>
    <id>tag:labs.restorm.com,2008-03-29:19</id>
    <published>2008-03-29T16:14:00Z</published>
    <updated>2008-03-30T07:14:44Z</updated>
    <link href="http://labs.restorm.com/2008/3/29/practical-jokes-for-speccers" rel="alternate" type="text/html"/>
    <title>Practical Jokes for Speccers</title>
<content type="html">
            Say your colleague started running rake spec and goes to the toilet with a triumphant smile on his face, expecting all .........................................., sprinkled with a few Ps here and there, be sure to press Shift-F and or -E on his keyboard with deliberation. Try not to giggle too loud when he returns ;) Ok – greetings from euruko, non-silly stuff forthcoming…
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>kaspar</name>
    </author>
    <id>tag:labs.restorm.com,2008-03-13:18</id>
    <published>2008-03-13T16:22:00Z</published>
    <updated>2008-03-13T16:32:24Z</updated>
    <category term="ruby hacks"/>
    <category term="stuff"/>
    <link href="http://labs.restorm.com/2008/3/13/armit-jumping-the-git-train" rel="alternate" type="text/html"/>
    <title>ARMIT - Jumping the git train</title>
<content type="html">
            &lt;p&gt;I want to be on it. So I release &lt;em&gt;armit&lt;/em&gt; to the world &#8211; even before its all mature (the way we like our beer). What&#8217;s &lt;em&gt;armit&lt;/em&gt;, you say? Well, Armit is &#8216;ActiveRecord Multiple InheriTance&#8217;. Ok, that&#8217;s contrived you say, right. But it rings well.&lt;/p&gt;


	&lt;p&gt;With armit you can finally do all that crazy table stuff you&#8217;ve always wanted to. I promise to write more about it here &#8211; and to make a formal release once it is ready. Birdie, fly: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;&lt;a href=&quot;http://github.com/kschiess/armit/tree/master&quot;&gt;http://github.com/kschiess/armit/tree/master&lt;/a&gt;
git://github.com/kschiess/armit.git&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Meanwhile, back at the ranch &#8230; that new kid &lt;em&gt;git&lt;/em&gt; really rocks me off of my feet. And github looks really promising &#8211; so promising in fact that we might host more projects there in the future (not affiliated). Do give it a whirl!&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Edit: Now that I read through it, that post reads like the spam I am getting. The same giddy excitement over not much. That&#8217;s a mood I am in often, I call it taking pleasure in living.&lt;/em&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>kaspar</name>
    </author>
    <id>tag:labs.restorm.com,2008-02-12:15</id>
    <published>2008-02-12T13:24:00Z</published>
    <updated>2008-02-12T14:23:54Z</updated>
    <category term="ruby hacks"/>
    <category term="stuff"/>
    <link href="http://labs.restorm.com/2008/2/12/eliminate-stamp-out-and-abolish-redundancy-to-hell-with-spec-mocks" rel="alternate" type="text/html"/>
    <title>eliminate, stamp out and abolish redundancy - to hell with spec/mocks</title>
<content type="html">
            &lt;p&gt;We firmly believe a testing framework should not also bring a mocking framework along. And we choose flexmock over the alternatives. Also &#8211; that choice was made before switching to rspec, so we weren&#8217;t at all happy with spec/mocks and flexmock battling themselves in our code.&lt;/p&gt;


	&lt;p&gt;The battle was inevitable, since both offer you convenience methods like &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;object.should_receive(:message)&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Are you sure which framework you use in your rails specs? Really? Read on.&lt;/p&gt;


	&lt;h3&gt;Ripping out spec/mocks&lt;/h3&gt;


	&lt;p&gt;So you rip it out, right? No. Even though rspec allows you to configure mocking, rspec_on_rails will load and use the spec/mocks framework.&lt;/p&gt;


	&lt;p&gt;We selfishly rewrote rspec_on_rails into rspec_flexmock_on_rails. Branching is not always a good idea, but this time &#8211; it might just solve things for some people, that&#8217;s why we put our code in public under the same license that rspec is. Here goes: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;http://swissrb.rubyforge.org/svn/rspec_flexmock_on_rails/&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Please leave us a comment &#8211; if enough people start using this, we might be tempted to patch&#8230;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>kaspar</name>
    </author>
    <id>tag:labs.restorm.com,2008-02-12:14</id>
    <published>2008-02-12T12:31:00Z</published>
    <updated>2008-02-12T12:35:51Z</updated>
    <link href="http://labs.restorm.com/2008/2/12/job-offering" rel="alternate" type="text/html"/>
    <title>Job Offering</title>
<content type="html">
            &lt;p&gt;Are you an experienced Programmer that lives in the region of Zurich, Switzerland? Then please send your full resume to kaspar at restorm dot com. We&#8217;re hiring!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>kaspar</name>
    </author>
    <id>tag:labs.restorm.com,2007-12-21:13</id>
    <published>2007-12-21T13:39:00Z</published>
    <updated>2007-12-28T06:03:28Z</updated>
    <category term="stuff"/>
    <link href="http://labs.restorm.com/2007/12/21/scopedproxy-1-0" rel="alternate" type="text/html"/>
    <title>ScopedProxy 1.0</title>
<content type="html">
            &lt;p&gt;We&#8217;re proud to announce our first software release: Scoped Proxy. Here&#8217;s what it does:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;require 'scoped_proxy'&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;class User &amp;lt; ActiveRecord::Base
  scoped_proxy :role do |role|
    {
      :find =&amp;gt; { :conditions =&amp;gt; ['role = ?', role] }
    }
  end
  scoped_proxy :deleted, :find =&amp;gt; {
    :conditions =&amp;gt; 'deleted_at is not null'
  }
end&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;admins = User.role('admin')
admins.count              # =&amp;gt; 12
admins.find(:all)         # =&amp;gt; [ ... ]&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;User.deleted.count        # =&amp;gt; a number&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Those of you who&#8217;ve read our old blog (&lt;a href=&quot;http://www.neotrivium.com&quot;&gt;neotrivium.com&lt;/a&gt;) will know the scoped proxy as a single file drop in plugin. On public demand I&#8217;ve gem-ified it. To install, simply type: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;sudo gem install ScopedProxy&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Easy as that. Please let me know what you think!&lt;/p&gt;


	&lt;p&gt;(Update: Here&#8217;s the link to our rubyforge project: &lt;a href=&quot;http://rubyforge.org/projects/swissrb&quot;&gt;swissrb&lt;/a&gt;)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>kaspar</name>
    </author>
    <id>tag:labs.restorm.com,2007-11-15:10</id>
    <published>2007-11-15T10:00:00Z</published>
    <updated>2007-11-15T10:02:09Z</updated>
    <category term="oblique thoughts"/>
    <link href="http://labs.restorm.com/2007/11/15/zen-of-test-driven-development" rel="alternate" type="text/html"/>
    <title>Zen of Test Driven Development</title>
<content type="html">
            &lt;p&gt;Run your tests. Profit of that moment of silence to find blank mind below busy thoughts. Breathe deeply.&lt;/p&gt;


	&lt;p&gt;...&lt;/p&gt;


	&lt;p&gt;3 tests, 27 assertions, 1 failures, 0 errors&lt;/p&gt;


	&lt;p&gt;Continue refreshed. That way, you can easily squeeze hours of meditation in an otherwise busy day. Think about it.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>kaspar</name>
    </author>
    <id>tag:labs.restorm.com,2007-11-11:9</id>
    <published>2007-11-11T07:17:00Z</published>
    <updated>2007-11-11T08:08:10Z</updated>
    <category term="ruby hacks"/>
    <link href="http://labs.restorm.com/2007/11/11/tending-to-the-blog-and-other-crazy-stuff" rel="alternate" type="text/html"/>
    <title>Tending to the blog and other crazy stuff</title>
<summary type="html">&lt;p&gt;Dear readers,&lt;/p&gt;


	&lt;p&gt;I hope none of you held their breath after my last announcement that I would be talking about a lot of new features. Turns out, I won&#8217;t. Because our sister blog, the &lt;a href=&quot;http://blog.restorm.com&quot;&gt;official one&lt;/a&gt;, is already doing that. But be reminded that I will not falter in my intention to keep this blog a happy place. Let&#8217;s start making everybody happy by talking about some crazy block stuff in Ruby (and Rails):&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;Dear readers,&lt;/p&gt;


	&lt;p&gt;I hope none of you held their breath after my last announcement that I would be talking about a lot of new features. Turns out, I won&#8217;t. Because our sister blog, the &lt;a href=&quot;http://blog.restorm.com&quot;&gt;official one&lt;/a&gt;, is already doing that. But be reminded that I will not falter in my intention to keep this blog a happy place. Let&#8217;s start making everybody happy by talking about some crazy block stuff in Ruby (and Rails):&lt;/p&gt;
&lt;p&gt;Let&#8217;s assume you want to call #capture(&#38;block) somewhere out of view context. Like so (caution, &lt;a href=&quot;http://neotrivium.com/blog/2007/1/17/willkommen_hobo&quot;&gt;haml ahead&lt;/a&gt;):&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;= form.radio_button_group_with_label 'How\'s the surf?' do |button|
  = button.create 'IE 6'
  = button.create 'IE 7'
  = button.create 'A real Browser'&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Let&#8217;s look at how we might do this: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;def radio_button_group(label, field, &#38;block)
  builder = RadioButtonGroup.new(self, field)
  label_tag = content_tag('label', label)
  content_tag = ''
  proc {
    content_tag = capture(builder, &#38;block)
  }.bind(eval('self', block.binding)).call
  return label_format(
    label_tag, 
    content_tag
  )
end&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;If you look beside the boilerplate that is for formatting and other irrelevant stuff (coder attitude forever!), you see a central snippet that has a bizarre beauty about its airs: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;proc {
  content_tag = capture(builder, &#38;block)
}.bind(eval('self', block.binding)).call&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;We create a block using #proc, #bind something to it (as a new execution context) and then #call it. So far.. so good. This executes the block in the content of the &lt;em&gt;view&lt;/em&gt;, which is needed for easy #capture access. Now what is the #eval(...) about? Well, turns out that Proc#bind() will only accept an object instance as an argument, no binding. Even though that would be logical, would it not?&lt;/p&gt;


	&lt;p&gt;So admire the thing in all its hideousness &#8211; and see the equivalence to &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;eval('self', block.binding).instance_eval do 
  # ...
end&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Or, using facets&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;block.binding.self.instance_eval do 
  # ... 
end&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Let&#8217;s assume for a second that Proc#bind would take a binding as argument. How would that transform the piece?&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;proc do 
  # ...
end.bind(block.binding).call&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;A lot cleaner already. Here&#8217;s the piece of magic that allows you to do that: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;class Proc
  def bind_correct(self_or_binding)
    if self_or_binding.kind_of? Binding
      bind_incorrect eval('self', self_or_binding)
    else
      bind_incorrect self_or_binding
    end
  end
  alias :bind_incorrect :bind
  alias :bind :bind_correct
end&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;As always, have fun. The interested reader should take a look at the implementation of Proc#bind in active_support. Clever, that.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>kaspar</name>
    </author>
    <id>tag:labs.restorm.com,2007-10-21:7</id>
    <published>2007-10-21T17:16:00Z</published>
    <updated>2007-10-21T17:18:19Z</updated>
    <link href="http://labs.restorm.com/2007/10/21/going-live" rel="alternate" type="text/html"/>
    <title>Going live</title>
<content type="html">
            &lt;p&gt;Just a quick note to let you all know that we&#8217;ve put a load of new features online. Try to find them all !&lt;/p&gt;


	&lt;p&gt;Seriously, we&#8217;ll be posting a list of them tomorrow, with screenshots and goodies.&lt;/p&gt;


	&lt;p&gt;hugs, 
kaspar&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>kaspar</name>
    </author>
    <id>tag:labs.restorm.com,2007-10-16:5</id>
    <published>2007-10-16T14:25:00Z</published>
    <updated>2007-10-16T14:34:15Z</updated>
    <link href="http://labs.restorm.com/2007/10/16/our-firefox-trouble" rel="alternate" type="text/html"/>
    <title>Our Firefox Trouble</title>
<content type="html">
            &lt;p&gt;We&#8217;re currently having trouble with Firefox. The Quicktime Plugin for Firefox doesn&#8217;t play our stream anymore. To all our cherished and frustrated users: Here&#8217;s what currently &lt;em&gt;does&lt;/em&gt; work: &lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Safari on Mac OS&lt;/li&gt;
		&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;IE 6&lt;/span&gt; and 7 on Windows&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;And to all those users that also love Firefox like we do: We&#8217;re working on it. Please accord us just a tiny bit more patience. And of course &#8211; if you happen to know exactly what the problem is &#8211; please tell us. We&#8217;ll reserve a special place in our hearts for you.&lt;/p&gt;


	&lt;h2&gt;Streaming Quality&lt;/h2&gt;


	&lt;p&gt;Most of our users will notice that the streaming quality has changed. Most of you should now be able to watch the stream, since bandwidth requirements have been halved.&lt;/p&gt;


	&lt;p&gt;Does it work for you? You liked it better before? Please let us know what you think.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://labs.restorm.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:labs.restorm.com,2007-10-11:1</id>
    <published>2007-10-11T12:42:00Z</published>
    <updated>2007-10-11T12:55:56Z</updated>
    <link href="http://labs.restorm.com/2007/10/11/welcome" rel="alternate" type="text/html"/>
    <title>Welcome</title>
<content type="html">
            &lt;p&gt;This is the technical blog of restorm.com. This will be the place where you can get to know the people behind restorm.com. We&#8217;ll post: &lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Notices of service with all the gory details&lt;/li&gt;
		&lt;li&gt;What we&#8217;re working on and why&lt;/li&gt;
		&lt;li&gt;Libs and stuff that falls out of our work that we&#8217;d like to share&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;And so on. Watch this space for lots of interesting stuff about restorm.com and the tech we&#8217;re working with.&lt;/p&gt;


	&lt;p&gt;Welcome!&lt;/p&gt;
          </content>  </entry>
</feed>
