同步操作将从 src-openEuler/ruby 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
module Gemclass << self### Returns full path of previous but one directory of dir in path# E.g. for '/usr/share/ruby', 'ruby', it returns '/usr'def previous_but_one_dir_to(path, dir)return unless pathsplit_path = path.split(File::SEPARATOR)File.join(split_path.take_while { |one_dir| one_dir !~ /^#{dir}$/ }[0..-2])endprivate :previous_but_one_dir_to### Detects --install-dir option specified on command line.def opt_install_dir?@opt_install_dir ||= ARGV.include?('--install-dir') || ARGV.include?('-i')endprivate :opt_install_dir?### Detects --build-root option specified on command line.def opt_build_root?@opt_build_root ||= ARGV.include?('--build-root')endprivate :opt_build_root?### Tries to detect, if arguments and environment variables suggest that# 'gem install' is executed from rpmbuild.def rpmbuild?@rpmbuild ||= ENV['RPM_PACKAGE_NAME'] && (opt_install_dir? || opt_build_root?)endprivate :rpmbuild?### Default gems locations allowed on FHS system (/usr, /usr/share).# The locations are derived from directories specified during build# configuration.def default_locations@default_locations ||= {:system => previous_but_one_dir_to(RbConfig::CONFIG['vendordir'], RbConfig::CONFIG['RUBY_INSTALL_NAME']),:local => previous_but_one_dir_to(RbConfig::CONFIG['sitedir'], RbConfig::CONFIG['RUBY_INSTALL_NAME'])}end### For each location provides set of directories for binaries (:bin_dir)# platform independent (:gem_dir) and dependent (:ext_dir) files.def default_dirs@libdir ||= case RUBY_PLATFORMwhen 'java'RbConfig::CONFIG['datadir']elseRbConfig::CONFIG['libdir']end@default_dirs ||= default_locations.inject(Hash.new) do |hash, location|destination, path = locationhash[destination] = if path{:bin_dir => File.join(path, RbConfig::CONFIG['bindir'].split(File::SEPARATOR).last),:gem_dir => File.join(path, RbConfig::CONFIG['datadir'].split(File::SEPARATOR).last, 'gems'),:ext_dir => File.join(path, @libdir.split(File::SEPARATOR).last, 'gems')}else{:bin_dir => '',:gem_dir => '',:ext_dir => ''}endhashendend### Remove methods we are going to override. This avoids "method redefined;"# warnings otherwise issued by Ruby.remove_method :operating_system_defaults if method_defined? :operating_system_defaultsremove_method :default_dir if method_defined? :default_dirremove_method :default_path if method_defined? :default_pathremove_method :default_ext_dir_for if method_defined? :default_ext_dir_for### Regular user installs into user directory, root manages /usr/local.def operating_system_defaultsunless opt_build_root?options = if Process.uid == 0"--install-dir=#{Gem.default_dirs[:local][:gem_dir]} --bindir #{Gem.default_dirs[:local][:bin_dir]}"else"--user-install --bindir #{File.join [Dir.home, 'bin']}"end{"gem" => options}else{}endend### RubyGems default overrides.def default_dirGem.default_dirs[:system][:gem_dir]enddef default_pathpath = default_dirs.collect {|location, paths| paths[:gem_dir]}path.unshift Gem.user_dir if File.exist? Gem.user_homepathenddef default_ext_dir_for base_dirdir = if rpmbuild?build_dir = base_dir.chomp Gem.default_dirs[:system][:gem_dir]if build_dir != base_dirFile.join build_dir, Gem.default_dirs[:system][:ext_dir]endelsedirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}dirs && dirs.last[:ext_dir]enddir && File.join(dir, RbConfig::CONFIG['RUBY_INSTALL_NAME'])end# This method should be available since RubyGems 2.2 until RubyGems 3.0.# https://github.com/rubygems/rubygems/issues/749if method_defined? :install_extension_in_libremove_method :install_extension_in_libdef install_extension_in_libfalseendendendend
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。