summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2023-08-29 08:41:28 -0400
committergit <svn-admin@ruby-lang.org>2023-10-03 17:16:19 +0000
commitaccda74cbeb96a5539e0cf44741418654291d3c0 (patch)
tree947065b69109c1007300918791a6ff9eeb34862b /include
parent1992aef7225b864613b22be5bfb164f5c909a71c (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')
0 files changed, 0 insertions, 0 deletions