method
generate_bin
v1_9_3_125 -
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 280 def generate_bin return if spec.executables.nil? or 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 gem_home. bindir = @bin_dir || Gem.bindir(gem_home) Dir.mkdir bindir unless File.exist? bindir raise Gem::FilePermissionError.new(bindir) unless File.writable? bindir spec.executables.each do |filename| filename.untaint bin_path = File.expand_path File.join(gem_dir, spec.bindir, filename) unless File.exist? bin_path warn "Hey?!?! Where did #{bin_path} go??" next end mode = File.stat(bin_path).mode | 0111 FileUtils.chmod mode, bin_path if @wrappers then generate_bin_script filename, bindir else generate_bin_symlink filename, bindir end end end