SonicIQ Hiring! - UK, Ruby on Rails Developer Required

Posted by jamie Tue, 28 Aug 2007 00:01:21 GMT

We are looking for a Ruby on Rails, XHTML & CSS Developer to join our team at SonicIQ. Head over to 43folders job board to view our ad.

These are exiting times with projects like Propel’r in the pipeline, along with the ever-growing opportunities for new and interesting client projects.

If you are a highly motivated developer and can see yourself in a Ruby on Rails position in sunny (sometimes) Bournemouth, UK then apply at 43folders.

Posted in , ,  | Tags , , , ,  | no comments

Using Rcov to measure the test coverage of Rails plugins

Posted by jamie Fri, 24 Aug 2007 18:44:35 GMT

To view the coverage of your plugins using Rcov, first install the rcov gem with sudo gem install rcov, then copy and paste the following onto the end of the Rakefile inside your plugin directory:

desc 'Measures test coverage using rcov'
task :rcov do
  rm_f "coverage"
  rm_f "coverage.data"
  rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib"
  system("#{rcov} --html #{Dir.glob('test/**/*_test.rb').join(' ')}")
  system("open coverage/index.html") if PLATFORM['darwin']
end

You can now simply run rake rcov from inside your plugin directory which will generate a coverage directory with the results. Open coverage/index.html (if you are on OSX this will open automatically) in a browser to view the results.

Thanks to Mike Clark for his Rcov rake task for Rails which this task is based on.

Posted in , ,  | Tags , , , ,  | 1 comment

Ruby Ternary operator re-written with Boolean operators

Posted by jamie Thu, 23 Aug 2007 12:09:34 GMT

Just noticed something interesting (well not that interesting). Ternary operators in Ruby can be re-written using Boolean operators e.g.

method = object.respond_to?(:foo) ? :foo : :bar

would become…

method = object.respond_to?(:foo) && :foo || :bar

Simply replace ? with && and : with ||

I don’t know if there is any performance gain here, anyone care to investigate?

Posted in  | Tags , , ,  | 8 comments

Typo 4.1 slow comment posting

Posted by jamie Fri, 17 Aug 2007 00:38:07 GMT

Is anyone else having problems with Typo 4.1 taking ages to process new comments. If anyone has any suggestions I would love to hear them (If you can be bothered to wait for the comment to go through!)

Posted in , ,  | Tags , ,  | no comments