Slashify .gitignore template.

Without the initial `/` all such matches within the repo get ignored,
and without the trailing slash files as well as directories of that
name get ignored. e.g. Specifying `tmp` as well as `test/tmp` without
slashes is redundant, as `tmp` already ignores `test/tmp`, as well as
every other `tmp` and `tmp/`.
only add ext ignores to ext gems
yardoc is a config file
stop ignoring overly-specific things

if you need to ignore these things, you should either put them in your
user-wide ignore (like .rbc), or you need to add them to your particular
gem, but not to every gem that exists
extract the ext name guard to a method
hey let's copy and paste less code