Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't create new class Gem::CustomRequire

Suggested by Evan Phoenix.

I'll re-propose this change later. I don't work on it with default gem
changes.
  • Loading branch information...
commit e627cdada399997e7bbf230d1e708f6de70c113e 1 parent 018a90e
@kou authored
Showing with 5 additions and 17 deletions.
  1. +5 −17 lib/rubygems/core_ext/kernel_require.rb
View
22 lib/rubygems/core_ext/kernel_require.rb
@@ -4,22 +4,6 @@
# See LICENSE.txt for permissions.
#++
-module Gem
- class CustomRequire
- def initialize(path)
- @path = path
- end
-
- def run
- spec = Gem.find_unresolved_default_spec(@path)
- if spec
- Gem.remove_unresolved_default_spec(spec)
- gem(spec.name)
- end
- end
- end
-end
-
module Kernel
if defined?(gem_original_require) then
@@ -48,7 +32,11 @@ module Kernel
# that file has already been loaded is preserved.
def require path
- Gem::CustomRequire.new(path).run
+ spec = Gem.find_unresolved_default_spec(path)
+ if spec
+ Gem.remove_unresolved_default_spec(spec)
+ gem(spec.name)
+ end
# If there are no unresolved deps, then we can use just try
# normal require handle loading a gem from the rescue below.
Please sign in to comment.
Something went wrong with that request. Please try again.