May 2009
1 post
3 tags
Setup Rcov with Ruby on Rails on Ubuntu
Rrcov is a code coverage tool for Ruby. First of all we install it with Ruby gems. sudo gem install rcov Then we create a file lib/tasks/rcov.rake in your rails project. require 'rcov/rcovtask' Rcov::RcovTask.new do |t| t.test_files = FileList['test/unit/*.rb'] + FileList['test/functional/*.rb'] t.rcov_opts = ['--rails', '-x /var/lib', '--text-report', '--sort coverage'] t.output_dir =...
May 3rd
3 notes
June 2008
1 post
2 tags
Control download with Net::HTTP::Stats
Download a file is a source of problems. Host can be down, bandwith can be too slow, file can be too big, download takes too much time … This is an important point for a program which download many files. Furthemore it’s often useful to notice users how much of a file is downloaded and when it will be finished. That’s why I wrote a little module named Net::HTTP::Stats. This...
Jun 7th
30 notes
February 2008
1 post
2 tags
Ruby Inline
Sometimes applications need to be fast. Unfortunalty scripting languages like Ruby are slow. However rewriting an entire application isn’t the most efficient way. Furthemore the part that need to be faster isn’t really of an outstanding size in terms of code. That’s why Ruby inline is an excellent solution. The goal is to replace the slow Ruby code by C code. It could be 5 or...
Feb 28th
January 2008
1 post
2 tags
The end of ensecure authentications
When I’m logging up on the web, on unsecure connections, I’m always thinking that anybody can discover my password. The attacker just needs to listen to the network using some Ethereal-like software. One solution is to use the HTTPS protocol instead of HTTP. Unfortunately too few web sites use it because it requires an SSL certificate. To get a certificate you have two...
Jan 31st
1 note