method
check_that_user_bin_dir_is_in_path
v2_4_6 -
Show latest stable
- Class:
Gem::Installer
check_that_user_bin_dir_is_in_path()public
No documentation available.
# File lib/rubygems/installer.rb, line 671
def check_that_user_bin_dir_is_in_path # :nodoc:
user_bin_dir = @bin_dir || Gem.bindir(gem_home)
user_bin_dir = user_bin_dir.gsub(File::SEPARATOR, File::ALT_SEPARATOR) if
File::ALT_SEPARATOR
path = ENV['PATH']
if Gem.win_platform? then
path = path.downcase
user_bin_dir = user_bin_dir.downcase
end
path = path.split(File::PATH_SEPARATOR)
unless path.include? user_bin_dir then
unless !Gem.win_platform? && (path.include? user_bin_dir.sub(ENV['HOME'], '~'))
unless self.class.path_warning then
alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run."
self.class.path_warning = true
end
end
end
end