[#122900] [Ruby Bug#21529] Deprecate the /o modifier and warn against using it — "jpcamara (JP Camara) via ruby-core" <ruby-core@...>

Issue #21529 has been reported by jpcamara (JP Camara).

10 messages 2025/08/03

[#122925] [Ruby Feature#21533] Introduce `Time#am?` and `Time#pm?` — "matheusrich (Matheus Richard) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNTMzIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IG1hdGhldXNyaWNoIChNYXRoZXVzIFJp

10 messages 2025/08/06

[#122932] [Ruby Bug#21534] ppc64le Ractor ractor_port_receive aborted (core dumped) — "jaruga (Jun Aruga) via ruby-core" <ruby-core@...>

Issue #21534 has been reported by jaruga (Jun Aruga).

12 messages 2025/08/07

[#122953] [Ruby Bug#21540] prism allows `foo && return bar` when parse.y doesn't — "Earlopain (Earlopain _) via ruby-core" <ruby-core@...>

Issue #21540 has been reported by Earlopain (Earlopain _).

12 messages 2025/08/12

[#122964] [Ruby Feature#21543] Point ArgumentError to the call site — "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>

Issue #21543 has been reported by mame (Yusuke Endoh).

8 messages 2025/08/14

[#122969] [Ruby Feature#21545] `#try_dig`: a dig that returns early if it cannot dig deeper — "cb341 (Daniel Bengl) via ruby-core" <ruby-core@...>

Issue #21545 has been reported by cb341 (Daniel Bengl).

10 messages 2025/08/15

[#122987] [Ruby Bug#21547] SEGV after 2083fa commit — "watson1978 (Shizuo Fujita) via ruby-core" <ruby-core@...>

Issue #21547 has been reported by watson1978 (Shizuo Fujita).

10 messages 2025/08/20

[#123042] [Ruby Feature#21550] Ractor.sharable_proc/sharable_lambda to make sharable Proc object — "ko1 (Koichi Sasada) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNTUwIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtvMSAoS29pY2hpIFNhc2FkYSkuDQoN

16 messages 2025/08/21

[#123122] [Ruby Feature#21556] Add true? and false? methods to NilClass, TrueClass, FalseClass, and String — "Phalado (Raphael Cordeiro) via ruby-core" <ruby-core@...>

Issue #21556 has been reported by Phalado (Raphael Cordeiro).

9 messages 2025/08/29

[#123146] [Ruby Bug#21559] Unicode normalization nfd -> nfc -> nfd is not reversible — "tompng (tomoya ishida) via ruby-core" <ruby-core@...>

Issue #21559 has been reported by tompng (tomoya ishida).

8 messages 2025/08/31

[ruby-core:122973] [PATCH] Add Gem.default_install

From: Felipe Contreras via ruby-core <ruby-core@...>
Date: 2025-08-17 20:00:38 UTC
List: ruby-core #122973
We need a way to enable user installs by default so that tools like
bundler don't attempt to install to system directories.

The configuration Gem.default_user_install was meant to enable user
installs, but it only affects `gem install`, not bundler. Distributions
were already able to change the defaults of `gem install`, so it didn't
change anything, and that's why nobody is using it.

Instead we need a method that allows something that is not currently
possible: override Gem.dir.

Gem.default_install is that method, which allows changing user installs
to both gem and bundler.

It defaults to Gem.default_dir, so there's no change in functionality:

  def default_install
    default_dir
  end

Distributions can then override this to enable user installs by default:

  def default_install
    user_dir
  end

This allows for more flexibility than Gem.default_user_install. For
example distributions can choose to install to different directories
based on the user id:

  def default_install
    Process.uid == 0 ? local_dir : user_dir
  end

The current Gem.default_user_install solution is simply not enough.
---
 lib/rubygems/defaults.rb     | 7 +++++++
 lib/rubygems/path_support.rb | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
index db07681a17..20f4fcd2f3 100644
--- a/lib/rubygems/defaults.rb
+++ b/lib/rubygems/defaults.rb
@@ -9,6 +9,13 @@ module Gem
   @pre_uninstall_hooks  ||= []
   @pre_install_hooks    ||= []
 
+  ##
+  # Determines the default install directory
+
+  def self.default_install
+    default_dir
+  end
+
   ##
   # An Array of the default sources that come with RubyGems
 
diff --git a/lib/rubygems/path_support.rb b/lib/rubygems/path_support.rb
index 13091e29ba..455f413f3d 100644
--- a/lib/rubygems/path_support.rb
+++ b/lib/rubygems/path_support.rb
@@ -24,7 +24,7 @@ class Gem::PathSupport
   # hashtable, or defaults to ENV, the system environment.
   #
   def initialize(env)
-    @home = normalize_home_dir(env["GEM_HOME"] || Gem.default_dir)
+    @home = normalize_home_dir(env["GEM_HOME"] || Gem.default_install)
     @path = split_gem_path env["GEM_PATH"], @home
 
     @spec_cache_dir = env["GEM_SPEC_CACHE"] || Gem.default_spec_cache_dir
-- 
0.1

______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/


In This Thread

Prev Next