The behavior introduced with pull request #942 when creating the windows
batch file of a ruby gem has the downside that it is no longer easy
possible to use a different (J)Ruby installation but the same %GEM_HOME%
directory. This is for example needed when distributing all gems
available in a %GEM_HOME% directory accross various installations which
may have different Ruby installations.
The proposed changes tries to fix the mentioned flaws by utilizing set
environment variables. It keeps the existing behavior if no environment
variable is set but uses the environment variables if set.