Check out who we are and our recent projects.

Factory Girl callbacks

Posted: November 25th, 2009 | Author: tarsolya | Filed under: News | Tags: , , , , | No Comments »

I’ve been mainly using Shoulda for testing with Test::Unit and Factory Girl helps a lot by letting me stub out simple or more complex object instance variations easily. Now is getting even more easier: callbacks are here!

The three main factory methods all get their respective callbacks, namely: after_build, after_create and after_stub. We can do the following now:

  class Foo < ActiveRecord::Base
    has_many :bar
  end
 
  class Bar < ActiveRecord::Base  
    belongs_to :foo
  end
 
  Factory.define(:foo) do |foo|
    foo.title { "The quick brown fox." }
  end
 
  Factory.define(:bar) do |bar|
    bar.title { "Jumps over the lazy dog." }
  end
 
  Factory.define(:foo_with_bar, :parent => :foo) do |foo|
    foo.after_create { |o| Factory(:bar, :foo => o) }
  end

Neat stuff. 1.2.3 is on Gemcutter now and you can check out more details over at Smashing Robots.


Yehuda Katz: It’s all about the self

Posted: November 21st, 2009 | Author: tarsolya | Filed under: News | Tags: , , , , | 1 Comment »

Yehuda Katz written an interesting piece about the nuances of metaprogramming in Ruby. He talks about classes, metaclasses and the importance of self, in particular.

A must read, if you are somewhat familiar, but not totally friends with the OO internals of Ruby.


A new Ruby e-mail library: Mail

Posted: November 21st, 2009 | Author: tarsolya | Filed under: Previews | Tags: , , | No Comments »

Mail handling was always a bit of a nag in Ruby: you either used Net::SMTP or TMail or if you’ve been building stuff in Rails, you had ActionMailer. From these three options, ActionMailer is the most friendly and you could easily decouple it from the Rails stack to use it on your own, in Sinatra, for example.

That said, Mikel Lindsaar just released a new library, simply called Mail, which handles everything from mail generation to sending. A major point for me when selecting libraries for future use is full Ruby 1.9 compatibility. Mail has been built 100% Ruby 1.9 compatible, which means proper encoding handling throughout the entire library. It’s a relief, to be honest.

Some other features, you might like:

  • Ruby idioms, when working with mail. This makes it easy to pick up the pace.
  • Sending and receiving, Net::SMTP and Net::POP3 support
  • Attaching files are a breeze
  • Full spec coverage

Check out the code examples on the project’s page on GitHub or pay a visit to the mail-ruby Google Group.


John Resig: Learning Advanced JavaScript

Posted: November 16th, 2009 | Author: tarsolya | Filed under: News | Tags: , | No Comments »

John Resig, a well-known javascript hacker, author of the jQuery javascript libarary posted an interesting piece of javascript tutorial, which will guide you through the more confusing inner mechanics of JS with a do-it-yourself approach.

It comes with various easy and more tricky quizes and it’s an introduction of his javascript book, Secrets of the Javascript Ninja. Cool stuff.

(Via ejohn.com.)


On the track again!

Posted: October 20th, 2009 | Author: tarsolya | Filed under: News | Tags: , | No Comments »

Well, it’s been a time since I blogged seriously about tech stuff and since I’m working on to get my small dev shop up and running, it’s time to start again.

You will find stuff here about our projects, the modern web and tools to make it happen: ruby, javascript, rails, php, unix, just to mention a few.

Welcome!