From 5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 Mon Sep 17 00:00:00 2001 From: hsbt Date: Wed, 21 Nov 2018 10:20:47 +0000 Subject: 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 --- lib/rubygems/ext/builder.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/rubygems/ext/builder.rb') diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index 54eeae57b6..f578e7feee 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -27,14 +27,14 @@ class Gem::Ext::Builder end def self.make(dest_path, results) - unless File.exist? 'Makefile' then + unless File.exist? 'Makefile' raise Gem::InstallError, 'Makefile not found' end # try to find make program from Ruby configure arguments first RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/ make_program = ENV['MAKE'] || ENV['make'] || $1 - unless make_program then + unless make_program make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make' end @@ -86,13 +86,13 @@ class Gem::Ext::Builder ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps end - unless $?.success? then + unless $?.success? results << "Building has failed. See above output for more information on the failure." if verbose exit_reason = - if $?.exited? then + if $?.exited? ", exit code #{$?.exitstatus}" - elsif $?.signaled? then + elsif $?.signaled? ", uncaught signal #{$?.termsig}" end @@ -105,7 +105,7 @@ class Gem::Ext::Builder # have build arguments, saved, set +build_args+ which is an ARGV-style # array. - def initialize spec, build_args = spec.build_args + def initialize(spec, build_args = spec.build_args) @spec = spec @build_args = build_args @gem_dir = spec.full_gem_path @@ -116,7 +116,7 @@ class Gem::Ext::Builder ## # Chooses the extension builder class for +extension+ - def builder_for extension # :nodoc: + def builder_for(extension) # :nodoc: case extension when /extconf/ then Gem::Ext::ExtConfBuilder @@ -138,7 +138,7 @@ class Gem::Ext::Builder ## # Logs the build +output+ in +build_dir+, then raises Gem::Ext::BuildError. - def build_error build_dir, output, backtrace = nil # :nodoc: + def build_error(build_dir, output, backtrace = nil) # :nodoc: gem_make_out = write_gem_make_out output message = <<-EOF @@ -153,7 +153,7 @@ EOF raise Gem::Ext::BuildError, message, backtrace end - def build_extension extension, dest_path # :nodoc: + def build_extension(extension, dest_path) # :nodoc: results = [] # FIXME: Determine if this line is necessary and, if so, why. @@ -235,7 +235,7 @@ EOF ## # Writes +output+ to gem_make.out in the extension install directory. - def write_gem_make_out output # :nodoc: + def write_gem_make_out(output) # :nodoc: destination = File.join @spec.extension_dir, 'gem_make.out' FileUtils.mkdir_p @spec.extension_dir -- cgit v1.2.3