method
generate_bin
v2_5_5 -
Show latest stable
-
0 notes -
Class: Installer
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9 (-38)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
generate_bin()
public
Hide source
# 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