summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2022-01-16 17:03:27 +0100
committerHans de Graaff <graaff@gentoo.org>2022-01-16 17:03:38 +0100
commit05be1308f64a6ee663e8c2d1a5a7f60caa904b2a (patch)
treef1fef8c506d80950f6f47e5426db9be290974aee /dev-ruby/rubygems/files
parentsys-libs/efivar: unkeyword 38 for ~riscv (diff)
downloadgentoo-05be1308f64a6ee663e8c2d1a5a7f60caa904b2a.tar.gz
gentoo-05be1308f64a6ee663e8c2d1a5a7f60caa904b2a.tar.bz2
gentoo-05be1308f64a6ee663e8c2d1a5a7f60caa904b2a.zip
dev-ruby/rubygems: add 3.2.33 and update gentoo-defaults
This version uses a new set of defaults that make better use of the existing mechanism for configuration and require us to overwrite less methods. Bug: https://bugs.gentoo.org/789957 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'dev-ruby/rubygems/files')
-rw-r--r--dev-ruby/rubygems/files/gentoo-defaults-5.rb44
1 files changed, 13 insertions, 31 deletions
diff --git a/dev-ruby/rubygems/files/gentoo-defaults-5.rb b/dev-ruby/rubygems/files/gentoo-defaults-5.rb
index 602ad0e4055e..b6ac5554b121 100644
--- a/dev-ruby/rubygems/files/gentoo-defaults-5.rb
+++ b/dev-ruby/rubygems/files/gentoo-defaults-5.rb
@@ -6,30 +6,23 @@
# /usr/local and to keep /usr managed by Gentoo. This policy file
# ensures that all manually installed gems using "gem install" as root
# are installed in /usr/local. Gentoo gems are installed in /usr.
-
-# TODO: We used to manipulate the default_dir, but this no longer
-# works since this is now the base for the new "default" gems that
-# ruby 2.6 uses with irb. So default_dir should refer to the system
-# default now. rubygems also provides various hooks so we may be able
-# to use those to install gems in /usr/local by default in a less
-# intrusive way.
module Gem
class << self
- def portage_gems_dir
+ def gentoo_gems_dir
RbConfig::CONFIG['sitelibdir'].gsub('site_ruby', 'gems')
end
- def bindir
+ def gentoo_bindir
Process.euid.zero? ? '@GENTOO_PORTAGE_EPREFIX@/usr/local/bin' : File.join(user_home, 'bin')
end
- def local_dir
- portage_gems_dir.gsub('@GENTOO_PORTAGE_EPREFIX@/usr',
- '@GENTOO_PORTAGE_EPREFIX@/usr/local')
+ def gentoo_local_dir
+ gentoo_gems_dir.gsub('@GENTOO_PORTAGE_EPREFIX@/usr',
+ '@GENTOO_PORTAGE_EPREFIX@/usr/local')
end
- def install_dir
- Process.euid.zero? ? local_dir : user_dir
+ def gentoo_install_dir
+ Process.euid.zero? ? gentoo_local_dir : user_dir
end
undef :default_path
@@ -38,27 +31,16 @@ module Gem
path << user_dir if user_home && File.exist?(user_home)
path << default_dir
path << vendor_dir if vendor_dir && File.directory?(vendor_dir)
- path << local_dir
- path << portage_gems_dir
- end
-
- def system_config_path
- '@GENTOO_PORTAGE_EPREFIX@/etc'
+ path << gentoo_local_dir
+ path << gentoo_gems_dir
end
- # Set Gentoo defaults for gem commands
- begin
- undef :operating_system_defaults
- rescue NameError
- # Avoid either runtime errors or redefinition warnings since
- # this method is not present in all rubygem versions distributed
- # with dev-lang/ruby.
- end
def operating_system_defaults
+ options = "--install-dir #{gentoo_install_dir} --bindir #{gentoo_bindir}"
{
- 'install' => "--install-dir #{install_dir}",
- 'uninstall' => "--install-dir #{install_dir}",
- 'update' => "--install-dir #{install_dir}"
+ 'install' => options,
+ 'uninstall' => options,
+ 'update' => options
}
end
end