class Gem::Commands::SetupCommand

def generate_default_dirs(install_destdir)

def generate_default_dirs(install_destdir)
  prefix = options[:prefix]
  site_or_vendor = options[:site_or_vendor]
  if prefix.empty? then
    lib_dir = Gem::ConfigMap[site_or_vendor]
    bin_dir = Gem::ConfigMap[:bindir]
  else
    # Apple installed RubyGems into libdir, and RubyGems <= 1.1.0 gets
    # confused about installation location, so switch back to
    # sitelibdir/vendorlibdir.
    if defined?(APPLE_GEM_HOME) and
      # just in case Apple and RubyGems don't get this patched up proper.
      (prefix == Gem::ConfigMap[:libdir] or
       # this one is important
       prefix == File.join(Gem::ConfigMap[:libdir], 'ruby')) then
       lib_dir = Gem::ConfigMap[site_or_vendor]
       bin_dir = Gem::ConfigMap[:bindir]
    else
      lib_dir = File.join prefix, 'lib'
      bin_dir = File.join prefix, 'bin'
    end
  end
  unless install_destdir.empty? then
    lib_dir = File.join install_destdir, lib_dir.gsub(/^[a-zA-Z]:/, '')
    bin_dir = File.join install_destdir, bin_dir.gsub(/^[a-zA-Z]:/, '')
  end
  [lib_dir, bin_dir]
end