require 'rubygems'

Gem.post_install do
  puts 'this is a test'
end

Gem.post_install do |gem|

  spec  = gem.spec
  files = spec.files - spec.test_files - spec.extra_rdoc_files

  files.each do |file|
    next unless file.match /\.rb$/
    puts "Compiling #{file} to #{file}o"
  end

end

Add code to find the files that need to be compiled
Add code to find the files that need to be compiled

The trick now is going to be getting the correct path.