method
generate_bin
v2_4_6 -
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 462 def generate_bin # :nodoc: return if spec.executables.nil? or spec.executables.empty? Dir.mkdir @bin_dir unless File.exist? @bin_dir 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} 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