You should learn to Rake. I’ve been meaning to switch everything over for some time now. Rake can currently automate building of gems and documentation from your libraries. And now that’s it’s a hugely popular gem, you can feel safe moving away from setup.rb/install.rb.
Rake can automatically generate file based tasks according to some simple pattern matching rules.
For example, we can capture the above logic in a single rule ⦠no need to find all the source files and iterate through them.
rule '.o' => '.c' do |t|
sh "cc -c -o #{t.name} #{t.source}"
end
The above rule says that if you want to generate a file ending in .o, then you if you have a file with the same base name, but ending in .c, then you can generate the .o from the .c.