Spacerobots:






A place for me (Matt Petty aka lodestone) to stream and splay stuff. I'm an entrepreneur and ruby developer with a love of life, great fiction (mostly the science or fantasy variety), and drink.


Follow/Stalk me:
  • Forrst
  • Twitter
  • Facebook
  • Working w/ Rails

Also, I like words
Archive Ask me anything
October 22nd, 2011 at 9:34AM
Spinach

Spinach, a gherkin based test framework like cucumber but without the Regex madness.

https://github.com/codegram/spinach

6 notes #testing#spinach#cucumber#ruby#tdd#bdd
February 9th, 2010 at 8:39AM
Scope a variable and clean up your code with .tap

Great case for using .tap to clean up and organize code.

Example

<div class="active_messages">
  <% @active_messages.each do |message| %>
    <h1><%= message.title %></h1>
    <div class="latest_comment">
      <% message.comments.last.tap do |comment| %>
        <div class="avatar">
          <%= avatar_for(comment.creator) %>
        </div>
        Latest comment <%= time_ago_in_words(comment.created_at) %> ago by <%=    comment.creator.full_name %>
      <% end %>
    </div>
  <% end %>
</div>
#ruby
Page 1 of 1

Brutal Simplicity theme by Kevin Burg