aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/core_ext/kernel_require.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
commit5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch)
treec63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/core_ext/kernel_require.rb
parent2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff)
downloadruby-5335ce0e060c7a2a0b01c57f8f8a64254f2658e1.tar.gz
Merge master branch from rubygems/rubygems upstream.
* Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/core_ext/kernel_require.rb')
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index e93cd7c728..3b78011619 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -31,7 +31,7 @@ module Kernel
# The normal <tt>require</tt> functionality of returning false if
# that file has already been loaded is preserved.
- def require path
+ def require(path)
RUBYGEMS_ACTIVATION_MONITOR.enter
path = path.to_path if path.respond_to? :to_path
@@ -49,7 +49,7 @@ module Kernel
# If there are no unresolved deps, then we can use just try
# normal require handle loading a gem from the rescue below.
- if Gem::Specification.unresolved_deps.empty? then
+ if Gem::Specification.unresolved_deps.empty?
RUBYGEMS_ACTIVATION_MONITOR.exit
return gem_original_require(path)
end
@@ -79,7 +79,7 @@ module Kernel
# requested, then find_in_unresolved_tree will find d.rb in d because
# it's a dependency of c.
#
- if found_specs.empty? then
+ if found_specs.empty?
found_specs = Gem::Specification.find_in_unresolved_tree path
found_specs.each do |found_spec|
@@ -94,7 +94,7 @@ module Kernel
# versions of the same gem
names = found_specs.map(&:name).uniq
- if names.size > 1 then
+ if names.size > 1
RUBYGEMS_ACTIVATION_MONITOR.exit
raise Gem::LoadError, "#{path} found in multiple gems: #{names.join ', '}"
end
@@ -103,7 +103,7 @@ module Kernel
# at the highest version.
valid = found_specs.find { |s| !s.has_conflicts? }
- unless valid then
+ unless valid
le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate"
le.name = names.first
RUBYGEMS_ACTIVATION_MONITOR.exit
@@ -120,7 +120,7 @@ module Kernel
begin
if load_error.message.start_with?("Could not find") or
- (load_error.message.end_with?(path) and Gem.try_activate(path)) then
+ (load_error.message.end_with?(path) and Gem.try_activate(path))
require_again = true
end
ensure