# File lib/rubygems/installer.rb, line 193 def generate_bin(spec, install_dir=Gem.dir) return unless spec.executables && ! spec.executables.empty? # If the user has asked for the gem to be installed in # a directory that is the system gem directory, then # use the system bin directory, else create (or use) a # new bin dir under the install_dir. bindir = Gem.bindir(install_dir) Dir.mkdir bindir unless File.exist? bindir raise Gem::FilePermissionError.new(bindir) unless File.writable?(bindir) spec.executables.each do |filename| if @options[:wrappers] then generate_bin_script spec, filename, bindir, install_dir else generate_bin_symlink spec, filename, bindir, install_dir end end end