What's New in Ruby: The August 2012 edition

Every month, Kansas City Ruby (#kcruby) reviews a subset of Peter Cooper's fantastic Ruby Weekly selections, along with other items picked up around the web.

Pow 0.4 with xip.io support

xip.io allows you to test your application from your local network without setting up DNS. Testing in IE? Testing from iPad? Especially handy when you need subdomains to work or have multiple apps running on a port and need domain resolution.

rspec's new expectation syntax

rspec is getting a new expectation syntax.

Now:
foo.should eq(bar)
        foo.should_not eq(bar)
Then:
expect(foo).to eq(bar)
        expect(foo).not_to eq(bar)

Read the post to get more information about the new rspec syntax.

Rails 4.0 Sneak Peek: Asynchronous ActionMailer

Rails 4.0 has Rails.queue and this new feature allows you to push emails into the queue with code like:

class WelcomeMailer < ActionMailer::Base
          self.async = true
        end
When you call the mailer:
WelcomeMailer.welcome(@user.id).deliver
... you need to use ids and look the object up in the mailer, instead of marshalling the entire object, like so:
        class WelcomeMailer < ActionMailer::Base
          def welcome(id)
            @user = User.find(id)
            ...
          end
        end
        

Established 2005 · Databasically © 2016