Is it possible from within a rake task to get a list of tasks in a namespace? A sort of programatic \'rake -T db\' ?
You can use the grep command like this
desc 'Test' task :test do # You can change db: by any other namespaces result = %x[rake -T | sed -n '/db:/{/grep/!p;}' | awk '{print$2}'] result.each_line do |t| puts t # Where t is your task name end end