Flowdock
method

generate_default_dirs

Importance_0
Ruby latest stable (v1_9_3_392) - 0 notes - Class: SetupCommand
generate_default_dirs(install_destdir) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/commands/setup_command.rb, line 267
  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
Register or log in to add new notes.