Rake Shame
If you’ve ever been working on a Rails application (or any application, for that matter) and found yourself stupidly slipping in your testing, I have just the tool for you.
Using rake and rubyosa, you can now automatically post your Code to Test Ratio as your iChat status message– meaning you can now use shame and self- humiliation to keep you motivated.
First, take a look at Mike Clark’s instructions for setting up rubyosa. After you’ve set up rubyosa, add shame.rake to your lib/tasks directory, which contains:
require 'rbosa'
require 'code_statistics'
task :shame do
stats = CodeStatistics.new(*STATS_DIRECTORIES)
code = stats.send :calculate_code
tests = stats.send :calculate_tests
ichat = OSA.app('ichat')
msg = "Code To Test Ratio: 1:#{sprintf("%.1f", tests.to_f/code)}"
ichat.status_message = msg
$stderr.puts %|iChat status set to: #{msg.inspect}|
endType rake shame and let the mocking (and motivation) begin!
- Company:
- Person:


Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago