method

ensure_subdirectories

Importance_0
v2_4_6 - Show latest stable - 0 notes - Class: Gem
ensure_subdirectories(dir, mode, subdirs) public

No documentation

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

Hide source
# File lib/rubygems.rb, line 456
  def self.ensure_subdirectories dir, mode, subdirs # :nodoc:
    old_umask = File.umask
    File.umask old_umask | 002

    require 'fileutils'

    options = {}

    options[:mode] = mode if mode

    subdirs.each do |name|
      subdir = File.join dir, name
      next if File.exist? subdir
      FileUtils.mkdir_p subdir, options rescue nil
    end
  ensure
    File.umask old_umask
  end
Register or log in to add new notes.