зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] make bundled gemst list as constant under Gem namespace
https://github.com/rubygems/rubygems/commit/438eac5447
This commit is contained in:
Родитель
cc2617ae3f
Коммит
2424b921b2
|
@ -29,6 +29,12 @@ unless Gem.ruby_version.to_s == RUBY_VERSION || RUBY_PATCHLEVEL == -1
|
||||||
end
|
end
|
||||||
|
|
||||||
module Gem
|
module Gem
|
||||||
|
|
||||||
|
BUNDLED_GEMS = %w[
|
||||||
|
abbrev observer getoptlong resolv-replace rinda
|
||||||
|
nkf syslog drb mutex_m csv base64
|
||||||
|
]
|
||||||
|
|
||||||
class Specification
|
class Specification
|
||||||
include ::Bundler::MatchMetadata
|
include ::Bundler::MatchMetadata
|
||||||
include ::Bundler::MatchPlatform
|
include ::Bundler::MatchPlatform
|
||||||
|
|
|
@ -230,14 +230,10 @@ module Bundler
|
||||||
|
|
||||||
return if [kernel, ::Kernel].any?{|klass| klass.respond_to?(:no_warning_require)}
|
return if [kernel, ::Kernel].any?{|klass| klass.respond_to?(:no_warning_require)}
|
||||||
|
|
||||||
bundled_gems = %w[
|
|
||||||
abbrev observer getoptlong resolv-replace rinda
|
|
||||||
nkf syslog drb mutex_m csv base64
|
|
||||||
]
|
|
||||||
[kernel, ::Kernel].each do |kernel_class|
|
[kernel, ::Kernel].each do |kernel_class|
|
||||||
kernel_class.send(:alias_method, :no_warning_require, :require)
|
kernel_class.send(:alias_method, :no_warning_require, :require)
|
||||||
kernel_class.send(:define_method, :require) do |file|
|
kernel_class.send(:define_method, :require) do |file|
|
||||||
if bundled_gems.include?(file)
|
if ::Gem::BUNDLED_GEMS.include?(file)
|
||||||
unless specs.to_a.map(&:name).include?(file)
|
unless specs.to_a.map(&:name).include?(file)
|
||||||
target_file = begin
|
target_file = begin
|
||||||
Bundler.default_gemfile.basename
|
Bundler.default_gemfile.basename
|
||||||
|
|
Загрузка…
Ссылка в новой задаче