generate_bin()public
No documentation available.
# File lib/rubygems/installer.rb, line 464
def generate_bin # :nodoc:
return if spec.executables.nil? or spec.executables.empty?
begin
Dir.mkdir @bin_dir
rescue SystemCallError
raise unless File.directory? @bin_dir
end
raise Gem::FilePermissionError.new(@bin_dir) unless File.writable? @bin_dir
spec.executables.each do |filename|
filename.untaint
bin_path = File.join gem_dir, spec.bindir, filename
unless File.exist? bin_path then
# TODO change this to a more useful warning
warn "`#{bin_path}` does not exist, maybe `gem pristine #{spec.name}` will fix it?"
next
end
mode = File.stat(bin_path).mode
FileUtils.chmod mode | 0111, bin_path unless (mode | 0111) == mode
check_executable_overwrite filename
if @wrappers then
generate_bin_script filename, @bin_dir
else
generate_bin_symlink filename, @bin_dir
end
end
end