summaryrefslogtreecommitdiff
path: root/lib/rubygems/ext
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/ext
parent2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff)
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/ext')
-rw-r--r--lib/rubygems/ext/build_error.rb1
-rw-r--r--lib/rubygems/ext/builder.rb20
-rw-r--r--lib/rubygems/ext/cmake_builder.rb2
-rw-r--r--lib/rubygems/ext/configure_builder.rb2
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb4
-rw-r--r--lib/rubygems/ext/rake_builder.rb2
6 files changed, 15 insertions, 16 deletions
diff --git a/lib/rubygems/ext/build_error.rb b/lib/rubygems/ext/build_error.rb
index 0b3c17a9a0..6dffddb5cc 100644
--- a/lib/rubygems/ext/build_error.rb
+++ b/lib/rubygems/ext/build_error.rb
@@ -4,4 +4,3 @@
class Gem::Ext::BuildError < Gem::InstallError
end
-
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
diff --git a/lib/rubygems/ext/cmake_builder.rb b/lib/rubygems/ext/cmake_builder.rb
index cfcc83c9a7..ab226733d9 100644
--- a/lib/rubygems/ext/cmake_builder.rb
+++ b/lib/rubygems/ext/cmake_builder.rb
@@ -3,7 +3,7 @@ require 'rubygems/command'
class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
def self.build(extension, dest_path, results, args=[], lib_dir=nil)
- unless File.exist?('Makefile') then
+ unless File.exist?('Makefile')
cmd = "cmake . -DCMAKE_INSTALL_PREFIX=#{dest_path}"
cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty?
diff --git a/lib/rubygems/ext/configure_builder.rb b/lib/rubygems/ext/configure_builder.rb
index 1b9e374075..7d105c9bd3 100644
--- a/lib/rubygems/ext/configure_builder.rb
+++ b/lib/rubygems/ext/configure_builder.rb
@@ -8,7 +8,7 @@
class Gem::Ext::ConfigureBuilder < Gem::Ext::Builder
def self.build(extension, dest_path, results, args=[], lib_dir=nil)
- unless File.exist?('Makefile') then
+ unless File.exist?('Makefile')
cmd = "sh ./configure --prefix=#{dest_path}"
cmd << " #{args.join ' '}" unless args.empty?
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb
index 97bb789fb8..5a2b3eb533 100644
--- a/lib/rubygems/ext/ext_conf_builder.rb
+++ b/lib/rubygems/ext/ext_conf_builder.rb
@@ -47,7 +47,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
run cmd, results
ensure
if File.exist? 'mkmf.log'
- unless $?.success? then
+ unless $?.success?
results << "To see why this extension failed to compile, please check" \
" the mkmf.log which can be found here:\n"
results << " " + File.join(dest_path, 'mkmf.log') + "\n"
@@ -63,7 +63,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
if tmp_dest
# TODO remove in RubyGems 3
- if Gem.install_extension_in_lib and lib_dir then
+ if Gem.install_extension_in_lib and lib_dir
FileUtils.mkdir_p lib_dir
entries = Dir.entries(tmp_dest) - %w[. ..]
entries = entries.map { |entry| File.join tmp_dest, entry }
diff --git a/lib/rubygems/ext/rake_builder.rb b/lib/rubygems/ext/rake_builder.rb
index f41e5618dc..52041a2713 100644
--- a/lib/rubygems/ext/rake_builder.rb
+++ b/lib/rubygems/ext/rake_builder.rb
@@ -10,7 +10,7 @@ require "shellwords"
class Gem::Ext::RakeBuilder < Gem::Ext::Builder
def self.build(extension, dest_path, results, args=[], lib_dir=nil)
- if File.basename(extension) =~ /mkrf_conf/i then
+ if File.basename(extension) =~ /mkrf_conf/i
run([Gem.ruby, File.basename(extension), *args], results)
end