summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-16 00:43:14 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-16 00:43:14 +0000
commit33d1f172c839bc14ba71a8e74f5ca6b01b7e069b (patch)
treee3f855133bb072667c588712dc86ea51a4092118 /lib
parent28918eac58eb6e2681d10839ac0d1430b2a4f1f9 (diff)
* lib/rubygems: Update to RubyGems master 278d00d. Changes:
Fixes building extensions without a "clean" make rule Adds gem dependency file autodetection to "gem install -g" * test/rubygems: Tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/commands/install_command.rb6
-rw-r--r--lib/rubygems/ext/builder.rb13
-rw-r--r--lib/rubygems/ext/cmake_builder.rb3
3 files changed, 11 insertions, 11 deletions
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index f02b12906d..a45d9057b0 100644
--- a/lib/rubygems/commands/install_command.rb
+++ b/lib/rubygems/commands/install_command.rb
@@ -32,9 +32,13 @@ class Gem::Commands::InstallCommand < Gem::Command
add_version_option
add_prerelease_option "to be installed. (Only for listed gems)"
- add_option(:"Install/Update", '-g', '--file FILE',
+ add_option(:"Install/Update", '-g', '--file [FILE]',
'Read from a gem dependencies API file and',
'install the listed gems') do |v,o|
+ v = %w[gem.deps.rb Gemfile Isolate].find do |file|
+ File.exist? file
+ end unless v
+
o[:gemdeps] = v
end
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb
index 069ab4cfe0..761505636c 100644
--- a/lib/rubygems/ext/builder.rb
+++ b/lib/rubygems/ext/builder.rb
@@ -19,11 +19,6 @@ class Gem::Ext::Builder
CHDIR_MUTEX = Mutex.new # :nodoc:
- ##
- # `make` targets to run when building the extension
-
- MAKE_TARGETS = ['clean', '', 'install'] # :nodoc:
-
attr_accessor :build_args # :nodoc:
def self.class_name
@@ -45,14 +40,18 @@ class Gem::Ext::Builder
destdir = '"DESTDIR=%s"' % ENV['DESTDIR'] if RUBY_VERSION > '2.0'
- self::MAKE_TARGETS.each do |target|
+ ['clean', '', 'install'].each do |target|
# Pass DESTDIR via command line to override what's in MAKEFLAGS
cmd = [
make_program,
destdir,
target
].join(' ').rstrip
- run(cmd, results, "make #{target}".rstrip)
+ begin
+ run(cmd, results, "make #{target}".rstrip)
+ rescue Gem::InstallError
+ raise unless target == 'clean' # ignore clean failure
+ end
end
end
diff --git a/lib/rubygems/ext/cmake_builder.rb b/lib/rubygems/ext/cmake_builder.rb
index 8bd82dafe2..d6d106f4ae 100644
--- a/lib/rubygems/ext/cmake_builder.rb
+++ b/lib/rubygems/ext/cmake_builder.rb
@@ -1,7 +1,4 @@
class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
-
- MAKE_TARGETS = ['', 'install'] # :nodoc:
-
def self.build(extension, directory, dest_path, results)
unless File.exist?('Makefile') then
cmd = "cmake . -DCMAKE_INSTALL_PREFIX=#{dest_path}"