diff options
| author | Daniel Colson <danieljamescolson@gmail.com> | 2023-08-29 08:41:28 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-10-03 17:16:19 +0000 |
| commit | accda74cbeb96a5539e0cf44741418654291d3c0 (patch) | |
| tree | 947065b69109c1007300918791a6ff9eeb34862b /include/ruby/internal/encoding/string.h | |
| parent | 1992aef7225b864613b22be5bfb164f5c909a71c (diff) | |
[rubygems/rubygems] Prevent gem activation in standalone mode
As discussed in https://github.com/rubygems/rubygems/issues/6273#issuecomment-1449176658
The `gem` method behaves awkwardly in standalone mode. Assuming bundler
isn't loaded at all, a call to gem might activate a gem that is not part
of the bundle (because it's the gem method defined in
lib/rubygems/core_ext/kernel_gem.rb and not
lib/bundler/rubygems_integration.rb). And when running with
`--disable-gems`, the gem method won't be defined at all so we'll get a
NoMethodError.
Calls to `gem` can appear in dependencies outside an application's
control. To work around this at GitHub we defined our own `Kernel#gem`
that no-ops.
I agree with https://github.com/rubygems/rubygems/issues/6273#issuecomment-1440755882
> people using standalone mode don't want to activate gems like Kernel.gem
This commit redefines `Kernel#gem` in the standalone script to no-op.
https://github.com/rubygems/rubygems/commit/bea17b55f1
Diffstat (limited to 'include/ruby/internal/encoding/string.h')
0 files changed, 0 insertions, 0 deletions
